@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.
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
@@ -0,0 +1,415 @@
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
+ import { mapValues } from '../runtime';
16
+ import type { TraceKind } from './TraceKind';
17
+ import {
18
+ TraceKindFromJSON,
19
+ TraceKindFromJSONTyped,
20
+ TraceKindToJSON,
21
+ TraceKindToJSONTyped,
22
+ } from './TraceKind';
23
+ import type { DiagnosticTraceStatus } from './DiagnosticTraceStatus';
24
+ import {
25
+ DiagnosticTraceStatusFromJSON,
26
+ DiagnosticTraceStatusFromJSONTyped,
27
+ DiagnosticTraceStatusToJSON,
28
+ DiagnosticTraceStatusToJSONTyped,
29
+ } from './DiagnosticTraceStatus';
30
+ import type { DiagnosticTraceFailureReason } from './DiagnosticTraceFailureReason';
31
+ import {
32
+ DiagnosticTraceFailureReasonFromJSON,
33
+ DiagnosticTraceFailureReasonFromJSONTyped,
34
+ DiagnosticTraceFailureReasonToJSON,
35
+ DiagnosticTraceFailureReasonToJSONTyped,
36
+ } from './DiagnosticTraceFailureReason';
37
+
38
+ /**
39
+ * One trace of the conversation; stats and the link are null unless ready.
40
+ * @export
41
+ * @interface DiagnosticTraceItem
42
+ */
43
+ export interface DiagnosticTraceItem {
44
+ /**
45
+ *
46
+ * @type {DiagnosticTraceStatus}
47
+ * @memberof DiagnosticTraceItem
48
+ */
49
+ status: DiagnosticTraceStatus;
50
+ /**
51
+ *
52
+ * @type {TraceKind}
53
+ * @memberof DiagnosticTraceItem
54
+ */
55
+ kind: TraceKind;
56
+ /**
57
+ *
58
+ * @type {DiagnosticTraceFailureReason}
59
+ * @memberof DiagnosticTraceItem
60
+ */
61
+ reason?: DiagnosticTraceFailureReason;
62
+ /**
63
+ *
64
+ * @type {string}
65
+ * @memberof DiagnosticTraceItem
66
+ */
67
+ traceId: string | null;
68
+ /**
69
+ *
70
+ * @type {string}
71
+ * @memberof DiagnosticTraceItem
72
+ */
73
+ runId?: string | null;
74
+ /**
75
+ *
76
+ * @type {string}
77
+ * @memberof DiagnosticTraceItem
78
+ */
79
+ threadId?: string | null;
80
+ /**
81
+ *
82
+ * @type {string}
83
+ * @memberof DiagnosticTraceItem
84
+ */
85
+ messageId?: string | null;
86
+ /**
87
+ *
88
+ * @type {string}
89
+ * @memberof DiagnosticTraceItem
90
+ */
91
+ userId: string | null;
92
+ /**
93
+ *
94
+ * @type {Date}
95
+ * @memberof DiagnosticTraceItem
96
+ */
97
+ startedAt: Date | null;
98
+ /**
99
+ *
100
+ * @type {Date}
101
+ * @memberof DiagnosticTraceItem
102
+ */
103
+ endedAt?: Date | null;
104
+ /**
105
+ *
106
+ * @type {number}
107
+ * @memberof DiagnosticTraceItem
108
+ */
109
+ durationMs?: number | null;
110
+ /**
111
+ *
112
+ * @type {string}
113
+ * @memberof DiagnosticTraceItem
114
+ */
115
+ model?: string | null;
116
+ /**
117
+ *
118
+ * @type {number}
119
+ * @memberof DiagnosticTraceItem
120
+ */
121
+ generations?: number | null;
122
+ /**
123
+ *
124
+ * @type {number}
125
+ * @memberof DiagnosticTraceItem
126
+ */
127
+ toolCalls?: number | null;
128
+ /**
129
+ *
130
+ * @type {number}
131
+ * @memberof DiagnosticTraceItem
132
+ */
133
+ subagents?: number | null;
134
+ /**
135
+ *
136
+ * @type {number}
137
+ * @memberof DiagnosticTraceItem
138
+ */
139
+ inputTokens?: number | null;
140
+ /**
141
+ *
142
+ * @type {number}
143
+ * @memberof DiagnosticTraceItem
144
+ */
145
+ outputTokens?: number | null;
146
+ /**
147
+ *
148
+ * @type {number}
149
+ * @memberof DiagnosticTraceItem
150
+ */
151
+ cachedTokens?: number | null;
152
+ /**
153
+ *
154
+ * @type {number}
155
+ * @memberof DiagnosticTraceItem
156
+ */
157
+ reasoningTokens?: number | null;
158
+ /**
159
+ *
160
+ * @type {number}
161
+ * @memberof DiagnosticTraceItem
162
+ */
163
+ maxContext?: number | null;
164
+ /**
165
+ *
166
+ * @type {number}
167
+ * @memberof DiagnosticTraceItem
168
+ */
169
+ degenerateGens?: number | null;
170
+ /**
171
+ *
172
+ * @type {number}
173
+ * @memberof DiagnosticTraceItem
174
+ */
175
+ selfDoubtPer1k?: number | null;
176
+ /**
177
+ *
178
+ * @type {number}
179
+ * @memberof DiagnosticTraceItem
180
+ */
181
+ cacheRate?: number | null;
182
+ /**
183
+ *
184
+ * @type {number}
185
+ * @memberof DiagnosticTraceItem
186
+ */
187
+ reasoningShare?: number | null;
188
+ /**
189
+ *
190
+ * @type {number}
191
+ * @memberof DiagnosticTraceItem
192
+ */
193
+ singleToolRate?: number | null;
194
+ /**
195
+ *
196
+ * @type {number}
197
+ * @memberof DiagnosticTraceItem
198
+ */
199
+ nEvents?: number | null;
200
+ /**
201
+ *
202
+ * @type {{ [key: string]: any; }}
203
+ * @memberof DiagnosticTraceItem
204
+ */
205
+ metrics?: { [key: string]: any; } | null;
206
+ /**
207
+ *
208
+ * @type {boolean}
209
+ * @memberof DiagnosticTraceItem
210
+ */
211
+ traceComplete?: boolean | null;
212
+ /**
213
+ *
214
+ * @type {boolean}
215
+ * @memberof DiagnosticTraceItem
216
+ */
217
+ corruptResults?: boolean | null;
218
+ /**
219
+ *
220
+ * @type {string}
221
+ * @memberof DiagnosticTraceItem
222
+ */
223
+ backendVersion?: string | null;
224
+ /**
225
+ *
226
+ * @type {number}
227
+ * @memberof DiagnosticTraceItem
228
+ */
229
+ schemaVersion?: number | null;
230
+ /**
231
+ *
232
+ * @type {string}
233
+ * @memberof DiagnosticTraceItem
234
+ */
235
+ title?: string | null;
236
+ /**
237
+ *
238
+ * @type {string}
239
+ * @memberof DiagnosticTraceItem
240
+ */
241
+ path?: string | null;
242
+ /**
243
+ *
244
+ * @type {string}
245
+ * @memberof DiagnosticTraceItem
246
+ */
247
+ workflowId?: string | null;
248
+ /**
249
+ *
250
+ * @type {string}
251
+ * @memberof DiagnosticTraceItem
252
+ */
253
+ workflowName?: string | null;
254
+ /**
255
+ *
256
+ * @type {string}
257
+ * @memberof DiagnosticTraceItem
258
+ */
259
+ state?: string | null;
260
+ /**
261
+ *
262
+ * @type {string}
263
+ * @memberof DiagnosticTraceItem
264
+ */
265
+ runLabel?: string | null;
266
+ /**
267
+ *
268
+ * @type {string}
269
+ * @memberof DiagnosticTraceItem
270
+ */
271
+ traceUrl?: string | null;
272
+ /**
273
+ *
274
+ * @type {number}
275
+ * @memberof DiagnosticTraceItem
276
+ */
277
+ expiresInSeconds?: number | null;
278
+ }
279
+
280
+
281
+ export const DiagnosticTraceItemPropertyValidationAttributesMap: {
282
+ [property: string]: {
283
+ maxLength?: number,
284
+ minLength?: number,
285
+ pattern?: string,
286
+ maximum?: number,
287
+ exclusiveMaximum?: boolean,
288
+ minimum?: number,
289
+ exclusiveMinimum?: boolean,
290
+ multipleOf?: number,
291
+ maxItems?: number,
292
+ minItems?: number,
293
+ uniqueItems?: boolean
294
+ }
295
+ } = {
296
+ }
297
+
298
+
299
+ /**
300
+ * Check if a given object implements the DiagnosticTraceItem interface.
301
+ */
302
+ export function instanceOfDiagnosticTraceItem(value: object): value is DiagnosticTraceItem {
303
+ if (!('status' in value) || value['status'] === undefined) return false;
304
+ if (!('kind' in value) || value['kind'] === undefined) return false;
305
+ if (!('traceId' in value) || value['traceId'] === undefined) return false;
306
+ if (!('userId' in value) || value['userId'] === undefined) return false;
307
+ if (!('startedAt' in value) || value['startedAt'] === undefined) return false;
308
+ return true;
309
+ }
310
+
311
+ export function DiagnosticTraceItemFromJSON(json: any): DiagnosticTraceItem {
312
+ return DiagnosticTraceItemFromJSONTyped(json, false);
313
+ }
314
+
315
+ export function DiagnosticTraceItemFromJSONTyped(json: any, ignoreDiscriminator: boolean): DiagnosticTraceItem {
316
+ if (json == null) {
317
+ return json;
318
+ }
319
+ return {
320
+
321
+ 'status': DiagnosticTraceStatusFromJSON(json['status']),
322
+ 'kind': TraceKindFromJSON(json['kind']),
323
+ 'reason': json['reason'] == null ? undefined : DiagnosticTraceFailureReasonFromJSON(json['reason']),
324
+ 'traceId': json['trace_id'],
325
+ 'runId': json['run_id'] == null ? undefined : json['run_id'],
326
+ 'threadId': json['thread_id'] == null ? undefined : json['thread_id'],
327
+ 'messageId': json['message_id'] == null ? undefined : json['message_id'],
328
+ 'userId': json['user_id'],
329
+ 'startedAt': (json['started_at'] == null ? null : new Date(json['started_at'])),
330
+ 'endedAt': json['ended_at'] == null ? undefined : (new Date(json['ended_at'])),
331
+ 'durationMs': json['duration_ms'] == null ? undefined : json['duration_ms'],
332
+ 'model': json['model'] == null ? undefined : json['model'],
333
+ 'generations': json['generations'] == null ? undefined : json['generations'],
334
+ 'toolCalls': json['tool_calls'] == null ? undefined : json['tool_calls'],
335
+ 'subagents': json['subagents'] == null ? undefined : json['subagents'],
336
+ 'inputTokens': json['input_tokens'] == null ? undefined : json['input_tokens'],
337
+ 'outputTokens': json['output_tokens'] == null ? undefined : json['output_tokens'],
338
+ 'cachedTokens': json['cached_tokens'] == null ? undefined : json['cached_tokens'],
339
+ 'reasoningTokens': json['reasoning_tokens'] == null ? undefined : json['reasoning_tokens'],
340
+ 'maxContext': json['max_context'] == null ? undefined : json['max_context'],
341
+ 'degenerateGens': json['degenerate_gens'] == null ? undefined : json['degenerate_gens'],
342
+ 'selfDoubtPer1k': json['self_doubt_per_1k'] == null ? undefined : json['self_doubt_per_1k'],
343
+ 'cacheRate': json['cache_rate'] == null ? undefined : json['cache_rate'],
344
+ 'reasoningShare': json['reasoning_share'] == null ? undefined : json['reasoning_share'],
345
+ 'singleToolRate': json['single_tool_rate'] == null ? undefined : json['single_tool_rate'],
346
+ 'nEvents': json['n_events'] == null ? undefined : json['n_events'],
347
+ 'metrics': json['metrics'] == null ? undefined : json['metrics'],
348
+ 'traceComplete': json['trace_complete'] == null ? undefined : json['trace_complete'],
349
+ 'corruptResults': json['corrupt_results'] == null ? undefined : json['corrupt_results'],
350
+ 'backendVersion': json['backend_version'] == null ? undefined : json['backend_version'],
351
+ 'schemaVersion': json['schema_version'] == null ? undefined : json['schema_version'],
352
+ 'title': json['title'] == null ? undefined : json['title'],
353
+ 'path': json['path'] == null ? undefined : json['path'],
354
+ 'workflowId': json['workflow_id'] == null ? undefined : json['workflow_id'],
355
+ 'workflowName': json['workflow_name'] == null ? undefined : json['workflow_name'],
356
+ 'state': json['state'] == null ? undefined : json['state'],
357
+ 'runLabel': json['run_label'] == null ? undefined : json['run_label'],
358
+ 'traceUrl': json['trace_url'] == null ? undefined : json['trace_url'],
359
+ 'expiresInSeconds': json['expires_in_seconds'] == null ? undefined : json['expires_in_seconds'],
360
+ };
361
+ }
362
+
363
+ export function DiagnosticTraceItemToJSON(json: any): DiagnosticTraceItem {
364
+ return DiagnosticTraceItemToJSONTyped(json, false);
365
+ }
366
+
367
+ export function DiagnosticTraceItemToJSONTyped(value?: DiagnosticTraceItem | null, ignoreDiscriminator: boolean = false): any {
368
+ if (value == null) {
369
+ return value;
370
+ }
371
+
372
+ return {
373
+
374
+ 'status': DiagnosticTraceStatusToJSON(value['status']),
375
+ 'kind': TraceKindToJSON(value['kind']),
376
+ 'reason': DiagnosticTraceFailureReasonToJSON(value['reason']),
377
+ 'trace_id': value['traceId'],
378
+ 'run_id': value['runId'],
379
+ 'thread_id': value['threadId'],
380
+ 'message_id': value['messageId'],
381
+ 'user_id': value['userId'],
382
+ 'started_at': value['startedAt'] == null ? value['startedAt'] : value['startedAt'].toISOString(),
383
+ 'ended_at': value['endedAt'] == null ? value['endedAt'] : value['endedAt'].toISOString(),
384
+ 'duration_ms': value['durationMs'],
385
+ 'model': value['model'],
386
+ 'generations': value['generations'],
387
+ 'tool_calls': value['toolCalls'],
388
+ 'subagents': value['subagents'],
389
+ 'input_tokens': value['inputTokens'],
390
+ 'output_tokens': value['outputTokens'],
391
+ 'cached_tokens': value['cachedTokens'],
392
+ 'reasoning_tokens': value['reasoningTokens'],
393
+ 'max_context': value['maxContext'],
394
+ 'degenerate_gens': value['degenerateGens'],
395
+ 'self_doubt_per_1k': value['selfDoubtPer1k'],
396
+ 'cache_rate': value['cacheRate'],
397
+ 'reasoning_share': value['reasoningShare'],
398
+ 'single_tool_rate': value['singleToolRate'],
399
+ 'n_events': value['nEvents'],
400
+ 'metrics': value['metrics'],
401
+ 'trace_complete': value['traceComplete'],
402
+ 'corrupt_results': value['corruptResults'],
403
+ 'backend_version': value['backendVersion'],
404
+ 'schema_version': value['schemaVersion'],
405
+ 'title': value['title'],
406
+ 'path': value['path'],
407
+ 'workflow_id': value['workflowId'],
408
+ 'workflow_name': value['workflowName'],
409
+ 'state': value['state'],
410
+ 'run_label': value['runLabel'],
411
+ 'trace_url': value['traceUrl'],
412
+ 'expires_in_seconds': value['expiresInSeconds'],
413
+ };
414
+ }
415
+
@@ -0,0 +1,54 @@
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
+ /**
17
+ *
18
+ * @export
19
+ */
20
+ export const DiagnosticTraceStatus = {
21
+ Ready: 'ready',
22
+ Pending: 'pending',
23
+ Failed: 'failed'
24
+ } as const;
25
+ export type DiagnosticTraceStatus = typeof DiagnosticTraceStatus[keyof typeof DiagnosticTraceStatus];
26
+
27
+
28
+ export function instanceOfDiagnosticTraceStatus(value: any): boolean {
29
+ for (const key in DiagnosticTraceStatus) {
30
+ if (Object.prototype.hasOwnProperty.call(DiagnosticTraceStatus, key)) {
31
+ if (DiagnosticTraceStatus[key as keyof typeof DiagnosticTraceStatus] === value) {
32
+ return true;
33
+ }
34
+ }
35
+ }
36
+ return false;
37
+ }
38
+
39
+ export function DiagnosticTraceStatusFromJSON(json: any): DiagnosticTraceStatus {
40
+ return DiagnosticTraceStatusFromJSONTyped(json, false);
41
+ }
42
+
43
+ export function DiagnosticTraceStatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): DiagnosticTraceStatus {
44
+ return json as DiagnosticTraceStatus;
45
+ }
46
+
47
+ export function DiagnosticTraceStatusToJSON(value?: DiagnosticTraceStatus | null): any {
48
+ return value as any;
49
+ }
50
+
51
+ export function DiagnosticTraceStatusToJSONTyped(value: any, ignoreDiscriminator: boolean): DiagnosticTraceStatus {
52
+ return value as DiagnosticTraceStatus;
53
+ }
54
+
@@ -0,0 +1,100 @@
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
+ import { mapValues } from '../runtime';
16
+ import type { DiagnosticTraceItem } from './DiagnosticTraceItem';
17
+ import {
18
+ DiagnosticTraceItemFromJSON,
19
+ DiagnosticTraceItemFromJSONTyped,
20
+ DiagnosticTraceItemToJSON,
21
+ DiagnosticTraceItemToJSONTyped,
22
+ } from './DiagnosticTraceItem';
23
+
24
+ /**
25
+ *
26
+ * @export
27
+ * @interface DiagnosticsResponse
28
+ */
29
+ export interface DiagnosticsResponse {
30
+ /**
31
+ * True when no item is pending.
32
+ * @type {boolean}
33
+ * @memberof DiagnosticsResponse
34
+ */
35
+ _final: boolean;
36
+ /**
37
+ *
38
+ * @type {Array<DiagnosticTraceItem>}
39
+ * @memberof DiagnosticsResponse
40
+ */
41
+ traces: Array<DiagnosticTraceItem>;
42
+ }
43
+ export const DiagnosticsResponsePropertyValidationAttributesMap: {
44
+ [property: string]: {
45
+ maxLength?: number,
46
+ minLength?: number,
47
+ pattern?: string,
48
+ maximum?: number,
49
+ exclusiveMaximum?: boolean,
50
+ minimum?: number,
51
+ exclusiveMinimum?: boolean,
52
+ multipleOf?: number,
53
+ maxItems?: number,
54
+ minItems?: number,
55
+ uniqueItems?: boolean
56
+ }
57
+ } = {
58
+ }
59
+
60
+
61
+ /**
62
+ * Check if a given object implements the DiagnosticsResponse interface.
63
+ */
64
+ export function instanceOfDiagnosticsResponse(value: object): value is DiagnosticsResponse {
65
+ if (!('_final' in value) || value['_final'] === undefined) return false;
66
+ if (!('traces' in value) || value['traces'] === undefined) return false;
67
+ return true;
68
+ }
69
+
70
+ export function DiagnosticsResponseFromJSON(json: any): DiagnosticsResponse {
71
+ return DiagnosticsResponseFromJSONTyped(json, false);
72
+ }
73
+
74
+ export function DiagnosticsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): DiagnosticsResponse {
75
+ if (json == null) {
76
+ return json;
77
+ }
78
+ return {
79
+
80
+ '_final': json['final'],
81
+ 'traces': ((json['traces'] as Array<any>).map(DiagnosticTraceItemFromJSON)),
82
+ };
83
+ }
84
+
85
+ export function DiagnosticsResponseToJSON(json: any): DiagnosticsResponse {
86
+ return DiagnosticsResponseToJSONTyped(json, false);
87
+ }
88
+
89
+ export function DiagnosticsResponseToJSONTyped(value?: DiagnosticsResponse | null, ignoreDiscriminator: boolean = false): any {
90
+ if (value == null) {
91
+ return value;
92
+ }
93
+
94
+ return {
95
+
96
+ 'final': value['_final'],
97
+ 'traces': ((value['traces'] as Array<any>).map(DiagnosticTraceItemToJSON)),
98
+ };
99
+ }
100
+
@@ -0,0 +1,53 @@
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
+ /**
17
+ *
18
+ * @export
19
+ */
20
+ export const TraceKind = {
21
+ WorkflowRun: 'workflow_run',
22
+ ChatTurn: 'chat_turn'
23
+ } as const;
24
+ export type TraceKind = typeof TraceKind[keyof typeof TraceKind];
25
+
26
+
27
+ export function instanceOfTraceKind(value: any): boolean {
28
+ for (const key in TraceKind) {
29
+ if (Object.prototype.hasOwnProperty.call(TraceKind, key)) {
30
+ if (TraceKind[key as keyof typeof TraceKind] === value) {
31
+ return true;
32
+ }
33
+ }
34
+ }
35
+ return false;
36
+ }
37
+
38
+ export function TraceKindFromJSON(json: any): TraceKind {
39
+ return TraceKindFromJSONTyped(json, false);
40
+ }
41
+
42
+ export function TraceKindFromJSONTyped(json: any, ignoreDiscriminator: boolean): TraceKind {
43
+ return json as TraceKind;
44
+ }
45
+
46
+ export function TraceKindToJSON(value?: TraceKind | null): any {
47
+ return value as any;
48
+ }
49
+
50
+ export function TraceKindToJSONTyped(value: any, ignoreDiscriminator: boolean): TraceKind {
51
+ return value as TraceKind;
52
+ }
53
+
@@ -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';