@knowledge-stack/ksapi 1.152.0 → 1.154.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 (83) hide show
  1. package/.openapi-generator/FILES +10 -0
  2. package/README.md +12 -2
  3. package/dist/apis/DocumentsApi.d.ts +203 -7
  4. package/dist/apis/DocumentsApi.js +262 -6
  5. package/dist/esm/apis/DocumentsApi.d.ts +203 -7
  6. package/dist/esm/apis/DocumentsApi.js +263 -7
  7. package/dist/esm/models/ChunkMetadata.d.ts +12 -0
  8. package/dist/esm/models/ChunkMetadata.js +4 -0
  9. package/dist/esm/models/Citation.d.ts +12 -0
  10. package/dist/esm/models/Citation.js +4 -0
  11. package/dist/esm/models/CompleteUploadRequest.d.ts +47 -0
  12. package/dist/esm/models/CompleteUploadRequest.js +44 -0
  13. package/dist/esm/models/CreateUploadRequest.d.ts +65 -0
  14. package/dist/esm/models/CreateUploadRequest.js +56 -0
  15. package/dist/esm/models/CreateUploadResponse.d.ts +65 -0
  16. package/dist/esm/models/CreateUploadResponse.js +56 -0
  17. package/dist/esm/models/DocumentType.d.ts +2 -0
  18. package/dist/esm/models/DocumentType.js +2 -0
  19. package/dist/esm/models/EnrichedCitation.d.ts +12 -0
  20. package/dist/esm/models/EnrichedCitation.js +4 -0
  21. package/dist/esm/models/IngestionMode.d.ts +1 -0
  22. package/dist/esm/models/IngestionMode.js +2 -1
  23. package/dist/esm/models/SubscriptionPlanResponse.d.ts +6 -0
  24. package/dist/esm/models/SubscriptionPlanResponse.js +4 -0
  25. package/dist/esm/models/UploadPartResponse.d.ts +59 -0
  26. package/dist/esm/models/UploadPartResponse.js +52 -0
  27. package/dist/esm/models/UploadStatusResponse.d.ts +54 -0
  28. package/dist/esm/models/UploadStatusResponse.js +49 -0
  29. package/dist/esm/models/UsageMetric.d.ts +1 -0
  30. package/dist/esm/models/UsageMetric.js +2 -1
  31. package/dist/esm/models/index.d.ts +5 -0
  32. package/dist/esm/models/index.js +5 -0
  33. package/dist/models/ChunkMetadata.d.ts +12 -0
  34. package/dist/models/ChunkMetadata.js +4 -0
  35. package/dist/models/Citation.d.ts +12 -0
  36. package/dist/models/Citation.js +4 -0
  37. package/dist/models/CompleteUploadRequest.d.ts +47 -0
  38. package/dist/models/CompleteUploadRequest.js +52 -0
  39. package/dist/models/CreateUploadRequest.d.ts +65 -0
  40. package/dist/models/CreateUploadRequest.js +64 -0
  41. package/dist/models/CreateUploadResponse.d.ts +65 -0
  42. package/dist/models/CreateUploadResponse.js +64 -0
  43. package/dist/models/DocumentType.d.ts +2 -0
  44. package/dist/models/DocumentType.js +2 -0
  45. package/dist/models/EnrichedCitation.d.ts +12 -0
  46. package/dist/models/EnrichedCitation.js +4 -0
  47. package/dist/models/IngestionMode.d.ts +1 -0
  48. package/dist/models/IngestionMode.js +2 -1
  49. package/dist/models/SubscriptionPlanResponse.d.ts +6 -0
  50. package/dist/models/SubscriptionPlanResponse.js +4 -0
  51. package/dist/models/UploadPartResponse.d.ts +59 -0
  52. package/dist/models/UploadPartResponse.js +60 -0
  53. package/dist/models/UploadStatusResponse.d.ts +54 -0
  54. package/dist/models/UploadStatusResponse.js +57 -0
  55. package/dist/models/UsageMetric.d.ts +1 -0
  56. package/dist/models/UsageMetric.js +2 -1
  57. package/dist/models/index.d.ts +5 -0
  58. package/dist/models/index.js +5 -0
  59. package/docs/ChunkMetadata.md +4 -0
  60. package/docs/Citation.md +4 -0
  61. package/docs/CompleteUploadRequest.md +35 -0
  62. package/docs/CreateUploadRequest.md +41 -0
  63. package/docs/CreateUploadResponse.md +41 -0
  64. package/docs/DocumentsApi.md +397 -11
  65. package/docs/EnrichedCitation.md +4 -0
  66. package/docs/SubscriptionPlanResponse.md +2 -0
  67. package/docs/UploadPartResponse.md +39 -0
  68. package/docs/UploadStatusResponse.md +37 -0
  69. package/package.json +1 -1
  70. package/src/apis/DocumentsApi.ts +480 -14
  71. package/src/models/ChunkMetadata.ts +16 -0
  72. package/src/models/Citation.ts +16 -0
  73. package/src/models/CompleteUploadRequest.ts +83 -0
  74. package/src/models/CreateUploadRequest.ts +110 -0
  75. package/src/models/CreateUploadResponse.ts +110 -0
  76. package/src/models/DocumentType.ts +2 -0
  77. package/src/models/EnrichedCitation.ts +16 -0
  78. package/src/models/IngestionMode.ts +2 -1
  79. package/src/models/SubscriptionPlanResponse.ts +9 -0
  80. package/src/models/UploadPartResponse.ts +101 -0
  81. package/src/models/UploadStatusResponse.ts +100 -0
  82. package/src/models/UsageMetric.ts +2 -1
  83. package/src/models/index.ts +5 -0
@@ -0,0 +1,65 @@
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
+ * Handles for a started resumable upload.
14
+ * @export
15
+ * @interface CreateUploadResponse
16
+ */
17
+ export interface CreateUploadResponse {
18
+ /**
19
+ *
20
+ * @type {string}
21
+ * @memberof CreateUploadResponse
22
+ */
23
+ documentId: string;
24
+ /**
25
+ *
26
+ * @type {string}
27
+ * @memberof CreateUploadResponse
28
+ */
29
+ documentVersionId: string;
30
+ /**
31
+ * Opaque token; return it on every part/status/complete/abort
32
+ * @type {string}
33
+ * @memberof CreateUploadResponse
34
+ */
35
+ uploadToken: string;
36
+ /**
37
+ * Recommended part size in bytes; every part except the last must be at least 5 MiB
38
+ * @type {number}
39
+ * @memberof CreateUploadResponse
40
+ */
41
+ partSize: number;
42
+ }
43
+ export declare const CreateUploadResponsePropertyValidationAttributesMap: {
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
+ * Check if a given object implements the CreateUploadResponse interface.
60
+ */
61
+ export declare function instanceOfCreateUploadResponse(value: object): value is CreateUploadResponse;
62
+ export declare function CreateUploadResponseFromJSON(json: any): CreateUploadResponse;
63
+ export declare function CreateUploadResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateUploadResponse;
64
+ export declare function CreateUploadResponseToJSON(json: any): CreateUploadResponse;
65
+ export declare function CreateUploadResponseToJSONTyped(value?: CreateUploadResponse | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,56 @@
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
+ export const CreateUploadResponsePropertyValidationAttributesMap = {};
15
+ /**
16
+ * Check if a given object implements the CreateUploadResponse interface.
17
+ */
18
+ export function instanceOfCreateUploadResponse(value) {
19
+ if (!('documentId' in value) || value['documentId'] === undefined)
20
+ return false;
21
+ if (!('documentVersionId' in value) || value['documentVersionId'] === undefined)
22
+ return false;
23
+ if (!('uploadToken' in value) || value['uploadToken'] === undefined)
24
+ return false;
25
+ if (!('partSize' in value) || value['partSize'] === undefined)
26
+ return false;
27
+ return true;
28
+ }
29
+ export function CreateUploadResponseFromJSON(json) {
30
+ return CreateUploadResponseFromJSONTyped(json, false);
31
+ }
32
+ export function CreateUploadResponseFromJSONTyped(json, ignoreDiscriminator) {
33
+ if (json == null) {
34
+ return json;
35
+ }
36
+ return {
37
+ 'documentId': json['document_id'],
38
+ 'documentVersionId': json['document_version_id'],
39
+ 'uploadToken': json['upload_token'],
40
+ 'partSize': json['part_size'],
41
+ };
42
+ }
43
+ export function CreateUploadResponseToJSON(json) {
44
+ return CreateUploadResponseToJSONTyped(json, false);
45
+ }
46
+ export function CreateUploadResponseToJSONTyped(value, ignoreDiscriminator = false) {
47
+ if (value == null) {
48
+ return value;
49
+ }
50
+ return {
51
+ 'document_id': value['documentId'],
52
+ 'document_version_id': value['documentVersionId'],
53
+ 'upload_token': value['uploadToken'],
54
+ 'part_size': value['partSize'],
55
+ };
56
+ }
@@ -24,6 +24,8 @@ export declare const DocumentType: {
24
24
  readonly Json: 'JSON';
25
25
  readonly Yaml: 'YAML';
26
26
  readonly Code: 'CODE';
27
+ readonly Audio: 'AUDIO';
28
+ readonly Video: 'VIDEO';
27
29
  readonly Unknown: 'UNKNOWN';
28
30
  };
29
31
  export type DocumentType = typeof DocumentType[keyof typeof DocumentType];
@@ -26,6 +26,8 @@ export const DocumentType = {
26
26
  Json: 'JSON',
27
27
  Yaml: 'YAML',
28
28
  Code: 'CODE',
29
+ Audio: 'AUDIO',
30
+ Video: 'VIDEO',
29
31
  Unknown: 'UNKNOWN'
30
32
  };
31
33
  export function instanceOfDocumentType(value) {
@@ -39,6 +39,18 @@ export interface EnrichedCitation {
39
39
  * @memberof EnrichedCitation
40
40
  */
41
41
  length: number;
42
+ /**
43
+ * Start time (ms) of the cited chunk in the source media, for AUDIO/VIDEO — lets the client deep-link playback to the moment. None for non-media chunks.
44
+ * @type {number}
45
+ * @memberof EnrichedCitation
46
+ */
47
+ startMs?: number | null;
48
+ /**
49
+ * End time (ms) of the cited chunk in the source media (AUDIO/VIDEO); None for non-media chunks.
50
+ * @type {number}
51
+ * @memberof EnrichedCitation
52
+ */
53
+ endMs?: number | null;
42
54
  /**
43
55
  *
44
56
  * @type {string}
@@ -43,6 +43,8 @@ export function EnrichedCitationFromJSONTyped(json, ignoreDiscriminator) {
43
43
  'quote': json['quote'],
44
44
  'startChar': json['start_char'],
45
45
  'length': json['length'],
46
+ 'startMs': json['start_ms'] == null ? undefined : json['start_ms'],
47
+ 'endMs': json['end_ms'] == null ? undefined : json['end_ms'],
46
48
  'documentId': json['document_id'] == null ? undefined : json['document_id'],
47
49
  'documentVersionId': json['document_version_id'] == null ? undefined : json['document_version_id'],
48
50
  'documentName': json['document_name'] == null ? undefined : json['document_name'],
@@ -63,6 +65,8 @@ export function EnrichedCitationToJSONTyped(value, ignoreDiscriminator = false)
63
65
  'quote': value['quote'],
64
66
  'start_char': value['startChar'],
65
67
  'length': value['length'],
68
+ 'start_ms': value['startMs'],
69
+ 'end_ms': value['endMs'],
66
70
  'document_id': value['documentId'],
67
71
  'document_version_id': value['documentVersionId'],
68
72
  'document_name': value['documentName'],
@@ -17,6 +17,7 @@ export declare const IngestionMode: {
17
17
  readonly HighAccuracy: 'high_accuracy';
18
18
  readonly Standard: 'standard';
19
19
  readonly SingleChunk: 'single_chunk';
20
+ readonly Media: 'media';
20
21
  };
21
22
  export type IngestionMode = typeof IngestionMode[keyof typeof IngestionMode];
22
23
  export declare function instanceOfIngestionMode(value: any): boolean;
@@ -18,7 +18,8 @@
18
18
  export const IngestionMode = {
19
19
  HighAccuracy: 'high_accuracy',
20
20
  Standard: 'standard',
21
- SingleChunk: 'single_chunk'
21
+ SingleChunk: 'single_chunk',
22
+ Media: 'media'
22
23
  };
23
24
  export function instanceOfIngestionMode(value) {
24
25
  for (const key in IngestionMode) {
@@ -51,6 +51,12 @@ export interface SubscriptionPlanResponse {
51
51
  * @memberof SubscriptionPlanResponse
52
52
  */
53
53
  searches: number;
54
+ /**
55
+ * Per-period cap on transcribed media minutes (MEDIA_MINUTE).
56
+ * @type {number}
57
+ * @memberof SubscriptionPlanResponse
58
+ */
59
+ mediaMinutes: number;
54
60
  /**
55
61
  * Upper bound on num_seats accepted by the upgrade endpoint. Admin PATCH may set tenant.seats above this value.
56
62
  * @type {number}
@@ -26,6 +26,8 @@ export function instanceOfSubscriptionPlanResponse(value) {
26
26
  return false;
27
27
  if (!('searches' in value) || value['searches'] === undefined)
28
28
  return false;
29
+ if (!('mediaMinutes' in value) || value['mediaMinutes'] === undefined)
30
+ return false;
29
31
  if (!('maxSeats' in value) || value['maxSeats'] === undefined)
30
32
  return false;
31
33
  if (!('_public' in value) || value['_public'] === undefined)
@@ -49,6 +51,7 @@ export function SubscriptionPlanResponseFromJSONTyped(json, ignoreDiscriminator)
49
51
  'ingestedPages': json['ingested_pages'],
50
52
  'messages': json['messages'],
51
53
  'searches': json['searches'],
54
+ 'mediaMinutes': json['media_minutes'],
52
55
  'maxSeats': json['max_seats'],
53
56
  '_public': json['public'],
54
57
  'createdAt': (new Date(json['created_at'])),
@@ -68,6 +71,7 @@ export function SubscriptionPlanResponseToJSONTyped(value, ignoreDiscriminator =
68
71
  'ingested_pages': value['ingestedPages'],
69
72
  'messages': value['messages'],
70
73
  'searches': value['searches'],
74
+ 'media_minutes': value['mediaMinutes'],
71
75
  'max_seats': value['maxSeats'],
72
76
  'public': value['_public'],
73
77
  'created_at': value['createdAt'].toISOString(),
@@ -0,0 +1,59 @@
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
+ * Acknowledgement of one stored part.
14
+ * @export
15
+ * @interface UploadPartResponse
16
+ */
17
+ export interface UploadPartResponse {
18
+ /**
19
+ *
20
+ * @type {number}
21
+ * @memberof UploadPartResponse
22
+ */
23
+ partNumber: number;
24
+ /**
25
+ *
26
+ * @type {string}
27
+ * @memberof UploadPartResponse
28
+ */
29
+ etag: string;
30
+ /**
31
+ *
32
+ * @type {number}
33
+ * @memberof UploadPartResponse
34
+ */
35
+ size: number;
36
+ }
37
+ export declare const UploadPartResponsePropertyValidationAttributesMap: {
38
+ [property: string]: {
39
+ maxLength?: number;
40
+ minLength?: number;
41
+ pattern?: string;
42
+ maximum?: number;
43
+ exclusiveMaximum?: boolean;
44
+ minimum?: number;
45
+ exclusiveMinimum?: boolean;
46
+ multipleOf?: number;
47
+ maxItems?: number;
48
+ minItems?: number;
49
+ uniqueItems?: boolean;
50
+ };
51
+ };
52
+ /**
53
+ * Check if a given object implements the UploadPartResponse interface.
54
+ */
55
+ export declare function instanceOfUploadPartResponse(value: object): value is UploadPartResponse;
56
+ export declare function UploadPartResponseFromJSON(json: any): UploadPartResponse;
57
+ export declare function UploadPartResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): UploadPartResponse;
58
+ export declare function UploadPartResponseToJSON(json: any): UploadPartResponse;
59
+ export declare function UploadPartResponseToJSONTyped(value?: UploadPartResponse | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,52 @@
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
+ export const UploadPartResponsePropertyValidationAttributesMap = {};
15
+ /**
16
+ * Check if a given object implements the UploadPartResponse interface.
17
+ */
18
+ export function instanceOfUploadPartResponse(value) {
19
+ if (!('partNumber' in value) || value['partNumber'] === undefined)
20
+ return false;
21
+ if (!('etag' in value) || value['etag'] === undefined)
22
+ return false;
23
+ if (!('size' in value) || value['size'] === undefined)
24
+ return false;
25
+ return true;
26
+ }
27
+ export function UploadPartResponseFromJSON(json) {
28
+ return UploadPartResponseFromJSONTyped(json, false);
29
+ }
30
+ export function UploadPartResponseFromJSONTyped(json, ignoreDiscriminator) {
31
+ if (json == null) {
32
+ return json;
33
+ }
34
+ return {
35
+ 'partNumber': json['part_number'],
36
+ 'etag': json['etag'],
37
+ 'size': json['size'],
38
+ };
39
+ }
40
+ export function UploadPartResponseToJSON(json) {
41
+ return UploadPartResponseToJSONTyped(json, false);
42
+ }
43
+ export function UploadPartResponseToJSONTyped(value, ignoreDiscriminator = false) {
44
+ if (value == null) {
45
+ return value;
46
+ }
47
+ return {
48
+ 'part_number': value['partNumber'],
49
+ 'etag': value['etag'],
50
+ 'size': value['size'],
51
+ };
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 { UploadPartResponse } from './UploadPartResponse';
13
+ /**
14
+ * Parts S3 already holds — resume by re-sending the rest.
15
+ * @export
16
+ * @interface UploadStatusResponse
17
+ */
18
+ export interface UploadStatusResponse {
19
+ /**
20
+ *
21
+ * @type {Array<UploadPartResponse>}
22
+ * @memberof UploadStatusResponse
23
+ */
24
+ parts: Array<UploadPartResponse>;
25
+ /**
26
+ *
27
+ * @type {number}
28
+ * @memberof UploadStatusResponse
29
+ */
30
+ uploadedBytes: number;
31
+ }
32
+ export declare const UploadStatusResponsePropertyValidationAttributesMap: {
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 UploadStatusResponse interface.
49
+ */
50
+ export declare function instanceOfUploadStatusResponse(value: object): value is UploadStatusResponse;
51
+ export declare function UploadStatusResponseFromJSON(json: any): UploadStatusResponse;
52
+ export declare function UploadStatusResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): UploadStatusResponse;
53
+ export declare function UploadStatusResponseToJSON(json: any): UploadStatusResponse;
54
+ export declare function UploadStatusResponseToJSONTyped(value?: UploadStatusResponse | null, ignoreDiscriminator?: boolean): any;
@@ -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 { UploadPartResponseFromJSON, UploadPartResponseToJSON, } from './UploadPartResponse';
15
+ export const UploadStatusResponsePropertyValidationAttributesMap = {};
16
+ /**
17
+ * Check if a given object implements the UploadStatusResponse interface.
18
+ */
19
+ export function instanceOfUploadStatusResponse(value) {
20
+ if (!('parts' in value) || value['parts'] === undefined)
21
+ return false;
22
+ if (!('uploadedBytes' in value) || value['uploadedBytes'] === undefined)
23
+ return false;
24
+ return true;
25
+ }
26
+ export function UploadStatusResponseFromJSON(json) {
27
+ return UploadStatusResponseFromJSONTyped(json, false);
28
+ }
29
+ export function UploadStatusResponseFromJSONTyped(json, ignoreDiscriminator) {
30
+ if (json == null) {
31
+ return json;
32
+ }
33
+ return {
34
+ 'parts': (json['parts'].map(UploadPartResponseFromJSON)),
35
+ 'uploadedBytes': json['uploaded_bytes'],
36
+ };
37
+ }
38
+ export function UploadStatusResponseToJSON(json) {
39
+ return UploadStatusResponseToJSONTyped(json, false);
40
+ }
41
+ export function UploadStatusResponseToJSONTyped(value, ignoreDiscriminator = false) {
42
+ if (value == null) {
43
+ return value;
44
+ }
45
+ return {
46
+ 'parts': (value['parts'].map(UploadPartResponseToJSON)),
47
+ 'uploaded_bytes': value['uploadedBytes'],
48
+ };
49
+ }
@@ -17,6 +17,7 @@ export declare const UsageMetric: {
17
17
  readonly Page: 'PAGE';
18
18
  readonly Search: 'SEARCH';
19
19
  readonly Message: 'MESSAGE';
20
+ readonly MediaMinute: 'MEDIA_MINUTE';
20
21
  };
21
22
  export type UsageMetric = typeof UsageMetric[keyof typeof UsageMetric];
22
23
  export declare function instanceOfUsageMetric(value: any): boolean;
@@ -18,7 +18,8 @@
18
18
  export const UsageMetric = {
19
19
  Page: 'PAGE',
20
20
  Search: 'SEARCH',
21
- Message: 'MESSAGE'
21
+ Message: 'MESSAGE',
22
+ MediaMinute: 'MEDIA_MINUTE'
22
23
  };
23
24
  export function instanceOfUsageMetric(value) {
24
25
  for (const key in UsageMetric) {
@@ -47,6 +47,7 @@ export * from './CloneWorkflowRunRequest';
47
47
  export * from './ColumnConfig';
48
48
  export * from './ColumnReference';
49
49
  export * from './CommonFileExclusionReason';
50
+ export * from './CompleteUploadRequest';
50
51
  export * from './ConnectionConfig';
51
52
  export * from './ContentsSortOrder';
52
53
  export * from './CreateApiConnectionRequest';
@@ -67,6 +68,8 @@ export * from './CreateSkillRequest';
67
68
  export * from './CreateTagRequest';
68
69
  export * from './CreateThreadMessageRequest';
69
70
  export * from './CreateThreadRequest';
71
+ export * from './CreateUploadRequest';
72
+ export * from './CreateUploadResponse';
70
73
  export * from './CreateWorkflowDefinitionRequest';
71
74
  export * from './DataSourceCatalogResponse';
72
75
  export * from './DataSourceDescribeResponse';
@@ -328,6 +331,8 @@ export * from './UpdateWorkflowDefinitionRequest';
328
331
  export * from './UpdateWorkflowRunRequest';
329
332
  export * from './UploadConstraints';
330
333
  export * from './UploadFormat';
334
+ export * from './UploadPartResponse';
335
+ export * from './UploadStatusResponse';
331
336
  export * from './UsageMetric';
332
337
  export * from './UserInfo';
333
338
  export * from './UserMessageRequest';
@@ -49,6 +49,7 @@ export * from './CloneWorkflowRunRequest';
49
49
  export * from './ColumnConfig';
50
50
  export * from './ColumnReference';
51
51
  export * from './CommonFileExclusionReason';
52
+ export * from './CompleteUploadRequest';
52
53
  export * from './ConnectionConfig';
53
54
  export * from './ContentsSortOrder';
54
55
  export * from './CreateApiConnectionRequest';
@@ -69,6 +70,8 @@ export * from './CreateSkillRequest';
69
70
  export * from './CreateTagRequest';
70
71
  export * from './CreateThreadMessageRequest';
71
72
  export * from './CreateThreadRequest';
73
+ export * from './CreateUploadRequest';
74
+ export * from './CreateUploadResponse';
72
75
  export * from './CreateWorkflowDefinitionRequest';
73
76
  export * from './DataSourceCatalogResponse';
74
77
  export * from './DataSourceDescribeResponse';
@@ -330,6 +333,8 @@ export * from './UpdateWorkflowDefinitionRequest';
330
333
  export * from './UpdateWorkflowRunRequest';
331
334
  export * from './UploadConstraints';
332
335
  export * from './UploadFormat';
336
+ export * from './UploadPartResponse';
337
+ export * from './UploadStatusResponse';
333
338
  export * from './UsageMetric';
334
339
  export * from './UserInfo';
335
340
  export * from './UserMessageRequest';
@@ -53,6 +53,18 @@ export interface ChunkMetadata {
53
53
  * @memberof ChunkMetadata
54
54
  */
55
55
  secondaryTaxonomy?: ImageTaxonomy;
56
+ /**
57
+ * Start time of this chunk in the source media (ms from start).
58
+ * @type {number}
59
+ * @memberof ChunkMetadata
60
+ */
61
+ startMs?: number | null;
62
+ /**
63
+ * End time of this chunk in the source media (ms from start).
64
+ * @type {number}
65
+ * @memberof ChunkMetadata
66
+ */
67
+ endMs?: number | null;
56
68
  /**
57
69
  * Worksheet name this chunk was extracted from (XLSX only)
58
70
  * @type {string}
@@ -42,6 +42,8 @@ function ChunkMetadataFromJSONTyped(json, ignoreDiscriminator) {
42
42
  'summarizeForEmbedding': json['summarize_for_embedding'] == null ? undefined : json['summarize_for_embedding'],
43
43
  'extractedTextS3Uri': json['extracted_text_s3_uri'] == null ? undefined : json['extracted_text_s3_uri'],
44
44
  'secondaryTaxonomy': json['secondary_taxonomy'] == null ? undefined : (0, ImageTaxonomy_1.ImageTaxonomyFromJSON)(json['secondary_taxonomy']),
45
+ 'startMs': json['start_ms'] == null ? undefined : json['start_ms'],
46
+ 'endMs': json['end_ms'] == null ? undefined : json['end_ms'],
45
47
  'sheetName': json['sheet_name'] == null ? undefined : json['sheet_name'],
46
48
  'blockType': json['block_type'] == null ? undefined : json['block_type'],
47
49
  'sourceUri': json['source_uri'] == null ? undefined : json['source_uri'],
@@ -67,6 +69,8 @@ function ChunkMetadataToJSONTyped(value, ignoreDiscriminator = false) {
67
69
  'summarize_for_embedding': value['summarizeForEmbedding'],
68
70
  'extracted_text_s3_uri': value['extractedTextS3Uri'],
69
71
  'secondary_taxonomy': (0, ImageTaxonomy_1.ImageTaxonomyToJSON)(value['secondaryTaxonomy']),
72
+ 'start_ms': value['startMs'],
73
+ 'end_ms': value['endMs'],
70
74
  'sheet_name': value['sheetName'],
71
75
  'block_type': value['blockType'],
72
76
  'source_uri': value['sourceUri'],
@@ -39,6 +39,18 @@ export interface Citation {
39
39
  * @memberof Citation
40
40
  */
41
41
  length: number;
42
+ /**
43
+ * Start time (ms) of the cited chunk in the source media, for AUDIO/VIDEO — lets the client deep-link playback to the moment. None for non-media chunks.
44
+ * @type {number}
45
+ * @memberof Citation
46
+ */
47
+ startMs?: number | null;
48
+ /**
49
+ * End time (ms) of the cited chunk in the source media (AUDIO/VIDEO); None for non-media chunks.
50
+ * @type {number}
51
+ * @memberof Citation
52
+ */
53
+ endMs?: number | null;
42
54
  }
43
55
  export declare const CitationPropertyValidationAttributesMap: {
44
56
  [property: string]: {
@@ -51,6 +51,8 @@ function CitationFromJSONTyped(json, ignoreDiscriminator) {
51
51
  'quote': json['quote'],
52
52
  'startChar': json['start_char'],
53
53
  'length': json['length'],
54
+ 'startMs': json['start_ms'] == null ? undefined : json['start_ms'],
55
+ 'endMs': json['end_ms'] == null ? undefined : json['end_ms'],
54
56
  };
55
57
  }
56
58
  function CitationToJSON(json) {
@@ -65,5 +67,7 @@ function CitationToJSONTyped(value, ignoreDiscriminator = false) {
65
67
  'quote': value['quote'],
66
68
  'start_char': value['startChar'],
67
69
  'length': value['length'],
70
+ 'start_ms': value['startMs'],
71
+ 'end_ms': value['endMs'],
68
72
  };
69
73
  }