@knowledge-stack/ksapi 3.16.1 → 3.17.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 (114) hide show
  1. package/.openapi-generator/FILES +26 -4
  2. package/README.md +23 -4
  3. package/dist/apis/MemoryApi.d.ts +5 -5
  4. package/dist/apis/MemoryApi.js +1 -1
  5. package/dist/apis/WorkflowMemoryApi.d.ts +17 -17
  6. package/dist/apis/WorkflowMemoryApi.js +4 -4
  7. package/dist/apis/WorkflowRepositoryApi.d.ts +419 -0
  8. package/dist/apis/WorkflowRepositoryApi.js +595 -0
  9. package/dist/apis/index.d.ts +1 -0
  10. package/dist/apis/index.js +1 -0
  11. package/dist/esm/apis/MemoryApi.d.ts +5 -5
  12. package/dist/esm/apis/MemoryApi.js +2 -2
  13. package/dist/esm/apis/WorkflowMemoryApi.d.ts +17 -17
  14. package/dist/esm/apis/WorkflowMemoryApi.js +5 -5
  15. package/dist/esm/apis/WorkflowRepositoryApi.d.ts +419 -0
  16. package/dist/esm/apis/WorkflowRepositoryApi.js +558 -0
  17. package/dist/esm/apis/index.d.ts +1 -0
  18. package/dist/esm/apis/index.js +1 -0
  19. package/dist/esm/models/ErrorResponse.d.ts +7 -0
  20. package/dist/esm/models/ErrorResponse.js +7 -0
  21. package/dist/esm/models/{MemoryChunkResponse.d.ts → MemoryEntryResponse.d.ts} +12 -12
  22. package/dist/esm/models/{MemoryChunkResponse.js → MemoryEntryResponse.js} +9 -9
  23. package/dist/esm/models/{PaginatedResponseMemoryChunkResponse.d.ts → PaginatedResponseMemoryEntryResponse.d.ts} +16 -16
  24. package/dist/esm/models/{PaginatedResponseMemoryChunkResponse.js → PaginatedResponseMemoryEntryResponse.js} +12 -12
  25. package/dist/esm/models/PaginatedResponseRepoVersionResponse.d.ts +66 -0
  26. package/dist/esm/models/PaginatedResponseRepoVersionResponse.js +70 -0
  27. package/dist/esm/models/RecordRepoSaveSkipRequest.d.ts +60 -0
  28. package/dist/esm/models/RecordRepoSaveSkipRequest.js +55 -0
  29. package/dist/esm/models/RepoBranchResponse.d.ts +126 -0
  30. package/dist/esm/models/RepoBranchResponse.js +95 -0
  31. package/dist/esm/models/RepoCommitSummary.d.ts +71 -0
  32. package/dist/esm/models/RepoCommitSummary.js +60 -0
  33. package/dist/esm/models/RepoSaveSkipReason.d.ts +36 -0
  34. package/dist/esm/models/RepoSaveSkipReason.js +54 -0
  35. package/dist/esm/models/RepoSnapshot.d.ts +59 -0
  36. package/dist/esm/models/RepoSnapshot.js +50 -0
  37. package/dist/esm/models/RepoTreeEntry.d.ts +59 -0
  38. package/dist/esm/models/RepoTreeEntry.js +52 -0
  39. package/dist/esm/models/RepoTreeResponse.d.ts +54 -0
  40. package/dist/esm/models/RepoTreeResponse.js +49 -0
  41. package/dist/esm/models/RepoVersionResponse.d.ts +95 -0
  42. package/dist/esm/models/RepoVersionResponse.js +74 -0
  43. package/dist/esm/models/WorkflowRepoResponse.d.ts +102 -0
  44. package/dist/esm/models/WorkflowRepoResponse.js +81 -0
  45. package/dist/esm/models/WorkflowRunSnapshot.d.ts +7 -0
  46. package/dist/esm/models/WorkflowRunSnapshot.js +3 -0
  47. package/dist/esm/models/index.d.ts +12 -2
  48. package/dist/esm/models/index.js +12 -2
  49. package/dist/models/ErrorResponse.d.ts +7 -0
  50. package/dist/models/ErrorResponse.js +7 -0
  51. package/dist/models/{MemoryChunkResponse.d.ts → MemoryEntryResponse.d.ts} +12 -12
  52. package/dist/models/{MemoryChunkResponse.js → MemoryEntryResponse.js} +15 -15
  53. package/dist/models/{PaginatedResponseMemoryChunkResponse.d.ts → PaginatedResponseMemoryEntryResponse.d.ts} +16 -16
  54. package/dist/models/{PaginatedResponseMemoryChunkResponse.js → PaginatedResponseMemoryEntryResponse.js} +18 -18
  55. package/dist/models/PaginatedResponseRepoVersionResponse.d.ts +66 -0
  56. package/dist/models/PaginatedResponseRepoVersionResponse.js +78 -0
  57. package/dist/models/RecordRepoSaveSkipRequest.d.ts +60 -0
  58. package/dist/models/RecordRepoSaveSkipRequest.js +63 -0
  59. package/dist/models/RepoBranchResponse.d.ts +126 -0
  60. package/dist/models/RepoBranchResponse.js +103 -0
  61. package/dist/models/RepoCommitSummary.d.ts +71 -0
  62. package/dist/models/RepoCommitSummary.js +68 -0
  63. package/dist/models/RepoSaveSkipReason.d.ts +36 -0
  64. package/dist/models/RepoSaveSkipReason.js +62 -0
  65. package/dist/models/RepoSnapshot.d.ts +59 -0
  66. package/dist/models/RepoSnapshot.js +58 -0
  67. package/dist/models/RepoTreeEntry.d.ts +59 -0
  68. package/dist/models/RepoTreeEntry.js +60 -0
  69. package/dist/models/RepoTreeResponse.d.ts +54 -0
  70. package/dist/models/RepoTreeResponse.js +57 -0
  71. package/dist/models/RepoVersionResponse.d.ts +95 -0
  72. package/dist/models/RepoVersionResponse.js +82 -0
  73. package/dist/models/WorkflowRepoResponse.d.ts +102 -0
  74. package/dist/models/WorkflowRepoResponse.js +89 -0
  75. package/dist/models/WorkflowRunSnapshot.d.ts +7 -0
  76. package/dist/models/WorkflowRunSnapshot.js +3 -0
  77. package/dist/models/index.d.ts +12 -2
  78. package/dist/models/index.js +12 -2
  79. package/docs/MemoryApi.md +2 -2
  80. package/docs/{MemoryChunkResponse.md → MemoryEntryResponse.md} +4 -4
  81. package/docs/{PaginatedResponseMemoryChunkResponse.md → PaginatedResponseMemoryEntryResponse.md} +5 -5
  82. package/docs/PaginatedResponseRepoVersionResponse.md +40 -0
  83. package/docs/RecordRepoSaveSkipRequest.md +38 -0
  84. package/docs/RepoBranchResponse.md +61 -0
  85. package/docs/RepoCommitSummary.md +42 -0
  86. package/docs/RepoSaveSkipReason.md +33 -0
  87. package/docs/RepoSnapshot.md +39 -0
  88. package/docs/RepoTreeEntry.md +38 -0
  89. package/docs/RepoTreeResponse.md +36 -0
  90. package/docs/RepoVersionResponse.md +51 -0
  91. package/docs/WorkflowMemoryApi.md +8 -8
  92. package/docs/WorkflowRepoResponse.md +53 -0
  93. package/docs/WorkflowRepositoryApi.md +745 -0
  94. package/docs/WorkflowRunSnapshot.md +2 -0
  95. package/package.json +1 -1
  96. package/src/apis/MemoryApi.ts +8 -8
  97. package/src/apis/WorkflowMemoryApi.ts +26 -26
  98. package/src/apis/WorkflowRepositoryApi.ts +1002 -0
  99. package/src/apis/index.ts +1 -0
  100. package/src/models/ErrorResponse.ts +7 -0
  101. package/src/models/{MemoryChunkResponse.ts → MemoryEntryResponse.ts} +14 -14
  102. package/src/models/{PaginatedResponseMemoryChunkResponse.ts → PaginatedResponseMemoryEntryResponse.ts} +25 -25
  103. package/src/models/PaginatedResponseRepoVersionResponse.ts +130 -0
  104. package/src/models/RecordRepoSaveSkipRequest.ts +113 -0
  105. package/src/models/RepoBranchResponse.ts +207 -0
  106. package/src/models/RepoCommitSummary.ts +119 -0
  107. package/src/models/RepoSaveSkipReason.ts +64 -0
  108. package/src/models/RepoSnapshot.ts +100 -0
  109. package/src/models/RepoTreeEntry.ts +101 -0
  110. package/src/models/RepoTreeResponse.ts +100 -0
  111. package/src/models/RepoVersionResponse.ts +154 -0
  112. package/src/models/WorkflowRepoResponse.ts +172 -0
  113. package/src/models/WorkflowRunSnapshot.ts +15 -0
  114. package/src/models/index.ts +12 -2
@@ -12,11 +12,11 @@
12
12
  * Do not edit the class manually.
13
13
  */
14
14
  import { MemoryKindFromJSON, MemoryKindToJSON, } from './MemoryKind';
15
- export const MemoryChunkResponsePropertyValidationAttributesMap = {};
15
+ export const MemoryEntryResponsePropertyValidationAttributesMap = {};
16
16
  /**
17
- * Check if a given object implements the MemoryChunkResponse interface.
17
+ * Check if a given object implements the MemoryEntryResponse interface.
18
18
  */
19
- export function instanceOfMemoryChunkResponse(value) {
19
+ export function instanceOfMemoryEntryResponse(value) {
20
20
  if (!('chunkId' in value) || value['chunkId'] === undefined)
21
21
  return false;
22
22
  if (!('kind' in value) || value['kind'] === undefined)
@@ -25,10 +25,10 @@ export function instanceOfMemoryChunkResponse(value) {
25
25
  return false;
26
26
  return true;
27
27
  }
28
- export function MemoryChunkResponseFromJSON(json) {
29
- return MemoryChunkResponseFromJSONTyped(json, false);
28
+ export function MemoryEntryResponseFromJSON(json) {
29
+ return MemoryEntryResponseFromJSONTyped(json, false);
30
30
  }
31
- export function MemoryChunkResponseFromJSONTyped(json, ignoreDiscriminator) {
31
+ export function MemoryEntryResponseFromJSONTyped(json, ignoreDiscriminator) {
32
32
  if (json == null) {
33
33
  return json;
34
34
  }
@@ -38,10 +38,10 @@ export function MemoryChunkResponseFromJSONTyped(json, ignoreDiscriminator) {
38
38
  'body': json['body'],
39
39
  };
40
40
  }
41
- export function MemoryChunkResponseToJSON(json) {
42
- return MemoryChunkResponseToJSONTyped(json, false);
41
+ export function MemoryEntryResponseToJSON(json) {
42
+ return MemoryEntryResponseToJSONTyped(json, false);
43
43
  }
44
- export function MemoryChunkResponseToJSONTyped(value, ignoreDiscriminator = false) {
44
+ export function MemoryEntryResponseToJSONTyped(value, ignoreDiscriminator = false) {
45
45
  if (value == null) {
46
46
  return value;
47
47
  }
@@ -9,39 +9,39 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
- import type { MemoryChunkResponse } from './MemoryChunkResponse';
12
+ import type { MemoryEntryResponse } from './MemoryEntryResponse';
13
13
  /**
14
14
  *
15
15
  * @export
16
- * @interface PaginatedResponseMemoryChunkResponse
16
+ * @interface PaginatedResponseMemoryEntryResponse
17
17
  */
18
- export interface PaginatedResponseMemoryChunkResponse {
18
+ export interface PaginatedResponseMemoryEntryResponse {
19
19
  /**
20
20
  * List of items
21
- * @type {Array<MemoryChunkResponse>}
22
- * @memberof PaginatedResponseMemoryChunkResponse
21
+ * @type {Array<MemoryEntryResponse>}
22
+ * @memberof PaginatedResponseMemoryEntryResponse
23
23
  */
24
- items: Array<MemoryChunkResponse>;
24
+ items: Array<MemoryEntryResponse>;
25
25
  /**
26
26
  * Total number of items
27
27
  * @type {number}
28
- * @memberof PaginatedResponseMemoryChunkResponse
28
+ * @memberof PaginatedResponseMemoryEntryResponse
29
29
  */
30
30
  total: number;
31
31
  /**
32
32
  * Number of items per page
33
33
  * @type {number}
34
- * @memberof PaginatedResponseMemoryChunkResponse
34
+ * @memberof PaginatedResponseMemoryEntryResponse
35
35
  */
36
36
  limit: number;
37
37
  /**
38
38
  * Number of items to skip
39
39
  * @type {number}
40
- * @memberof PaginatedResponseMemoryChunkResponse
40
+ * @memberof PaginatedResponseMemoryEntryResponse
41
41
  */
42
42
  offset: number;
43
43
  }
44
- export declare const PaginatedResponseMemoryChunkResponsePropertyValidationAttributesMap: {
44
+ export declare const PaginatedResponseMemoryEntryResponsePropertyValidationAttributesMap: {
45
45
  [property: string]: {
46
46
  maxLength?: number;
47
47
  minLength?: number;
@@ -57,10 +57,10 @@ export declare const PaginatedResponseMemoryChunkResponsePropertyValidationAttri
57
57
  };
58
58
  };
59
59
  /**
60
- * Check if a given object implements the PaginatedResponseMemoryChunkResponse interface.
60
+ * Check if a given object implements the PaginatedResponseMemoryEntryResponse interface.
61
61
  */
62
- export declare function instanceOfPaginatedResponseMemoryChunkResponse(value: object): value is PaginatedResponseMemoryChunkResponse;
63
- export declare function PaginatedResponseMemoryChunkResponseFromJSON(json: any): PaginatedResponseMemoryChunkResponse;
64
- export declare function PaginatedResponseMemoryChunkResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaginatedResponseMemoryChunkResponse;
65
- export declare function PaginatedResponseMemoryChunkResponseToJSON(json: any): PaginatedResponseMemoryChunkResponse;
66
- export declare function PaginatedResponseMemoryChunkResponseToJSONTyped(value?: PaginatedResponseMemoryChunkResponse | null, ignoreDiscriminator?: boolean): any;
62
+ export declare function instanceOfPaginatedResponseMemoryEntryResponse(value: object): value is PaginatedResponseMemoryEntryResponse;
63
+ export declare function PaginatedResponseMemoryEntryResponseFromJSON(json: any): PaginatedResponseMemoryEntryResponse;
64
+ export declare function PaginatedResponseMemoryEntryResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaginatedResponseMemoryEntryResponse;
65
+ export declare function PaginatedResponseMemoryEntryResponseToJSON(json: any): PaginatedResponseMemoryEntryResponse;
66
+ export declare function PaginatedResponseMemoryEntryResponseToJSONTyped(value?: PaginatedResponseMemoryEntryResponse | null, ignoreDiscriminator?: boolean): any;
@@ -11,8 +11,8 @@
11
11
  * https://openapi-generator.tech
12
12
  * Do not edit the class manually.
13
13
  */
14
- import { MemoryChunkResponseFromJSON, MemoryChunkResponseToJSON, } from './MemoryChunkResponse';
15
- export const PaginatedResponseMemoryChunkResponsePropertyValidationAttributesMap = {
14
+ import { MemoryEntryResponseFromJSON, MemoryEntryResponseToJSON, } from './MemoryEntryResponse';
15
+ export const PaginatedResponseMemoryEntryResponsePropertyValidationAttributesMap = {
16
16
  total: {
17
17
  minimum: 0,
18
18
  exclusiveMinimum: false,
@@ -27,9 +27,9 @@ export const PaginatedResponseMemoryChunkResponsePropertyValidationAttributesMap
27
27
  },
28
28
  };
29
29
  /**
30
- * Check if a given object implements the PaginatedResponseMemoryChunkResponse interface.
30
+ * Check if a given object implements the PaginatedResponseMemoryEntryResponse interface.
31
31
  */
32
- export function instanceOfPaginatedResponseMemoryChunkResponse(value) {
32
+ export function instanceOfPaginatedResponseMemoryEntryResponse(value) {
33
33
  if (!('items' in value) || value['items'] === undefined)
34
34
  return false;
35
35
  if (!('total' in value) || value['total'] === undefined)
@@ -40,29 +40,29 @@ export function instanceOfPaginatedResponseMemoryChunkResponse(value) {
40
40
  return false;
41
41
  return true;
42
42
  }
43
- export function PaginatedResponseMemoryChunkResponseFromJSON(json) {
44
- return PaginatedResponseMemoryChunkResponseFromJSONTyped(json, false);
43
+ export function PaginatedResponseMemoryEntryResponseFromJSON(json) {
44
+ return PaginatedResponseMemoryEntryResponseFromJSONTyped(json, false);
45
45
  }
46
- export function PaginatedResponseMemoryChunkResponseFromJSONTyped(json, ignoreDiscriminator) {
46
+ export function PaginatedResponseMemoryEntryResponseFromJSONTyped(json, ignoreDiscriminator) {
47
47
  if (json == null) {
48
48
  return json;
49
49
  }
50
50
  return {
51
- 'items': (json['items'].map(MemoryChunkResponseFromJSON)),
51
+ 'items': (json['items'].map(MemoryEntryResponseFromJSON)),
52
52
  'total': json['total'],
53
53
  'limit': json['limit'],
54
54
  'offset': json['offset'],
55
55
  };
56
56
  }
57
- export function PaginatedResponseMemoryChunkResponseToJSON(json) {
58
- return PaginatedResponseMemoryChunkResponseToJSONTyped(json, false);
57
+ export function PaginatedResponseMemoryEntryResponseToJSON(json) {
58
+ return PaginatedResponseMemoryEntryResponseToJSONTyped(json, false);
59
59
  }
60
- export function PaginatedResponseMemoryChunkResponseToJSONTyped(value, ignoreDiscriminator = false) {
60
+ export function PaginatedResponseMemoryEntryResponseToJSONTyped(value, ignoreDiscriminator = false) {
61
61
  if (value == null) {
62
62
  return value;
63
63
  }
64
64
  return {
65
- 'items': (value['items'].map(MemoryChunkResponseToJSON)),
65
+ 'items': (value['items'].map(MemoryEntryResponseToJSON)),
66
66
  'total': value['total'],
67
67
  'limit': value['limit'],
68
68
  'offset': value['offset'],
@@ -0,0 +1,66 @@
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 { RepoVersionResponse } from './RepoVersionResponse';
13
+ /**
14
+ *
15
+ * @export
16
+ * @interface PaginatedResponseRepoVersionResponse
17
+ */
18
+ export interface PaginatedResponseRepoVersionResponse {
19
+ /**
20
+ * List of items
21
+ * @type {Array<RepoVersionResponse>}
22
+ * @memberof PaginatedResponseRepoVersionResponse
23
+ */
24
+ items: Array<RepoVersionResponse>;
25
+ /**
26
+ * Total number of items
27
+ * @type {number}
28
+ * @memberof PaginatedResponseRepoVersionResponse
29
+ */
30
+ total: number;
31
+ /**
32
+ * Number of items per page
33
+ * @type {number}
34
+ * @memberof PaginatedResponseRepoVersionResponse
35
+ */
36
+ limit: number;
37
+ /**
38
+ * Number of items to skip
39
+ * @type {number}
40
+ * @memberof PaginatedResponseRepoVersionResponse
41
+ */
42
+ offset: number;
43
+ }
44
+ export declare const PaginatedResponseRepoVersionResponsePropertyValidationAttributesMap: {
45
+ [property: string]: {
46
+ maxLength?: number;
47
+ minLength?: number;
48
+ pattern?: string;
49
+ maximum?: number;
50
+ exclusiveMaximum?: boolean;
51
+ minimum?: number;
52
+ exclusiveMinimum?: boolean;
53
+ multipleOf?: number;
54
+ maxItems?: number;
55
+ minItems?: number;
56
+ uniqueItems?: boolean;
57
+ };
58
+ };
59
+ /**
60
+ * Check if a given object implements the PaginatedResponseRepoVersionResponse interface.
61
+ */
62
+ export declare function instanceOfPaginatedResponseRepoVersionResponse(value: object): value is PaginatedResponseRepoVersionResponse;
63
+ export declare function PaginatedResponseRepoVersionResponseFromJSON(json: any): PaginatedResponseRepoVersionResponse;
64
+ export declare function PaginatedResponseRepoVersionResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaginatedResponseRepoVersionResponse;
65
+ export declare function PaginatedResponseRepoVersionResponseToJSON(json: any): PaginatedResponseRepoVersionResponse;
66
+ export declare function PaginatedResponseRepoVersionResponseToJSONTyped(value?: PaginatedResponseRepoVersionResponse | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,70 @@
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 { RepoVersionResponseFromJSON, RepoVersionResponseToJSON, } from './RepoVersionResponse';
15
+ export const PaginatedResponseRepoVersionResponsePropertyValidationAttributesMap = {
16
+ total: {
17
+ minimum: 0,
18
+ exclusiveMinimum: false,
19
+ },
20
+ limit: {
21
+ minimum: 1,
22
+ exclusiveMinimum: false,
23
+ },
24
+ offset: {
25
+ minimum: 0,
26
+ exclusiveMinimum: false,
27
+ },
28
+ };
29
+ /**
30
+ * Check if a given object implements the PaginatedResponseRepoVersionResponse interface.
31
+ */
32
+ export function instanceOfPaginatedResponseRepoVersionResponse(value) {
33
+ if (!('items' in value) || value['items'] === undefined)
34
+ return false;
35
+ if (!('total' in value) || value['total'] === undefined)
36
+ return false;
37
+ if (!('limit' in value) || value['limit'] === undefined)
38
+ return false;
39
+ if (!('offset' in value) || value['offset'] === undefined)
40
+ return false;
41
+ return true;
42
+ }
43
+ export function PaginatedResponseRepoVersionResponseFromJSON(json) {
44
+ return PaginatedResponseRepoVersionResponseFromJSONTyped(json, false);
45
+ }
46
+ export function PaginatedResponseRepoVersionResponseFromJSONTyped(json, ignoreDiscriminator) {
47
+ if (json == null) {
48
+ return json;
49
+ }
50
+ return {
51
+ 'items': (json['items'].map(RepoVersionResponseFromJSON)),
52
+ 'total': json['total'],
53
+ 'limit': json['limit'],
54
+ 'offset': json['offset'],
55
+ };
56
+ }
57
+ export function PaginatedResponseRepoVersionResponseToJSON(json) {
58
+ return PaginatedResponseRepoVersionResponseToJSONTyped(json, false);
59
+ }
60
+ export function PaginatedResponseRepoVersionResponseToJSONTyped(value, ignoreDiscriminator = false) {
61
+ if (value == null) {
62
+ return value;
63
+ }
64
+ return {
65
+ 'items': (value['items'].map(RepoVersionResponseToJSON)),
66
+ 'total': value['total'],
67
+ 'limit': value['limit'],
68
+ 'offset': value['offset'],
69
+ };
70
+ }
@@ -0,0 +1,60 @@
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 { RepoSaveSkipReason } from './RepoSaveSkipReason';
13
+ /**
14
+ *
15
+ * @export
16
+ * @interface RecordRepoSaveSkipRequest
17
+ */
18
+ export interface RecordRepoSaveSkipRequest {
19
+ /**
20
+ * The run whose turn produced the changes.
21
+ * @type {string}
22
+ * @memberof RecordRepoSaveSkipRequest
23
+ */
24
+ runId: string;
25
+ /**
26
+ *
27
+ * @type {RepoSaveSkipReason}
28
+ * @memberof RecordRepoSaveSkipRequest
29
+ */
30
+ reason: RepoSaveSkipReason;
31
+ /**
32
+ * A machine-readable code adding context, e.g. the refusal code (`repo_too_large`) or `commits_not_on_main`; never free text.
33
+ * @type {string}
34
+ * @memberof RecordRepoSaveSkipRequest
35
+ */
36
+ detail?: string | null;
37
+ }
38
+ export declare const RecordRepoSaveSkipRequestPropertyValidationAttributesMap: {
39
+ [property: string]: {
40
+ maxLength?: number;
41
+ minLength?: number;
42
+ pattern?: string;
43
+ maximum?: number;
44
+ exclusiveMaximum?: boolean;
45
+ minimum?: number;
46
+ exclusiveMinimum?: boolean;
47
+ multipleOf?: number;
48
+ maxItems?: number;
49
+ minItems?: number;
50
+ uniqueItems?: boolean;
51
+ };
52
+ };
53
+ /**
54
+ * Check if a given object implements the RecordRepoSaveSkipRequest interface.
55
+ */
56
+ export declare function instanceOfRecordRepoSaveSkipRequest(value: object): value is RecordRepoSaveSkipRequest;
57
+ export declare function RecordRepoSaveSkipRequestFromJSON(json: any): RecordRepoSaveSkipRequest;
58
+ export declare function RecordRepoSaveSkipRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): RecordRepoSaveSkipRequest;
59
+ export declare function RecordRepoSaveSkipRequestToJSON(json: any): RecordRepoSaveSkipRequest;
60
+ export declare function RecordRepoSaveSkipRequestToJSONTyped(value?: RecordRepoSaveSkipRequest | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,55 @@
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 { RepoSaveSkipReasonFromJSON, RepoSaveSkipReasonToJSON, } from './RepoSaveSkipReason';
15
+ export const RecordRepoSaveSkipRequestPropertyValidationAttributesMap = {
16
+ detail: {
17
+ pattern: '/^[a-z0-9_]{1,64}$/',
18
+ },
19
+ };
20
+ /**
21
+ * Check if a given object implements the RecordRepoSaveSkipRequest interface.
22
+ */
23
+ export function instanceOfRecordRepoSaveSkipRequest(value) {
24
+ if (!('runId' in value) || value['runId'] === undefined)
25
+ return false;
26
+ if (!('reason' in value) || value['reason'] === undefined)
27
+ return false;
28
+ return true;
29
+ }
30
+ export function RecordRepoSaveSkipRequestFromJSON(json) {
31
+ return RecordRepoSaveSkipRequestFromJSONTyped(json, false);
32
+ }
33
+ export function RecordRepoSaveSkipRequestFromJSONTyped(json, ignoreDiscriminator) {
34
+ if (json == null) {
35
+ return json;
36
+ }
37
+ return {
38
+ 'runId': json['run_id'],
39
+ 'reason': RepoSaveSkipReasonFromJSON(json['reason']),
40
+ 'detail': json['detail'] == null ? undefined : json['detail'],
41
+ };
42
+ }
43
+ export function RecordRepoSaveSkipRequestToJSON(json) {
44
+ return RecordRepoSaveSkipRequestToJSONTyped(json, false);
45
+ }
46
+ export function RecordRepoSaveSkipRequestToJSONTyped(value, ignoreDiscriminator = false) {
47
+ if (value == null) {
48
+ return value;
49
+ }
50
+ return {
51
+ 'run_id': value['runId'],
52
+ 'reason': RepoSaveSkipReasonToJSON(value['reason']),
53
+ 'detail': value['detail'],
54
+ };
55
+ }
@@ -0,0 +1,126 @@
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 { RepoTreeEntry } from './RepoTreeEntry';
13
+ /**
14
+ * A retained run branch, independently of whether it reached main.
15
+ * @export
16
+ * @interface RepoBranchResponse
17
+ */
18
+ export interface RepoBranchResponse {
19
+ /**
20
+ *
21
+ * @type {string}
22
+ * @memberof RepoBranchResponse
23
+ */
24
+ versionId: string;
25
+ /**
26
+ *
27
+ * @type {string}
28
+ * @memberof RepoBranchResponse
29
+ */
30
+ headSha: string;
31
+ /**
32
+ *
33
+ * @type {string}
34
+ * @memberof RepoBranchResponse
35
+ */
36
+ previousHeadSha: string | null;
37
+ /**
38
+ *
39
+ * @type {number}
40
+ * @memberof RepoBranchResponse
41
+ */
42
+ commitsAdded: number;
43
+ /**
44
+ *
45
+ * @type {string}
46
+ * @memberof RepoBranchResponse
47
+ */
48
+ runId: string | null;
49
+ /**
50
+ *
51
+ * @type {string}
52
+ * @memberof RepoBranchResponse
53
+ */
54
+ savedByUserId: string;
55
+ /**
56
+ *
57
+ * @type {Date}
58
+ * @memberof RepoBranchResponse
59
+ */
60
+ savedAt: Date;
61
+ /**
62
+ *
63
+ * @type {string}
64
+ * @memberof RepoBranchResponse
65
+ */
66
+ instructionVersionId: string | null;
67
+ /**
68
+ * Retained run-branch version this publication integrated.
69
+ * @type {string}
70
+ * @memberof RepoBranchResponse
71
+ */
72
+ candidateVersionId?: string | null;
73
+ /**
74
+ *
75
+ * @type {string}
76
+ * @memberof RepoBranchResponse
77
+ */
78
+ branch: string;
79
+ /**
80
+ *
81
+ * @type {string}
82
+ * @memberof RepoBranchResponse
83
+ */
84
+ baseVersionId: string | null;
85
+ /**
86
+ *
87
+ * @type {string}
88
+ * @memberof RepoBranchResponse
89
+ */
90
+ integratedVersionId: string | null;
91
+ /**
92
+ *
93
+ * @type {string}
94
+ * @memberof RepoBranchResponse
95
+ */
96
+ integratedHeadSha: string | null;
97
+ /**
98
+ *
99
+ * @type {Array<RepoTreeEntry>}
100
+ * @memberof RepoBranchResponse
101
+ */
102
+ files: Array<RepoTreeEntry>;
103
+ }
104
+ export declare const RepoBranchResponsePropertyValidationAttributesMap: {
105
+ [property: string]: {
106
+ maxLength?: number;
107
+ minLength?: number;
108
+ pattern?: string;
109
+ maximum?: number;
110
+ exclusiveMaximum?: boolean;
111
+ minimum?: number;
112
+ exclusiveMinimum?: boolean;
113
+ multipleOf?: number;
114
+ maxItems?: number;
115
+ minItems?: number;
116
+ uniqueItems?: boolean;
117
+ };
118
+ };
119
+ /**
120
+ * Check if a given object implements the RepoBranchResponse interface.
121
+ */
122
+ export declare function instanceOfRepoBranchResponse(value: object): value is RepoBranchResponse;
123
+ export declare function RepoBranchResponseFromJSON(json: any): RepoBranchResponse;
124
+ export declare function RepoBranchResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): RepoBranchResponse;
125
+ export declare function RepoBranchResponseToJSON(json: any): RepoBranchResponse;
126
+ export declare function RepoBranchResponseToJSONTyped(value?: RepoBranchResponse | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,95 @@
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 { RepoTreeEntryFromJSON, RepoTreeEntryToJSON, } from './RepoTreeEntry';
15
+ export const RepoBranchResponsePropertyValidationAttributesMap = {};
16
+ /**
17
+ * Check if a given object implements the RepoBranchResponse interface.
18
+ */
19
+ export function instanceOfRepoBranchResponse(value) {
20
+ if (!('versionId' in value) || value['versionId'] === undefined)
21
+ return false;
22
+ if (!('headSha' in value) || value['headSha'] === undefined)
23
+ return false;
24
+ if (!('previousHeadSha' in value) || value['previousHeadSha'] === undefined)
25
+ return false;
26
+ if (!('commitsAdded' in value) || value['commitsAdded'] === undefined)
27
+ return false;
28
+ if (!('runId' in value) || value['runId'] === undefined)
29
+ return false;
30
+ if (!('savedByUserId' in value) || value['savedByUserId'] === undefined)
31
+ return false;
32
+ if (!('savedAt' in value) || value['savedAt'] === undefined)
33
+ return false;
34
+ if (!('instructionVersionId' in value) || value['instructionVersionId'] === undefined)
35
+ return false;
36
+ if (!('branch' in value) || value['branch'] === undefined)
37
+ return false;
38
+ if (!('baseVersionId' in value) || value['baseVersionId'] === undefined)
39
+ return false;
40
+ if (!('integratedVersionId' in value) || value['integratedVersionId'] === undefined)
41
+ return false;
42
+ if (!('integratedHeadSha' in value) || value['integratedHeadSha'] === undefined)
43
+ return false;
44
+ if (!('files' in value) || value['files'] === undefined)
45
+ return false;
46
+ return true;
47
+ }
48
+ export function RepoBranchResponseFromJSON(json) {
49
+ return RepoBranchResponseFromJSONTyped(json, false);
50
+ }
51
+ export function RepoBranchResponseFromJSONTyped(json, ignoreDiscriminator) {
52
+ if (json == null) {
53
+ return json;
54
+ }
55
+ return {
56
+ 'versionId': json['version_id'],
57
+ 'headSha': json['head_sha'],
58
+ 'previousHeadSha': json['previous_head_sha'],
59
+ 'commitsAdded': json['commits_added'],
60
+ 'runId': json['run_id'],
61
+ 'savedByUserId': json['saved_by_user_id'],
62
+ 'savedAt': (new Date(json['saved_at'])),
63
+ 'instructionVersionId': json['instruction_version_id'],
64
+ 'candidateVersionId': json['candidate_version_id'] == null ? undefined : json['candidate_version_id'],
65
+ 'branch': json['branch'],
66
+ 'baseVersionId': json['base_version_id'],
67
+ 'integratedVersionId': json['integrated_version_id'],
68
+ 'integratedHeadSha': json['integrated_head_sha'],
69
+ 'files': (json['files'].map(RepoTreeEntryFromJSON)),
70
+ };
71
+ }
72
+ export function RepoBranchResponseToJSON(json) {
73
+ return RepoBranchResponseToJSONTyped(json, false);
74
+ }
75
+ export function RepoBranchResponseToJSONTyped(value, ignoreDiscriminator = false) {
76
+ if (value == null) {
77
+ return value;
78
+ }
79
+ return {
80
+ 'version_id': value['versionId'],
81
+ 'head_sha': value['headSha'],
82
+ 'previous_head_sha': value['previousHeadSha'],
83
+ 'commits_added': value['commitsAdded'],
84
+ 'run_id': value['runId'],
85
+ 'saved_by_user_id': value['savedByUserId'],
86
+ 'saved_at': value['savedAt'].toISOString(),
87
+ 'instruction_version_id': value['instructionVersionId'],
88
+ 'candidate_version_id': value['candidateVersionId'],
89
+ 'branch': value['branch'],
90
+ 'base_version_id': value['baseVersionId'],
91
+ 'integrated_version_id': value['integratedVersionId'],
92
+ 'integrated_head_sha': value['integratedHeadSha'],
93
+ 'files': (value['files'].map(RepoTreeEntryToJSON)),
94
+ };
95
+ }