@knowledge-stack/ksapi 1.149.1 → 1.151.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 (52) hide show
  1. package/.openapi-generator/FILES +4 -2
  2. package/README.md +5 -3
  3. package/dist/apis/DocumentsApi.d.ts +13 -4
  4. package/dist/apis/DocumentsApi.js +11 -2
  5. package/dist/apis/MemoryApi.d.ts +5 -5
  6. package/dist/apis/MemoryApi.js +1 -1
  7. package/dist/apis/SystemJobsApi.d.ts +39 -1
  8. package/dist/apis/SystemJobsApi.js +48 -0
  9. package/dist/esm/apis/DocumentsApi.d.ts +13 -4
  10. package/dist/esm/apis/DocumentsApi.js +11 -2
  11. package/dist/esm/apis/MemoryApi.d.ts +5 -5
  12. package/dist/esm/apis/MemoryApi.js +2 -2
  13. package/dist/esm/apis/SystemJobsApi.d.ts +39 -1
  14. package/dist/esm/apis/SystemJobsApi.js +49 -1
  15. package/dist/esm/models/DocumentVersionMetadata.d.ts +6 -0
  16. package/dist/esm/models/DocumentVersionMetadata.js +2 -0
  17. package/dist/esm/models/IngestZipResponse.d.ts +10 -23
  18. package/dist/esm/models/IngestZipResponse.js +5 -17
  19. package/dist/esm/models/ZipIngestionStatusResponse.d.ts +64 -0
  20. package/dist/esm/models/{ProposedMemoryChunkResponse.js → ZipIngestionStatusResponse.js} +19 -40
  21. package/dist/esm/models/{ProposedMemoryChunkResponse.d.ts → ZipMemberStatusResponse.d.ts} +23 -37
  22. package/dist/esm/models/ZipMemberStatusResponse.js +54 -0
  23. package/dist/esm/models/index.d.ts +2 -1
  24. package/dist/esm/models/index.js +2 -1
  25. package/dist/models/DocumentVersionMetadata.d.ts +6 -0
  26. package/dist/models/DocumentVersionMetadata.js +2 -0
  27. package/dist/models/IngestZipResponse.d.ts +10 -23
  28. package/dist/models/IngestZipResponse.js +5 -17
  29. package/dist/models/ZipIngestionStatusResponse.d.ts +64 -0
  30. package/dist/models/{ProposedMemoryChunkResponse.js → ZipIngestionStatusResponse.js} +25 -46
  31. package/dist/models/{ProposedMemoryChunkResponse.d.ts → ZipMemberStatusResponse.d.ts} +23 -37
  32. package/dist/models/ZipMemberStatusResponse.js +62 -0
  33. package/dist/models/index.d.ts +2 -1
  34. package/dist/models/index.js +2 -1
  35. package/docs/DocumentVersionMetadata.md +2 -0
  36. package/docs/DocumentsApi.md +12 -3
  37. package/docs/IngestZipResponse.md +4 -10
  38. package/docs/MemoryApi.md +2 -2
  39. package/docs/SystemJobsApi.md +76 -0
  40. package/docs/ZipIngestionStatusResponse.md +39 -0
  41. package/docs/ZipMemberStatusResponse.md +45 -0
  42. package/package.json +1 -1
  43. package/src/apis/DocumentsApi.ts +25 -4
  44. package/src/apis/MemoryApi.ts +8 -8
  45. package/src/apis/SystemJobsApi.ts +86 -0
  46. package/src/models/DocumentVersionMetadata.ts +8 -0
  47. package/src/models/IngestZipResponse.ts +15 -37
  48. package/src/models/ZipIngestionStatusResponse.ts +113 -0
  49. package/src/models/ZipMemberStatusResponse.ts +123 -0
  50. package/src/models/index.ts +2 -1
  51. package/docs/ProposedMemoryChunkResponse.md +0 -48
  52. package/src/models/ProposedMemoryChunkResponse.ts +0 -163
@@ -11,41 +11,28 @@
11
11
  */
12
12
  import type { ZipFileResult } from './ZipFileResult';
13
13
  /**
14
- * Aggregate response from a ZIP ingestion batch.
14
+ * Response from dispatching a ZIP archive to async ingestion.
15
+ *
16
+ * ``workflow_id`` is the fan-out workflow to poll at
17
+ * ``GET /v1/system-jobs/zip-ingestions/{workflow_id}`` for per-member outcomes;
18
+ * it is None when the archive held no ingestible members. ``skipped`` are the
19
+ * artifact/error entries resolved synchronously during classification.
15
20
  * @export
16
21
  * @interface IngestZipResponse
17
22
  */
18
23
  export interface IngestZipResponse {
19
24
  /**
20
25
  *
21
- * @type {Array<ZipFileResult>}
22
- * @memberof IngestZipResponse
23
- */
24
- files: Array<ZipFileResult>;
25
- /**
26
- *
27
- * @type {number}
26
+ * @type {string}
28
27
  * @memberof IngestZipResponse
29
28
  */
30
- totalFound: number;
29
+ workflowId: string | null;
31
30
  /**
32
31
  *
33
- * @type {number}
34
- * @memberof IngestZipResponse
35
- */
36
- succeeded: number;
37
- /**
38
- *
39
- * @type {number}
40
- * @memberof IngestZipResponse
41
- */
42
- skipped: number;
43
- /**
44
- *
45
- * @type {number}
32
+ * @type {Array<ZipFileResult>}
46
33
  * @memberof IngestZipResponse
47
34
  */
48
- failed: number;
35
+ skipped: Array<ZipFileResult>;
49
36
  }
50
37
  export declare const IngestZipResponsePropertyValidationAttributesMap: {
51
38
  [property: string]: {
@@ -25,16 +25,10 @@ exports.IngestZipResponsePropertyValidationAttributesMap = {};
25
25
  * Check if a given object implements the IngestZipResponse interface.
26
26
  */
27
27
  function instanceOfIngestZipResponse(value) {
28
- if (!('files' in value) || value['files'] === undefined)
29
- return false;
30
- if (!('totalFound' in value) || value['totalFound'] === undefined)
31
- return false;
32
- if (!('succeeded' in value) || value['succeeded'] === undefined)
28
+ if (!('workflowId' in value) || value['workflowId'] === undefined)
33
29
  return false;
34
30
  if (!('skipped' in value) || value['skipped'] === undefined)
35
31
  return false;
36
- if (!('failed' in value) || value['failed'] === undefined)
37
- return false;
38
32
  return true;
39
33
  }
40
34
  function IngestZipResponseFromJSON(json) {
@@ -45,11 +39,8 @@ function IngestZipResponseFromJSONTyped(json, ignoreDiscriminator) {
45
39
  return json;
46
40
  }
47
41
  return {
48
- 'files': (json['files'].map(ZipFileResult_1.ZipFileResultFromJSON)),
49
- 'totalFound': json['total_found'],
50
- 'succeeded': json['succeeded'],
51
- 'skipped': json['skipped'],
52
- 'failed': json['failed'],
42
+ 'workflowId': json['workflow_id'],
43
+ 'skipped': (json['skipped'].map(ZipFileResult_1.ZipFileResultFromJSON)),
53
44
  };
54
45
  }
55
46
  function IngestZipResponseToJSON(json) {
@@ -60,10 +51,7 @@ function IngestZipResponseToJSONTyped(value, ignoreDiscriminator = false) {
60
51
  return value;
61
52
  }
62
53
  return {
63
- 'files': (value['files'].map(ZipFileResult_1.ZipFileResultToJSON)),
64
- 'total_found': value['totalFound'],
65
- 'succeeded': value['succeeded'],
66
- 'skipped': value['skipped'],
67
- 'failed': value['failed'],
54
+ 'workflow_id': value['workflowId'],
55
+ 'skipped': (value['skipped'].map(ZipFileResult_1.ZipFileResultToJSON)),
68
56
  };
69
57
  }
@@ -0,0 +1,64 @@
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 { ZipMemberStatusResponse } from './ZipMemberStatusResponse';
13
+ /**
14
+ * Status of a ZIP fan-out: live Temporal state + per-member outcomes.
15
+ *
16
+ * ``files`` reflects progress so far — members that have been dispatched
17
+ * (``workflow_id`` set), failed to dispatch (``error`` set), or were skipped as
18
+ * artifacts. Poll until ``temporal_status`` is terminal (e.g. ``COMPLETED``).
19
+ * @export
20
+ * @interface ZipIngestionStatusResponse
21
+ */
22
+ export interface ZipIngestionStatusResponse {
23
+ /**
24
+ *
25
+ * @type {string}
26
+ * @memberof ZipIngestionStatusResponse
27
+ */
28
+ workflowId: string;
29
+ /**
30
+ *
31
+ * @type {string}
32
+ * @memberof ZipIngestionStatusResponse
33
+ */
34
+ temporalStatus: string;
35
+ /**
36
+ *
37
+ * @type {Array<ZipMemberStatusResponse>}
38
+ * @memberof ZipIngestionStatusResponse
39
+ */
40
+ files: Array<ZipMemberStatusResponse>;
41
+ }
42
+ export declare const ZipIngestionStatusResponsePropertyValidationAttributesMap: {
43
+ [property: string]: {
44
+ maxLength?: number;
45
+ minLength?: number;
46
+ pattern?: string;
47
+ maximum?: number;
48
+ exclusiveMaximum?: boolean;
49
+ minimum?: number;
50
+ exclusiveMinimum?: boolean;
51
+ multipleOf?: number;
52
+ maxItems?: number;
53
+ minItems?: number;
54
+ uniqueItems?: boolean;
55
+ };
56
+ };
57
+ /**
58
+ * Check if a given object implements the ZipIngestionStatusResponse interface.
59
+ */
60
+ export declare function instanceOfZipIngestionStatusResponse(value: object): value is ZipIngestionStatusResponse;
61
+ export declare function ZipIngestionStatusResponseFromJSON(json: any): ZipIngestionStatusResponse;
62
+ export declare function ZipIngestionStatusResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ZipIngestionStatusResponse;
63
+ export declare function ZipIngestionStatusResponseToJSON(json: any): ZipIngestionStatusResponse;
64
+ export declare function ZipIngestionStatusResponseToJSONTyped(value?: ZipIngestionStatusResponse | null, ignoreDiscriminator?: boolean): any;
@@ -13,70 +13,49 @@
13
13
  * Do not edit the class manually.
14
14
  */
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.ProposedMemoryChunkResponsePropertyValidationAttributesMap = void 0;
17
- exports.instanceOfProposedMemoryChunkResponse = instanceOfProposedMemoryChunkResponse;
18
- exports.ProposedMemoryChunkResponseFromJSON = ProposedMemoryChunkResponseFromJSON;
19
- exports.ProposedMemoryChunkResponseFromJSONTyped = ProposedMemoryChunkResponseFromJSONTyped;
20
- exports.ProposedMemoryChunkResponseToJSON = ProposedMemoryChunkResponseToJSON;
21
- exports.ProposedMemoryChunkResponseToJSONTyped = ProposedMemoryChunkResponseToJSONTyped;
22
- const MemoryScope_1 = require("./MemoryScope");
23
- const MemoryKind_1 = require("./MemoryKind");
24
- exports.ProposedMemoryChunkResponsePropertyValidationAttributesMap = {};
16
+ exports.ZipIngestionStatusResponsePropertyValidationAttributesMap = void 0;
17
+ exports.instanceOfZipIngestionStatusResponse = instanceOfZipIngestionStatusResponse;
18
+ exports.ZipIngestionStatusResponseFromJSON = ZipIngestionStatusResponseFromJSON;
19
+ exports.ZipIngestionStatusResponseFromJSONTyped = ZipIngestionStatusResponseFromJSONTyped;
20
+ exports.ZipIngestionStatusResponseToJSON = ZipIngestionStatusResponseToJSON;
21
+ exports.ZipIngestionStatusResponseToJSONTyped = ZipIngestionStatusResponseToJSONTyped;
22
+ const ZipMemberStatusResponse_1 = require("./ZipMemberStatusResponse");
23
+ exports.ZipIngestionStatusResponsePropertyValidationAttributesMap = {};
25
24
  /**
26
- * Check if a given object implements the ProposedMemoryChunkResponse interface.
25
+ * Check if a given object implements the ZipIngestionStatusResponse interface.
27
26
  */
28
- function instanceOfProposedMemoryChunkResponse(value) {
29
- if (!('chunkId' in value) || value['chunkId'] === undefined)
27
+ function instanceOfZipIngestionStatusResponse(value) {
28
+ if (!('workflowId' in value) || value['workflowId'] === undefined)
30
29
  return false;
31
- if (!('scope' in value) || value['scope'] === undefined)
30
+ if (!('temporalStatus' in value) || value['temporalStatus'] === undefined)
32
31
  return false;
33
- if (!('ownerPathPartId' in value) || value['ownerPathPartId'] === undefined)
34
- return false;
35
- if (!('kind' in value) || value['kind'] === undefined)
36
- return false;
37
- if (!('rationale' in value) || value['rationale'] === undefined)
38
- return false;
39
- if (!('body' in value) || value['body'] === undefined)
40
- return false;
41
- if (!('proposerTenantUserId' in value) || value['proposerTenantUserId'] === undefined)
42
- return false;
43
- if (!('runId' in value) || value['runId'] === undefined)
32
+ if (!('files' in value) || value['files'] === undefined)
44
33
  return false;
45
34
  return true;
46
35
  }
47
- function ProposedMemoryChunkResponseFromJSON(json) {
48
- return ProposedMemoryChunkResponseFromJSONTyped(json, false);
36
+ function ZipIngestionStatusResponseFromJSON(json) {
37
+ return ZipIngestionStatusResponseFromJSONTyped(json, false);
49
38
  }
50
- function ProposedMemoryChunkResponseFromJSONTyped(json, ignoreDiscriminator) {
39
+ function ZipIngestionStatusResponseFromJSONTyped(json, ignoreDiscriminator) {
51
40
  if (json == null) {
52
41
  return json;
53
42
  }
54
43
  return {
55
- 'chunkId': json['chunk_id'],
56
- 'scope': (0, MemoryScope_1.MemoryScopeFromJSON)(json['scope']),
57
- 'ownerPathPartId': json['owner_path_part_id'],
58
- 'kind': (0, MemoryKind_1.MemoryKindFromJSON)(json['kind']),
59
- 'rationale': json['rationale'],
60
- 'body': json['body'],
61
- 'proposerTenantUserId': json['proposer_tenant_user_id'],
62
- 'runId': json['run_id'],
44
+ 'workflowId': json['workflow_id'],
45
+ 'temporalStatus': json['temporal_status'],
46
+ 'files': (json['files'].map(ZipMemberStatusResponse_1.ZipMemberStatusResponseFromJSON)),
63
47
  };
64
48
  }
65
- function ProposedMemoryChunkResponseToJSON(json) {
66
- return ProposedMemoryChunkResponseToJSONTyped(json, false);
49
+ function ZipIngestionStatusResponseToJSON(json) {
50
+ return ZipIngestionStatusResponseToJSONTyped(json, false);
67
51
  }
68
- function ProposedMemoryChunkResponseToJSONTyped(value, ignoreDiscriminator = false) {
52
+ function ZipIngestionStatusResponseToJSONTyped(value, ignoreDiscriminator = false) {
69
53
  if (value == null) {
70
54
  return value;
71
55
  }
72
56
  return {
73
- 'chunk_id': value['chunkId'],
74
- 'scope': (0, MemoryScope_1.MemoryScopeToJSON)(value['scope']),
75
- 'owner_path_part_id': value['ownerPathPartId'],
76
- 'kind': (0, MemoryKind_1.MemoryKindToJSON)(value['kind']),
77
- 'rationale': value['rationale'],
78
- 'body': value['body'],
79
- 'proposer_tenant_user_id': value['proposerTenantUserId'],
80
- 'run_id': value['runId'],
57
+ 'workflow_id': value['workflowId'],
58
+ 'temporal_status': value['temporalStatus'],
59
+ 'files': (value['files'].map(ZipMemberStatusResponse_1.ZipMemberStatusResponseToJSON)),
81
60
  };
82
61
  }
@@ -9,64 +9,50 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
- import type { MemoryScope } from './MemoryScope';
13
- import type { MemoryKind } from './MemoryKind';
14
12
  /**
15
- *
13
+ * One member's outcome within a ZIP fan-out (from the workflow query).
16
14
  * @export
17
- * @interface ProposedMemoryChunkResponse
15
+ * @interface ZipMemberStatusResponse
18
16
  */
19
- export interface ProposedMemoryChunkResponse {
17
+ export interface ZipMemberStatusResponse {
20
18
  /**
21
19
  *
22
20
  * @type {string}
23
- * @memberof ProposedMemoryChunkResponse
24
- */
25
- chunkId: string;
26
- /**
27
- *
28
- * @type {MemoryScope}
29
- * @memberof ProposedMemoryChunkResponse
21
+ * @memberof ZipMemberStatusResponse
30
22
  */
31
- scope: MemoryScope;
23
+ zipPath: string;
32
24
  /**
33
25
  *
34
26
  * @type {string}
35
- * @memberof ProposedMemoryChunkResponse
27
+ * @memberof ZipMemberStatusResponse
36
28
  */
37
- ownerPathPartId: string;
38
- /**
39
- *
40
- * @type {MemoryKind}
41
- * @memberof ProposedMemoryChunkResponse
42
- */
43
- kind: MemoryKind;
29
+ documentId?: string | null;
44
30
  /**
45
31
  *
46
32
  * @type {string}
47
- * @memberof ProposedMemoryChunkResponse
33
+ * @memberof ZipMemberStatusResponse
48
34
  */
49
- rationale: string;
35
+ documentVersionId?: string | null;
50
36
  /**
51
37
  *
52
38
  * @type {string}
53
- * @memberof ProposedMemoryChunkResponse
39
+ * @memberof ZipMemberStatusResponse
54
40
  */
55
- body: string;
41
+ workflowId?: string | null;
56
42
  /**
57
43
  *
58
44
  * @type {string}
59
- * @memberof ProposedMemoryChunkResponse
45
+ * @memberof ZipMemberStatusResponse
60
46
  */
61
- proposerTenantUserId: string;
47
+ error?: string | null;
62
48
  /**
63
49
  *
64
- * @type {string}
65
- * @memberof ProposedMemoryChunkResponse
50
+ * @type {boolean}
51
+ * @memberof ZipMemberStatusResponse
66
52
  */
67
- runId: string | null;
53
+ skipped?: boolean;
68
54
  }
69
- export declare const ProposedMemoryChunkResponsePropertyValidationAttributesMap: {
55
+ export declare const ZipMemberStatusResponsePropertyValidationAttributesMap: {
70
56
  [property: string]: {
71
57
  maxLength?: number;
72
58
  minLength?: number;
@@ -82,10 +68,10 @@ export declare const ProposedMemoryChunkResponsePropertyValidationAttributesMap:
82
68
  };
83
69
  };
84
70
  /**
85
- * Check if a given object implements the ProposedMemoryChunkResponse interface.
71
+ * Check if a given object implements the ZipMemberStatusResponse interface.
86
72
  */
87
- export declare function instanceOfProposedMemoryChunkResponse(value: object): value is ProposedMemoryChunkResponse;
88
- export declare function ProposedMemoryChunkResponseFromJSON(json: any): ProposedMemoryChunkResponse;
89
- export declare function ProposedMemoryChunkResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ProposedMemoryChunkResponse;
90
- export declare function ProposedMemoryChunkResponseToJSON(json: any): ProposedMemoryChunkResponse;
91
- export declare function ProposedMemoryChunkResponseToJSONTyped(value?: ProposedMemoryChunkResponse | null, ignoreDiscriminator?: boolean): any;
73
+ export declare function instanceOfZipMemberStatusResponse(value: object): value is ZipMemberStatusResponse;
74
+ export declare function ZipMemberStatusResponseFromJSON(json: any): ZipMemberStatusResponse;
75
+ export declare function ZipMemberStatusResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ZipMemberStatusResponse;
76
+ export declare function ZipMemberStatusResponseToJSON(json: any): ZipMemberStatusResponse;
77
+ export declare function ZipMemberStatusResponseToJSONTyped(value?: ZipMemberStatusResponse | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,62 @@
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.ZipMemberStatusResponsePropertyValidationAttributesMap = void 0;
17
+ exports.instanceOfZipMemberStatusResponse = instanceOfZipMemberStatusResponse;
18
+ exports.ZipMemberStatusResponseFromJSON = ZipMemberStatusResponseFromJSON;
19
+ exports.ZipMemberStatusResponseFromJSONTyped = ZipMemberStatusResponseFromJSONTyped;
20
+ exports.ZipMemberStatusResponseToJSON = ZipMemberStatusResponseToJSON;
21
+ exports.ZipMemberStatusResponseToJSONTyped = ZipMemberStatusResponseToJSONTyped;
22
+ exports.ZipMemberStatusResponsePropertyValidationAttributesMap = {};
23
+ /**
24
+ * Check if a given object implements the ZipMemberStatusResponse interface.
25
+ */
26
+ function instanceOfZipMemberStatusResponse(value) {
27
+ if (!('zipPath' in value) || value['zipPath'] === undefined)
28
+ return false;
29
+ return true;
30
+ }
31
+ function ZipMemberStatusResponseFromJSON(json) {
32
+ return ZipMemberStatusResponseFromJSONTyped(json, false);
33
+ }
34
+ function ZipMemberStatusResponseFromJSONTyped(json, ignoreDiscriminator) {
35
+ if (json == null) {
36
+ return json;
37
+ }
38
+ return {
39
+ 'zipPath': json['zip_path'],
40
+ 'documentId': json['document_id'] == null ? undefined : json['document_id'],
41
+ 'documentVersionId': json['document_version_id'] == null ? undefined : json['document_version_id'],
42
+ 'workflowId': json['workflow_id'] == null ? undefined : json['workflow_id'],
43
+ 'error': json['error'] == null ? undefined : json['error'],
44
+ 'skipped': json['skipped'] == null ? undefined : json['skipped'],
45
+ };
46
+ }
47
+ function ZipMemberStatusResponseToJSON(json) {
48
+ return ZipMemberStatusResponseToJSONTyped(json, false);
49
+ }
50
+ function ZipMemberStatusResponseToJSONTyped(value, ignoreDiscriminator = false) {
51
+ if (value == null) {
52
+ return value;
53
+ }
54
+ return {
55
+ 'zip_path': value['zipPath'],
56
+ 'document_id': value['documentId'],
57
+ 'document_version_id': value['documentVersionId'],
58
+ 'workflow_id': value['workflowId'],
59
+ 'error': value['error'],
60
+ 'skipped': value['skipped'],
61
+ };
62
+ }
@@ -223,7 +223,6 @@ export * from './PixelRegion';
223
223
  export * from './Polygon';
224
224
  export * from './PolygonReference';
225
225
  export * from './ProposeMemoryChunkRequest';
226
- export * from './ProposedMemoryChunkResponse';
227
226
  export * from './ReasoningPart';
228
227
  export * from './ReferenceType';
229
228
  export * from './ReorderPathPartRequest';
@@ -361,3 +360,5 @@ export * from './XlsxCellAnchorInputOrDocxParagraphAnchorInput';
361
360
  export * from './XlsxCellAnchorOutput';
362
361
  export * from './XlsxCellAnchorOutputOrDocxParagraphAnchorOutput';
363
362
  export * from './ZipFileResult';
363
+ export * from './ZipIngestionStatusResponse';
364
+ export * from './ZipMemberStatusResponse';
@@ -241,7 +241,6 @@ __exportStar(require("./PixelRegion"), exports);
241
241
  __exportStar(require("./Polygon"), exports);
242
242
  __exportStar(require("./PolygonReference"), exports);
243
243
  __exportStar(require("./ProposeMemoryChunkRequest"), exports);
244
- __exportStar(require("./ProposedMemoryChunkResponse"), exports);
245
244
  __exportStar(require("./ReasoningPart"), exports);
246
245
  __exportStar(require("./ReferenceType"), exports);
247
246
  __exportStar(require("./ReorderPathPartRequest"), exports);
@@ -379,3 +378,5 @@ __exportStar(require("./XlsxCellAnchorInputOrDocxParagraphAnchorInput"), exports
379
378
  __exportStar(require("./XlsxCellAnchorOutput"), exports);
380
379
  __exportStar(require("./XlsxCellAnchorOutputOrDocxParagraphAnchorOutput"), exports);
381
380
  __exportStar(require("./ZipFileResult"), exports);
381
+ __exportStar(require("./ZipIngestionStatusResponse"), exports);
382
+ __exportStar(require("./ZipMemberStatusResponse"), exports);
@@ -27,6 +27,7 @@ Name | Type
27
27
  `quotaPageCount` | number
28
28
  `quotaIdempotencyKey` | string
29
29
  `fileMd5` | string
30
+ `idempotencyKey` | string
30
31
 
31
32
  ## Example
32
33
 
@@ -55,6 +56,7 @@ const example = {
55
56
  "quotaPageCount": null,
56
57
  "quotaIdempotencyKey": null,
57
58
  "fileMd5": null,
59
+ "idempotencyKey": null,
58
60
  } satisfies DocumentVersionMetadata
59
61
 
60
62
  console.log(example)
@@ -322,7 +322,7 @@ example().catch(console.error);
322
322
 
323
323
  ## ingestDocument
324
324
 
325
- > IngestDocumentResponse ingestDocument(file, pathPartId, name, ingestionMode, chunkType, secondaryTaxonomy, pageDpi, workflowRunId, workflowDefinitionId)
325
+ > IngestDocumentResponse ingestDocument(file, pathPartId, name, ingestionMode, chunkType, secondaryTaxonomy, pageDpi, workflowRunId, tagIds, idempotencyKey, workflowDefinitionId)
326
326
 
327
327
  Ingest Document Handler
328
328
 
@@ -364,6 +364,10 @@ async function example() {
364
364
  pageDpi: 56,
365
365
  // string | Workflow run context for assumed agent uploads. (optional)
366
366
  workflowRunId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
367
+ // Array<string> | Tag IDs applied to the created document. (optional)
368
+ tagIds: ...,
369
+ // string | Opt-in key: a repeat with the same key at the same (parent, name) replays the existing document instead of a 409. (optional)
370
+ idempotencyKey: idempotencyKey_example,
367
371
  // string | Workflow definition context for assumed agent uploads. (optional)
368
372
  workflowDefinitionId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
369
373
  } satisfies IngestDocumentRequest;
@@ -393,6 +397,8 @@ example().catch(console.error);
393
397
  | **secondaryTaxonomy** | `ImageTaxonomy` | | [Optional] [Defaults to `undefined`] [Enum: picture, flowchart] |
394
398
  | **pageDpi** | `number` | DPI for PDF page screenshots (default 72, min 36, max 216). | [Optional] [Defaults to `72`] |
395
399
  | **workflowRunId** | `string` | Workflow run context for assumed agent uploads. | [Optional] [Defaults to `undefined`] |
400
+ | **tagIds** | `Array<string>` | Tag IDs applied to the created document. | [Optional] |
401
+ | **idempotencyKey** | `string` | Opt-in key: a repeat with the same key at the same (parent, name) replays the existing document instead of a 409. | [Optional] [Defaults to `undefined`] |
396
402
  | **workflowDefinitionId** | `string` | Workflow definition context for assumed agent uploads. | [Optional] [Defaults to `undefined`] |
397
403
 
398
404
  ### Return type
@@ -517,11 +523,11 @@ example().catch(console.error);
517
523
 
518
524
  ## ingestZip
519
525
 
520
- > IngestZipResponse ingestZip(file, pathPartId, ingestionMode)
526
+ > IngestZipResponse ingestZip(file, pathPartId, ingestionMode, tagIds)
521
527
 
522
528
  Ingest Zip Handler
523
529
 
524
- Upload a ZIP archive and ingest each member file individually. Directory structure inside the ZIP is preserved as FOLDER PathParts under the target folder. Returns 202 with per-file outcomes each file that ingests successfully has its own Temporal workflow ID to poll for status. Whole-archive failures (not a ZIP, zip-bomb, &gt;500 files) return 400 before any DB writes. Per-file failures (unsupported type, oversized) are included in the response with &#x60;&#x60;error&#x60;&#x60; set; other files continue processing.
530
+ Upload a ZIP archive; ingest each member asynchronously via a fan-out. The whole archive nests under a single FOLDER named after the ZIP file (&#x60;&#x60;report.zip&#x60;&#x60; -&gt; &#x60;&#x60;report/&#x60;&#x60;), with the ZIP\&#39;s directory structure mirrored beneath it as FOLDER PathParts all created synchronously. Returns 202 with the fan-out &#x60;&#x60;workflow_id&#x60;&#x60; (poll &#x60;&#x60;GET /v1/system-jobs/zip-ingestions/{workflow_id}&#x60;&#x60; for per-member outcomes) plus the artifacts &#x60;&#x60;skipped&#x60;&#x60; during classification. Whole-archive failures (not a ZIP, zip-bomb, &gt;500 files) return 400 before any DB writes; a re-upload whose ZIP-named folder already exists returns 409. Per-member failures (unsupported type, oversized) surface in the polled workflow results, not in this response. Each member reuses the single-file ingest path, so run-enrollment and completion events fire per member there.
525
531
 
526
532
  ### Example
527
533
 
@@ -549,6 +555,8 @@ async function example() {
549
555
  pathPartId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
550
556
  // IngestionMode (optional)
551
557
  ingestionMode: ...,
558
+ // Array<string> | Tag IDs applied to every ingested member document. (optional)
559
+ tagIds: ...,
552
560
  } satisfies IngestZipRequest;
553
561
 
554
562
  try {
@@ -571,6 +579,7 @@ example().catch(console.error);
571
579
  | **file** | `Blob` | | [Defaults to `undefined`] |
572
580
  | **pathPartId** | `string` | Parent path part ID (must be a FOLDER type) | [Defaults to `undefined`] |
573
581
  | **ingestionMode** | `IngestionMode` | | [Optional] [Defaults to `undefined`] [Enum: high_accuracy, standard, single_chunk] |
582
+ | **tagIds** | `Array<string>` | Tag IDs applied to every ingested member document. | [Optional] |
574
583
 
575
584
  ### Return type
576
585
 
@@ -1,17 +1,14 @@
1
1
 
2
2
  # IngestZipResponse
3
3
 
4
- Aggregate response from a ZIP ingestion batch.
4
+ Response from dispatching a ZIP archive to async ingestion. ``workflow_id`` is the fan-out workflow to poll at ``GET /v1/system-jobs/zip-ingestions/{workflow_id}`` for per-member outcomes; it is None when the archive held no ingestible members. ``skipped`` are the artifact/error entries resolved synchronously during classification.
5
5
 
6
6
  ## Properties
7
7
 
8
8
  Name | Type
9
9
  ------------ | -------------
10
- `files` | [Array&lt;ZipFileResult&gt;](ZipFileResult.md)
11
- `totalFound` | number
12
- `succeeded` | number
13
- `skipped` | number
14
- `failed` | number
10
+ `workflowId` | string
11
+ `skipped` | [Array&lt;ZipFileResult&gt;](ZipFileResult.md)
15
12
 
16
13
  ## Example
17
14
 
@@ -20,11 +17,8 @@ import type { IngestZipResponse } from '@knowledge-stack/ksapi'
20
17
 
21
18
  // TODO: Update the object below with actual values
22
19
  const example = {
23
- "files": null,
24
- "totalFound": null,
25
- "succeeded": null,
20
+ "workflowId": null,
26
21
  "skipped": null,
27
- "failed": null,
28
22
  } satisfies IngestZipResponse
29
23
 
30
24
  console.log(example)
package/docs/MemoryApi.md CHANGED
@@ -239,7 +239,7 @@ example().catch(console.error);
239
239
 
240
240
  ## proposeMemoryChunk
241
241
 
242
- > ProposedMemoryChunkResponse proposeMemoryChunk(proposeMemoryChunkRequest)
242
+ > PendingMemoryChunkResponse proposeMemoryChunk(proposeMemoryChunkRequest)
243
243
 
244
244
  Propose Memory Chunk Handler
245
245
 
@@ -288,7 +288,7 @@ example().catch(console.error);
288
288
 
289
289
  ### Return type
290
290
 
291
- [**ProposedMemoryChunkResponse**](ProposedMemoryChunkResponse.md)
291
+ [**PendingMemoryChunkResponse**](PendingMemoryChunkResponse.md)
292
292
 
293
293
  ### Authorization
294
294