@knowledge-stack/ksapi 1.81.0 → 1.82.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 (53) hide show
  1. package/.openapi-generator/FILES +2 -0
  2. package/README.md +3 -2
  3. package/dist/apis/WorkflowDefinitionsApi.d.ts +4 -1
  4. package/dist/apis/WorkflowDefinitionsApi.js +2 -0
  5. package/dist/esm/apis/WorkflowDefinitionsApi.d.ts +4 -1
  6. package/dist/esm/apis/WorkflowDefinitionsApi.js +2 -0
  7. package/dist/esm/models/CreateWorkflowDefinitionRequest.d.ts +8 -1
  8. package/dist/esm/models/CreateWorkflowDefinitionRequest.js +1 -4
  9. package/dist/esm/models/InstructionSnapshot.d.ts +71 -0
  10. package/dist/esm/models/InstructionSnapshot.js +57 -0
  11. package/dist/esm/models/InvokeWorkflowRequest.d.ts +6 -0
  12. package/dist/esm/models/InvokeWorkflowRequest.js +6 -0
  13. package/dist/esm/models/UpdateWorkflowDefinitionRequest.d.ts +6 -1
  14. package/dist/esm/models/WorkflowRunResponse.d.ts +17 -0
  15. package/dist/esm/models/WorkflowRunResponse.js +8 -0
  16. package/dist/esm/models/WorkflowRunSnapshot.d.ts +3 -2
  17. package/dist/esm/models/WorkflowRunSnapshot.js +3 -2
  18. package/dist/esm/models/WorkflowRunnerType.d.ts +1 -0
  19. package/dist/esm/models/WorkflowRunnerType.js +2 -1
  20. package/dist/esm/models/index.d.ts +1 -0
  21. package/dist/esm/models/index.js +1 -0
  22. package/dist/models/CreateWorkflowDefinitionRequest.d.ts +8 -1
  23. package/dist/models/CreateWorkflowDefinitionRequest.js +1 -4
  24. package/dist/models/InstructionSnapshot.d.ts +71 -0
  25. package/dist/models/InstructionSnapshot.js +65 -0
  26. package/dist/models/InvokeWorkflowRequest.d.ts +6 -0
  27. package/dist/models/InvokeWorkflowRequest.js +6 -0
  28. package/dist/models/UpdateWorkflowDefinitionRequest.d.ts +6 -1
  29. package/dist/models/WorkflowRunResponse.d.ts +17 -0
  30. package/dist/models/WorkflowRunResponse.js +8 -0
  31. package/dist/models/WorkflowRunSnapshot.d.ts +3 -2
  32. package/dist/models/WorkflowRunSnapshot.js +3 -2
  33. package/dist/models/WorkflowRunnerType.d.ts +1 -0
  34. package/dist/models/WorkflowRunnerType.js +2 -1
  35. package/dist/models/index.d.ts +1 -0
  36. package/dist/models/index.js +1 -0
  37. package/docs/CreateWorkflowDefinitionRequest.md +1 -1
  38. package/docs/InstructionSnapshot.md +41 -0
  39. package/docs/InvokeWorkflowRequest.md +2 -0
  40. package/docs/UpdateWorkflowDefinitionRequest.md +1 -1
  41. package/docs/WorkflowDefinitionsApi.md +2 -0
  42. package/docs/WorkflowRunResponse.md +5 -1
  43. package/docs/WorkflowRunSnapshot.md +1 -1
  44. package/package.json +1 -1
  45. package/src/apis/WorkflowDefinitionsApi.ts +4 -1
  46. package/src/models/CreateWorkflowDefinitionRequest.ts +9 -4
  47. package/src/models/InstructionSnapshot.ts +125 -0
  48. package/src/models/InvokeWorkflowRequest.ts +12 -0
  49. package/src/models/UpdateWorkflowDefinitionRequest.ts +6 -1
  50. package/src/models/WorkflowRunResponse.ts +23 -0
  51. package/src/models/WorkflowRunSnapshot.ts +11 -4
  52. package/src/models/WorkflowRunnerType.ts +2 -1
  53. package/src/models/index.ts +1 -0
@@ -89,6 +89,7 @@ docs/ImageTaxonomy.md
89
89
  docs/InformationStatistics.md
90
90
  docs/IngestDocumentResponse.md
91
91
  docs/IngestionMode.md
92
+ docs/InstructionSnapshot.md
92
93
  docs/InviteLinkSettingsRequest.md
93
94
  docs/InviteLinkSettingsResponse.md
94
95
  docs/InviteResponse.md
@@ -331,6 +332,7 @@ src/models/ImageTaxonomy.ts
331
332
  src/models/InformationStatistics.ts
332
333
  src/models/IngestDocumentResponse.ts
333
334
  src/models/IngestionMode.ts
335
+ src/models/InstructionSnapshot.ts
334
336
  src/models/InviteLinkSettingsRequest.ts
335
337
  src/models/InviteLinkSettingsResponse.ts
336
338
  src/models/InviteResponse.ts
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # @knowledge-stack/ksapi@1.81.0
1
+ # @knowledge-stack/ksapi@1.82.0
2
2
 
3
3
  A TypeScript SDK client for the localhost API.
4
4
 
@@ -279,6 +279,7 @@ All URIs are relative to *http://localhost:8000*
279
279
  - [InformationStatistics](docs/InformationStatistics.md)
280
280
  - [IngestDocumentResponse](docs/IngestDocumentResponse.md)
281
281
  - [IngestionMode](docs/IngestionMode.md)
282
+ - [InstructionSnapshot](docs/InstructionSnapshot.md)
282
283
  - [InviteLinkSettingsRequest](docs/InviteLinkSettingsRequest.md)
283
284
  - [InviteLinkSettingsResponse](docs/InviteLinkSettingsResponse.md)
284
285
  - [InviteResponse](docs/InviteResponse.md)
@@ -414,7 +415,7 @@ and is automatically generated by the
414
415
  [OpenAPI Generator](https://openapi-generator.tech) project:
415
416
 
416
417
  - API version: `0.1.0`
417
- - Package version: `1.81.0`
418
+ - Package version: `1.82.0`
418
419
  - Generator version: `7.21.0`
419
420
  - Build package: `org.openapitools.codegen.languages.TypeScriptFetchClientCodegen`
420
421
 
@@ -141,7 +141,7 @@ export interface WorkflowDefinitionsApiInterface {
141
141
  */
142
142
  invokeWorkflowRequestOpts(requestParameters: InvokeWorkflowOperationRequest): Promise<runtime.RequestOpts>;
143
143
  /**
144
- *
144
+ * Trigger a workflow run. All business logic lives in ``WorkflowInvocationService``. This handler only orchestrates the two phases: 1. **Phase 1 (in-session):** validate, build snapshot, persist run row, mint JWT. Wrapped in a single DB session so the run insert and the idempotency-race resolution share a transaction. 2. **Phase 2 (out-of-session):** dispatch HTTP call to the SELF_HOSTED runner. Best-effort — the run is already persisted, so failures here transition the run to ``FAILED`` rather than rejecting the request.
145
145
  * @summary Invoke Workflow Handler
146
146
  * @param {string} definitionId
147
147
  * @param {InvokeWorkflowRequest} invokeWorkflowRequest
@@ -153,6 +153,7 @@ export interface WorkflowDefinitionsApiInterface {
153
153
  */
154
154
  invokeWorkflowRaw(requestParameters: InvokeWorkflowOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WorkflowRunResponse>>;
155
155
  /**
156
+ * Trigger a workflow run. All business logic lives in ``WorkflowInvocationService``. This handler only orchestrates the two phases: 1. **Phase 1 (in-session):** validate, build snapshot, persist run row, mint JWT. Wrapped in a single DB session so the run insert and the idempotency-race resolution share a transaction. 2. **Phase 2 (out-of-session):** dispatch HTTP call to the SELF_HOSTED runner. Best-effort — the run is already persisted, so failures here transition the run to ``FAILED`` rather than rejecting the request.
156
157
  * Invoke Workflow Handler
157
158
  */
158
159
  invokeWorkflow(requestParameters: InvokeWorkflowOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowRunResponse>;
@@ -282,10 +283,12 @@ export declare class WorkflowDefinitionsApi extends runtime.BaseAPI implements W
282
283
  */
283
284
  invokeWorkflowRequestOpts(requestParameters: InvokeWorkflowOperationRequest): Promise<runtime.RequestOpts>;
284
285
  /**
286
+ * Trigger a workflow run. All business logic lives in ``WorkflowInvocationService``. This handler only orchestrates the two phases: 1. **Phase 1 (in-session):** validate, build snapshot, persist run row, mint JWT. Wrapped in a single DB session so the run insert and the idempotency-race resolution share a transaction. 2. **Phase 2 (out-of-session):** dispatch HTTP call to the SELF_HOSTED runner. Best-effort — the run is already persisted, so failures here transition the run to ``FAILED`` rather than rejecting the request.
285
287
  * Invoke Workflow Handler
286
288
  */
287
289
  invokeWorkflowRaw(requestParameters: InvokeWorkflowOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WorkflowRunResponse>>;
288
290
  /**
291
+ * Trigger a workflow run. All business logic lives in ``WorkflowInvocationService``. This handler only orchestrates the two phases: 1. **Phase 1 (in-session):** validate, build snapshot, persist run row, mint JWT. Wrapped in a single DB session so the run insert and the idempotency-race resolution share a transaction. 2. **Phase 2 (out-of-session):** dispatch HTTP call to the SELF_HOSTED runner. Best-effort — the run is already persisted, so failures here transition the run to ``FAILED`` rather than rejecting the request.
289
292
  * Invoke Workflow Handler
290
293
  */
291
294
  invokeWorkflow(requestParameters: InvokeWorkflowOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowRunResponse>;
@@ -217,6 +217,7 @@ class WorkflowDefinitionsApi extends runtime.BaseAPI {
217
217
  });
218
218
  }
219
219
  /**
220
+ * Trigger a workflow run. All business logic lives in ``WorkflowInvocationService``. This handler only orchestrates the two phases: 1. **Phase 1 (in-session):** validate, build snapshot, persist run row, mint JWT. Wrapped in a single DB session so the run insert and the idempotency-race resolution share a transaction. 2. **Phase 2 (out-of-session):** dispatch HTTP call to the SELF_HOSTED runner. Best-effort — the run is already persisted, so failures here transition the run to ``FAILED`` rather than rejecting the request.
220
221
  * Invoke Workflow Handler
221
222
  */
222
223
  invokeWorkflowRaw(requestParameters, initOverrides) {
@@ -227,6 +228,7 @@ class WorkflowDefinitionsApi extends runtime.BaseAPI {
227
228
  });
228
229
  }
229
230
  /**
231
+ * Trigger a workflow run. All business logic lives in ``WorkflowInvocationService``. This handler only orchestrates the two phases: 1. **Phase 1 (in-session):** validate, build snapshot, persist run row, mint JWT. Wrapped in a single DB session so the run insert and the idempotency-race resolution share a transaction. 2. **Phase 2 (out-of-session):** dispatch HTTP call to the SELF_HOSTED runner. Best-effort — the run is already persisted, so failures here transition the run to ``FAILED`` rather than rejecting the request.
230
232
  * Invoke Workflow Handler
231
233
  */
232
234
  invokeWorkflow(requestParameters, initOverrides) {
@@ -141,7 +141,7 @@ export interface WorkflowDefinitionsApiInterface {
141
141
  */
142
142
  invokeWorkflowRequestOpts(requestParameters: InvokeWorkflowOperationRequest): Promise<runtime.RequestOpts>;
143
143
  /**
144
- *
144
+ * Trigger a workflow run. All business logic lives in ``WorkflowInvocationService``. This handler only orchestrates the two phases: 1. **Phase 1 (in-session):** validate, build snapshot, persist run row, mint JWT. Wrapped in a single DB session so the run insert and the idempotency-race resolution share a transaction. 2. **Phase 2 (out-of-session):** dispatch HTTP call to the SELF_HOSTED runner. Best-effort — the run is already persisted, so failures here transition the run to ``FAILED`` rather than rejecting the request.
145
145
  * @summary Invoke Workflow Handler
146
146
  * @param {string} definitionId
147
147
  * @param {InvokeWorkflowRequest} invokeWorkflowRequest
@@ -153,6 +153,7 @@ export interface WorkflowDefinitionsApiInterface {
153
153
  */
154
154
  invokeWorkflowRaw(requestParameters: InvokeWorkflowOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WorkflowRunResponse>>;
155
155
  /**
156
+ * Trigger a workflow run. All business logic lives in ``WorkflowInvocationService``. This handler only orchestrates the two phases: 1. **Phase 1 (in-session):** validate, build snapshot, persist run row, mint JWT. Wrapped in a single DB session so the run insert and the idempotency-race resolution share a transaction. 2. **Phase 2 (out-of-session):** dispatch HTTP call to the SELF_HOSTED runner. Best-effort — the run is already persisted, so failures here transition the run to ``FAILED`` rather than rejecting the request.
156
157
  * Invoke Workflow Handler
157
158
  */
158
159
  invokeWorkflow(requestParameters: InvokeWorkflowOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowRunResponse>;
@@ -282,10 +283,12 @@ export declare class WorkflowDefinitionsApi extends runtime.BaseAPI implements W
282
283
  */
283
284
  invokeWorkflowRequestOpts(requestParameters: InvokeWorkflowOperationRequest): Promise<runtime.RequestOpts>;
284
285
  /**
286
+ * Trigger a workflow run. All business logic lives in ``WorkflowInvocationService``. This handler only orchestrates the two phases: 1. **Phase 1 (in-session):** validate, build snapshot, persist run row, mint JWT. Wrapped in a single DB session so the run insert and the idempotency-race resolution share a transaction. 2. **Phase 2 (out-of-session):** dispatch HTTP call to the SELF_HOSTED runner. Best-effort — the run is already persisted, so failures here transition the run to ``FAILED`` rather than rejecting the request.
285
287
  * Invoke Workflow Handler
286
288
  */
287
289
  invokeWorkflowRaw(requestParameters: InvokeWorkflowOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WorkflowRunResponse>>;
288
290
  /**
291
+ * Trigger a workflow run. All business logic lives in ``WorkflowInvocationService``. This handler only orchestrates the two phases: 1. **Phase 1 (in-session):** validate, build snapshot, persist run row, mint JWT. Wrapped in a single DB session so the run insert and the idempotency-race resolution share a transaction. 2. **Phase 2 (out-of-session):** dispatch HTTP call to the SELF_HOSTED runner. Best-effort — the run is already persisted, so failures here transition the run to ``FAILED`` rather than rejecting the request.
289
292
  * Invoke Workflow Handler
290
293
  */
291
294
  invokeWorkflow(requestParameters: InvokeWorkflowOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowRunResponse>;
@@ -181,6 +181,7 @@ export class WorkflowDefinitionsApi extends runtime.BaseAPI {
181
181
  });
182
182
  }
183
183
  /**
184
+ * Trigger a workflow run. All business logic lives in ``WorkflowInvocationService``. This handler only orchestrates the two phases: 1. **Phase 1 (in-session):** validate, build snapshot, persist run row, mint JWT. Wrapped in a single DB session so the run insert and the idempotency-race resolution share a transaction. 2. **Phase 2 (out-of-session):** dispatch HTTP call to the SELF_HOSTED runner. Best-effort — the run is already persisted, so failures here transition the run to ``FAILED`` rather than rejecting the request.
184
185
  * Invoke Workflow Handler
185
186
  */
186
187
  invokeWorkflowRaw(requestParameters, initOverrides) {
@@ -191,6 +192,7 @@ export class WorkflowDefinitionsApi extends runtime.BaseAPI {
191
192
  });
192
193
  }
193
194
  /**
195
+ * Trigger a workflow run. All business logic lives in ``WorkflowInvocationService``. This handler only orchestrates the two phases: 1. **Phase 1 (in-session):** validate, build snapshot, persist run row, mint JWT. Wrapped in a single DB session so the run insert and the idempotency-race resolution share a transaction. 2. **Phase 2 (out-of-session):** dispatch HTTP call to the SELF_HOSTED runner. Best-effort — the run is already persisted, so failures here transition the run to ``FAILED`` rather than rejecting the request.
194
196
  * Invoke Workflow Handler
195
197
  */
196
198
  invokeWorkflow(requestParameters, initOverrides) {
@@ -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>}
@@ -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,7 +66,7 @@ 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'],
75
72
  };
@@ -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
  }
@@ -12,7 +12,12 @@
12
12
  import type { SelfHostedRunnerConfig } from './SelfHostedRunnerConfig';
13
13
  import type { WorkflowRunnerType } from './WorkflowRunnerType';
14
14
  /**
15
- * Full replacement (PUT semantics). All fields are required.
15
+ * Full replacement (PUT semantics).
16
+ *
17
+ * ``instruction_path_part_ids``:
18
+ *
19
+ * - ``KS_INTERNAL``: must remain ``len == 1`` (the auto-provisioned doc).
20
+ * - ``SELF_HOSTED``: ``len ≥ 1``; callers may swap or add documents.
16
21
  * @export
17
22
  * @interface UpdateWorkflowDefinitionRequest
18
23
  */
@@ -14,6 +14,11 @@ import type { WorkflowRunStatus } from './WorkflowRunStatus';
14
14
  import type { WorkflowRunnerType } from './WorkflowRunnerType';
15
15
  /**
16
16
  * Workflow run response.
17
+ *
18
+ * Note: ``run_token_jti`` is intentionally NOT exposed. It's an
19
+ * internal token identifier persisted on the run row for callback
20
+ * auth — clients should treat run dispatch state as observable via
21
+ * ``status`` (RUNNING => dispatched), not via JTI presence.
17
22
  * @export
18
23
  * @interface WorkflowRunResponse
19
24
  */
@@ -72,6 +77,18 @@ export interface WorkflowRunResponse {
72
77
  * @memberof WorkflowRunResponse
73
78
  */
74
79
  error: string | null;
80
+ /**
81
+ *
82
+ * @type {Array<string>}
83
+ * @memberof WorkflowRunResponse
84
+ */
85
+ inputPathPartIds: Array<string>;
86
+ /**
87
+ *
88
+ * @type {Array<string>}
89
+ * @memberof WorkflowRunResponse
90
+ */
91
+ inputVersionIds: Array<string>;
75
92
  /**
76
93
  *
77
94
  * @type {Date}
@@ -37,6 +37,10 @@ export function instanceOfWorkflowRunResponse(value) {
37
37
  return false;
38
38
  if (!('error' in value) || value['error'] === undefined)
39
39
  return false;
40
+ if (!('inputPathPartIds' in value) || value['inputPathPartIds'] === undefined)
41
+ return false;
42
+ if (!('inputVersionIds' in value) || value['inputVersionIds'] === undefined)
43
+ return false;
40
44
  if (!('createdAt' in value) || value['createdAt'] === undefined)
41
45
  return false;
42
46
  if (!('updatedAt' in value) || value['updatedAt'] === undefined)
@@ -60,6 +64,8 @@ export function WorkflowRunResponseFromJSONTyped(json, ignoreDiscriminator) {
60
64
  'completedAt': (json['completed_at'] == null ? null : new Date(json['completed_at'])),
61
65
  'runSnapshot': WorkflowRunSnapshotFromJSON(json['run_snapshot']),
62
66
  'error': json['error'],
67
+ 'inputPathPartIds': json['input_path_part_ids'],
68
+ 'inputVersionIds': json['input_version_ids'],
63
69
  'createdAt': (new Date(json['created_at'])),
64
70
  'updatedAt': (new Date(json['updated_at'])),
65
71
  };
@@ -81,6 +87,8 @@ export function WorkflowRunResponseToJSONTyped(value, ignoreDiscriminator = fals
81
87
  'completed_at': value['completedAt'] == null ? value['completedAt'] : value['completedAt'].toISOString(),
82
88
  'run_snapshot': WorkflowRunSnapshotToJSON(value['runSnapshot']),
83
89
  'error': value['error'],
90
+ 'input_path_part_ids': value['inputPathPartIds'],
91
+ 'input_version_ids': value['inputVersionIds'],
84
92
  'created_at': value['createdAt'].toISOString(),
85
93
  'updated_at': value['updatedAt'].toISOString(),
86
94
  };
@@ -10,6 +10,7 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import type { ABCDPathSnapshot } from './ABCDPathSnapshot';
13
+ import type { InstructionSnapshot } from './InstructionSnapshot';
13
14
  import type { WorkflowRunnerType } from './WorkflowRunnerType';
14
15
  /**
15
16
  * Frozen ABCD configuration captured at workflow trigger time.
@@ -55,10 +56,10 @@ export interface WorkflowRunSnapshot {
55
56
  sources: Array<ABCDPathSnapshot>;
56
57
  /**
57
58
  *
58
- * @type {Array<ABCDPathSnapshot>}
59
+ * @type {Array<InstructionSnapshot>}
59
60
  * @memberof WorkflowRunSnapshot
60
61
  */
61
- instructions: Array<ABCDPathSnapshot>;
62
+ instructions: Array<InstructionSnapshot>;
62
63
  /**
63
64
  *
64
65
  * @type {Array<ABCDPathSnapshot>}
@@ -12,6 +12,7 @@
12
12
  * Do not edit the class manually.
13
13
  */
14
14
  import { ABCDPathSnapshotFromJSON, ABCDPathSnapshotToJSON, } from './ABCDPathSnapshot';
15
+ import { InstructionSnapshotFromJSON, InstructionSnapshotToJSON, } from './InstructionSnapshot';
15
16
  import { WorkflowRunnerTypeFromJSON, WorkflowRunnerTypeToJSON, } from './WorkflowRunnerType';
16
17
  export const WorkflowRunSnapshotPropertyValidationAttributesMap = {};
17
18
  /**
@@ -52,7 +53,7 @@ export function WorkflowRunSnapshotFromJSONTyped(json, ignoreDiscriminator) {
52
53
  'userId': json['user_id'],
53
54
  'maxRunDurationSeconds': json['max_run_duration_seconds'],
54
55
  'sources': (json['sources'].map(ABCDPathSnapshotFromJSON)),
55
- 'instructions': (json['instructions'].map(ABCDPathSnapshotFromJSON)),
56
+ 'instructions': (json['instructions'].map(InstructionSnapshotFromJSON)),
56
57
  'outputs': (json['outputs'].map(ABCDPathSnapshotFromJSON)),
57
58
  'template': ABCDPathSnapshotFromJSON(json['template']),
58
59
  };
@@ -71,7 +72,7 @@ export function WorkflowRunSnapshotToJSONTyped(value, ignoreDiscriminator = fals
71
72
  'user_id': value['userId'],
72
73
  'max_run_duration_seconds': value['maxRunDurationSeconds'],
73
74
  'sources': (value['sources'].map(ABCDPathSnapshotToJSON)),
74
- 'instructions': (value['instructions'].map(ABCDPathSnapshotToJSON)),
75
+ 'instructions': (value['instructions'].map(InstructionSnapshotToJSON)),
75
76
  'outputs': (value['outputs'].map(ABCDPathSnapshotToJSON)),
76
77
  'template': ABCDPathSnapshotToJSON(value['template']),
77
78
  };
@@ -15,6 +15,7 @@
15
15
  */
16
16
  export declare const WorkflowRunnerType: {
17
17
  readonly SelfHosted: "SELF_HOSTED";
18
+ readonly KsInternal: "KS_INTERNAL";
18
19
  };
19
20
  export type WorkflowRunnerType = typeof WorkflowRunnerType[keyof typeof WorkflowRunnerType];
20
21
  export declare function instanceOfWorkflowRunnerType(value: any): boolean;
@@ -16,7 +16,8 @@
16
16
  * @export
17
17
  */
18
18
  export const WorkflowRunnerType = {
19
- SelfHosted: 'SELF_HOSTED'
19
+ SelfHosted: 'SELF_HOSTED',
20
+ KsInternal: 'KS_INTERNAL'
20
21
  };
21
22
  export function instanceOfWorkflowRunnerType(value) {
22
23
  for (const key in WorkflowRunnerType) {
@@ -74,6 +74,7 @@ export * from './ImageTaxonomy';
74
74
  export * from './InformationStatistics';
75
75
  export * from './IngestDocumentResponse';
76
76
  export * from './IngestionMode';
77
+ export * from './InstructionSnapshot';
77
78
  export * from './InviteLinkSettingsRequest';
78
79
  export * from './InviteLinkSettingsResponse';
79
80
  export * from './InviteResponse';
@@ -76,6 +76,7 @@ export * from './ImageTaxonomy';
76
76
  export * from './InformationStatistics';
77
77
  export * from './IngestDocumentResponse';
78
78
  export * from './IngestionMode';
79
+ export * from './InstructionSnapshot';
79
80
  export * from './InviteLinkSettingsRequest';
80
81
  export * from './InviteLinkSettingsResponse';
81
82
  export * from './InviteResponse';
@@ -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>}
@@ -38,7 +38,6 @@ exports.CreateWorkflowDefinitionRequestPropertyValidationAttributesMap = {
38
38
  },
39
39
  instructionPathPartIds: {
40
40
  maxItems: 20,
41
- minItems: 1,
42
41
  uniqueItems: false,
43
42
  },
44
43
  outputPathPartIds: {
@@ -57,8 +56,6 @@ function instanceOfCreateWorkflowDefinitionRequest(value) {
57
56
  return false;
58
57
  if (!('sourcePathPartIds' in value) || value['sourcePathPartIds'] === undefined)
59
58
  return false;
60
- if (!('instructionPathPartIds' in value) || value['instructionPathPartIds'] === undefined)
61
- return false;
62
59
  if (!('outputPathPartIds' in value) || value['outputPathPartIds'] === undefined)
63
60
  return false;
64
61
  return true;
@@ -77,7 +74,7 @@ function CreateWorkflowDefinitionRequestFromJSONTyped(json, ignoreDiscriminator)
77
74
  'runnerConfig': json['runner_config'] == null ? undefined : (0, SelfHostedRunnerConfig_1.SelfHostedRunnerConfigFromJSON)(json['runner_config']),
78
75
  'maxRunDurationSeconds': json['max_run_duration_seconds'] == null ? undefined : json['max_run_duration_seconds'],
79
76
  'sourcePathPartIds': json['source_path_part_ids'],
80
- 'instructionPathPartIds': json['instruction_path_part_ids'],
77
+ 'instructionPathPartIds': json['instruction_path_part_ids'] == null ? undefined : json['instruction_path_part_ids'],
81
78
  'outputPathPartIds': json['output_path_part_ids'],
82
79
  'templatePathPartId': json['template_path_part_id'] == null ? undefined : json['template_path_part_id'],
83
80
  };
@@ -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;