@knowledge-stack/ksapi 3.5.2 → 3.6.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.
Files changed (49) hide show
  1. package/.openapi-generator/FILES +12 -0
  2. package/README.md +9 -2
  3. package/dist/apis/DiagnosticsApi.d.ts +102 -0
  4. package/dist/apis/DiagnosticsApi.js +162 -0
  5. package/dist/apis/index.d.ts +1 -0
  6. package/dist/apis/index.js +1 -0
  7. package/dist/esm/apis/DiagnosticsApi.d.ts +102 -0
  8. package/dist/esm/apis/DiagnosticsApi.js +125 -0
  9. package/dist/esm/apis/index.d.ts +1 -0
  10. package/dist/esm/apis/index.js +1 -0
  11. package/dist/esm/models/DiagnosticTraceFailureReason.d.ts +27 -0
  12. package/dist/esm/models/DiagnosticTraceFailureReason.js +45 -0
  13. package/dist/esm/models/DiagnosticTraceItem.d.ts +280 -0
  14. package/dist/esm/models/DiagnosticTraceItem.js +131 -0
  15. package/dist/esm/models/DiagnosticTraceStatus.d.ts +26 -0
  16. package/dist/esm/models/DiagnosticTraceStatus.js +44 -0
  17. package/dist/esm/models/DiagnosticsResponse.d.ts +54 -0
  18. package/dist/esm/models/DiagnosticsResponse.js +49 -0
  19. package/dist/esm/models/TraceKind.d.ts +25 -0
  20. package/dist/esm/models/TraceKind.js +43 -0
  21. package/dist/esm/models/index.d.ts +5 -0
  22. package/dist/esm/models/index.js +5 -0
  23. package/dist/models/DiagnosticTraceFailureReason.d.ts +27 -0
  24. package/dist/models/DiagnosticTraceFailureReason.js +53 -0
  25. package/dist/models/DiagnosticTraceItem.d.ts +280 -0
  26. package/dist/models/DiagnosticTraceItem.js +139 -0
  27. package/dist/models/DiagnosticTraceStatus.d.ts +26 -0
  28. package/dist/models/DiagnosticTraceStatus.js +52 -0
  29. package/dist/models/DiagnosticsResponse.d.ts +54 -0
  30. package/dist/models/DiagnosticsResponse.js +57 -0
  31. package/dist/models/TraceKind.d.ts +25 -0
  32. package/dist/models/TraceKind.js +51 -0
  33. package/dist/models/index.d.ts +5 -0
  34. package/dist/models/index.js +5 -0
  35. package/docs/DiagnosticTraceFailureReason.md +32 -0
  36. package/docs/DiagnosticTraceItem.md +111 -0
  37. package/docs/DiagnosticTraceStatus.md +32 -0
  38. package/docs/DiagnosticsApi.md +160 -0
  39. package/docs/DiagnosticsResponse.md +36 -0
  40. package/docs/TraceKind.md +32 -0
  41. package/package.json +1 -1
  42. package/src/apis/DiagnosticsApi.ts +211 -0
  43. package/src/apis/index.ts +1 -0
  44. package/src/models/DiagnosticTraceFailureReason.ts +55 -0
  45. package/src/models/DiagnosticTraceItem.ts +415 -0
  46. package/src/models/DiagnosticTraceStatus.ts +54 -0
  47. package/src/models/DiagnosticsResponse.ts +100 -0
  48. package/src/models/TraceKind.ts +53 -0
  49. package/src/models/index.ts +5 -0
@@ -121,6 +121,11 @@ docs/DataSourceTableResponse.md
121
121
  docs/DataSourcesApi.md
122
122
  docs/DefaultApi.md
123
123
  docs/DefinitionOutputStat.md
124
+ docs/DiagnosticTraceFailureReason.md
125
+ docs/DiagnosticTraceItem.md
126
+ docs/DiagnosticTraceStatus.md
127
+ docs/DiagnosticsApi.md
128
+ docs/DiagnosticsResponse.md
124
129
  docs/DiffFormat.md
125
130
  docs/DiffRow.md
126
131
  docs/DiffRowType.md
@@ -374,6 +379,7 @@ docs/TimeseriesPoint.md
374
379
  docs/ToolDisplayType.md
375
380
  docs/ToolPart.md
376
381
  docs/ToolStatus.md
382
+ docs/TraceKind.md
377
383
  docs/TranscriptionResponse.md
378
384
  docs/TranscriptionsApi.md
379
385
  docs/TransferOwnerRequest.md
@@ -462,6 +468,7 @@ src/apis/ChunkLineagesApi.ts
462
468
  src/apis/ChunksApi.ts
463
469
  src/apis/DataSourcesApi.ts
464
470
  src/apis/DefaultApi.ts
471
+ src/apis/DiagnosticsApi.ts
465
472
  src/apis/DocumentCheckoutApi.ts
466
473
  src/apis/DocumentVersionsApi.ts
467
474
  src/apis/DocumentsApi.ts
@@ -595,6 +602,10 @@ src/models/DataSourceSchemaResponse.ts
595
602
  src/models/DataSourceSyncResponse.ts
596
603
  src/models/DataSourceTableResponse.ts
597
604
  src/models/DefinitionOutputStat.ts
605
+ src/models/DiagnosticTraceFailureReason.ts
606
+ src/models/DiagnosticTraceItem.ts
607
+ src/models/DiagnosticTraceStatus.ts
608
+ src/models/DiagnosticsResponse.ts
598
609
  src/models/DiffFormat.ts
599
610
  src/models/DiffRow.ts
600
611
  src/models/DiffRowType.ts
@@ -828,6 +839,7 @@ src/models/TimeseriesPoint.ts
828
839
  src/models/ToolDisplayType.ts
829
840
  src/models/ToolPart.ts
830
841
  src/models/ToolStatus.ts
842
+ src/models/TraceKind.ts
831
843
  src/models/TranscriptionResponse.ts
832
844
  src/models/TransferOwnerRequest.ts
833
845
  src/models/TransferOwnerResponse.ts
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # @knowledge-stack/ksapi@3.5.2
1
+ # @knowledge-stack/ksapi@3.6.0
2
2
 
3
3
  A TypeScript SDK client for the localhost API.
4
4
 
@@ -125,6 +125,8 @@ All URIs are relative to *http://localhost:8000*
125
125
  *DataSourcesApi* | [**updateDataSourceTable**](docs/DataSourcesApi.md#updatedatasourcetable) | **PATCH** /v1/data-sources/{data_source_id}/tables/{table_id} | Update Data Source Table Handler
126
126
  *DefaultApi* | [**healthCheck**](docs/DefaultApi.md#healthcheck) | **GET** /healthz | Health Check Handler
127
127
  *DefaultApi* | [**hello**](docs/DefaultApi.md#hello) | **GET** / | Root Handler
128
+ *DiagnosticsApi* | [**computeThreadDiagnostics**](docs/DiagnosticsApi.md#computethreaddiagnostics) | **POST** /v1/diagnostics/threads/{thread_id} | Compute Thread Diagnostics Handler
129
+ *DiagnosticsApi* | [**computeWorkflowRunDiagnostics**](docs/DiagnosticsApi.md#computeworkflowrundiagnostics) | **POST** /v1/diagnostics/workflow-runs/{run_id} | Compute Workflow Run Diagnostics Handler
128
130
  *DocumentCheckoutApi* | [**acquireDocumentCheckout**](docs/DocumentCheckoutApi.md#acquiredocumentcheckout) | **POST** /v1/documents/{document_id}/checkout | Acquire Document Checkout Handler
129
131
  *DocumentCheckoutApi* | [**getDocumentCheckout**](docs/DocumentCheckoutApi.md#getdocumentcheckout) | **GET** /v1/documents/{document_id}/checkout | Get Document Checkout Handler
130
132
  *DocumentCheckoutApi* | [**releaseDocumentCheckout**](docs/DocumentCheckoutApi.md#releasedocumentcheckout) | **DELETE** /v1/documents/{document_id}/checkout | Release Document Checkout Handler
@@ -410,6 +412,10 @@ All URIs are relative to *http://localhost:8000*
410
412
  - [DataSourceSyncResponse](docs/DataSourceSyncResponse.md)
411
413
  - [DataSourceTableResponse](docs/DataSourceTableResponse.md)
412
414
  - [DefinitionOutputStat](docs/DefinitionOutputStat.md)
415
+ - [DiagnosticTraceFailureReason](docs/DiagnosticTraceFailureReason.md)
416
+ - [DiagnosticTraceItem](docs/DiagnosticTraceItem.md)
417
+ - [DiagnosticTraceStatus](docs/DiagnosticTraceStatus.md)
418
+ - [DiagnosticsResponse](docs/DiagnosticsResponse.md)
413
419
  - [DiffFormat](docs/DiffFormat.md)
414
420
  - [DiffRow](docs/DiffRow.md)
415
421
  - [DiffRowType](docs/DiffRowType.md)
@@ -643,6 +649,7 @@ All URIs are relative to *http://localhost:8000*
643
649
  - [ToolDisplayType](docs/ToolDisplayType.md)
644
650
  - [ToolPart](docs/ToolPart.md)
645
651
  - [ToolStatus](docs/ToolStatus.md)
652
+ - [TraceKind](docs/TraceKind.md)
646
653
  - [TranscriptionResponse](docs/TranscriptionResponse.md)
647
654
  - [TransferOwnerRequest](docs/TransferOwnerRequest.md)
648
655
  - [TransferOwnerResponse](docs/TransferOwnerResponse.md)
@@ -733,7 +740,7 @@ and is automatically generated by the
733
740
  [OpenAPI Generator](https://openapi-generator.tech) project:
734
741
 
735
742
  - API version: `0.1.0`
736
- - Package version: `3.5.2`
743
+ - Package version: `3.6.0`
737
744
  - Generator version: `7.21.0`
738
745
  - Build package: `org.openapitools.codegen.languages.TypeScriptFetchClientCodegen`
739
746
 
@@ -0,0 +1,102 @@
1
+ /**
2
+ * Knowledge Stack API
3
+ * Knowledge Stack backend API for authentication and knowledge management. ## Integrating (RPA / machine clients) **Base URL.** Knowledge Stack is self-hosted — point at your own deployment host (see `servers`). The `localhost` entry is for local development only. **Authentication.** Send `Authorization: Bearer <api-key>` on every request. Mint an API key once via `POST /v1/api-keys` from a signed-in browser session; the raw `sk-user-...` secret is returned **only** at creation, so store it then. A key inherits its owning user\'s live tenant role and path permissions — create RPA keys from a least-privilege user, and set `expires_at` for rotation. The `ks_uat` cookie scheme is browser-only and cannot be used by headless clients. **Async work is polled, not pushed.** There are no outbound webhooks. - `POST /v1/documents/ingest` returns `201` immediately with a `workflow_id`; poll `GET /v1/system-jobs/document_versions/{workflow_id}` until `status` is terminal (anything other than `pending`/`processing`). The `Location` response header points at this poll resource. - `POST /v1/workflow-runs/{run_id}/start` returns `202`; poll `GET /v1/workflow-runs/{run_id}` until `execution_state` is `COMPLETED` or `FAILED`. The `Location` header points at the run resource. - `POST /v1/agent/ask` is **synchronous** — it blocks until the agent finishes and returns the answer inline. Use a generous HTTP timeout. **Pagination.** List endpoints accept `limit`/`offset` and return `{items, total, limit, offset}`. **Errors.** Every non-2xx body is `{detail, code, request_id}`. `code` is a stable value from a closed set (see the `ErrorResponse` schema\'s `code` enum) — branch on it rather than parsing `detail`. Quota rejections return `429` with a `Retry-After` header; transient lock contention returns a retryable `503`. Quote `request_id` (also the `x-request-id` response header) to support. **Idempotency.** `POST /v1/workflow-runs` accepts an `idempotency_key` to dedupe retried run creation. `agent/ask` charges one message *before* running and does not refund a client-cancelled call.
4
+ *
5
+ * The version of the OpenAPI document: 0.1.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import * as runtime from '../runtime';
13
+ import type { DiagnosticsResponse } from '../models/index';
14
+ export interface ComputeThreadDiagnosticsRequest {
15
+ threadId: string;
16
+ }
17
+ export interface ComputeWorkflowRunDiagnosticsRequest {
18
+ runId: string;
19
+ }
20
+ /**
21
+ * DiagnosticsApi - interface
22
+ *
23
+ * @export
24
+ * @interface DiagnosticsApiInterface
25
+ */
26
+ export interface DiagnosticsApiInterface {
27
+ /**
28
+ * Creates request options for computeThreadDiagnostics without sending the request
29
+ * @param {string} threadId
30
+ * @throws {RequiredError}
31
+ * @memberof DiagnosticsApiInterface
32
+ */
33
+ computeThreadDiagnosticsRequestOpts(requestParameters: ComputeThreadDiagnosticsRequest): Promise<runtime.RequestOpts>;
34
+ /**
35
+ * Stats and trace links for every turn; a run\'s thread answers as its run.
36
+ * @summary Compute Thread Diagnostics Handler
37
+ * @param {string} threadId
38
+ * @param {*} [options] Override http request option.
39
+ * @throws {RequiredError}
40
+ * @memberof DiagnosticsApiInterface
41
+ */
42
+ computeThreadDiagnosticsRaw(requestParameters: ComputeThreadDiagnosticsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DiagnosticsResponse>>;
43
+ /**
44
+ * Stats and trace links for every turn; a run\'s thread answers as its run.
45
+ * Compute Thread Diagnostics Handler
46
+ */
47
+ computeThreadDiagnostics(requestParameters: ComputeThreadDiagnosticsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DiagnosticsResponse>;
48
+ /**
49
+ * Creates request options for computeWorkflowRunDiagnostics without sending the request
50
+ * @param {string} runId
51
+ * @throws {RequiredError}
52
+ * @memberof DiagnosticsApiInterface
53
+ */
54
+ computeWorkflowRunDiagnosticsRequestOpts(requestParameters: ComputeWorkflowRunDiagnosticsRequest): Promise<runtime.RequestOpts>;
55
+ /**
56
+ * Stats and trace links for the run\'s attempts and every turn in its thread.
57
+ * @summary Compute Workflow Run Diagnostics Handler
58
+ * @param {string} runId
59
+ * @param {*} [options] Override http request option.
60
+ * @throws {RequiredError}
61
+ * @memberof DiagnosticsApiInterface
62
+ */
63
+ computeWorkflowRunDiagnosticsRaw(requestParameters: ComputeWorkflowRunDiagnosticsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DiagnosticsResponse>>;
64
+ /**
65
+ * Stats and trace links for the run\'s attempts and every turn in its thread.
66
+ * Compute Workflow Run Diagnostics Handler
67
+ */
68
+ computeWorkflowRunDiagnostics(requestParameters: ComputeWorkflowRunDiagnosticsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DiagnosticsResponse>;
69
+ }
70
+ /**
71
+ *
72
+ */
73
+ export declare class DiagnosticsApi extends runtime.BaseAPI implements DiagnosticsApiInterface {
74
+ /**
75
+ * Creates request options for computeThreadDiagnostics without sending the request
76
+ */
77
+ computeThreadDiagnosticsRequestOpts(requestParameters: ComputeThreadDiagnosticsRequest): Promise<runtime.RequestOpts>;
78
+ /**
79
+ * Stats and trace links for every turn; a run\'s thread answers as its run.
80
+ * Compute Thread Diagnostics Handler
81
+ */
82
+ computeThreadDiagnosticsRaw(requestParameters: ComputeThreadDiagnosticsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DiagnosticsResponse>>;
83
+ /**
84
+ * Stats and trace links for every turn; a run\'s thread answers as its run.
85
+ * Compute Thread Diagnostics Handler
86
+ */
87
+ computeThreadDiagnostics(requestParameters: ComputeThreadDiagnosticsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DiagnosticsResponse>;
88
+ /**
89
+ * Creates request options for computeWorkflowRunDiagnostics without sending the request
90
+ */
91
+ computeWorkflowRunDiagnosticsRequestOpts(requestParameters: ComputeWorkflowRunDiagnosticsRequest): Promise<runtime.RequestOpts>;
92
+ /**
93
+ * Stats and trace links for the run\'s attempts and every turn in its thread.
94
+ * Compute Workflow Run Diagnostics Handler
95
+ */
96
+ computeWorkflowRunDiagnosticsRaw(requestParameters: ComputeWorkflowRunDiagnosticsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DiagnosticsResponse>>;
97
+ /**
98
+ * Stats and trace links for the run\'s attempts and every turn in its thread.
99
+ * Compute Workflow Run Diagnostics Handler
100
+ */
101
+ computeWorkflowRunDiagnostics(requestParameters: ComputeWorkflowRunDiagnosticsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DiagnosticsResponse>;
102
+ }
@@ -0,0 +1,162 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Knowledge Stack API
6
+ * Knowledge Stack backend API for authentication and knowledge management. ## Integrating (RPA / machine clients) **Base URL.** Knowledge Stack is self-hosted — point at your own deployment host (see `servers`). The `localhost` entry is for local development only. **Authentication.** Send `Authorization: Bearer <api-key>` on every request. Mint an API key once via `POST /v1/api-keys` from a signed-in browser session; the raw `sk-user-...` secret is returned **only** at creation, so store it then. A key inherits its owning user\'s live tenant role and path permissions — create RPA keys from a least-privilege user, and set `expires_at` for rotation. The `ks_uat` cookie scheme is browser-only and cannot be used by headless clients. **Async work is polled, not pushed.** There are no outbound webhooks. - `POST /v1/documents/ingest` returns `201` immediately with a `workflow_id`; poll `GET /v1/system-jobs/document_versions/{workflow_id}` until `status` is terminal (anything other than `pending`/`processing`). The `Location` response header points at this poll resource. - `POST /v1/workflow-runs/{run_id}/start` returns `202`; poll `GET /v1/workflow-runs/{run_id}` until `execution_state` is `COMPLETED` or `FAILED`. The `Location` header points at the run resource. - `POST /v1/agent/ask` is **synchronous** — it blocks until the agent finishes and returns the answer inline. Use a generous HTTP timeout. **Pagination.** List endpoints accept `limit`/`offset` and return `{items, total, limit, offset}`. **Errors.** Every non-2xx body is `{detail, code, request_id}`. `code` is a stable value from a closed set (see the `ErrorResponse` schema\'s `code` enum) — branch on it rather than parsing `detail`. Quota rejections return `429` with a `Retry-After` header; transient lock contention returns a retryable `503`. Quote `request_id` (also the `x-request-id` response header) to support. **Idempotency.** `POST /v1/workflow-runs` accepts an `idempotency_key` to dedupe retried run creation. `agent/ask` charges one message *before* running and does not refund a client-cancelled call.
7
+ *
8
+ * The version of the OpenAPI document: 0.1.0
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
16
+ if (k2 === undefined) k2 = k;
17
+ var desc = Object.getOwnPropertyDescriptor(m, k);
18
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
19
+ desc = { enumerable: true, get: function() { return m[k]; } };
20
+ }
21
+ Object.defineProperty(o, k2, desc);
22
+ }) : (function(o, m, k, k2) {
23
+ if (k2 === undefined) k2 = k;
24
+ o[k2] = m[k];
25
+ }));
26
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
27
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
28
+ }) : function(o, v) {
29
+ o["default"] = v;
30
+ });
31
+ var __importStar = (this && this.__importStar) || (function () {
32
+ var ownKeys = function(o) {
33
+ ownKeys = Object.getOwnPropertyNames || function (o) {
34
+ var ar = [];
35
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
36
+ return ar;
37
+ };
38
+ return ownKeys(o);
39
+ };
40
+ return function (mod) {
41
+ if (mod && mod.__esModule) return mod;
42
+ var result = {};
43
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
44
+ __setModuleDefault(result, mod);
45
+ return result;
46
+ };
47
+ })();
48
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
49
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
50
+ return new (P || (P = Promise))(function (resolve, reject) {
51
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
52
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
53
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
54
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
55
+ });
56
+ };
57
+ Object.defineProperty(exports, "__esModule", { value: true });
58
+ exports.DiagnosticsApi = void 0;
59
+ const runtime = __importStar(require("../runtime"));
60
+ const index_1 = require("../models/index");
61
+ /**
62
+ *
63
+ */
64
+ class DiagnosticsApi extends runtime.BaseAPI {
65
+ /**
66
+ * Creates request options for computeThreadDiagnostics without sending the request
67
+ */
68
+ computeThreadDiagnosticsRequestOpts(requestParameters) {
69
+ return __awaiter(this, void 0, void 0, function* () {
70
+ if (requestParameters['threadId'] == null) {
71
+ throw new runtime.RequiredError('threadId', 'Required parameter "threadId" was null or undefined when calling computeThreadDiagnostics().');
72
+ }
73
+ const queryParameters = {};
74
+ const headerParameters = {};
75
+ if (this.configuration && this.configuration.accessToken) {
76
+ const token = this.configuration.accessToken;
77
+ const tokenString = yield token("bearerAuth", []);
78
+ if (tokenString) {
79
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
80
+ }
81
+ }
82
+ let urlPath = `/v1/diagnostics/threads/{thread_id}`;
83
+ urlPath = urlPath.replace(`{${"thread_id"}}`, encodeURIComponent(String(requestParameters['threadId'])));
84
+ return {
85
+ path: urlPath,
86
+ method: 'POST',
87
+ headers: headerParameters,
88
+ query: queryParameters,
89
+ };
90
+ });
91
+ }
92
+ /**
93
+ * Stats and trace links for every turn; a run\'s thread answers as its run.
94
+ * Compute Thread Diagnostics Handler
95
+ */
96
+ computeThreadDiagnosticsRaw(requestParameters, initOverrides) {
97
+ return __awaiter(this, void 0, void 0, function* () {
98
+ const requestOptions = yield this.computeThreadDiagnosticsRequestOpts(requestParameters);
99
+ const response = yield this.request(requestOptions, initOverrides);
100
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.DiagnosticsResponseFromJSON)(jsonValue));
101
+ });
102
+ }
103
+ /**
104
+ * Stats and trace links for every turn; a run\'s thread answers as its run.
105
+ * Compute Thread Diagnostics Handler
106
+ */
107
+ computeThreadDiagnostics(requestParameters, initOverrides) {
108
+ return __awaiter(this, void 0, void 0, function* () {
109
+ const response = yield this.computeThreadDiagnosticsRaw(requestParameters, initOverrides);
110
+ return yield response.value();
111
+ });
112
+ }
113
+ /**
114
+ * Creates request options for computeWorkflowRunDiagnostics without sending the request
115
+ */
116
+ computeWorkflowRunDiagnosticsRequestOpts(requestParameters) {
117
+ return __awaiter(this, void 0, void 0, function* () {
118
+ if (requestParameters['runId'] == null) {
119
+ throw new runtime.RequiredError('runId', 'Required parameter "runId" was null or undefined when calling computeWorkflowRunDiagnostics().');
120
+ }
121
+ const queryParameters = {};
122
+ const headerParameters = {};
123
+ if (this.configuration && this.configuration.accessToken) {
124
+ const token = this.configuration.accessToken;
125
+ const tokenString = yield token("bearerAuth", []);
126
+ if (tokenString) {
127
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
128
+ }
129
+ }
130
+ let urlPath = `/v1/diagnostics/workflow-runs/{run_id}`;
131
+ urlPath = urlPath.replace(`{${"run_id"}}`, encodeURIComponent(String(requestParameters['runId'])));
132
+ return {
133
+ path: urlPath,
134
+ method: 'POST',
135
+ headers: headerParameters,
136
+ query: queryParameters,
137
+ };
138
+ });
139
+ }
140
+ /**
141
+ * Stats and trace links for the run\'s attempts and every turn in its thread.
142
+ * Compute Workflow Run Diagnostics Handler
143
+ */
144
+ computeWorkflowRunDiagnosticsRaw(requestParameters, initOverrides) {
145
+ return __awaiter(this, void 0, void 0, function* () {
146
+ const requestOptions = yield this.computeWorkflowRunDiagnosticsRequestOpts(requestParameters);
147
+ const response = yield this.request(requestOptions, initOverrides);
148
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.DiagnosticsResponseFromJSON)(jsonValue));
149
+ });
150
+ }
151
+ /**
152
+ * Stats and trace links for the run\'s attempts and every turn in its thread.
153
+ * Compute Workflow Run Diagnostics Handler
154
+ */
155
+ computeWorkflowRunDiagnostics(requestParameters, initOverrides) {
156
+ return __awaiter(this, void 0, void 0, function* () {
157
+ const response = yield this.computeWorkflowRunDiagnosticsRaw(requestParameters, initOverrides);
158
+ return yield response.value();
159
+ });
160
+ }
161
+ }
162
+ exports.DiagnosticsApi = DiagnosticsApi;
@@ -13,6 +13,7 @@ export * from './ChunkLineagesApi';
13
13
  export * from './ChunksApi';
14
14
  export * from './DataSourcesApi';
15
15
  export * from './DefaultApi';
16
+ export * from './DiagnosticsApi';
16
17
  export * from './DocumentCheckoutApi';
17
18
  export * from './DocumentVersionsApi';
18
19
  export * from './DocumentsApi';
@@ -31,6 +31,7 @@ __exportStar(require("./ChunkLineagesApi"), exports);
31
31
  __exportStar(require("./ChunksApi"), exports);
32
32
  __exportStar(require("./DataSourcesApi"), exports);
33
33
  __exportStar(require("./DefaultApi"), exports);
34
+ __exportStar(require("./DiagnosticsApi"), exports);
34
35
  __exportStar(require("./DocumentCheckoutApi"), exports);
35
36
  __exportStar(require("./DocumentVersionsApi"), exports);
36
37
  __exportStar(require("./DocumentsApi"), exports);
@@ -0,0 +1,102 @@
1
+ /**
2
+ * Knowledge Stack API
3
+ * Knowledge Stack backend API for authentication and knowledge management. ## Integrating (RPA / machine clients) **Base URL.** Knowledge Stack is self-hosted — point at your own deployment host (see `servers`). The `localhost` entry is for local development only. **Authentication.** Send `Authorization: Bearer <api-key>` on every request. Mint an API key once via `POST /v1/api-keys` from a signed-in browser session; the raw `sk-user-...` secret is returned **only** at creation, so store it then. A key inherits its owning user\'s live tenant role and path permissions — create RPA keys from a least-privilege user, and set `expires_at` for rotation. The `ks_uat` cookie scheme is browser-only and cannot be used by headless clients. **Async work is polled, not pushed.** There are no outbound webhooks. - `POST /v1/documents/ingest` returns `201` immediately with a `workflow_id`; poll `GET /v1/system-jobs/document_versions/{workflow_id}` until `status` is terminal (anything other than `pending`/`processing`). The `Location` response header points at this poll resource. - `POST /v1/workflow-runs/{run_id}/start` returns `202`; poll `GET /v1/workflow-runs/{run_id}` until `execution_state` is `COMPLETED` or `FAILED`. The `Location` header points at the run resource. - `POST /v1/agent/ask` is **synchronous** — it blocks until the agent finishes and returns the answer inline. Use a generous HTTP timeout. **Pagination.** List endpoints accept `limit`/`offset` and return `{items, total, limit, offset}`. **Errors.** Every non-2xx body is `{detail, code, request_id}`. `code` is a stable value from a closed set (see the `ErrorResponse` schema\'s `code` enum) — branch on it rather than parsing `detail`. Quota rejections return `429` with a `Retry-After` header; transient lock contention returns a retryable `503`. Quote `request_id` (also the `x-request-id` response header) to support. **Idempotency.** `POST /v1/workflow-runs` accepts an `idempotency_key` to dedupe retried run creation. `agent/ask` charges one message *before* running and does not refund a client-cancelled call.
4
+ *
5
+ * The version of the OpenAPI document: 0.1.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import * as runtime from '../runtime';
13
+ import type { DiagnosticsResponse } from '../models/index';
14
+ export interface ComputeThreadDiagnosticsRequest {
15
+ threadId: string;
16
+ }
17
+ export interface ComputeWorkflowRunDiagnosticsRequest {
18
+ runId: string;
19
+ }
20
+ /**
21
+ * DiagnosticsApi - interface
22
+ *
23
+ * @export
24
+ * @interface DiagnosticsApiInterface
25
+ */
26
+ export interface DiagnosticsApiInterface {
27
+ /**
28
+ * Creates request options for computeThreadDiagnostics without sending the request
29
+ * @param {string} threadId
30
+ * @throws {RequiredError}
31
+ * @memberof DiagnosticsApiInterface
32
+ */
33
+ computeThreadDiagnosticsRequestOpts(requestParameters: ComputeThreadDiagnosticsRequest): Promise<runtime.RequestOpts>;
34
+ /**
35
+ * Stats and trace links for every turn; a run\'s thread answers as its run.
36
+ * @summary Compute Thread Diagnostics Handler
37
+ * @param {string} threadId
38
+ * @param {*} [options] Override http request option.
39
+ * @throws {RequiredError}
40
+ * @memberof DiagnosticsApiInterface
41
+ */
42
+ computeThreadDiagnosticsRaw(requestParameters: ComputeThreadDiagnosticsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DiagnosticsResponse>>;
43
+ /**
44
+ * Stats and trace links for every turn; a run\'s thread answers as its run.
45
+ * Compute Thread Diagnostics Handler
46
+ */
47
+ computeThreadDiagnostics(requestParameters: ComputeThreadDiagnosticsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DiagnosticsResponse>;
48
+ /**
49
+ * Creates request options for computeWorkflowRunDiagnostics without sending the request
50
+ * @param {string} runId
51
+ * @throws {RequiredError}
52
+ * @memberof DiagnosticsApiInterface
53
+ */
54
+ computeWorkflowRunDiagnosticsRequestOpts(requestParameters: ComputeWorkflowRunDiagnosticsRequest): Promise<runtime.RequestOpts>;
55
+ /**
56
+ * Stats and trace links for the run\'s attempts and every turn in its thread.
57
+ * @summary Compute Workflow Run Diagnostics Handler
58
+ * @param {string} runId
59
+ * @param {*} [options] Override http request option.
60
+ * @throws {RequiredError}
61
+ * @memberof DiagnosticsApiInterface
62
+ */
63
+ computeWorkflowRunDiagnosticsRaw(requestParameters: ComputeWorkflowRunDiagnosticsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DiagnosticsResponse>>;
64
+ /**
65
+ * Stats and trace links for the run\'s attempts and every turn in its thread.
66
+ * Compute Workflow Run Diagnostics Handler
67
+ */
68
+ computeWorkflowRunDiagnostics(requestParameters: ComputeWorkflowRunDiagnosticsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DiagnosticsResponse>;
69
+ }
70
+ /**
71
+ *
72
+ */
73
+ export declare class DiagnosticsApi extends runtime.BaseAPI implements DiagnosticsApiInterface {
74
+ /**
75
+ * Creates request options for computeThreadDiagnostics without sending the request
76
+ */
77
+ computeThreadDiagnosticsRequestOpts(requestParameters: ComputeThreadDiagnosticsRequest): Promise<runtime.RequestOpts>;
78
+ /**
79
+ * Stats and trace links for every turn; a run\'s thread answers as its run.
80
+ * Compute Thread Diagnostics Handler
81
+ */
82
+ computeThreadDiagnosticsRaw(requestParameters: ComputeThreadDiagnosticsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DiagnosticsResponse>>;
83
+ /**
84
+ * Stats and trace links for every turn; a run\'s thread answers as its run.
85
+ * Compute Thread Diagnostics Handler
86
+ */
87
+ computeThreadDiagnostics(requestParameters: ComputeThreadDiagnosticsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DiagnosticsResponse>;
88
+ /**
89
+ * Creates request options for computeWorkflowRunDiagnostics without sending the request
90
+ */
91
+ computeWorkflowRunDiagnosticsRequestOpts(requestParameters: ComputeWorkflowRunDiagnosticsRequest): Promise<runtime.RequestOpts>;
92
+ /**
93
+ * Stats and trace links for the run\'s attempts and every turn in its thread.
94
+ * Compute Workflow Run Diagnostics Handler
95
+ */
96
+ computeWorkflowRunDiagnosticsRaw(requestParameters: ComputeWorkflowRunDiagnosticsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DiagnosticsResponse>>;
97
+ /**
98
+ * Stats and trace links for the run\'s attempts and every turn in its thread.
99
+ * Compute Workflow Run Diagnostics Handler
100
+ */
101
+ computeWorkflowRunDiagnostics(requestParameters: ComputeWorkflowRunDiagnosticsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DiagnosticsResponse>;
102
+ }
@@ -0,0 +1,125 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Knowledge Stack API
5
+ * Knowledge Stack backend API for authentication and knowledge management. ## Integrating (RPA / machine clients) **Base URL.** Knowledge Stack is self-hosted — point at your own deployment host (see `servers`). The `localhost` entry is for local development only. **Authentication.** Send `Authorization: Bearer <api-key>` on every request. Mint an API key once via `POST /v1/api-keys` from a signed-in browser session; the raw `sk-user-...` secret is returned **only** at creation, so store it then. A key inherits its owning user\'s live tenant role and path permissions — create RPA keys from a least-privilege user, and set `expires_at` for rotation. The `ks_uat` cookie scheme is browser-only and cannot be used by headless clients. **Async work is polled, not pushed.** There are no outbound webhooks. - `POST /v1/documents/ingest` returns `201` immediately with a `workflow_id`; poll `GET /v1/system-jobs/document_versions/{workflow_id}` until `status` is terminal (anything other than `pending`/`processing`). The `Location` response header points at this poll resource. - `POST /v1/workflow-runs/{run_id}/start` returns `202`; poll `GET /v1/workflow-runs/{run_id}` until `execution_state` is `COMPLETED` or `FAILED`. The `Location` header points at the run resource. - `POST /v1/agent/ask` is **synchronous** — it blocks until the agent finishes and returns the answer inline. Use a generous HTTP timeout. **Pagination.** List endpoints accept `limit`/`offset` and return `{items, total, limit, offset}`. **Errors.** Every non-2xx body is `{detail, code, request_id}`. `code` is a stable value from a closed set (see the `ErrorResponse` schema\'s `code` enum) — branch on it rather than parsing `detail`. Quota rejections return `429` with a `Retry-After` header; transient lock contention returns a retryable `503`. Quote `request_id` (also the `x-request-id` response header) to support. **Idempotency.** `POST /v1/workflow-runs` accepts an `idempotency_key` to dedupe retried run creation. `agent/ask` charges one message *before* running and does not refund a client-cancelled call.
6
+ *
7
+ * The version of the OpenAPI document: 0.1.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
+ return new (P || (P = Promise))(function (resolve, reject) {
17
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
21
+ });
22
+ };
23
+ import * as runtime from '../runtime';
24
+ import { DiagnosticsResponseFromJSON, } from '../models/index';
25
+ /**
26
+ *
27
+ */
28
+ export class DiagnosticsApi extends runtime.BaseAPI {
29
+ /**
30
+ * Creates request options for computeThreadDiagnostics without sending the request
31
+ */
32
+ computeThreadDiagnosticsRequestOpts(requestParameters) {
33
+ return __awaiter(this, void 0, void 0, function* () {
34
+ if (requestParameters['threadId'] == null) {
35
+ throw new runtime.RequiredError('threadId', 'Required parameter "threadId" was null or undefined when calling computeThreadDiagnostics().');
36
+ }
37
+ const queryParameters = {};
38
+ const headerParameters = {};
39
+ if (this.configuration && this.configuration.accessToken) {
40
+ const token = this.configuration.accessToken;
41
+ const tokenString = yield token("bearerAuth", []);
42
+ if (tokenString) {
43
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
44
+ }
45
+ }
46
+ let urlPath = `/v1/diagnostics/threads/{thread_id}`;
47
+ urlPath = urlPath.replace(`{${"thread_id"}}`, encodeURIComponent(String(requestParameters['threadId'])));
48
+ return {
49
+ path: urlPath,
50
+ method: 'POST',
51
+ headers: headerParameters,
52
+ query: queryParameters,
53
+ };
54
+ });
55
+ }
56
+ /**
57
+ * Stats and trace links for every turn; a run\'s thread answers as its run.
58
+ * Compute Thread Diagnostics Handler
59
+ */
60
+ computeThreadDiagnosticsRaw(requestParameters, initOverrides) {
61
+ return __awaiter(this, void 0, void 0, function* () {
62
+ const requestOptions = yield this.computeThreadDiagnosticsRequestOpts(requestParameters);
63
+ const response = yield this.request(requestOptions, initOverrides);
64
+ return new runtime.JSONApiResponse(response, (jsonValue) => DiagnosticsResponseFromJSON(jsonValue));
65
+ });
66
+ }
67
+ /**
68
+ * Stats and trace links for every turn; a run\'s thread answers as its run.
69
+ * Compute Thread Diagnostics Handler
70
+ */
71
+ computeThreadDiagnostics(requestParameters, initOverrides) {
72
+ return __awaiter(this, void 0, void 0, function* () {
73
+ const response = yield this.computeThreadDiagnosticsRaw(requestParameters, initOverrides);
74
+ return yield response.value();
75
+ });
76
+ }
77
+ /**
78
+ * Creates request options for computeWorkflowRunDiagnostics without sending the request
79
+ */
80
+ computeWorkflowRunDiagnosticsRequestOpts(requestParameters) {
81
+ return __awaiter(this, void 0, void 0, function* () {
82
+ if (requestParameters['runId'] == null) {
83
+ throw new runtime.RequiredError('runId', 'Required parameter "runId" was null or undefined when calling computeWorkflowRunDiagnostics().');
84
+ }
85
+ const queryParameters = {};
86
+ const headerParameters = {};
87
+ if (this.configuration && this.configuration.accessToken) {
88
+ const token = this.configuration.accessToken;
89
+ const tokenString = yield token("bearerAuth", []);
90
+ if (tokenString) {
91
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
92
+ }
93
+ }
94
+ let urlPath = `/v1/diagnostics/workflow-runs/{run_id}`;
95
+ urlPath = urlPath.replace(`{${"run_id"}}`, encodeURIComponent(String(requestParameters['runId'])));
96
+ return {
97
+ path: urlPath,
98
+ method: 'POST',
99
+ headers: headerParameters,
100
+ query: queryParameters,
101
+ };
102
+ });
103
+ }
104
+ /**
105
+ * Stats and trace links for the run\'s attempts and every turn in its thread.
106
+ * Compute Workflow Run Diagnostics Handler
107
+ */
108
+ computeWorkflowRunDiagnosticsRaw(requestParameters, initOverrides) {
109
+ return __awaiter(this, void 0, void 0, function* () {
110
+ const requestOptions = yield this.computeWorkflowRunDiagnosticsRequestOpts(requestParameters);
111
+ const response = yield this.request(requestOptions, initOverrides);
112
+ return new runtime.JSONApiResponse(response, (jsonValue) => DiagnosticsResponseFromJSON(jsonValue));
113
+ });
114
+ }
115
+ /**
116
+ * Stats and trace links for the run\'s attempts and every turn in its thread.
117
+ * Compute Workflow Run Diagnostics Handler
118
+ */
119
+ computeWorkflowRunDiagnostics(requestParameters, initOverrides) {
120
+ return __awaiter(this, void 0, void 0, function* () {
121
+ const response = yield this.computeWorkflowRunDiagnosticsRaw(requestParameters, initOverrides);
122
+ return yield response.value();
123
+ });
124
+ }
125
+ }
@@ -13,6 +13,7 @@ export * from './ChunkLineagesApi';
13
13
  export * from './ChunksApi';
14
14
  export * from './DataSourcesApi';
15
15
  export * from './DefaultApi';
16
+ export * from './DiagnosticsApi';
16
17
  export * from './DocumentCheckoutApi';
17
18
  export * from './DocumentVersionsApi';
18
19
  export * from './DocumentsApi';
@@ -15,6 +15,7 @@ export * from './ChunkLineagesApi';
15
15
  export * from './ChunksApi';
16
16
  export * from './DataSourcesApi';
17
17
  export * from './DefaultApi';
18
+ export * from './DiagnosticsApi';
18
19
  export * from './DocumentCheckoutApi';
19
20
  export * from './DocumentVersionsApi';
20
21
  export * from './DocumentsApi';