@knowledge-stack/ksapi 3.5.2 → 3.6.1
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/.openapi-generator/FILES +12 -0
- package/README.md +9 -2
- package/dist/apis/DiagnosticsApi.d.ts +102 -0
- package/dist/apis/DiagnosticsApi.js +162 -0
- package/dist/apis/index.d.ts +1 -0
- package/dist/apis/index.js +1 -0
- package/dist/esm/apis/DiagnosticsApi.d.ts +102 -0
- package/dist/esm/apis/DiagnosticsApi.js +125 -0
- package/dist/esm/apis/index.d.ts +1 -0
- package/dist/esm/apis/index.js +1 -0
- package/dist/esm/models/DiagnosticTraceFailureReason.d.ts +27 -0
- package/dist/esm/models/DiagnosticTraceFailureReason.js +45 -0
- package/dist/esm/models/DiagnosticTraceItem.d.ts +280 -0
- package/dist/esm/models/DiagnosticTraceItem.js +131 -0
- package/dist/esm/models/DiagnosticTraceStatus.d.ts +26 -0
- package/dist/esm/models/DiagnosticTraceStatus.js +44 -0
- package/dist/esm/models/DiagnosticsResponse.d.ts +54 -0
- package/dist/esm/models/DiagnosticsResponse.js +49 -0
- package/dist/esm/models/TraceKind.d.ts +25 -0
- package/dist/esm/models/TraceKind.js +43 -0
- package/dist/esm/models/index.d.ts +5 -0
- package/dist/esm/models/index.js +5 -0
- package/dist/models/DiagnosticTraceFailureReason.d.ts +27 -0
- package/dist/models/DiagnosticTraceFailureReason.js +53 -0
- package/dist/models/DiagnosticTraceItem.d.ts +280 -0
- package/dist/models/DiagnosticTraceItem.js +139 -0
- package/dist/models/DiagnosticTraceStatus.d.ts +26 -0
- package/dist/models/DiagnosticTraceStatus.js +52 -0
- package/dist/models/DiagnosticsResponse.d.ts +54 -0
- package/dist/models/DiagnosticsResponse.js +57 -0
- package/dist/models/TraceKind.d.ts +25 -0
- package/dist/models/TraceKind.js +51 -0
- package/dist/models/index.d.ts +5 -0
- package/dist/models/index.js +5 -0
- package/docs/DiagnosticTraceFailureReason.md +32 -0
- package/docs/DiagnosticTraceItem.md +111 -0
- package/docs/DiagnosticTraceStatus.md +32 -0
- package/docs/DiagnosticsApi.md +160 -0
- package/docs/DiagnosticsResponse.md +36 -0
- package/docs/TraceKind.md +32 -0
- package/package.json +1 -1
- package/src/apis/DiagnosticsApi.ts +211 -0
- package/src/apis/index.ts +1 -0
- package/src/models/DiagnosticTraceFailureReason.ts +55 -0
- package/src/models/DiagnosticTraceItem.ts +415 -0
- package/src/models/DiagnosticTraceStatus.ts +54 -0
- package/src/models/DiagnosticsResponse.ts +100 -0
- package/src/models/TraceKind.ts +53 -0
- package/src/models/index.ts +5 -0
|
@@ -0,0 +1,49 @@
|
|
|
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
|
+
import { DiagnosticTraceItemFromJSON, DiagnosticTraceItemToJSON, } from './DiagnosticTraceItem';
|
|
15
|
+
export const DiagnosticsResponsePropertyValidationAttributesMap = {};
|
|
16
|
+
/**
|
|
17
|
+
* Check if a given object implements the DiagnosticsResponse interface.
|
|
18
|
+
*/
|
|
19
|
+
export function instanceOfDiagnosticsResponse(value) {
|
|
20
|
+
if (!('_final' in value) || value['_final'] === undefined)
|
|
21
|
+
return false;
|
|
22
|
+
if (!('traces' in value) || value['traces'] === undefined)
|
|
23
|
+
return false;
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
export function DiagnosticsResponseFromJSON(json) {
|
|
27
|
+
return DiagnosticsResponseFromJSONTyped(json, false);
|
|
28
|
+
}
|
|
29
|
+
export function DiagnosticsResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
30
|
+
if (json == null) {
|
|
31
|
+
return json;
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
'_final': json['final'],
|
|
35
|
+
'traces': (json['traces'].map(DiagnosticTraceItemFromJSON)),
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export function DiagnosticsResponseToJSON(json) {
|
|
39
|
+
return DiagnosticsResponseToJSONTyped(json, false);
|
|
40
|
+
}
|
|
41
|
+
export function DiagnosticsResponseToJSONTyped(value, ignoreDiscriminator = false) {
|
|
42
|
+
if (value == null) {
|
|
43
|
+
return value;
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
'final': value['_final'],
|
|
47
|
+
'traces': (value['traces'].map(DiagnosticTraceItemToJSON)),
|
|
48
|
+
};
|
|
49
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @export
|
|
15
|
+
*/
|
|
16
|
+
export declare const TraceKind: {
|
|
17
|
+
readonly WorkflowRun: 'workflow_run';
|
|
18
|
+
readonly ChatTurn: 'chat_turn';
|
|
19
|
+
};
|
|
20
|
+
export type TraceKind = typeof TraceKind[keyof typeof TraceKind];
|
|
21
|
+
export declare function instanceOfTraceKind(value: any): boolean;
|
|
22
|
+
export declare function TraceKindFromJSON(json: any): TraceKind;
|
|
23
|
+
export declare function TraceKindFromJSONTyped(json: any, ignoreDiscriminator: boolean): TraceKind;
|
|
24
|
+
export declare function TraceKindToJSON(value?: TraceKind | null): any;
|
|
25
|
+
export declare function TraceKindToJSONTyped(value: any, ignoreDiscriminator: boolean): TraceKind;
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* @export
|
|
17
|
+
*/
|
|
18
|
+
export const TraceKind = {
|
|
19
|
+
WorkflowRun: 'workflow_run',
|
|
20
|
+
ChatTurn: 'chat_turn'
|
|
21
|
+
};
|
|
22
|
+
export function instanceOfTraceKind(value) {
|
|
23
|
+
for (const key in TraceKind) {
|
|
24
|
+
if (Object.prototype.hasOwnProperty.call(TraceKind, key)) {
|
|
25
|
+
if (TraceKind[key] === value) {
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
export function TraceKindFromJSON(json) {
|
|
33
|
+
return TraceKindFromJSONTyped(json, false);
|
|
34
|
+
}
|
|
35
|
+
export function TraceKindFromJSONTyped(json, ignoreDiscriminator) {
|
|
36
|
+
return json;
|
|
37
|
+
}
|
|
38
|
+
export function TraceKindToJSON(value) {
|
|
39
|
+
return value;
|
|
40
|
+
}
|
|
41
|
+
export function TraceKindToJSONTyped(value, ignoreDiscriminator) {
|
|
42
|
+
return value;
|
|
43
|
+
}
|
|
@@ -102,6 +102,10 @@ export * from './DataSourceSchemaResponse';
|
|
|
102
102
|
export * from './DataSourceSyncResponse';
|
|
103
103
|
export * from './DataSourceTableResponse';
|
|
104
104
|
export * from './DefinitionOutputStat';
|
|
105
|
+
export * from './DiagnosticTraceFailureReason';
|
|
106
|
+
export * from './DiagnosticTraceItem';
|
|
107
|
+
export * from './DiagnosticTraceStatus';
|
|
108
|
+
export * from './DiagnosticsResponse';
|
|
105
109
|
export * from './DiffFormat';
|
|
106
110
|
export * from './DiffRow';
|
|
107
111
|
export * from './DiffRowType';
|
|
@@ -335,6 +339,7 @@ export * from './TimeseriesPoint';
|
|
|
335
339
|
export * from './ToolDisplayType';
|
|
336
340
|
export * from './ToolPart';
|
|
337
341
|
export * from './ToolStatus';
|
|
342
|
+
export * from './TraceKind';
|
|
338
343
|
export * from './TranscriptionResponse';
|
|
339
344
|
export * from './TransferOwnerRequest';
|
|
340
345
|
export * from './TransferOwnerResponse';
|
package/dist/esm/models/index.js
CHANGED
|
@@ -104,6 +104,10 @@ export * from './DataSourceSchemaResponse';
|
|
|
104
104
|
export * from './DataSourceSyncResponse';
|
|
105
105
|
export * from './DataSourceTableResponse';
|
|
106
106
|
export * from './DefinitionOutputStat';
|
|
107
|
+
export * from './DiagnosticTraceFailureReason';
|
|
108
|
+
export * from './DiagnosticTraceItem';
|
|
109
|
+
export * from './DiagnosticTraceStatus';
|
|
110
|
+
export * from './DiagnosticsResponse';
|
|
107
111
|
export * from './DiffFormat';
|
|
108
112
|
export * from './DiffRow';
|
|
109
113
|
export * from './DiffRowType';
|
|
@@ -337,6 +341,7 @@ export * from './TimeseriesPoint';
|
|
|
337
341
|
export * from './ToolDisplayType';
|
|
338
342
|
export * from './ToolPart';
|
|
339
343
|
export * from './ToolStatus';
|
|
344
|
+
export * from './TraceKind';
|
|
340
345
|
export * from './TranscriptionResponse';
|
|
341
346
|
export * from './TransferOwnerRequest';
|
|
342
347
|
export * from './TransferOwnerResponse';
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @export
|
|
15
|
+
*/
|
|
16
|
+
export declare const DiagnosticTraceFailureReason: {
|
|
17
|
+
readonly TooLarge: 'too_large';
|
|
18
|
+
readonly ClickhouseError: 'clickhouse_error';
|
|
19
|
+
readonly MalformedTrace: 'malformed_trace';
|
|
20
|
+
readonly NoTrace: 'no_trace';
|
|
21
|
+
};
|
|
22
|
+
export type DiagnosticTraceFailureReason = typeof DiagnosticTraceFailureReason[keyof typeof DiagnosticTraceFailureReason];
|
|
23
|
+
export declare function instanceOfDiagnosticTraceFailureReason(value: any): boolean;
|
|
24
|
+
export declare function DiagnosticTraceFailureReasonFromJSON(json: any): DiagnosticTraceFailureReason;
|
|
25
|
+
export declare function DiagnosticTraceFailureReasonFromJSONTyped(json: any, ignoreDiscriminator: boolean): DiagnosticTraceFailureReason;
|
|
26
|
+
export declare function DiagnosticTraceFailureReasonToJSON(value?: DiagnosticTraceFailureReason | null): any;
|
|
27
|
+
export declare function DiagnosticTraceFailureReasonToJSONTyped(value: any, ignoreDiscriminator: boolean): DiagnosticTraceFailureReason;
|
|
@@ -0,0 +1,53 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.DiagnosticTraceFailureReason = void 0;
|
|
17
|
+
exports.instanceOfDiagnosticTraceFailureReason = instanceOfDiagnosticTraceFailureReason;
|
|
18
|
+
exports.DiagnosticTraceFailureReasonFromJSON = DiagnosticTraceFailureReasonFromJSON;
|
|
19
|
+
exports.DiagnosticTraceFailureReasonFromJSONTyped = DiagnosticTraceFailureReasonFromJSONTyped;
|
|
20
|
+
exports.DiagnosticTraceFailureReasonToJSON = DiagnosticTraceFailureReasonToJSON;
|
|
21
|
+
exports.DiagnosticTraceFailureReasonToJSONTyped = DiagnosticTraceFailureReasonToJSONTyped;
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @export
|
|
25
|
+
*/
|
|
26
|
+
exports.DiagnosticTraceFailureReason = {
|
|
27
|
+
TooLarge: 'too_large',
|
|
28
|
+
ClickhouseError: 'clickhouse_error',
|
|
29
|
+
MalformedTrace: 'malformed_trace',
|
|
30
|
+
NoTrace: 'no_trace'
|
|
31
|
+
};
|
|
32
|
+
function instanceOfDiagnosticTraceFailureReason(value) {
|
|
33
|
+
for (const key in exports.DiagnosticTraceFailureReason) {
|
|
34
|
+
if (Object.prototype.hasOwnProperty.call(exports.DiagnosticTraceFailureReason, key)) {
|
|
35
|
+
if (exports.DiagnosticTraceFailureReason[key] === value) {
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
function DiagnosticTraceFailureReasonFromJSON(json) {
|
|
43
|
+
return DiagnosticTraceFailureReasonFromJSONTyped(json, false);
|
|
44
|
+
}
|
|
45
|
+
function DiagnosticTraceFailureReasonFromJSONTyped(json, ignoreDiscriminator) {
|
|
46
|
+
return json;
|
|
47
|
+
}
|
|
48
|
+
function DiagnosticTraceFailureReasonToJSON(value) {
|
|
49
|
+
return value;
|
|
50
|
+
}
|
|
51
|
+
function DiagnosticTraceFailureReasonToJSONTyped(value, ignoreDiscriminator) {
|
|
52
|
+
return value;
|
|
53
|
+
}
|
|
@@ -0,0 +1,280 @@
|
|
|
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 type { TraceKind } from './TraceKind';
|
|
13
|
+
import type { DiagnosticTraceStatus } from './DiagnosticTraceStatus';
|
|
14
|
+
import type { DiagnosticTraceFailureReason } from './DiagnosticTraceFailureReason';
|
|
15
|
+
/**
|
|
16
|
+
* One trace of the conversation; stats and the link are null unless ready.
|
|
17
|
+
* @export
|
|
18
|
+
* @interface DiagnosticTraceItem
|
|
19
|
+
*/
|
|
20
|
+
export interface DiagnosticTraceItem {
|
|
21
|
+
/**
|
|
22
|
+
*
|
|
23
|
+
* @type {DiagnosticTraceStatus}
|
|
24
|
+
* @memberof DiagnosticTraceItem
|
|
25
|
+
*/
|
|
26
|
+
status: DiagnosticTraceStatus;
|
|
27
|
+
/**
|
|
28
|
+
*
|
|
29
|
+
* @type {TraceKind}
|
|
30
|
+
* @memberof DiagnosticTraceItem
|
|
31
|
+
*/
|
|
32
|
+
kind: TraceKind;
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
* @type {DiagnosticTraceFailureReason}
|
|
36
|
+
* @memberof DiagnosticTraceItem
|
|
37
|
+
*/
|
|
38
|
+
reason?: DiagnosticTraceFailureReason;
|
|
39
|
+
/**
|
|
40
|
+
*
|
|
41
|
+
* @type {string}
|
|
42
|
+
* @memberof DiagnosticTraceItem
|
|
43
|
+
*/
|
|
44
|
+
traceId: string | null;
|
|
45
|
+
/**
|
|
46
|
+
*
|
|
47
|
+
* @type {string}
|
|
48
|
+
* @memberof DiagnosticTraceItem
|
|
49
|
+
*/
|
|
50
|
+
runId?: string | null;
|
|
51
|
+
/**
|
|
52
|
+
*
|
|
53
|
+
* @type {string}
|
|
54
|
+
* @memberof DiagnosticTraceItem
|
|
55
|
+
*/
|
|
56
|
+
threadId?: string | null;
|
|
57
|
+
/**
|
|
58
|
+
*
|
|
59
|
+
* @type {string}
|
|
60
|
+
* @memberof DiagnosticTraceItem
|
|
61
|
+
*/
|
|
62
|
+
messageId?: string | null;
|
|
63
|
+
/**
|
|
64
|
+
*
|
|
65
|
+
* @type {string}
|
|
66
|
+
* @memberof DiagnosticTraceItem
|
|
67
|
+
*/
|
|
68
|
+
userId: string | null;
|
|
69
|
+
/**
|
|
70
|
+
*
|
|
71
|
+
* @type {Date}
|
|
72
|
+
* @memberof DiagnosticTraceItem
|
|
73
|
+
*/
|
|
74
|
+
startedAt: Date | null;
|
|
75
|
+
/**
|
|
76
|
+
*
|
|
77
|
+
* @type {Date}
|
|
78
|
+
* @memberof DiagnosticTraceItem
|
|
79
|
+
*/
|
|
80
|
+
endedAt?: Date | null;
|
|
81
|
+
/**
|
|
82
|
+
*
|
|
83
|
+
* @type {number}
|
|
84
|
+
* @memberof DiagnosticTraceItem
|
|
85
|
+
*/
|
|
86
|
+
durationMs?: number | null;
|
|
87
|
+
/**
|
|
88
|
+
*
|
|
89
|
+
* @type {string}
|
|
90
|
+
* @memberof DiagnosticTraceItem
|
|
91
|
+
*/
|
|
92
|
+
model?: string | null;
|
|
93
|
+
/**
|
|
94
|
+
*
|
|
95
|
+
* @type {number}
|
|
96
|
+
* @memberof DiagnosticTraceItem
|
|
97
|
+
*/
|
|
98
|
+
generations?: number | null;
|
|
99
|
+
/**
|
|
100
|
+
*
|
|
101
|
+
* @type {number}
|
|
102
|
+
* @memberof DiagnosticTraceItem
|
|
103
|
+
*/
|
|
104
|
+
toolCalls?: number | null;
|
|
105
|
+
/**
|
|
106
|
+
*
|
|
107
|
+
* @type {number}
|
|
108
|
+
* @memberof DiagnosticTraceItem
|
|
109
|
+
*/
|
|
110
|
+
subagents?: number | null;
|
|
111
|
+
/**
|
|
112
|
+
*
|
|
113
|
+
* @type {number}
|
|
114
|
+
* @memberof DiagnosticTraceItem
|
|
115
|
+
*/
|
|
116
|
+
inputTokens?: number | null;
|
|
117
|
+
/**
|
|
118
|
+
*
|
|
119
|
+
* @type {number}
|
|
120
|
+
* @memberof DiagnosticTraceItem
|
|
121
|
+
*/
|
|
122
|
+
outputTokens?: number | null;
|
|
123
|
+
/**
|
|
124
|
+
*
|
|
125
|
+
* @type {number}
|
|
126
|
+
* @memberof DiagnosticTraceItem
|
|
127
|
+
*/
|
|
128
|
+
cachedTokens?: number | null;
|
|
129
|
+
/**
|
|
130
|
+
*
|
|
131
|
+
* @type {number}
|
|
132
|
+
* @memberof DiagnosticTraceItem
|
|
133
|
+
*/
|
|
134
|
+
reasoningTokens?: number | null;
|
|
135
|
+
/**
|
|
136
|
+
*
|
|
137
|
+
* @type {number}
|
|
138
|
+
* @memberof DiagnosticTraceItem
|
|
139
|
+
*/
|
|
140
|
+
maxContext?: number | null;
|
|
141
|
+
/**
|
|
142
|
+
*
|
|
143
|
+
* @type {number}
|
|
144
|
+
* @memberof DiagnosticTraceItem
|
|
145
|
+
*/
|
|
146
|
+
degenerateGens?: number | null;
|
|
147
|
+
/**
|
|
148
|
+
*
|
|
149
|
+
* @type {number}
|
|
150
|
+
* @memberof DiagnosticTraceItem
|
|
151
|
+
*/
|
|
152
|
+
selfDoubtPer1k?: number | null;
|
|
153
|
+
/**
|
|
154
|
+
*
|
|
155
|
+
* @type {number}
|
|
156
|
+
* @memberof DiagnosticTraceItem
|
|
157
|
+
*/
|
|
158
|
+
cacheRate?: number | null;
|
|
159
|
+
/**
|
|
160
|
+
*
|
|
161
|
+
* @type {number}
|
|
162
|
+
* @memberof DiagnosticTraceItem
|
|
163
|
+
*/
|
|
164
|
+
reasoningShare?: number | null;
|
|
165
|
+
/**
|
|
166
|
+
*
|
|
167
|
+
* @type {number}
|
|
168
|
+
* @memberof DiagnosticTraceItem
|
|
169
|
+
*/
|
|
170
|
+
singleToolRate?: number | null;
|
|
171
|
+
/**
|
|
172
|
+
*
|
|
173
|
+
* @type {number}
|
|
174
|
+
* @memberof DiagnosticTraceItem
|
|
175
|
+
*/
|
|
176
|
+
nEvents?: number | null;
|
|
177
|
+
/**
|
|
178
|
+
*
|
|
179
|
+
* @type {{ [key: string]: any; }}
|
|
180
|
+
* @memberof DiagnosticTraceItem
|
|
181
|
+
*/
|
|
182
|
+
metrics?: {
|
|
183
|
+
[key: string]: any;
|
|
184
|
+
} | null;
|
|
185
|
+
/**
|
|
186
|
+
*
|
|
187
|
+
* @type {boolean}
|
|
188
|
+
* @memberof DiagnosticTraceItem
|
|
189
|
+
*/
|
|
190
|
+
traceComplete?: boolean | null;
|
|
191
|
+
/**
|
|
192
|
+
*
|
|
193
|
+
* @type {boolean}
|
|
194
|
+
* @memberof DiagnosticTraceItem
|
|
195
|
+
*/
|
|
196
|
+
corruptResults?: boolean | null;
|
|
197
|
+
/**
|
|
198
|
+
*
|
|
199
|
+
* @type {string}
|
|
200
|
+
* @memberof DiagnosticTraceItem
|
|
201
|
+
*/
|
|
202
|
+
backendVersion?: string | null;
|
|
203
|
+
/**
|
|
204
|
+
*
|
|
205
|
+
* @type {number}
|
|
206
|
+
* @memberof DiagnosticTraceItem
|
|
207
|
+
*/
|
|
208
|
+
schemaVersion?: number | null;
|
|
209
|
+
/**
|
|
210
|
+
*
|
|
211
|
+
* @type {string}
|
|
212
|
+
* @memberof DiagnosticTraceItem
|
|
213
|
+
*/
|
|
214
|
+
title?: string | null;
|
|
215
|
+
/**
|
|
216
|
+
*
|
|
217
|
+
* @type {string}
|
|
218
|
+
* @memberof DiagnosticTraceItem
|
|
219
|
+
*/
|
|
220
|
+
path?: string | null;
|
|
221
|
+
/**
|
|
222
|
+
*
|
|
223
|
+
* @type {string}
|
|
224
|
+
* @memberof DiagnosticTraceItem
|
|
225
|
+
*/
|
|
226
|
+
workflowId?: string | null;
|
|
227
|
+
/**
|
|
228
|
+
*
|
|
229
|
+
* @type {string}
|
|
230
|
+
* @memberof DiagnosticTraceItem
|
|
231
|
+
*/
|
|
232
|
+
workflowName?: string | null;
|
|
233
|
+
/**
|
|
234
|
+
*
|
|
235
|
+
* @type {string}
|
|
236
|
+
* @memberof DiagnosticTraceItem
|
|
237
|
+
*/
|
|
238
|
+
state?: string | null;
|
|
239
|
+
/**
|
|
240
|
+
*
|
|
241
|
+
* @type {string}
|
|
242
|
+
* @memberof DiagnosticTraceItem
|
|
243
|
+
*/
|
|
244
|
+
runLabel?: string | null;
|
|
245
|
+
/**
|
|
246
|
+
*
|
|
247
|
+
* @type {string}
|
|
248
|
+
* @memberof DiagnosticTraceItem
|
|
249
|
+
*/
|
|
250
|
+
traceUrl?: string | null;
|
|
251
|
+
/**
|
|
252
|
+
*
|
|
253
|
+
* @type {number}
|
|
254
|
+
* @memberof DiagnosticTraceItem
|
|
255
|
+
*/
|
|
256
|
+
expiresInSeconds?: number | null;
|
|
257
|
+
}
|
|
258
|
+
export declare const DiagnosticTraceItemPropertyValidationAttributesMap: {
|
|
259
|
+
[property: string]: {
|
|
260
|
+
maxLength?: number;
|
|
261
|
+
minLength?: number;
|
|
262
|
+
pattern?: string;
|
|
263
|
+
maximum?: number;
|
|
264
|
+
exclusiveMaximum?: boolean;
|
|
265
|
+
minimum?: number;
|
|
266
|
+
exclusiveMinimum?: boolean;
|
|
267
|
+
multipleOf?: number;
|
|
268
|
+
maxItems?: number;
|
|
269
|
+
minItems?: number;
|
|
270
|
+
uniqueItems?: boolean;
|
|
271
|
+
};
|
|
272
|
+
};
|
|
273
|
+
/**
|
|
274
|
+
* Check if a given object implements the DiagnosticTraceItem interface.
|
|
275
|
+
*/
|
|
276
|
+
export declare function instanceOfDiagnosticTraceItem(value: object): value is DiagnosticTraceItem;
|
|
277
|
+
export declare function DiagnosticTraceItemFromJSON(json: any): DiagnosticTraceItem;
|
|
278
|
+
export declare function DiagnosticTraceItemFromJSONTyped(json: any, ignoreDiscriminator: boolean): DiagnosticTraceItem;
|
|
279
|
+
export declare function DiagnosticTraceItemToJSON(json: any): DiagnosticTraceItem;
|
|
280
|
+
export declare function DiagnosticTraceItemToJSONTyped(value?: DiagnosticTraceItem | null, ignoreDiscriminator?: boolean): any;
|