@knowledge-stack/ksapi 1.81.0 → 1.83.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 (97) hide show
  1. package/.openapi-generator/FILES +10 -0
  2. package/README.md +12 -2
  3. package/dist/apis/WorkflowDefinitionsApi.d.ts +4 -1
  4. package/dist/apis/WorkflowDefinitionsApi.js +2 -0
  5. package/dist/apis/WorkflowRunsApi.d.ts +233 -1
  6. package/dist/apis/WorkflowRunsApi.js +236 -0
  7. package/dist/esm/apis/WorkflowDefinitionsApi.d.ts +4 -1
  8. package/dist/esm/apis/WorkflowDefinitionsApi.js +2 -0
  9. package/dist/esm/apis/WorkflowRunsApi.d.ts +233 -1
  10. package/dist/esm/apis/WorkflowRunsApi.js +237 -1
  11. package/dist/esm/models/CreateWorkflowDefinitionRequest.d.ts +14 -1
  12. package/dist/esm/models/CreateWorkflowDefinitionRequest.js +3 -4
  13. package/dist/esm/models/InstructionSnapshot.d.ts +71 -0
  14. package/dist/esm/models/InstructionSnapshot.js +57 -0
  15. package/dist/esm/models/InvokeWorkflowRequest.d.ts +6 -0
  16. package/dist/esm/models/InvokeWorkflowRequest.js +6 -0
  17. package/dist/esm/models/PathPartApprovalDecision.d.ts +30 -0
  18. package/dist/esm/models/PathPartApprovalDecision.js +48 -0
  19. package/dist/esm/models/PathPartApprovalResponse.d.ts +111 -0
  20. package/dist/esm/models/PathPartApprovalResponse.js +85 -0
  21. package/dist/esm/models/RejectFileRequest.d.ts +47 -0
  22. package/dist/esm/models/RejectFileRequest.js +49 -0
  23. package/dist/esm/models/RunLockResponse.d.ts +59 -0
  24. package/dist/esm/models/RunLockResponse.js +52 -0
  25. package/dist/esm/models/UpdateWorkflowDefinitionRequest.d.ts +12 -1
  26. package/dist/esm/models/UpdateWorkflowDefinitionRequest.js +2 -0
  27. package/dist/esm/models/WorkflowDefinitionResponse.d.ts +6 -0
  28. package/dist/esm/models/WorkflowDefinitionResponse.js +4 -0
  29. package/dist/esm/models/WorkflowRunResponse.d.ts +17 -0
  30. package/dist/esm/models/WorkflowRunResponse.js +8 -0
  31. package/dist/esm/models/WorkflowRunSnapshot.d.ts +3 -2
  32. package/dist/esm/models/WorkflowRunSnapshot.js +3 -2
  33. package/dist/esm/models/WorkflowRunStatus.d.ts +20 -2
  34. package/dist/esm/models/WorkflowRunStatus.js +20 -2
  35. package/dist/esm/models/WorkflowRunnerType.d.ts +1 -0
  36. package/dist/esm/models/WorkflowRunnerType.js +2 -1
  37. package/dist/esm/models/index.d.ts +5 -0
  38. package/dist/esm/models/index.js +5 -0
  39. package/dist/models/CreateWorkflowDefinitionRequest.d.ts +14 -1
  40. package/dist/models/CreateWorkflowDefinitionRequest.js +3 -4
  41. package/dist/models/InstructionSnapshot.d.ts +71 -0
  42. package/dist/models/InstructionSnapshot.js +65 -0
  43. package/dist/models/InvokeWorkflowRequest.d.ts +6 -0
  44. package/dist/models/InvokeWorkflowRequest.js +6 -0
  45. package/dist/models/PathPartApprovalDecision.d.ts +30 -0
  46. package/dist/models/PathPartApprovalDecision.js +56 -0
  47. package/dist/models/PathPartApprovalResponse.d.ts +111 -0
  48. package/dist/models/PathPartApprovalResponse.js +93 -0
  49. package/dist/models/RejectFileRequest.d.ts +47 -0
  50. package/dist/models/RejectFileRequest.js +57 -0
  51. package/dist/models/RunLockResponse.d.ts +59 -0
  52. package/dist/models/RunLockResponse.js +60 -0
  53. package/dist/models/UpdateWorkflowDefinitionRequest.d.ts +12 -1
  54. package/dist/models/UpdateWorkflowDefinitionRequest.js +2 -0
  55. package/dist/models/WorkflowDefinitionResponse.d.ts +6 -0
  56. package/dist/models/WorkflowDefinitionResponse.js +4 -0
  57. package/dist/models/WorkflowRunResponse.d.ts +17 -0
  58. package/dist/models/WorkflowRunResponse.js +8 -0
  59. package/dist/models/WorkflowRunSnapshot.d.ts +3 -2
  60. package/dist/models/WorkflowRunSnapshot.js +3 -2
  61. package/dist/models/WorkflowRunStatus.d.ts +20 -2
  62. package/dist/models/WorkflowRunStatus.js +20 -2
  63. package/dist/models/WorkflowRunnerType.d.ts +1 -0
  64. package/dist/models/WorkflowRunnerType.js +2 -1
  65. package/dist/models/index.d.ts +5 -0
  66. package/dist/models/index.js +5 -0
  67. package/docs/CreateWorkflowDefinitionRequest.md +3 -1
  68. package/docs/InstructionSnapshot.md +41 -0
  69. package/docs/InvokeWorkflowRequest.md +2 -0
  70. package/docs/PathPartApprovalDecision.md +33 -0
  71. package/docs/PathPartApprovalResponse.md +55 -0
  72. package/docs/RejectFileRequest.md +35 -0
  73. package/docs/RunLockResponse.md +39 -0
  74. package/docs/UpdateWorkflowDefinitionRequest.md +3 -1
  75. package/docs/WorkflowDefinitionResponse.md +2 -0
  76. package/docs/WorkflowDefinitionsApi.md +2 -0
  77. package/docs/WorkflowRunResponse.md +5 -1
  78. package/docs/WorkflowRunSnapshot.md +1 -1
  79. package/docs/WorkflowRunStatus.md +1 -1
  80. package/docs/WorkflowRunsApi.md +387 -0
  81. package/package.json +1 -1
  82. package/src/apis/WorkflowDefinitionsApi.ts +4 -1
  83. package/src/apis/WorkflowRunsApi.ts +479 -0
  84. package/src/models/CreateWorkflowDefinitionRequest.ts +17 -4
  85. package/src/models/InstructionSnapshot.ts +125 -0
  86. package/src/models/InvokeWorkflowRequest.ts +12 -0
  87. package/src/models/PathPartApprovalDecision.ts +58 -0
  88. package/src/models/PathPartApprovalResponse.ts +186 -0
  89. package/src/models/RejectFileRequest.ts +87 -0
  90. package/src/models/RunLockResponse.ts +101 -0
  91. package/src/models/UpdateWorkflowDefinitionRequest.ts +14 -1
  92. package/src/models/WorkflowDefinitionResponse.ts +9 -0
  93. package/src/models/WorkflowRunResponse.ts +23 -0
  94. package/src/models/WorkflowRunSnapshot.ts +11 -4
  95. package/src/models/WorkflowRunStatus.ts +20 -2
  96. package/src/models/WorkflowRunnerType.ts +2 -1
  97. package/src/models/index.ts +5 -0
@@ -21,11 +21,103 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
21
21
  });
22
22
  };
23
23
  import * as runtime from '../runtime';
24
- import { WorkflowCallbackResponseFromJSON, WorkflowRunCallbackRequestToJSON, WorkflowRunResponseFromJSON, } from '../models/index';
24
+ import { PathPartApprovalResponseFromJSON, RejectFileRequestToJSON, RunLockResponseFromJSON, WorkflowCallbackResponseFromJSON, WorkflowRunCallbackRequestToJSON, WorkflowRunResponseFromJSON, } from '../models/index';
25
25
  /**
26
26
  *
27
27
  */
28
28
  export class WorkflowRunsApi extends runtime.BaseAPI {
29
+ /**
30
+ * Creates request options for acquireWorkflowRunLock without sending the request
31
+ */
32
+ acquireWorkflowRunLockRequestOpts(requestParameters) {
33
+ return __awaiter(this, void 0, void 0, function* () {
34
+ if (requestParameters['runId'] == null) {
35
+ throw new runtime.RequiredError('runId', 'Required parameter "runId" was null or undefined when calling acquireWorkflowRunLock().');
36
+ }
37
+ const queryParameters = {};
38
+ const headerParameters = {};
39
+ if (requestParameters['authorization'] != null) {
40
+ headerParameters['authorization'] = String(requestParameters['authorization']);
41
+ }
42
+ let urlPath = `/v1/workflow-runs/{run_id}/lock`;
43
+ urlPath = urlPath.replace(`{${"run_id"}}`, encodeURIComponent(String(requestParameters['runId'])));
44
+ return {
45
+ path: urlPath,
46
+ method: 'POST',
47
+ headers: headerParameters,
48
+ query: queryParameters,
49
+ };
50
+ });
51
+ }
52
+ /**
53
+ * Acquire (or renew) the reviewer lock on ``run_id``. The current holder may re-POST to refresh ``lock_acquired_at``. A different user receives 409 until the lock is released or auto-swept.
54
+ * Acquire Workflow Run Lock Handler
55
+ */
56
+ acquireWorkflowRunLockRaw(requestParameters, initOverrides) {
57
+ return __awaiter(this, void 0, void 0, function* () {
58
+ const requestOptions = yield this.acquireWorkflowRunLockRequestOpts(requestParameters);
59
+ const response = yield this.request(requestOptions, initOverrides);
60
+ return new runtime.JSONApiResponse(response, (jsonValue) => RunLockResponseFromJSON(jsonValue));
61
+ });
62
+ }
63
+ /**
64
+ * Acquire (or renew) the reviewer lock on ``run_id``. The current holder may re-POST to refresh ``lock_acquired_at``. A different user receives 409 until the lock is released or auto-swept.
65
+ * Acquire Workflow Run Lock Handler
66
+ */
67
+ acquireWorkflowRunLock(requestParameters, initOverrides) {
68
+ return __awaiter(this, void 0, void 0, function* () {
69
+ const response = yield this.acquireWorkflowRunLockRaw(requestParameters, initOverrides);
70
+ return yield response.value();
71
+ });
72
+ }
73
+ /**
74
+ * Creates request options for approveWorkflowRunFile without sending the request
75
+ */
76
+ approveWorkflowRunFileRequestOpts(requestParameters) {
77
+ return __awaiter(this, void 0, void 0, function* () {
78
+ if (requestParameters['runId'] == null) {
79
+ throw new runtime.RequiredError('runId', 'Required parameter "runId" was null or undefined when calling approveWorkflowRunFile().');
80
+ }
81
+ if (requestParameters['pathPartId'] == null) {
82
+ throw new runtime.RequiredError('pathPartId', 'Required parameter "pathPartId" was null or undefined when calling approveWorkflowRunFile().');
83
+ }
84
+ const queryParameters = {};
85
+ const headerParameters = {};
86
+ if (requestParameters['authorization'] != null) {
87
+ headerParameters['authorization'] = String(requestParameters['authorization']);
88
+ }
89
+ let urlPath = `/v1/workflow-runs/{run_id}/files/{path_part_id}/approve`;
90
+ urlPath = urlPath.replace(`{${"run_id"}}`, encodeURIComponent(String(requestParameters['runId'])));
91
+ urlPath = urlPath.replace(`{${"path_part_id"}}`, encodeURIComponent(String(requestParameters['pathPartId'])));
92
+ return {
93
+ path: urlPath,
94
+ method: 'POST',
95
+ headers: headerParameters,
96
+ query: queryParameters,
97
+ };
98
+ });
99
+ }
100
+ /**
101
+ * Approve a single generated file. Caller must hold the run lock.
102
+ * Approve Workflow Run File Handler
103
+ */
104
+ approveWorkflowRunFileRaw(requestParameters, initOverrides) {
105
+ return __awaiter(this, void 0, void 0, function* () {
106
+ const requestOptions = yield this.approveWorkflowRunFileRequestOpts(requestParameters);
107
+ const response = yield this.request(requestOptions, initOverrides);
108
+ return new runtime.JSONApiResponse(response, (jsonValue) => PathPartApprovalResponseFromJSON(jsonValue));
109
+ });
110
+ }
111
+ /**
112
+ * Approve a single generated file. Caller must hold the run lock.
113
+ * Approve Workflow Run File Handler
114
+ */
115
+ approveWorkflowRunFile(requestParameters, initOverrides) {
116
+ return __awaiter(this, void 0, void 0, function* () {
117
+ const response = yield this.approveWorkflowRunFileRaw(requestParameters, initOverrides);
118
+ return yield response.value();
119
+ });
120
+ }
29
121
  /**
30
122
  * Creates request options for deleteWorkflowRun without sending the request
31
123
  */
@@ -109,6 +201,150 @@ export class WorkflowRunsApi extends runtime.BaseAPI {
109
201
  return yield response.value();
110
202
  });
111
203
  }
204
+ /**
205
+ * Creates request options for rejectWorkflowRunFile without sending the request
206
+ */
207
+ rejectWorkflowRunFileRequestOpts(requestParameters) {
208
+ return __awaiter(this, void 0, void 0, function* () {
209
+ if (requestParameters['runId'] == null) {
210
+ throw new runtime.RequiredError('runId', 'Required parameter "runId" was null or undefined when calling rejectWorkflowRunFile().');
211
+ }
212
+ if (requestParameters['pathPartId'] == null) {
213
+ throw new runtime.RequiredError('pathPartId', 'Required parameter "pathPartId" was null or undefined when calling rejectWorkflowRunFile().');
214
+ }
215
+ if (requestParameters['rejectFileRequest'] == null) {
216
+ throw new runtime.RequiredError('rejectFileRequest', 'Required parameter "rejectFileRequest" was null or undefined when calling rejectWorkflowRunFile().');
217
+ }
218
+ const queryParameters = {};
219
+ const headerParameters = {};
220
+ headerParameters['Content-Type'] = 'application/json';
221
+ if (requestParameters['authorization'] != null) {
222
+ headerParameters['authorization'] = String(requestParameters['authorization']);
223
+ }
224
+ let urlPath = `/v1/workflow-runs/{run_id}/files/{path_part_id}/reject`;
225
+ urlPath = urlPath.replace(`{${"run_id"}}`, encodeURIComponent(String(requestParameters['runId'])));
226
+ urlPath = urlPath.replace(`{${"path_part_id"}}`, encodeURIComponent(String(requestParameters['pathPartId'])));
227
+ return {
228
+ path: urlPath,
229
+ method: 'POST',
230
+ headers: headerParameters,
231
+ query: queryParameters,
232
+ body: RejectFileRequestToJSON(requestParameters['rejectFileRequest']),
233
+ };
234
+ });
235
+ }
236
+ /**
237
+ * Reject a single generated file with a reason. Caller must hold the run lock.
238
+ * Reject Workflow Run File Handler
239
+ */
240
+ rejectWorkflowRunFileRaw(requestParameters, initOverrides) {
241
+ return __awaiter(this, void 0, void 0, function* () {
242
+ const requestOptions = yield this.rejectWorkflowRunFileRequestOpts(requestParameters);
243
+ const response = yield this.request(requestOptions, initOverrides);
244
+ return new runtime.JSONApiResponse(response, (jsonValue) => PathPartApprovalResponseFromJSON(jsonValue));
245
+ });
246
+ }
247
+ /**
248
+ * Reject a single generated file with a reason. Caller must hold the run lock.
249
+ * Reject Workflow Run File Handler
250
+ */
251
+ rejectWorkflowRunFile(requestParameters, initOverrides) {
252
+ return __awaiter(this, void 0, void 0, function* () {
253
+ const response = yield this.rejectWorkflowRunFileRaw(requestParameters, initOverrides);
254
+ return yield response.value();
255
+ });
256
+ }
257
+ /**
258
+ * Creates request options for releaseWorkflowRunLock without sending the request
259
+ */
260
+ releaseWorkflowRunLockRequestOpts(requestParameters) {
261
+ return __awaiter(this, void 0, void 0, function* () {
262
+ if (requestParameters['runId'] == null) {
263
+ throw new runtime.RequiredError('runId', 'Required parameter "runId" was null or undefined when calling releaseWorkflowRunLock().');
264
+ }
265
+ const queryParameters = {};
266
+ const headerParameters = {};
267
+ if (requestParameters['authorization'] != null) {
268
+ headerParameters['authorization'] = String(requestParameters['authorization']);
269
+ }
270
+ let urlPath = `/v1/workflow-runs/{run_id}/lock`;
271
+ urlPath = urlPath.replace(`{${"run_id"}}`, encodeURIComponent(String(requestParameters['runId'])));
272
+ return {
273
+ path: urlPath,
274
+ method: 'DELETE',
275
+ headers: headerParameters,
276
+ query: queryParameters,
277
+ };
278
+ });
279
+ }
280
+ /**
281
+ * Release the reviewer lock; only the holder may call this. DELETE /lock is idempotent: returns 204 even if no lock is held.
282
+ * Release Workflow Run Lock Handler
283
+ */
284
+ releaseWorkflowRunLockRaw(requestParameters, initOverrides) {
285
+ return __awaiter(this, void 0, void 0, function* () {
286
+ const requestOptions = yield this.releaseWorkflowRunLockRequestOpts(requestParameters);
287
+ const response = yield this.request(requestOptions, initOverrides);
288
+ return new runtime.VoidApiResponse(response);
289
+ });
290
+ }
291
+ /**
292
+ * Release the reviewer lock; only the holder may call this. DELETE /lock is idempotent: returns 204 even if no lock is held.
293
+ * Release Workflow Run Lock Handler
294
+ */
295
+ releaseWorkflowRunLock(requestParameters, initOverrides) {
296
+ return __awaiter(this, void 0, void 0, function* () {
297
+ yield this.releaseWorkflowRunLockRaw(requestParameters, initOverrides);
298
+ });
299
+ }
300
+ /**
301
+ * Creates request options for unapproveWorkflowRunFile without sending the request
302
+ */
303
+ unapproveWorkflowRunFileRequestOpts(requestParameters) {
304
+ return __awaiter(this, void 0, void 0, function* () {
305
+ if (requestParameters['runId'] == null) {
306
+ throw new runtime.RequiredError('runId', 'Required parameter "runId" was null or undefined when calling unapproveWorkflowRunFile().');
307
+ }
308
+ if (requestParameters['pathPartId'] == null) {
309
+ throw new runtime.RequiredError('pathPartId', 'Required parameter "pathPartId" was null or undefined when calling unapproveWorkflowRunFile().');
310
+ }
311
+ const queryParameters = {};
312
+ const headerParameters = {};
313
+ if (requestParameters['authorization'] != null) {
314
+ headerParameters['authorization'] = String(requestParameters['authorization']);
315
+ }
316
+ let urlPath = `/v1/workflow-runs/{run_id}/files/{path_part_id}/unapprove`;
317
+ urlPath = urlPath.replace(`{${"run_id"}}`, encodeURIComponent(String(requestParameters['runId'])));
318
+ urlPath = urlPath.replace(`{${"path_part_id"}}`, encodeURIComponent(String(requestParameters['pathPartId'])));
319
+ return {
320
+ path: urlPath,
321
+ method: 'POST',
322
+ headers: headerParameters,
323
+ query: queryParameters,
324
+ };
325
+ });
326
+ }
327
+ /**
328
+ * Revert an approved file to ``pending``. Does NOT require the reviewer lock — anyone with ``can_write`` on the run path may unapprove (pilot plan §11.7).
329
+ * Unapprove Workflow Run File Handler
330
+ */
331
+ unapproveWorkflowRunFileRaw(requestParameters, initOverrides) {
332
+ return __awaiter(this, void 0, void 0, function* () {
333
+ const requestOptions = yield this.unapproveWorkflowRunFileRequestOpts(requestParameters);
334
+ const response = yield this.request(requestOptions, initOverrides);
335
+ return new runtime.JSONApiResponse(response, (jsonValue) => PathPartApprovalResponseFromJSON(jsonValue));
336
+ });
337
+ }
338
+ /**
339
+ * Revert an approved file to ``pending``. Does NOT require the reviewer lock — anyone with ``can_write`` on the run path may unapprove (pilot plan §11.7).
340
+ * Unapprove Workflow Run File Handler
341
+ */
342
+ unapproveWorkflowRunFile(requestParameters, initOverrides) {
343
+ return __awaiter(this, void 0, void 0, function* () {
344
+ const response = yield this.unapproveWorkflowRunFileRaw(requestParameters, initOverrides);
345
+ return yield response.value();
346
+ });
347
+ }
112
348
  /**
113
349
  * Creates request options for workflowRunCallback without sending the request
114
350
  */
@@ -13,6 +13,13 @@ import type { SelfHostedRunnerConfig } from './SelfHostedRunnerConfig';
13
13
  import type { WorkflowRunnerType } from './WorkflowRunnerType';
14
14
  /**
15
15
  * Create a new workflow definition.
16
+ *
17
+ * ``instruction_path_part_ids`` semantics depend on ``runner_type``:
18
+ *
19
+ * - ``KS_INTERNAL``: must be empty (``[]``); the server auto-provisions a
20
+ * single ``instruction.md`` and stores ``[doc.path_part_id]``.
21
+ * - ``SELF_HOSTED``: caller-supplied list of one-or-more document
22
+ * PathPart IDs. Must contain at least one entry.
16
23
  * @export
17
24
  * @interface CreateWorkflowDefinitionRequest
18
25
  */
@@ -58,7 +65,7 @@ export interface CreateWorkflowDefinitionRequest {
58
65
  * @type {Array<string>}
59
66
  * @memberof CreateWorkflowDefinitionRequest
60
67
  */
61
- instructionPathPartIds: Array<string>;
68
+ instructionPathPartIds?: Array<string>;
62
69
  /**
63
70
  *
64
71
  * @type {Array<string>}
@@ -71,6 +78,12 @@ export interface CreateWorkflowDefinitionRequest {
71
78
  * @memberof CreateWorkflowDefinitionRequest
72
79
  */
73
80
  templatePathPartId?: string | null;
81
+ /**
82
+ *
83
+ * @type {boolean}
84
+ * @memberof CreateWorkflowDefinitionRequest
85
+ */
86
+ approvalRequired?: boolean;
74
87
  }
75
88
  export declare const CreateWorkflowDefinitionRequestPropertyValidationAttributesMap: {
76
89
  [property: string]: {
@@ -30,7 +30,6 @@ export const CreateWorkflowDefinitionRequestPropertyValidationAttributesMap = {
30
30
  },
31
31
  instructionPathPartIds: {
32
32
  maxItems: 20,
33
- minItems: 1,
34
33
  uniqueItems: false,
35
34
  },
36
35
  outputPathPartIds: {
@@ -49,8 +48,6 @@ export function instanceOfCreateWorkflowDefinitionRequest(value) {
49
48
  return false;
50
49
  if (!('sourcePathPartIds' in value) || value['sourcePathPartIds'] === undefined)
51
50
  return false;
52
- if (!('instructionPathPartIds' in value) || value['instructionPathPartIds'] === undefined)
53
- return false;
54
51
  if (!('outputPathPartIds' in value) || value['outputPathPartIds'] === undefined)
55
52
  return false;
56
53
  return true;
@@ -69,9 +66,10 @@ export function CreateWorkflowDefinitionRequestFromJSONTyped(json, ignoreDiscrim
69
66
  'runnerConfig': json['runner_config'] == null ? undefined : SelfHostedRunnerConfigFromJSON(json['runner_config']),
70
67
  'maxRunDurationSeconds': json['max_run_duration_seconds'] == null ? undefined : json['max_run_duration_seconds'],
71
68
  'sourcePathPartIds': json['source_path_part_ids'],
72
- 'instructionPathPartIds': json['instruction_path_part_ids'],
69
+ 'instructionPathPartIds': json['instruction_path_part_ids'] == null ? undefined : json['instruction_path_part_ids'],
73
70
  'outputPathPartIds': json['output_path_part_ids'],
74
71
  'templatePathPartId': json['template_path_part_id'] == null ? undefined : json['template_path_part_id'],
72
+ 'approvalRequired': json['approval_required'] == null ? undefined : json['approval_required'],
75
73
  };
76
74
  }
77
75
  export function CreateWorkflowDefinitionRequestToJSON(json) {
@@ -91,5 +89,6 @@ export function CreateWorkflowDefinitionRequestToJSONTyped(value, ignoreDiscrimi
91
89
  'instruction_path_part_ids': value['instructionPathPartIds'],
92
90
  'output_path_part_ids': value['outputPathPartIds'],
93
91
  'template_path_part_id': value['templatePathPartId'],
92
+ 'approval_required': value['approvalRequired'],
94
93
  };
95
94
  }
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Knowledge Stack API
3
+ * Knowledge Stack backend API for authentication and knowledge management
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 { PartType } from './PartType';
13
+ /**
14
+ * Snapshot of one instruction document, pinned at trigger time.
15
+ *
16
+ * The instruction file is the workflow's **contract**: the agent reads
17
+ * this exact ``document_version_id`` for the duration of the run, even
18
+ * if the document is edited mid-flight or after the run completes.
19
+ * Reproducibility and audit replay depend on this pinning.
20
+ * @export
21
+ * @interface InstructionSnapshot
22
+ */
23
+ export interface InstructionSnapshot {
24
+ /**
25
+ *
26
+ * @type {string}
27
+ * @memberof InstructionSnapshot
28
+ */
29
+ pathPartId: string;
30
+ /**
31
+ *
32
+ * @type {string}
33
+ * @memberof InstructionSnapshot
34
+ */
35
+ materializedPath: string;
36
+ /**
37
+ *
38
+ * @type {PartType}
39
+ * @memberof InstructionSnapshot
40
+ */
41
+ partType: PartType;
42
+ /**
43
+ *
44
+ * @type {string}
45
+ * @memberof InstructionSnapshot
46
+ */
47
+ documentVersionId: string;
48
+ }
49
+ export declare const InstructionSnapshotPropertyValidationAttributesMap: {
50
+ [property: string]: {
51
+ maxLength?: number;
52
+ minLength?: number;
53
+ pattern?: string;
54
+ maximum?: number;
55
+ exclusiveMaximum?: boolean;
56
+ minimum?: number;
57
+ exclusiveMinimum?: boolean;
58
+ multipleOf?: number;
59
+ maxItems?: number;
60
+ minItems?: number;
61
+ uniqueItems?: boolean;
62
+ };
63
+ };
64
+ /**
65
+ * Check if a given object implements the InstructionSnapshot interface.
66
+ */
67
+ export declare function instanceOfInstructionSnapshot(value: object): value is InstructionSnapshot;
68
+ export declare function InstructionSnapshotFromJSON(json: any): InstructionSnapshot;
69
+ export declare function InstructionSnapshotFromJSONTyped(json: any, ignoreDiscriminator: boolean): InstructionSnapshot;
70
+ export declare function InstructionSnapshotToJSON(json: any): InstructionSnapshot;
71
+ export declare function InstructionSnapshotToJSONTyped(value?: InstructionSnapshot | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,57 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Knowledge Stack API
5
+ * Knowledge Stack backend API for authentication and knowledge management
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 { PartTypeFromJSON, PartTypeToJSON, } from './PartType';
15
+ export const InstructionSnapshotPropertyValidationAttributesMap = {};
16
+ /**
17
+ * Check if a given object implements the InstructionSnapshot interface.
18
+ */
19
+ export function instanceOfInstructionSnapshot(value) {
20
+ if (!('pathPartId' in value) || value['pathPartId'] === undefined)
21
+ return false;
22
+ if (!('materializedPath' in value) || value['materializedPath'] === undefined)
23
+ return false;
24
+ if (!('partType' in value) || value['partType'] === undefined)
25
+ return false;
26
+ if (!('documentVersionId' in value) || value['documentVersionId'] === undefined)
27
+ return false;
28
+ return true;
29
+ }
30
+ export function InstructionSnapshotFromJSON(json) {
31
+ return InstructionSnapshotFromJSONTyped(json, false);
32
+ }
33
+ export function InstructionSnapshotFromJSONTyped(json, ignoreDiscriminator) {
34
+ if (json == null) {
35
+ return json;
36
+ }
37
+ return {
38
+ 'pathPartId': json['path_part_id'],
39
+ 'materializedPath': json['materialized_path'],
40
+ 'partType': PartTypeFromJSON(json['part_type']),
41
+ 'documentVersionId': json['document_version_id'],
42
+ };
43
+ }
44
+ export function InstructionSnapshotToJSON(json) {
45
+ return InstructionSnapshotToJSONTyped(json, false);
46
+ }
47
+ export function InstructionSnapshotToJSONTyped(value, ignoreDiscriminator = false) {
48
+ if (value == null) {
49
+ return value;
50
+ }
51
+ return {
52
+ 'path_part_id': value['pathPartId'],
53
+ 'materialized_path': value['materializedPath'],
54
+ 'part_type': PartTypeToJSON(value['partType']),
55
+ 'document_version_id': value['documentVersionId'],
56
+ };
57
+ }
@@ -21,6 +21,12 @@ export interface InvokeWorkflowRequest {
21
21
  * @memberof InvokeWorkflowRequest
22
22
  */
23
23
  idempotencyKey?: string | null;
24
+ /**
25
+ * Path part IDs of input documents to pin to this run. Each path_part must be a DOCUMENT readable by the caller. Active document_version_id is captured at trigger time.
26
+ * @type {Array<string>}
27
+ * @memberof InvokeWorkflowRequest
28
+ */
29
+ inputPathPartIds?: Array<string>;
24
30
  }
25
31
  export declare const InvokeWorkflowRequestPropertyValidationAttributesMap: {
26
32
  [property: string]: {
@@ -15,6 +15,10 @@ export const InvokeWorkflowRequestPropertyValidationAttributesMap = {
15
15
  idempotencyKey: {
16
16
  maxLength: 255,
17
17
  },
18
+ inputPathPartIds: {
19
+ maxItems: 50,
20
+ uniqueItems: false,
21
+ },
18
22
  };
19
23
  /**
20
24
  * Check if a given object implements the InvokeWorkflowRequest interface.
@@ -31,6 +35,7 @@ export function InvokeWorkflowRequestFromJSONTyped(json, ignoreDiscriminator) {
31
35
  }
32
36
  return {
33
37
  'idempotencyKey': json['idempotency_key'] == null ? undefined : json['idempotency_key'],
38
+ 'inputPathPartIds': json['input_path_part_ids'] == null ? undefined : json['input_path_part_ids'],
34
39
  };
35
40
  }
36
41
  export function InvokeWorkflowRequestToJSON(json) {
@@ -42,5 +47,6 @@ export function InvokeWorkflowRequestToJSONTyped(value, ignoreDiscriminator = fa
42
47
  }
43
48
  return {
44
49
  'idempotency_key': value['idempotencyKey'],
50
+ 'input_path_part_ids': value['inputPathPartIds'],
45
51
  };
46
52
  }
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Knowledge Stack API
3
+ * Knowledge Stack backend API for authentication and knowledge management
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
+ * Per-file review status within a run (SeaHonor pilot).
14
+ *
15
+ * Now retained as the audit-history record (one row per (run, file));
16
+ * the current state of truth is ``path_part.approval_state``. The
17
+ * service dual-writes both.
18
+ * @export
19
+ */
20
+ export declare const PathPartApprovalDecision: {
21
+ readonly Pending: "pending";
22
+ readonly Approved: "approved";
23
+ readonly Rejected: "rejected";
24
+ };
25
+ export type PathPartApprovalDecision = typeof PathPartApprovalDecision[keyof typeof PathPartApprovalDecision];
26
+ export declare function instanceOfPathPartApprovalDecision(value: any): boolean;
27
+ export declare function PathPartApprovalDecisionFromJSON(json: any): PathPartApprovalDecision;
28
+ export declare function PathPartApprovalDecisionFromJSONTyped(json: any, ignoreDiscriminator: boolean): PathPartApprovalDecision;
29
+ export declare function PathPartApprovalDecisionToJSON(value?: PathPartApprovalDecision | null): any;
30
+ export declare function PathPartApprovalDecisionToJSONTyped(value: any, ignoreDiscriminator: boolean): PathPartApprovalDecision;
@@ -0,0 +1,48 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Knowledge Stack API
5
+ * Knowledge Stack backend API for authentication and knowledge management
6
+ *
7
+ * The version of the OpenAPI document: 0.1.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ /**
15
+ * Per-file review status within a run (SeaHonor pilot).
16
+ *
17
+ * Now retained as the audit-history record (one row per (run, file));
18
+ * the current state of truth is ``path_part.approval_state``. The
19
+ * service dual-writes both.
20
+ * @export
21
+ */
22
+ export const PathPartApprovalDecision = {
23
+ Pending: 'pending',
24
+ Approved: 'approved',
25
+ Rejected: 'rejected'
26
+ };
27
+ export function instanceOfPathPartApprovalDecision(value) {
28
+ for (const key in PathPartApprovalDecision) {
29
+ if (Object.prototype.hasOwnProperty.call(PathPartApprovalDecision, key)) {
30
+ if (PathPartApprovalDecision[key] === value) {
31
+ return true;
32
+ }
33
+ }
34
+ }
35
+ return false;
36
+ }
37
+ export function PathPartApprovalDecisionFromJSON(json) {
38
+ return PathPartApprovalDecisionFromJSONTyped(json, false);
39
+ }
40
+ export function PathPartApprovalDecisionFromJSONTyped(json, ignoreDiscriminator) {
41
+ return json;
42
+ }
43
+ export function PathPartApprovalDecisionToJSON(value) {
44
+ return value;
45
+ }
46
+ export function PathPartApprovalDecisionToJSONTyped(value, ignoreDiscriminator) {
47
+ return value;
48
+ }