@knowledge-stack/ksapi 3.16.2 → 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
@@ -0,0 +1,95 @@
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
+ * One saved version: a new main and the run that saved it.
14
+ * @export
15
+ * @interface RepoVersionResponse
16
+ */
17
+ export interface RepoVersionResponse {
18
+ /**
19
+ *
20
+ * @type {string}
21
+ * @memberof RepoVersionResponse
22
+ */
23
+ versionId: string;
24
+ /**
25
+ *
26
+ * @type {string}
27
+ * @memberof RepoVersionResponse
28
+ */
29
+ headSha: string;
30
+ /**
31
+ *
32
+ * @type {string}
33
+ * @memberof RepoVersionResponse
34
+ */
35
+ previousHeadSha: string | null;
36
+ /**
37
+ *
38
+ * @type {number}
39
+ * @memberof RepoVersionResponse
40
+ */
41
+ commitsAdded: number;
42
+ /**
43
+ *
44
+ * @type {string}
45
+ * @memberof RepoVersionResponse
46
+ */
47
+ runId: string | null;
48
+ /**
49
+ *
50
+ * @type {string}
51
+ * @memberof RepoVersionResponse
52
+ */
53
+ savedByUserId: string;
54
+ /**
55
+ *
56
+ * @type {Date}
57
+ * @memberof RepoVersionResponse
58
+ */
59
+ savedAt: Date;
60
+ /**
61
+ *
62
+ * @type {string}
63
+ * @memberof RepoVersionResponse
64
+ */
65
+ instructionVersionId: string | null;
66
+ /**
67
+ * Retained run-branch version this publication integrated.
68
+ * @type {string}
69
+ * @memberof RepoVersionResponse
70
+ */
71
+ candidateVersionId?: string | null;
72
+ }
73
+ export declare const RepoVersionResponsePropertyValidationAttributesMap: {
74
+ [property: string]: {
75
+ maxLength?: number;
76
+ minLength?: number;
77
+ pattern?: string;
78
+ maximum?: number;
79
+ exclusiveMaximum?: boolean;
80
+ minimum?: number;
81
+ exclusiveMinimum?: boolean;
82
+ multipleOf?: number;
83
+ maxItems?: number;
84
+ minItems?: number;
85
+ uniqueItems?: boolean;
86
+ };
87
+ };
88
+ /**
89
+ * Check if a given object implements the RepoVersionResponse interface.
90
+ */
91
+ export declare function instanceOfRepoVersionResponse(value: object): value is RepoVersionResponse;
92
+ export declare function RepoVersionResponseFromJSON(json: any): RepoVersionResponse;
93
+ export declare function RepoVersionResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): RepoVersionResponse;
94
+ export declare function RepoVersionResponseToJSON(json: any): RepoVersionResponse;
95
+ export declare function RepoVersionResponseToJSONTyped(value?: RepoVersionResponse | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,74 @@
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 RepoVersionResponsePropertyValidationAttributesMap = {};
15
+ /**
16
+ * Check if a given object implements the RepoVersionResponse interface.
17
+ */
18
+ export function instanceOfRepoVersionResponse(value) {
19
+ if (!('versionId' in value) || value['versionId'] === undefined)
20
+ return false;
21
+ if (!('headSha' in value) || value['headSha'] === undefined)
22
+ return false;
23
+ if (!('previousHeadSha' in value) || value['previousHeadSha'] === undefined)
24
+ return false;
25
+ if (!('commitsAdded' in value) || value['commitsAdded'] === undefined)
26
+ return false;
27
+ if (!('runId' in value) || value['runId'] === undefined)
28
+ return false;
29
+ if (!('savedByUserId' in value) || value['savedByUserId'] === undefined)
30
+ return false;
31
+ if (!('savedAt' in value) || value['savedAt'] === undefined)
32
+ return false;
33
+ if (!('instructionVersionId' in value) || value['instructionVersionId'] === undefined)
34
+ return false;
35
+ return true;
36
+ }
37
+ export function RepoVersionResponseFromJSON(json) {
38
+ return RepoVersionResponseFromJSONTyped(json, false);
39
+ }
40
+ export function RepoVersionResponseFromJSONTyped(json, ignoreDiscriminator) {
41
+ if (json == null) {
42
+ return json;
43
+ }
44
+ return {
45
+ 'versionId': json['version_id'],
46
+ 'headSha': json['head_sha'],
47
+ 'previousHeadSha': json['previous_head_sha'],
48
+ 'commitsAdded': json['commits_added'],
49
+ 'runId': json['run_id'],
50
+ 'savedByUserId': json['saved_by_user_id'],
51
+ 'savedAt': (new Date(json['saved_at'])),
52
+ 'instructionVersionId': json['instruction_version_id'],
53
+ 'candidateVersionId': json['candidate_version_id'] == null ? undefined : json['candidate_version_id'],
54
+ };
55
+ }
56
+ export function RepoVersionResponseToJSON(json) {
57
+ return RepoVersionResponseToJSONTyped(json, false);
58
+ }
59
+ export function RepoVersionResponseToJSONTyped(value, ignoreDiscriminator = false) {
60
+ if (value == null) {
61
+ return value;
62
+ }
63
+ return {
64
+ 'version_id': value['versionId'],
65
+ 'head_sha': value['headSha'],
66
+ 'previous_head_sha': value['previousHeadSha'],
67
+ 'commits_added': value['commitsAdded'],
68
+ 'run_id': value['runId'],
69
+ 'saved_by_user_id': value['savedByUserId'],
70
+ 'saved_at': value['savedAt'].toISOString(),
71
+ 'instruction_version_id': value['instructionVersionId'],
72
+ 'candidate_version_id': value['candidateVersionId'],
73
+ };
74
+ }
@@ -0,0 +1,102 @@
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 { RepoCommitSummary } from './RepoCommitSummary';
13
+ /**
14
+ * The workflow's repository at its current ``main``.
15
+ * @export
16
+ * @interface WorkflowRepoResponse
17
+ */
18
+ export interface WorkflowRepoResponse {
19
+ /**
20
+ * Directory name runs check the repository out under (`/work/<name>`); fixed by the first save.
21
+ * @type {string}
22
+ * @memberof WorkflowRepoResponse
23
+ */
24
+ name: string;
25
+ /**
26
+ *
27
+ * @type {boolean}
28
+ * @memberof WorkflowRepoResponse
29
+ */
30
+ _exists: boolean;
31
+ /**
32
+ * DocumentVersion holding the current main; null before any save.
33
+ * @type {string}
34
+ * @memberof WorkflowRepoResponse
35
+ */
36
+ versionId: string | null;
37
+ /**
38
+ *
39
+ * @type {RepoCommitSummary}
40
+ * @memberof WorkflowRepoResponse
41
+ */
42
+ head: RepoCommitSummary | null;
43
+ /**
44
+ *
45
+ * @type {number}
46
+ * @memberof WorkflowRepoResponse
47
+ */
48
+ fileCount: number;
49
+ /**
50
+ *
51
+ * @type {number}
52
+ * @memberof WorkflowRepoResponse
53
+ */
54
+ totalBytes: number;
55
+ /**
56
+ *
57
+ * @type {number}
58
+ * @memberof WorkflowRepoResponse
59
+ */
60
+ commitCount: number;
61
+ /**
62
+ *
63
+ * @type {Date}
64
+ * @memberof WorkflowRepoResponse
65
+ */
66
+ updatedAt: Date | null;
67
+ /**
68
+ * Whether the caller may save new versions (write on the workflow).
69
+ * @type {boolean}
70
+ * @memberof WorkflowRepoResponse
71
+ */
72
+ writableByMe: boolean;
73
+ /**
74
+ * Instruction version (DOCUMENT_VERSION path_part) the current main was saved against.
75
+ * @type {string}
76
+ * @memberof WorkflowRepoResponse
77
+ */
78
+ instructionVersionId: string | null;
79
+ }
80
+ export declare const WorkflowRepoResponsePropertyValidationAttributesMap: {
81
+ [property: string]: {
82
+ maxLength?: number;
83
+ minLength?: number;
84
+ pattern?: string;
85
+ maximum?: number;
86
+ exclusiveMaximum?: boolean;
87
+ minimum?: number;
88
+ exclusiveMinimum?: boolean;
89
+ multipleOf?: number;
90
+ maxItems?: number;
91
+ minItems?: number;
92
+ uniqueItems?: boolean;
93
+ };
94
+ };
95
+ /**
96
+ * Check if a given object implements the WorkflowRepoResponse interface.
97
+ */
98
+ export declare function instanceOfWorkflowRepoResponse(value: object): value is WorkflowRepoResponse;
99
+ export declare function WorkflowRepoResponseFromJSON(json: any): WorkflowRepoResponse;
100
+ export declare function WorkflowRepoResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): WorkflowRepoResponse;
101
+ export declare function WorkflowRepoResponseToJSON(json: any): WorkflowRepoResponse;
102
+ export declare function WorkflowRepoResponseToJSONTyped(value?: WorkflowRepoResponse | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,81 @@
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 { RepoCommitSummaryFromJSON, RepoCommitSummaryToJSON, } from './RepoCommitSummary';
15
+ export const WorkflowRepoResponsePropertyValidationAttributesMap = {};
16
+ /**
17
+ * Check if a given object implements the WorkflowRepoResponse interface.
18
+ */
19
+ export function instanceOfWorkflowRepoResponse(value) {
20
+ if (!('name' in value) || value['name'] === undefined)
21
+ return false;
22
+ if (!('_exists' in value) || value['_exists'] === undefined)
23
+ return false;
24
+ if (!('versionId' in value) || value['versionId'] === undefined)
25
+ return false;
26
+ if (!('head' in value) || value['head'] === undefined)
27
+ return false;
28
+ if (!('fileCount' in value) || value['fileCount'] === undefined)
29
+ return false;
30
+ if (!('totalBytes' in value) || value['totalBytes'] === undefined)
31
+ return false;
32
+ if (!('commitCount' in value) || value['commitCount'] === undefined)
33
+ return false;
34
+ if (!('updatedAt' in value) || value['updatedAt'] === undefined)
35
+ return false;
36
+ if (!('writableByMe' in value) || value['writableByMe'] === undefined)
37
+ return false;
38
+ if (!('instructionVersionId' in value) || value['instructionVersionId'] === undefined)
39
+ return false;
40
+ return true;
41
+ }
42
+ export function WorkflowRepoResponseFromJSON(json) {
43
+ return WorkflowRepoResponseFromJSONTyped(json, false);
44
+ }
45
+ export function WorkflowRepoResponseFromJSONTyped(json, ignoreDiscriminator) {
46
+ if (json == null) {
47
+ return json;
48
+ }
49
+ return {
50
+ 'name': json['name'],
51
+ '_exists': json['exists'],
52
+ 'versionId': json['version_id'],
53
+ 'head': RepoCommitSummaryFromJSON(json['head']),
54
+ 'fileCount': json['file_count'],
55
+ 'totalBytes': json['total_bytes'],
56
+ 'commitCount': json['commit_count'],
57
+ 'updatedAt': (json['updated_at'] == null ? null : new Date(json['updated_at'])),
58
+ 'writableByMe': json['writable_by_me'],
59
+ 'instructionVersionId': json['instruction_version_id'],
60
+ };
61
+ }
62
+ export function WorkflowRepoResponseToJSON(json) {
63
+ return WorkflowRepoResponseToJSONTyped(json, false);
64
+ }
65
+ export function WorkflowRepoResponseToJSONTyped(value, ignoreDiscriminator = false) {
66
+ if (value == null) {
67
+ return value;
68
+ }
69
+ return {
70
+ 'name': value['name'],
71
+ 'exists': value['_exists'],
72
+ 'version_id': value['versionId'],
73
+ 'head': RepoCommitSummaryToJSON(value['head']),
74
+ 'file_count': value['fileCount'],
75
+ 'total_bytes': value['totalBytes'],
76
+ 'commit_count': value['commitCount'],
77
+ 'updated_at': value['updatedAt'] == null ? value['updatedAt'] : value['updatedAt'].toISOString(),
78
+ 'writable_by_me': value['writableByMe'],
79
+ 'instruction_version_id': value['instructionVersionId'],
80
+ };
81
+ }
@@ -9,6 +9,7 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
+ import type { RepoSnapshot } from './RepoSnapshot';
12
13
  import type { InputSnapshot } from './InputSnapshot';
13
14
  import type { ExcludedCommonFile } from './ExcludedCommonFile';
14
15
  import type { InstructionSnapshot } from './InstructionSnapshot';
@@ -68,6 +69,12 @@ export interface WorkflowRunSnapshot {
68
69
  * @memberof WorkflowRunSnapshot
69
70
  */
70
71
  selectedSkillIds?: Array<string>;
72
+ /**
73
+ * The workflow repository's main when the run started; absent when the workflow had no repository.
74
+ * @type {RepoSnapshot}
75
+ * @memberof WorkflowRunSnapshot
76
+ */
77
+ repo?: RepoSnapshot | null;
71
78
  }
72
79
  export declare const WorkflowRunSnapshotPropertyValidationAttributesMap: {
73
80
  [property: string]: {
@@ -11,6 +11,7 @@
11
11
  * https://openapi-generator.tech
12
12
  * Do not edit the class manually.
13
13
  */
14
+ import { RepoSnapshotFromJSON, RepoSnapshotToJSON, } from './RepoSnapshot';
14
15
  import { InputSnapshotFromJSON, InputSnapshotToJSON, } from './InputSnapshot';
15
16
  import { ExcludedCommonFileFromJSON, ExcludedCommonFileToJSON, } from './ExcludedCommonFile';
16
17
  import { InstructionSnapshotFromJSON, InstructionSnapshotToJSON, } from './InstructionSnapshot';
@@ -48,6 +49,7 @@ export function WorkflowRunSnapshotFromJSONTyped(json, ignoreDiscriminator) {
48
49
  'excludedCommonFiles': json['excluded_common_files'] == null ? undefined : (json['excluded_common_files'].map(ExcludedCommonFileFromJSON)),
49
50
  'userMessage': json['user_message'] == null ? undefined : json['user_message'],
50
51
  'selectedSkillIds': json['selected_skill_ids'] == null ? undefined : json['selected_skill_ids'],
52
+ 'repo': json['repo'] == null ? undefined : RepoSnapshotFromJSON(json['repo']),
51
53
  };
52
54
  }
53
55
  export function WorkflowRunSnapshotToJSON(json) {
@@ -65,5 +67,6 @@ export function WorkflowRunSnapshotToJSONTyped(value, ignoreDiscriminator = fals
65
67
  'excluded_common_files': value['excludedCommonFiles'] == null ? undefined : (value['excludedCommonFiles'].map(ExcludedCommonFileToJSON)),
66
68
  'user_message': value['userMessage'],
67
69
  'selected_skill_ids': value['selectedSkillIds'],
70
+ 'repo': RepoSnapshotToJSON(value['repo']),
68
71
  };
69
72
  }
@@ -200,7 +200,7 @@ export * from './LineageNodeResponse';
200
200
  export * from './LocationInner';
201
201
  export * from './MembershipResponse';
202
202
  export * from './MemoryBodyResponse';
203
- export * from './MemoryChunkResponse';
203
+ export * from './MemoryEntryResponse';
204
204
  export * from './MemoryKind';
205
205
  export * from './MemoryScope';
206
206
  export * from './MessageRole';
@@ -225,10 +225,11 @@ export * from './PaginatedResponseGroupPermissionResponse';
225
225
  export * from './PaginatedResponseGroupResponse';
226
226
  export * from './PaginatedResponseInviteResponse';
227
227
  export * from './PaginatedResponseMembershipResponse';
228
- export * from './PaginatedResponseMemoryChunkResponse';
228
+ export * from './PaginatedResponseMemoryEntryResponse';
229
229
  export * from './PaginatedResponsePathPartResponse';
230
230
  export * from './PaginatedResponsePendingMemoryChunkResponse';
231
231
  export * from './PaginatedResponsePermissionResponse';
232
+ export * from './PaginatedResponseRepoVersionResponse';
232
233
  export * from './PaginatedResponseSkillResponse';
233
234
  export * from './PaginatedResponseTagResponse';
234
235
  export * from './PaginatedResponseTenantResponse';
@@ -263,8 +264,16 @@ export * from './Polygon';
263
264
  export * from './PolygonReference';
264
265
  export * from './ProposeMemoryChunkRequest';
265
266
  export * from './ReasoningPart';
267
+ export * from './RecordRepoSaveSkipRequest';
266
268
  export * from './ReferenceType';
267
269
  export * from './ReorderPathPartRequest';
270
+ export * from './RepoBranchResponse';
271
+ export * from './RepoCommitSummary';
272
+ export * from './RepoSaveSkipReason';
273
+ export * from './RepoSnapshot';
274
+ export * from './RepoTreeEntry';
275
+ export * from './RepoTreeResponse';
276
+ export * from './RepoVersionResponse';
268
277
  export * from './RequestPhoneChangeRequest';
269
278
  export * from './ResolvedRef';
270
279
  export * from './ResolvedReferenceInput';
@@ -400,6 +409,7 @@ export * from './WorkflowDetailResponse';
400
409
  export * from './WorkflowExecutionState';
401
410
  export * from './WorkflowLeaderboardResponse';
402
411
  export * from './WorkflowOutputStatsResponse';
412
+ export * from './WorkflowRepoResponse';
403
413
  export * from './WorkflowRunAsset';
404
414
  export * from './WorkflowRunCallbackRequest';
405
415
  export * from './WorkflowRunOrder';
@@ -202,7 +202,7 @@ export * from './LineageNodeResponse';
202
202
  export * from './LocationInner';
203
203
  export * from './MembershipResponse';
204
204
  export * from './MemoryBodyResponse';
205
- export * from './MemoryChunkResponse';
205
+ export * from './MemoryEntryResponse';
206
206
  export * from './MemoryKind';
207
207
  export * from './MemoryScope';
208
208
  export * from './MessageRole';
@@ -227,10 +227,11 @@ export * from './PaginatedResponseGroupPermissionResponse';
227
227
  export * from './PaginatedResponseGroupResponse';
228
228
  export * from './PaginatedResponseInviteResponse';
229
229
  export * from './PaginatedResponseMembershipResponse';
230
- export * from './PaginatedResponseMemoryChunkResponse';
230
+ export * from './PaginatedResponseMemoryEntryResponse';
231
231
  export * from './PaginatedResponsePathPartResponse';
232
232
  export * from './PaginatedResponsePendingMemoryChunkResponse';
233
233
  export * from './PaginatedResponsePermissionResponse';
234
+ export * from './PaginatedResponseRepoVersionResponse';
234
235
  export * from './PaginatedResponseSkillResponse';
235
236
  export * from './PaginatedResponseTagResponse';
236
237
  export * from './PaginatedResponseTenantResponse';
@@ -265,8 +266,16 @@ export * from './Polygon';
265
266
  export * from './PolygonReference';
266
267
  export * from './ProposeMemoryChunkRequest';
267
268
  export * from './ReasoningPart';
269
+ export * from './RecordRepoSaveSkipRequest';
268
270
  export * from './ReferenceType';
269
271
  export * from './ReorderPathPartRequest';
272
+ export * from './RepoBranchResponse';
273
+ export * from './RepoCommitSummary';
274
+ export * from './RepoSaveSkipReason';
275
+ export * from './RepoSnapshot';
276
+ export * from './RepoTreeEntry';
277
+ export * from './RepoTreeResponse';
278
+ export * from './RepoVersionResponse';
270
279
  export * from './RequestPhoneChangeRequest';
271
280
  export * from './ResolvedRef';
272
281
  export * from './ResolvedReferenceInput';
@@ -402,6 +411,7 @@ export * from './WorkflowDetailResponse';
402
411
  export * from './WorkflowExecutionState';
403
412
  export * from './WorkflowLeaderboardResponse';
404
413
  export * from './WorkflowOutputStatsResponse';
414
+ export * from './WorkflowRepoResponse';
405
415
  export * from './WorkflowRunAsset';
406
416
  export * from './WorkflowRunCallbackRequest';
407
417
  export * from './WorkflowRunOrder';
@@ -51,6 +51,13 @@ export declare const ErrorResponseCodeEnum: {
51
51
  readonly PayloadTooLarge: 'payload_too_large';
52
52
  readonly UnsupportedMediaType: 'unsupported_media_type';
53
53
  readonly UnprocessableEntity: 'unprocessable_entity';
54
+ readonly RepoHeadMoved: 'repo_head_moved';
55
+ readonly RepoNotFastForward: 'repo_not_fast_forward';
56
+ readonly RepoRunMismatch: 'repo_run_mismatch';
57
+ readonly RepoCommitNotFound: 'repo_commit_not_found';
58
+ readonly RepoInvalidBundle: 'repo_invalid_bundle';
59
+ readonly RepoTooLarge: 'repo_too_large';
60
+ readonly RepoUnsafePath: 'repo_unsafe_path';
54
61
  readonly TooManyRequests: 'too_many_requests';
55
62
  readonly QuotaExceeded: 'quota_exceeded';
56
63
  readonly NotImplemented: 'not_implemented';
@@ -36,6 +36,13 @@ exports.ErrorResponseCodeEnum = {
36
36
  PayloadTooLarge: 'payload_too_large',
37
37
  UnsupportedMediaType: 'unsupported_media_type',
38
38
  UnprocessableEntity: 'unprocessable_entity',
39
+ RepoHeadMoved: 'repo_head_moved',
40
+ RepoNotFastForward: 'repo_not_fast_forward',
41
+ RepoRunMismatch: 'repo_run_mismatch',
42
+ RepoCommitNotFound: 'repo_commit_not_found',
43
+ RepoInvalidBundle: 'repo_invalid_bundle',
44
+ RepoTooLarge: 'repo_too_large',
45
+ RepoUnsafePath: 'repo_unsafe_path',
39
46
  TooManyRequests: 'too_many_requests',
40
47
  QuotaExceeded: 'quota_exceeded',
41
48
  NotImplemented: 'not_implemented',
@@ -13,29 +13,29 @@ import type { MemoryKind } from './MemoryKind';
13
13
  /**
14
14
  *
15
15
  * @export
16
- * @interface MemoryChunkResponse
16
+ * @interface MemoryEntryResponse
17
17
  */
18
- export interface MemoryChunkResponse {
18
+ export interface MemoryEntryResponse {
19
19
  /**
20
20
  *
21
21
  * @type {string}
22
- * @memberof MemoryChunkResponse
22
+ * @memberof MemoryEntryResponse
23
23
  */
24
24
  chunkId: string;
25
25
  /**
26
26
  *
27
27
  * @type {MemoryKind}
28
- * @memberof MemoryChunkResponse
28
+ * @memberof MemoryEntryResponse
29
29
  */
30
30
  kind: MemoryKind;
31
31
  /**
32
32
  *
33
33
  * @type {string}
34
- * @memberof MemoryChunkResponse
34
+ * @memberof MemoryEntryResponse
35
35
  */
36
36
  body: string;
37
37
  }
38
- export declare const MemoryChunkResponsePropertyValidationAttributesMap: {
38
+ export declare const MemoryEntryResponsePropertyValidationAttributesMap: {
39
39
  [property: string]: {
40
40
  maxLength?: number;
41
41
  minLength?: number;
@@ -51,10 +51,10 @@ export declare const MemoryChunkResponsePropertyValidationAttributesMap: {
51
51
  };
52
52
  };
53
53
  /**
54
- * Check if a given object implements the MemoryChunkResponse interface.
54
+ * Check if a given object implements the MemoryEntryResponse interface.
55
55
  */
56
- export declare function instanceOfMemoryChunkResponse(value: object): value is MemoryChunkResponse;
57
- export declare function MemoryChunkResponseFromJSON(json: any): MemoryChunkResponse;
58
- export declare function MemoryChunkResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): MemoryChunkResponse;
59
- export declare function MemoryChunkResponseToJSON(json: any): MemoryChunkResponse;
60
- export declare function MemoryChunkResponseToJSONTyped(value?: MemoryChunkResponse | null, ignoreDiscriminator?: boolean): any;
56
+ export declare function instanceOfMemoryEntryResponse(value: object): value is MemoryEntryResponse;
57
+ export declare function MemoryEntryResponseFromJSON(json: any): MemoryEntryResponse;
58
+ export declare function MemoryEntryResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): MemoryEntryResponse;
59
+ export declare function MemoryEntryResponseToJSON(json: any): MemoryEntryResponse;
60
+ export declare function MemoryEntryResponseToJSONTyped(value?: MemoryEntryResponse | null, ignoreDiscriminator?: boolean): any;
@@ -13,18 +13,18 @@
13
13
  * Do not edit the class manually.
14
14
  */
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.MemoryChunkResponsePropertyValidationAttributesMap = void 0;
17
- exports.instanceOfMemoryChunkResponse = instanceOfMemoryChunkResponse;
18
- exports.MemoryChunkResponseFromJSON = MemoryChunkResponseFromJSON;
19
- exports.MemoryChunkResponseFromJSONTyped = MemoryChunkResponseFromJSONTyped;
20
- exports.MemoryChunkResponseToJSON = MemoryChunkResponseToJSON;
21
- exports.MemoryChunkResponseToJSONTyped = MemoryChunkResponseToJSONTyped;
16
+ exports.MemoryEntryResponsePropertyValidationAttributesMap = void 0;
17
+ exports.instanceOfMemoryEntryResponse = instanceOfMemoryEntryResponse;
18
+ exports.MemoryEntryResponseFromJSON = MemoryEntryResponseFromJSON;
19
+ exports.MemoryEntryResponseFromJSONTyped = MemoryEntryResponseFromJSONTyped;
20
+ exports.MemoryEntryResponseToJSON = MemoryEntryResponseToJSON;
21
+ exports.MemoryEntryResponseToJSONTyped = MemoryEntryResponseToJSONTyped;
22
22
  const MemoryKind_1 = require("./MemoryKind");
23
- exports.MemoryChunkResponsePropertyValidationAttributesMap = {};
23
+ exports.MemoryEntryResponsePropertyValidationAttributesMap = {};
24
24
  /**
25
- * Check if a given object implements the MemoryChunkResponse interface.
25
+ * Check if a given object implements the MemoryEntryResponse interface.
26
26
  */
27
- function instanceOfMemoryChunkResponse(value) {
27
+ function instanceOfMemoryEntryResponse(value) {
28
28
  if (!('chunkId' in value) || value['chunkId'] === undefined)
29
29
  return false;
30
30
  if (!('kind' in value) || value['kind'] === undefined)
@@ -33,10 +33,10 @@ function instanceOfMemoryChunkResponse(value) {
33
33
  return false;
34
34
  return true;
35
35
  }
36
- function MemoryChunkResponseFromJSON(json) {
37
- return MemoryChunkResponseFromJSONTyped(json, false);
36
+ function MemoryEntryResponseFromJSON(json) {
37
+ return MemoryEntryResponseFromJSONTyped(json, false);
38
38
  }
39
- function MemoryChunkResponseFromJSONTyped(json, ignoreDiscriminator) {
39
+ function MemoryEntryResponseFromJSONTyped(json, ignoreDiscriminator) {
40
40
  if (json == null) {
41
41
  return json;
42
42
  }
@@ -46,10 +46,10 @@ function MemoryChunkResponseFromJSONTyped(json, ignoreDiscriminator) {
46
46
  'body': json['body'],
47
47
  };
48
48
  }
49
- function MemoryChunkResponseToJSON(json) {
50
- return MemoryChunkResponseToJSONTyped(json, false);
49
+ function MemoryEntryResponseToJSON(json) {
50
+ return MemoryEntryResponseToJSONTyped(json, false);
51
51
  }
52
- function MemoryChunkResponseToJSONTyped(value, ignoreDiscriminator = false) {
52
+ function MemoryEntryResponseToJSONTyped(value, ignoreDiscriminator = false) {
53
53
  if (value == null) {
54
54
  return value;
55
55
  }