@knowledge-stack/ksapi 3.5.1 → 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 (50) 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/DataSourcesApi.md +1 -0
  36. package/docs/DiagnosticTraceFailureReason.md +32 -0
  37. package/docs/DiagnosticTraceItem.md +111 -0
  38. package/docs/DiagnosticTraceStatus.md +32 -0
  39. package/docs/DiagnosticsApi.md +160 -0
  40. package/docs/DiagnosticsResponse.md +36 -0
  41. package/docs/TraceKind.md +32 -0
  42. package/package.json +1 -1
  43. package/src/apis/DiagnosticsApi.ts +211 -0
  44. package/src/apis/index.ts +1 -0
  45. package/src/models/DiagnosticTraceFailureReason.ts +55 -0
  46. package/src/models/DiagnosticTraceItem.ts +415 -0
  47. package/src/models/DiagnosticTraceStatus.ts +54 -0
  48. package/src/models/DiagnosticsResponse.ts +100 -0
  49. package/src/models/TraceKind.ts +53 -0
  50. package/src/models/index.ts +5 -0
@@ -0,0 +1,139 @@
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.DiagnosticTraceItemPropertyValidationAttributesMap = void 0;
17
+ exports.instanceOfDiagnosticTraceItem = instanceOfDiagnosticTraceItem;
18
+ exports.DiagnosticTraceItemFromJSON = DiagnosticTraceItemFromJSON;
19
+ exports.DiagnosticTraceItemFromJSONTyped = DiagnosticTraceItemFromJSONTyped;
20
+ exports.DiagnosticTraceItemToJSON = DiagnosticTraceItemToJSON;
21
+ exports.DiagnosticTraceItemToJSONTyped = DiagnosticTraceItemToJSONTyped;
22
+ const TraceKind_1 = require("./TraceKind");
23
+ const DiagnosticTraceStatus_1 = require("./DiagnosticTraceStatus");
24
+ const DiagnosticTraceFailureReason_1 = require("./DiagnosticTraceFailureReason");
25
+ exports.DiagnosticTraceItemPropertyValidationAttributesMap = {};
26
+ /**
27
+ * Check if a given object implements the DiagnosticTraceItem interface.
28
+ */
29
+ function instanceOfDiagnosticTraceItem(value) {
30
+ if (!('status' in value) || value['status'] === undefined)
31
+ return false;
32
+ if (!('kind' in value) || value['kind'] === undefined)
33
+ return false;
34
+ if (!('traceId' in value) || value['traceId'] === undefined)
35
+ return false;
36
+ if (!('userId' in value) || value['userId'] === undefined)
37
+ return false;
38
+ if (!('startedAt' in value) || value['startedAt'] === undefined)
39
+ return false;
40
+ return true;
41
+ }
42
+ function DiagnosticTraceItemFromJSON(json) {
43
+ return DiagnosticTraceItemFromJSONTyped(json, false);
44
+ }
45
+ function DiagnosticTraceItemFromJSONTyped(json, ignoreDiscriminator) {
46
+ if (json == null) {
47
+ return json;
48
+ }
49
+ return {
50
+ 'status': (0, DiagnosticTraceStatus_1.DiagnosticTraceStatusFromJSON)(json['status']),
51
+ 'kind': (0, TraceKind_1.TraceKindFromJSON)(json['kind']),
52
+ 'reason': json['reason'] == null ? undefined : (0, DiagnosticTraceFailureReason_1.DiagnosticTraceFailureReasonFromJSON)(json['reason']),
53
+ 'traceId': json['trace_id'],
54
+ 'runId': json['run_id'] == null ? undefined : json['run_id'],
55
+ 'threadId': json['thread_id'] == null ? undefined : json['thread_id'],
56
+ 'messageId': json['message_id'] == null ? undefined : json['message_id'],
57
+ 'userId': json['user_id'],
58
+ 'startedAt': (json['started_at'] == null ? null : new Date(json['started_at'])),
59
+ 'endedAt': json['ended_at'] == null ? undefined : (new Date(json['ended_at'])),
60
+ 'durationMs': json['duration_ms'] == null ? undefined : json['duration_ms'],
61
+ 'model': json['model'] == null ? undefined : json['model'],
62
+ 'generations': json['generations'] == null ? undefined : json['generations'],
63
+ 'toolCalls': json['tool_calls'] == null ? undefined : json['tool_calls'],
64
+ 'subagents': json['subagents'] == null ? undefined : json['subagents'],
65
+ 'inputTokens': json['input_tokens'] == null ? undefined : json['input_tokens'],
66
+ 'outputTokens': json['output_tokens'] == null ? undefined : json['output_tokens'],
67
+ 'cachedTokens': json['cached_tokens'] == null ? undefined : json['cached_tokens'],
68
+ 'reasoningTokens': json['reasoning_tokens'] == null ? undefined : json['reasoning_tokens'],
69
+ 'maxContext': json['max_context'] == null ? undefined : json['max_context'],
70
+ 'degenerateGens': json['degenerate_gens'] == null ? undefined : json['degenerate_gens'],
71
+ 'selfDoubtPer1k': json['self_doubt_per_1k'] == null ? undefined : json['self_doubt_per_1k'],
72
+ 'cacheRate': json['cache_rate'] == null ? undefined : json['cache_rate'],
73
+ 'reasoningShare': json['reasoning_share'] == null ? undefined : json['reasoning_share'],
74
+ 'singleToolRate': json['single_tool_rate'] == null ? undefined : json['single_tool_rate'],
75
+ 'nEvents': json['n_events'] == null ? undefined : json['n_events'],
76
+ 'metrics': json['metrics'] == null ? undefined : json['metrics'],
77
+ 'traceComplete': json['trace_complete'] == null ? undefined : json['trace_complete'],
78
+ 'corruptResults': json['corrupt_results'] == null ? undefined : json['corrupt_results'],
79
+ 'backendVersion': json['backend_version'] == null ? undefined : json['backend_version'],
80
+ 'schemaVersion': json['schema_version'] == null ? undefined : json['schema_version'],
81
+ 'title': json['title'] == null ? undefined : json['title'],
82
+ 'path': json['path'] == null ? undefined : json['path'],
83
+ 'workflowId': json['workflow_id'] == null ? undefined : json['workflow_id'],
84
+ 'workflowName': json['workflow_name'] == null ? undefined : json['workflow_name'],
85
+ 'state': json['state'] == null ? undefined : json['state'],
86
+ 'runLabel': json['run_label'] == null ? undefined : json['run_label'],
87
+ 'traceUrl': json['trace_url'] == null ? undefined : json['trace_url'],
88
+ 'expiresInSeconds': json['expires_in_seconds'] == null ? undefined : json['expires_in_seconds'],
89
+ };
90
+ }
91
+ function DiagnosticTraceItemToJSON(json) {
92
+ return DiagnosticTraceItemToJSONTyped(json, false);
93
+ }
94
+ function DiagnosticTraceItemToJSONTyped(value, ignoreDiscriminator = false) {
95
+ if (value == null) {
96
+ return value;
97
+ }
98
+ return {
99
+ 'status': (0, DiagnosticTraceStatus_1.DiagnosticTraceStatusToJSON)(value['status']),
100
+ 'kind': (0, TraceKind_1.TraceKindToJSON)(value['kind']),
101
+ 'reason': (0, DiagnosticTraceFailureReason_1.DiagnosticTraceFailureReasonToJSON)(value['reason']),
102
+ 'trace_id': value['traceId'],
103
+ 'run_id': value['runId'],
104
+ 'thread_id': value['threadId'],
105
+ 'message_id': value['messageId'],
106
+ 'user_id': value['userId'],
107
+ 'started_at': value['startedAt'] == null ? value['startedAt'] : value['startedAt'].toISOString(),
108
+ 'ended_at': value['endedAt'] == null ? value['endedAt'] : value['endedAt'].toISOString(),
109
+ 'duration_ms': value['durationMs'],
110
+ 'model': value['model'],
111
+ 'generations': value['generations'],
112
+ 'tool_calls': value['toolCalls'],
113
+ 'subagents': value['subagents'],
114
+ 'input_tokens': value['inputTokens'],
115
+ 'output_tokens': value['outputTokens'],
116
+ 'cached_tokens': value['cachedTokens'],
117
+ 'reasoning_tokens': value['reasoningTokens'],
118
+ 'max_context': value['maxContext'],
119
+ 'degenerate_gens': value['degenerateGens'],
120
+ 'self_doubt_per_1k': value['selfDoubtPer1k'],
121
+ 'cache_rate': value['cacheRate'],
122
+ 'reasoning_share': value['reasoningShare'],
123
+ 'single_tool_rate': value['singleToolRate'],
124
+ 'n_events': value['nEvents'],
125
+ 'metrics': value['metrics'],
126
+ 'trace_complete': value['traceComplete'],
127
+ 'corrupt_results': value['corruptResults'],
128
+ 'backend_version': value['backendVersion'],
129
+ 'schema_version': value['schemaVersion'],
130
+ 'title': value['title'],
131
+ 'path': value['path'],
132
+ 'workflow_id': value['workflowId'],
133
+ 'workflow_name': value['workflowName'],
134
+ 'state': value['state'],
135
+ 'run_label': value['runLabel'],
136
+ 'trace_url': value['traceUrl'],
137
+ 'expires_in_seconds': value['expiresInSeconds'],
138
+ };
139
+ }
@@ -0,0 +1,26 @@
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 DiagnosticTraceStatus: {
17
+ readonly Ready: 'ready';
18
+ readonly Pending: 'pending';
19
+ readonly Failed: 'failed';
20
+ };
21
+ export type DiagnosticTraceStatus = typeof DiagnosticTraceStatus[keyof typeof DiagnosticTraceStatus];
22
+ export declare function instanceOfDiagnosticTraceStatus(value: any): boolean;
23
+ export declare function DiagnosticTraceStatusFromJSON(json: any): DiagnosticTraceStatus;
24
+ export declare function DiagnosticTraceStatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): DiagnosticTraceStatus;
25
+ export declare function DiagnosticTraceStatusToJSON(value?: DiagnosticTraceStatus | null): any;
26
+ export declare function DiagnosticTraceStatusToJSONTyped(value: any, ignoreDiscriminator: boolean): DiagnosticTraceStatus;
@@ -0,0 +1,52 @@
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.DiagnosticTraceStatus = void 0;
17
+ exports.instanceOfDiagnosticTraceStatus = instanceOfDiagnosticTraceStatus;
18
+ exports.DiagnosticTraceStatusFromJSON = DiagnosticTraceStatusFromJSON;
19
+ exports.DiagnosticTraceStatusFromJSONTyped = DiagnosticTraceStatusFromJSONTyped;
20
+ exports.DiagnosticTraceStatusToJSON = DiagnosticTraceStatusToJSON;
21
+ exports.DiagnosticTraceStatusToJSONTyped = DiagnosticTraceStatusToJSONTyped;
22
+ /**
23
+ *
24
+ * @export
25
+ */
26
+ exports.DiagnosticTraceStatus = {
27
+ Ready: 'ready',
28
+ Pending: 'pending',
29
+ Failed: 'failed'
30
+ };
31
+ function instanceOfDiagnosticTraceStatus(value) {
32
+ for (const key in exports.DiagnosticTraceStatus) {
33
+ if (Object.prototype.hasOwnProperty.call(exports.DiagnosticTraceStatus, key)) {
34
+ if (exports.DiagnosticTraceStatus[key] === value) {
35
+ return true;
36
+ }
37
+ }
38
+ }
39
+ return false;
40
+ }
41
+ function DiagnosticTraceStatusFromJSON(json) {
42
+ return DiagnosticTraceStatusFromJSONTyped(json, false);
43
+ }
44
+ function DiagnosticTraceStatusFromJSONTyped(json, ignoreDiscriminator) {
45
+ return json;
46
+ }
47
+ function DiagnosticTraceStatusToJSON(value) {
48
+ return value;
49
+ }
50
+ function DiagnosticTraceStatusToJSONTyped(value, ignoreDiscriminator) {
51
+ return value;
52
+ }
@@ -0,0 +1,54 @@
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 { DiagnosticTraceItem } from './DiagnosticTraceItem';
13
+ /**
14
+ *
15
+ * @export
16
+ * @interface DiagnosticsResponse
17
+ */
18
+ export interface DiagnosticsResponse {
19
+ /**
20
+ * True when no item is pending.
21
+ * @type {boolean}
22
+ * @memberof DiagnosticsResponse
23
+ */
24
+ _final: boolean;
25
+ /**
26
+ *
27
+ * @type {Array<DiagnosticTraceItem>}
28
+ * @memberof DiagnosticsResponse
29
+ */
30
+ traces: Array<DiagnosticTraceItem>;
31
+ }
32
+ export declare const DiagnosticsResponsePropertyValidationAttributesMap: {
33
+ [property: string]: {
34
+ maxLength?: number;
35
+ minLength?: number;
36
+ pattern?: string;
37
+ maximum?: number;
38
+ exclusiveMaximum?: boolean;
39
+ minimum?: number;
40
+ exclusiveMinimum?: boolean;
41
+ multipleOf?: number;
42
+ maxItems?: number;
43
+ minItems?: number;
44
+ uniqueItems?: boolean;
45
+ };
46
+ };
47
+ /**
48
+ * Check if a given object implements the DiagnosticsResponse interface.
49
+ */
50
+ export declare function instanceOfDiagnosticsResponse(value: object): value is DiagnosticsResponse;
51
+ export declare function DiagnosticsResponseFromJSON(json: any): DiagnosticsResponse;
52
+ export declare function DiagnosticsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): DiagnosticsResponse;
53
+ export declare function DiagnosticsResponseToJSON(json: any): DiagnosticsResponse;
54
+ export declare function DiagnosticsResponseToJSONTyped(value?: DiagnosticsResponse | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,57 @@
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.DiagnosticsResponsePropertyValidationAttributesMap = void 0;
17
+ exports.instanceOfDiagnosticsResponse = instanceOfDiagnosticsResponse;
18
+ exports.DiagnosticsResponseFromJSON = DiagnosticsResponseFromJSON;
19
+ exports.DiagnosticsResponseFromJSONTyped = DiagnosticsResponseFromJSONTyped;
20
+ exports.DiagnosticsResponseToJSON = DiagnosticsResponseToJSON;
21
+ exports.DiagnosticsResponseToJSONTyped = DiagnosticsResponseToJSONTyped;
22
+ const DiagnosticTraceItem_1 = require("./DiagnosticTraceItem");
23
+ exports.DiagnosticsResponsePropertyValidationAttributesMap = {};
24
+ /**
25
+ * Check if a given object implements the DiagnosticsResponse interface.
26
+ */
27
+ function instanceOfDiagnosticsResponse(value) {
28
+ if (!('_final' in value) || value['_final'] === undefined)
29
+ return false;
30
+ if (!('traces' in value) || value['traces'] === undefined)
31
+ return false;
32
+ return true;
33
+ }
34
+ function DiagnosticsResponseFromJSON(json) {
35
+ return DiagnosticsResponseFromJSONTyped(json, false);
36
+ }
37
+ function DiagnosticsResponseFromJSONTyped(json, ignoreDiscriminator) {
38
+ if (json == null) {
39
+ return json;
40
+ }
41
+ return {
42
+ '_final': json['final'],
43
+ 'traces': (json['traces'].map(DiagnosticTraceItem_1.DiagnosticTraceItemFromJSON)),
44
+ };
45
+ }
46
+ function DiagnosticsResponseToJSON(json) {
47
+ return DiagnosticsResponseToJSONTyped(json, false);
48
+ }
49
+ function DiagnosticsResponseToJSONTyped(value, ignoreDiscriminator = false) {
50
+ if (value == null) {
51
+ return value;
52
+ }
53
+ return {
54
+ 'final': value['_final'],
55
+ 'traces': (value['traces'].map(DiagnosticTraceItem_1.DiagnosticTraceItemToJSON)),
56
+ };
57
+ }
@@ -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,51 @@
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.TraceKind = void 0;
17
+ exports.instanceOfTraceKind = instanceOfTraceKind;
18
+ exports.TraceKindFromJSON = TraceKindFromJSON;
19
+ exports.TraceKindFromJSONTyped = TraceKindFromJSONTyped;
20
+ exports.TraceKindToJSON = TraceKindToJSON;
21
+ exports.TraceKindToJSONTyped = TraceKindToJSONTyped;
22
+ /**
23
+ *
24
+ * @export
25
+ */
26
+ exports.TraceKind = {
27
+ WorkflowRun: 'workflow_run',
28
+ ChatTurn: 'chat_turn'
29
+ };
30
+ function instanceOfTraceKind(value) {
31
+ for (const key in exports.TraceKind) {
32
+ if (Object.prototype.hasOwnProperty.call(exports.TraceKind, key)) {
33
+ if (exports.TraceKind[key] === value) {
34
+ return true;
35
+ }
36
+ }
37
+ }
38
+ return false;
39
+ }
40
+ function TraceKindFromJSON(json) {
41
+ return TraceKindFromJSONTyped(json, false);
42
+ }
43
+ function TraceKindFromJSONTyped(json, ignoreDiscriminator) {
44
+ return json;
45
+ }
46
+ function TraceKindToJSON(value) {
47
+ return value;
48
+ }
49
+ function TraceKindToJSONTyped(value, ignoreDiscriminator) {
50
+ return value;
51
+ }
@@ -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';
@@ -120,6 +120,10 @@ __exportStar(require("./DataSourceSchemaResponse"), exports);
120
120
  __exportStar(require("./DataSourceSyncResponse"), exports);
121
121
  __exportStar(require("./DataSourceTableResponse"), exports);
122
122
  __exportStar(require("./DefinitionOutputStat"), exports);
123
+ __exportStar(require("./DiagnosticTraceFailureReason"), exports);
124
+ __exportStar(require("./DiagnosticTraceItem"), exports);
125
+ __exportStar(require("./DiagnosticTraceStatus"), exports);
126
+ __exportStar(require("./DiagnosticsResponse"), exports);
123
127
  __exportStar(require("./DiffFormat"), exports);
124
128
  __exportStar(require("./DiffRow"), exports);
125
129
  __exportStar(require("./DiffRowType"), exports);
@@ -353,6 +357,7 @@ __exportStar(require("./TimeseriesPoint"), exports);
353
357
  __exportStar(require("./ToolDisplayType"), exports);
354
358
  __exportStar(require("./ToolPart"), exports);
355
359
  __exportStar(require("./ToolStatus"), exports);
360
+ __exportStar(require("./TraceKind"), exports);
356
361
  __exportStar(require("./TranscriptionResponse"), exports);
357
362
  __exportStar(require("./TransferOwnerRequest"), exports);
358
363
  __exportStar(require("./TransferOwnerResponse"), exports);
@@ -1012,6 +1012,7 @@ example().catch(console.error);
1012
1012
  |-------------|-------------|------------------|
1013
1013
  | **200** | Successful Response | - |
1014
1014
  | **202** | Crawl accepted; it runs in the background | - |
1015
+ | **409** | This connector\&#39;s crawl is already running | - |
1015
1016
  | **422** | Validation Error | - |
1016
1017
  | **0** | Error response. | - |
1017
1018
 
@@ -0,0 +1,32 @@
1
+
2
+ # DiagnosticTraceFailureReason
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+
10
+ ## Example
11
+
12
+ ```typescript
13
+ import type { DiagnosticTraceFailureReason } from '@knowledge-stack/ksapi'
14
+
15
+ // TODO: Update the object below with actual values
16
+ const example = {
17
+ } satisfies DiagnosticTraceFailureReason
18
+
19
+ console.log(example)
20
+
21
+ // Convert the instance to a JSON string
22
+ const exampleJSON: string = JSON.stringify(example)
23
+ console.log(exampleJSON)
24
+
25
+ // Parse the JSON string back to an object
26
+ const exampleParsed = JSON.parse(exampleJSON) as DiagnosticTraceFailureReason
27
+ console.log(exampleParsed)
28
+ ```
29
+
30
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
31
+
32
+
@@ -0,0 +1,111 @@
1
+
2
+ # DiagnosticTraceItem
3
+
4
+ One trace of the conversation; stats and the link are null unless ready.
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `status` | [DiagnosticTraceStatus](DiagnosticTraceStatus.md)
11
+ `kind` | [TraceKind](TraceKind.md)
12
+ `reason` | [DiagnosticTraceFailureReason](DiagnosticTraceFailureReason.md)
13
+ `traceId` | string
14
+ `runId` | string
15
+ `threadId` | string
16
+ `messageId` | string
17
+ `userId` | string
18
+ `startedAt` | Date
19
+ `endedAt` | Date
20
+ `durationMs` | number
21
+ `model` | string
22
+ `generations` | number
23
+ `toolCalls` | number
24
+ `subagents` | number
25
+ `inputTokens` | number
26
+ `outputTokens` | number
27
+ `cachedTokens` | number
28
+ `reasoningTokens` | number
29
+ `maxContext` | number
30
+ `degenerateGens` | number
31
+ `selfDoubtPer1k` | number
32
+ `cacheRate` | number
33
+ `reasoningShare` | number
34
+ `singleToolRate` | number
35
+ `nEvents` | number
36
+ `metrics` | { [key: string]: any; }
37
+ `traceComplete` | boolean
38
+ `corruptResults` | boolean
39
+ `backendVersion` | string
40
+ `schemaVersion` | number
41
+ `title` | string
42
+ `path` | string
43
+ `workflowId` | string
44
+ `workflowName` | string
45
+ `state` | string
46
+ `runLabel` | string
47
+ `traceUrl` | string
48
+ `expiresInSeconds` | number
49
+
50
+ ## Example
51
+
52
+ ```typescript
53
+ import type { DiagnosticTraceItem } from '@knowledge-stack/ksapi'
54
+
55
+ // TODO: Update the object below with actual values
56
+ const example = {
57
+ "status": null,
58
+ "kind": null,
59
+ "reason": null,
60
+ "traceId": null,
61
+ "runId": null,
62
+ "threadId": null,
63
+ "messageId": null,
64
+ "userId": null,
65
+ "startedAt": null,
66
+ "endedAt": null,
67
+ "durationMs": null,
68
+ "model": null,
69
+ "generations": null,
70
+ "toolCalls": null,
71
+ "subagents": null,
72
+ "inputTokens": null,
73
+ "outputTokens": null,
74
+ "cachedTokens": null,
75
+ "reasoningTokens": null,
76
+ "maxContext": null,
77
+ "degenerateGens": null,
78
+ "selfDoubtPer1k": null,
79
+ "cacheRate": null,
80
+ "reasoningShare": null,
81
+ "singleToolRate": null,
82
+ "nEvents": null,
83
+ "metrics": null,
84
+ "traceComplete": null,
85
+ "corruptResults": null,
86
+ "backendVersion": null,
87
+ "schemaVersion": null,
88
+ "title": null,
89
+ "path": null,
90
+ "workflowId": null,
91
+ "workflowName": null,
92
+ "state": null,
93
+ "runLabel": null,
94
+ "traceUrl": null,
95
+ "expiresInSeconds": null,
96
+ } satisfies DiagnosticTraceItem
97
+
98
+ console.log(example)
99
+
100
+ // Convert the instance to a JSON string
101
+ const exampleJSON: string = JSON.stringify(example)
102
+ console.log(exampleJSON)
103
+
104
+ // Parse the JSON string back to an object
105
+ const exampleParsed = JSON.parse(exampleJSON) as DiagnosticTraceItem
106
+ console.log(exampleParsed)
107
+ ```
108
+
109
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
110
+
111
+
@@ -0,0 +1,32 @@
1
+
2
+ # DiagnosticTraceStatus
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+
10
+ ## Example
11
+
12
+ ```typescript
13
+ import type { DiagnosticTraceStatus } from '@knowledge-stack/ksapi'
14
+
15
+ // TODO: Update the object below with actual values
16
+ const example = {
17
+ } satisfies DiagnosticTraceStatus
18
+
19
+ console.log(example)
20
+
21
+ // Convert the instance to a JSON string
22
+ const exampleJSON: string = JSON.stringify(example)
23
+ console.log(exampleJSON)
24
+
25
+ // Parse the JSON string back to an object
26
+ const exampleParsed = JSON.parse(exampleJSON) as DiagnosticTraceStatus
27
+ console.log(exampleParsed)
28
+ ```
29
+
30
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
31
+
32
+