@knowledge-stack/ksapi 1.104.0 → 1.105.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.
@@ -236,6 +236,7 @@ docs/SetApprovalStateRequest.md
236
236
  docs/SetWorkflowRunApprovalRequest.md
237
237
  docs/SignInRequest.md
238
238
  docs/SortDirection.md
239
+ docs/StartWorkflowRunRequest.md
239
240
  docs/StepInput.md
240
241
  docs/StepKind.md
241
242
  docs/StepOutput.md
@@ -577,6 +578,7 @@ src/models/SetApprovalStateRequest.ts
577
578
  src/models/SetWorkflowRunApprovalRequest.ts
578
579
  src/models/SignInRequest.ts
579
580
  src/models/SortDirection.ts
581
+ src/models/StartWorkflowRunRequest.ts
580
582
  src/models/StepInput.ts
581
583
  src/models/StepKind.ts
582
584
  src/models/StepOutput.ts
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # @knowledge-stack/ksapi@1.104.0
1
+ # @knowledge-stack/ksapi@1.105.0
2
2
 
3
3
  A TypeScript SDK client for the localhost API.
4
4
 
@@ -247,7 +247,7 @@ All URIs are relative to *http://localhost:8000*
247
247
  *WorkflowRunsApi* | [**listWorkflowRunsForTenant**](docs/WorkflowRunsApi.md#listworkflowrunsfortenant) | **GET** /v1/workflow-runs | List Workflow Runs For Tenant Handler
248
248
  *WorkflowRunsApi* | [**retryWorkflowRun**](docs/WorkflowRunsApi.md#retryworkflowrun) | **POST** /v1/workflow-runs/{run_id}/retry | Retry Workflow Run Handler
249
249
  *WorkflowRunsApi* | [**setWorkflowRunApproval**](docs/WorkflowRunsApi.md#setworkflowrunapprovaloperation) | **POST** /v1/workflow-runs/{run_id}/approval | Set Workflow Run Approval Handler
250
- *WorkflowRunsApi* | [**startWorkflowRun**](docs/WorkflowRunsApi.md#startworkflowrun) | **POST** /v1/workflow-runs/{run_id}/start | Start Workflow Run Handler
250
+ *WorkflowRunsApi* | [**startWorkflowRun**](docs/WorkflowRunsApi.md#startworkflowrunoperation) | **POST** /v1/workflow-runs/{run_id}/start | Start Workflow Run Handler
251
251
  *WorkflowRunsApi* | [**stopWorkflowRun**](docs/WorkflowRunsApi.md#stopworkflowrun) | **POST** /v1/workflow-runs/{run_id}/stop | Stop Workflow Run Handler
252
252
  *WorkflowRunsApi* | [**updateWorkflowRun**](docs/WorkflowRunsApi.md#updateworkflowrunoperation) | **PATCH** /v1/workflow-runs/{run_id} | Update Workflow Run Handler
253
253
  *WorkflowRunsApi* | [**workflowRunCallback**](docs/WorkflowRunsApi.md#workflowruncallbackoperation) | **POST** /v1/workflow-runs/{run_id}/callback | Workflow Run Callback Handler
@@ -473,6 +473,7 @@ All URIs are relative to *http://localhost:8000*
473
473
  - [SetWorkflowRunApprovalRequest](docs/SetWorkflowRunApprovalRequest.md)
474
474
  - [SignInRequest](docs/SignInRequest.md)
475
475
  - [SortDirection](docs/SortDirection.md)
476
+ - [StartWorkflowRunRequest](docs/StartWorkflowRunRequest.md)
476
477
  - [StepInput](docs/StepInput.md)
477
478
  - [StepKind](docs/StepKind.md)
478
479
  - [StepOutput](docs/StepOutput.md)
@@ -576,7 +577,7 @@ and is automatically generated by the
576
577
  [OpenAPI Generator](https://openapi-generator.tech) project:
577
578
 
578
579
  - API version: `0.1.0`
579
- - Package version: `1.104.0`
580
+ - Package version: `1.105.0`
580
581
  - Generator version: `7.21.0`
581
582
  - Build package: `org.openapitools.codegen.languages.TypeScriptFetchClientCodegen`
582
583
 
@@ -10,7 +10,7 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import type { CloneWorkflowRunRequest, PaginatedResponseWorkflowRunResponse, SetWorkflowRunApprovalRequest, SortDirection, UpdateWorkflowRunRequest, WorkflowCallbackResponse, WorkflowExecutionState, WorkflowRunCallbackRequest, WorkflowRunOrder, WorkflowRunResponse, WorkflowRunSummaryResponse } from '../models/index';
13
+ import type { CloneWorkflowRunRequest, PaginatedResponseWorkflowRunResponse, SetWorkflowRunApprovalRequest, SortDirection, StartWorkflowRunRequest, UpdateWorkflowRunRequest, WorkflowCallbackResponse, WorkflowExecutionState, WorkflowRunCallbackRequest, WorkflowRunOrder, WorkflowRunResponse, WorkflowRunSummaryResponse } from '../models/index';
14
14
  export interface CloneWorkflowRunOperationRequest {
15
15
  runId: string;
16
16
  cloneWorkflowRunRequest: CloneWorkflowRunRequest;
@@ -48,8 +48,9 @@ export interface SetWorkflowRunApprovalOperationRequest {
48
48
  runId: string;
49
49
  setWorkflowRunApprovalRequest: SetWorkflowRunApprovalRequest;
50
50
  }
51
- export interface StartWorkflowRunRequest {
51
+ export interface StartWorkflowRunOperationRequest {
52
52
  runId: string;
53
+ startWorkflowRunRequest?: StartWorkflowRunRequest | null;
53
54
  }
54
55
  export interface StopWorkflowRunRequest {
55
56
  runId: string;
@@ -249,24 +250,26 @@ export interface WorkflowRunsApiInterface {
249
250
  /**
250
251
  * Creates request options for startWorkflowRun without sending the request
251
252
  * @param {string} runId
253
+ * @param {StartWorkflowRunRequest} [startWorkflowRunRequest]
252
254
  * @throws {RequiredError}
253
255
  * @memberof WorkflowRunsApiInterface
254
256
  */
255
- startWorkflowRunRequestOpts(requestParameters: StartWorkflowRunRequest): Promise<runtime.RequestOpts>;
257
+ startWorkflowRunRequestOpts(requestParameters: StartWorkflowRunOperationRequest): Promise<runtime.RequestOpts>;
256
258
  /**
257
- * Flip a NOT_STARTED run to IN_PROGRESS and dispatch its agent run. Idempotent on IN_PROGRESS (returns the row). Terminal states → 409. Inputs still ingesting or in a failed terminal state → 409. The snapshot is built at this point (KB DOCUMENTs resolve to active versions, uploaded DVs are walked from inputs/, KB FOLDERs stay live).
259
+ * Flip a NOT_STARTED run to IN_PROGRESS and dispatch its agent run. Idempotent on IN_PROGRESS (returns the row). Terminal states → 409. Inputs still ingesting or in a failed terminal state → 409. The snapshot is built at this point (KB DOCUMENTs resolve to active versions, uploaded DVs are walked from inputs/, KB FOLDERs stay live). The body is optional; ``user_message`` (when sent) is pinned into the snapshot and shown in the run thread (see ``StartWorkflowRunRequest``).
258
260
  * @summary Start Workflow Run Handler
259
261
  * @param {string} runId
262
+ * @param {StartWorkflowRunRequest} [startWorkflowRunRequest]
260
263
  * @param {*} [options] Override http request option.
261
264
  * @throws {RequiredError}
262
265
  * @memberof WorkflowRunsApiInterface
263
266
  */
264
- startWorkflowRunRaw(requestParameters: StartWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WorkflowRunResponse>>;
267
+ startWorkflowRunRaw(requestParameters: StartWorkflowRunOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WorkflowRunResponse>>;
265
268
  /**
266
- * Flip a NOT_STARTED run to IN_PROGRESS and dispatch its agent run. Idempotent on IN_PROGRESS (returns the row). Terminal states → 409. Inputs still ingesting or in a failed terminal state → 409. The snapshot is built at this point (KB DOCUMENTs resolve to active versions, uploaded DVs are walked from inputs/, KB FOLDERs stay live).
269
+ * Flip a NOT_STARTED run to IN_PROGRESS and dispatch its agent run. Idempotent on IN_PROGRESS (returns the row). Terminal states → 409. Inputs still ingesting or in a failed terminal state → 409. The snapshot is built at this point (KB DOCUMENTs resolve to active versions, uploaded DVs are walked from inputs/, KB FOLDERs stay live). The body is optional; ``user_message`` (when sent) is pinned into the snapshot and shown in the run thread (see ``StartWorkflowRunRequest``).
267
270
  * Start Workflow Run Handler
268
271
  */
269
- startWorkflowRun(requestParameters: StartWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowRunResponse>;
272
+ startWorkflowRun(requestParameters: StartWorkflowRunOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowRunResponse>;
270
273
  /**
271
274
  * Creates request options for stopWorkflowRun without sending the request
272
275
  * @param {string} runId
@@ -436,17 +439,17 @@ export declare class WorkflowRunsApi extends runtime.BaseAPI implements Workflow
436
439
  /**
437
440
  * Creates request options for startWorkflowRun without sending the request
438
441
  */
439
- startWorkflowRunRequestOpts(requestParameters: StartWorkflowRunRequest): Promise<runtime.RequestOpts>;
442
+ startWorkflowRunRequestOpts(requestParameters: StartWorkflowRunOperationRequest): Promise<runtime.RequestOpts>;
440
443
  /**
441
- * Flip a NOT_STARTED run to IN_PROGRESS and dispatch its agent run. Idempotent on IN_PROGRESS (returns the row). Terminal states → 409. Inputs still ingesting or in a failed terminal state → 409. The snapshot is built at this point (KB DOCUMENTs resolve to active versions, uploaded DVs are walked from inputs/, KB FOLDERs stay live).
444
+ * Flip a NOT_STARTED run to IN_PROGRESS and dispatch its agent run. Idempotent on IN_PROGRESS (returns the row). Terminal states → 409. Inputs still ingesting or in a failed terminal state → 409. The snapshot is built at this point (KB DOCUMENTs resolve to active versions, uploaded DVs are walked from inputs/, KB FOLDERs stay live). The body is optional; ``user_message`` (when sent) is pinned into the snapshot and shown in the run thread (see ``StartWorkflowRunRequest``).
442
445
  * Start Workflow Run Handler
443
446
  */
444
- startWorkflowRunRaw(requestParameters: StartWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WorkflowRunResponse>>;
447
+ startWorkflowRunRaw(requestParameters: StartWorkflowRunOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WorkflowRunResponse>>;
445
448
  /**
446
- * Flip a NOT_STARTED run to IN_PROGRESS and dispatch its agent run. Idempotent on IN_PROGRESS (returns the row). Terminal states → 409. Inputs still ingesting or in a failed terminal state → 409. The snapshot is built at this point (KB DOCUMENTs resolve to active versions, uploaded DVs are walked from inputs/, KB FOLDERs stay live).
449
+ * Flip a NOT_STARTED run to IN_PROGRESS and dispatch its agent run. Idempotent on IN_PROGRESS (returns the row). Terminal states → 409. Inputs still ingesting or in a failed terminal state → 409. The snapshot is built at this point (KB DOCUMENTs resolve to active versions, uploaded DVs are walked from inputs/, KB FOLDERs stay live). The body is optional; ``user_message`` (when sent) is pinned into the snapshot and shown in the run thread (see ``StartWorkflowRunRequest``).
447
450
  * Start Workflow Run Handler
448
451
  */
449
- startWorkflowRun(requestParameters: StartWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowRunResponse>;
452
+ startWorkflowRun(requestParameters: StartWorkflowRunOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowRunResponse>;
450
453
  /**
451
454
  * Creates request options for stopWorkflowRun without sending the request
452
455
  */
@@ -453,6 +453,7 @@ class WorkflowRunsApi extends runtime.BaseAPI {
453
453
  }
454
454
  const queryParameters = {};
455
455
  const headerParameters = {};
456
+ headerParameters['Content-Type'] = 'application/json';
456
457
  if (this.configuration && this.configuration.accessToken) {
457
458
  const token = this.configuration.accessToken;
458
459
  const tokenString = yield token("bearerAuth", []);
@@ -467,11 +468,12 @@ class WorkflowRunsApi extends runtime.BaseAPI {
467
468
  method: 'POST',
468
469
  headers: headerParameters,
469
470
  query: queryParameters,
471
+ body: (0, index_1.StartWorkflowRunRequestToJSON)(requestParameters['startWorkflowRunRequest']),
470
472
  };
471
473
  });
472
474
  }
473
475
  /**
474
- * Flip a NOT_STARTED run to IN_PROGRESS and dispatch its agent run. Idempotent on IN_PROGRESS (returns the row). Terminal states → 409. Inputs still ingesting or in a failed terminal state → 409. The snapshot is built at this point (KB DOCUMENTs resolve to active versions, uploaded DVs are walked from inputs/, KB FOLDERs stay live).
476
+ * Flip a NOT_STARTED run to IN_PROGRESS and dispatch its agent run. Idempotent on IN_PROGRESS (returns the row). Terminal states → 409. Inputs still ingesting or in a failed terminal state → 409. The snapshot is built at this point (KB DOCUMENTs resolve to active versions, uploaded DVs are walked from inputs/, KB FOLDERs stay live). The body is optional; ``user_message`` (when sent) is pinned into the snapshot and shown in the run thread (see ``StartWorkflowRunRequest``).
475
477
  * Start Workflow Run Handler
476
478
  */
477
479
  startWorkflowRunRaw(requestParameters, initOverrides) {
@@ -482,7 +484,7 @@ class WorkflowRunsApi extends runtime.BaseAPI {
482
484
  });
483
485
  }
484
486
  /**
485
- * Flip a NOT_STARTED run to IN_PROGRESS and dispatch its agent run. Idempotent on IN_PROGRESS (returns the row). Terminal states → 409. Inputs still ingesting or in a failed terminal state → 409. The snapshot is built at this point (KB DOCUMENTs resolve to active versions, uploaded DVs are walked from inputs/, KB FOLDERs stay live).
487
+ * Flip a NOT_STARTED run to IN_PROGRESS and dispatch its agent run. Idempotent on IN_PROGRESS (returns the row). Terminal states → 409. Inputs still ingesting or in a failed terminal state → 409. The snapshot is built at this point (KB DOCUMENTs resolve to active versions, uploaded DVs are walked from inputs/, KB FOLDERs stay live). The body is optional; ``user_message`` (when sent) is pinned into the snapshot and shown in the run thread (see ``StartWorkflowRunRequest``).
486
488
  * Start Workflow Run Handler
487
489
  */
488
490
  startWorkflowRun(requestParameters, initOverrides) {
@@ -10,7 +10,7 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import type { CloneWorkflowRunRequest, PaginatedResponseWorkflowRunResponse, SetWorkflowRunApprovalRequest, SortDirection, UpdateWorkflowRunRequest, WorkflowCallbackResponse, WorkflowExecutionState, WorkflowRunCallbackRequest, WorkflowRunOrder, WorkflowRunResponse, WorkflowRunSummaryResponse } from '../models/index';
13
+ import type { CloneWorkflowRunRequest, PaginatedResponseWorkflowRunResponse, SetWorkflowRunApprovalRequest, SortDirection, StartWorkflowRunRequest, UpdateWorkflowRunRequest, WorkflowCallbackResponse, WorkflowExecutionState, WorkflowRunCallbackRequest, WorkflowRunOrder, WorkflowRunResponse, WorkflowRunSummaryResponse } from '../models/index';
14
14
  export interface CloneWorkflowRunOperationRequest {
15
15
  runId: string;
16
16
  cloneWorkflowRunRequest: CloneWorkflowRunRequest;
@@ -48,8 +48,9 @@ export interface SetWorkflowRunApprovalOperationRequest {
48
48
  runId: string;
49
49
  setWorkflowRunApprovalRequest: SetWorkflowRunApprovalRequest;
50
50
  }
51
- export interface StartWorkflowRunRequest {
51
+ export interface StartWorkflowRunOperationRequest {
52
52
  runId: string;
53
+ startWorkflowRunRequest?: StartWorkflowRunRequest | null;
53
54
  }
54
55
  export interface StopWorkflowRunRequest {
55
56
  runId: string;
@@ -249,24 +250,26 @@ export interface WorkflowRunsApiInterface {
249
250
  /**
250
251
  * Creates request options for startWorkflowRun without sending the request
251
252
  * @param {string} runId
253
+ * @param {StartWorkflowRunRequest} [startWorkflowRunRequest]
252
254
  * @throws {RequiredError}
253
255
  * @memberof WorkflowRunsApiInterface
254
256
  */
255
- startWorkflowRunRequestOpts(requestParameters: StartWorkflowRunRequest): Promise<runtime.RequestOpts>;
257
+ startWorkflowRunRequestOpts(requestParameters: StartWorkflowRunOperationRequest): Promise<runtime.RequestOpts>;
256
258
  /**
257
- * Flip a NOT_STARTED run to IN_PROGRESS and dispatch its agent run. Idempotent on IN_PROGRESS (returns the row). Terminal states → 409. Inputs still ingesting or in a failed terminal state → 409. The snapshot is built at this point (KB DOCUMENTs resolve to active versions, uploaded DVs are walked from inputs/, KB FOLDERs stay live).
259
+ * Flip a NOT_STARTED run to IN_PROGRESS and dispatch its agent run. Idempotent on IN_PROGRESS (returns the row). Terminal states → 409. Inputs still ingesting or in a failed terminal state → 409. The snapshot is built at this point (KB DOCUMENTs resolve to active versions, uploaded DVs are walked from inputs/, KB FOLDERs stay live). The body is optional; ``user_message`` (when sent) is pinned into the snapshot and shown in the run thread (see ``StartWorkflowRunRequest``).
258
260
  * @summary Start Workflow Run Handler
259
261
  * @param {string} runId
262
+ * @param {StartWorkflowRunRequest} [startWorkflowRunRequest]
260
263
  * @param {*} [options] Override http request option.
261
264
  * @throws {RequiredError}
262
265
  * @memberof WorkflowRunsApiInterface
263
266
  */
264
- startWorkflowRunRaw(requestParameters: StartWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WorkflowRunResponse>>;
267
+ startWorkflowRunRaw(requestParameters: StartWorkflowRunOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WorkflowRunResponse>>;
265
268
  /**
266
- * Flip a NOT_STARTED run to IN_PROGRESS and dispatch its agent run. Idempotent on IN_PROGRESS (returns the row). Terminal states → 409. Inputs still ingesting or in a failed terminal state → 409. The snapshot is built at this point (KB DOCUMENTs resolve to active versions, uploaded DVs are walked from inputs/, KB FOLDERs stay live).
269
+ * Flip a NOT_STARTED run to IN_PROGRESS and dispatch its agent run. Idempotent on IN_PROGRESS (returns the row). Terminal states → 409. Inputs still ingesting or in a failed terminal state → 409. The snapshot is built at this point (KB DOCUMENTs resolve to active versions, uploaded DVs are walked from inputs/, KB FOLDERs stay live). The body is optional; ``user_message`` (when sent) is pinned into the snapshot and shown in the run thread (see ``StartWorkflowRunRequest``).
267
270
  * Start Workflow Run Handler
268
271
  */
269
- startWorkflowRun(requestParameters: StartWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowRunResponse>;
272
+ startWorkflowRun(requestParameters: StartWorkflowRunOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowRunResponse>;
270
273
  /**
271
274
  * Creates request options for stopWorkflowRun without sending the request
272
275
  * @param {string} runId
@@ -436,17 +439,17 @@ export declare class WorkflowRunsApi extends runtime.BaseAPI implements Workflow
436
439
  /**
437
440
  * Creates request options for startWorkflowRun without sending the request
438
441
  */
439
- startWorkflowRunRequestOpts(requestParameters: StartWorkflowRunRequest): Promise<runtime.RequestOpts>;
442
+ startWorkflowRunRequestOpts(requestParameters: StartWorkflowRunOperationRequest): Promise<runtime.RequestOpts>;
440
443
  /**
441
- * Flip a NOT_STARTED run to IN_PROGRESS and dispatch its agent run. Idempotent on IN_PROGRESS (returns the row). Terminal states → 409. Inputs still ingesting or in a failed terminal state → 409. The snapshot is built at this point (KB DOCUMENTs resolve to active versions, uploaded DVs are walked from inputs/, KB FOLDERs stay live).
444
+ * Flip a NOT_STARTED run to IN_PROGRESS and dispatch its agent run. Idempotent on IN_PROGRESS (returns the row). Terminal states → 409. Inputs still ingesting or in a failed terminal state → 409. The snapshot is built at this point (KB DOCUMENTs resolve to active versions, uploaded DVs are walked from inputs/, KB FOLDERs stay live). The body is optional; ``user_message`` (when sent) is pinned into the snapshot and shown in the run thread (see ``StartWorkflowRunRequest``).
442
445
  * Start Workflow Run Handler
443
446
  */
444
- startWorkflowRunRaw(requestParameters: StartWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WorkflowRunResponse>>;
447
+ startWorkflowRunRaw(requestParameters: StartWorkflowRunOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WorkflowRunResponse>>;
445
448
  /**
446
- * Flip a NOT_STARTED run to IN_PROGRESS and dispatch its agent run. Idempotent on IN_PROGRESS (returns the row). Terminal states → 409. Inputs still ingesting or in a failed terminal state → 409. The snapshot is built at this point (KB DOCUMENTs resolve to active versions, uploaded DVs are walked from inputs/, KB FOLDERs stay live).
449
+ * Flip a NOT_STARTED run to IN_PROGRESS and dispatch its agent run. Idempotent on IN_PROGRESS (returns the row). Terminal states → 409. Inputs still ingesting or in a failed terminal state → 409. The snapshot is built at this point (KB DOCUMENTs resolve to active versions, uploaded DVs are walked from inputs/, KB FOLDERs stay live). The body is optional; ``user_message`` (when sent) is pinned into the snapshot and shown in the run thread (see ``StartWorkflowRunRequest``).
447
450
  * Start Workflow Run Handler
448
451
  */
449
- startWorkflowRun(requestParameters: StartWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowRunResponse>;
452
+ startWorkflowRun(requestParameters: StartWorkflowRunOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowRunResponse>;
450
453
  /**
451
454
  * Creates request options for stopWorkflowRun without sending the request
452
455
  */
@@ -21,7 +21,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
21
21
  });
22
22
  };
23
23
  import * as runtime from '../runtime';
24
- import { CloneWorkflowRunRequestToJSON, PaginatedResponseWorkflowRunResponseFromJSON, SetWorkflowRunApprovalRequestToJSON, UpdateWorkflowRunRequestToJSON, WorkflowCallbackResponseFromJSON, WorkflowRunCallbackRequestToJSON, WorkflowRunResponseFromJSON, WorkflowRunSummaryResponseFromJSON, } from '../models/index';
24
+ import { CloneWorkflowRunRequestToJSON, PaginatedResponseWorkflowRunResponseFromJSON, SetWorkflowRunApprovalRequestToJSON, StartWorkflowRunRequestToJSON, UpdateWorkflowRunRequestToJSON, WorkflowCallbackResponseFromJSON, WorkflowRunCallbackRequestToJSON, WorkflowRunResponseFromJSON, WorkflowRunSummaryResponseFromJSON, } from '../models/index';
25
25
  /**
26
26
  *
27
27
  */
@@ -417,6 +417,7 @@ export class WorkflowRunsApi extends runtime.BaseAPI {
417
417
  }
418
418
  const queryParameters = {};
419
419
  const headerParameters = {};
420
+ headerParameters['Content-Type'] = 'application/json';
420
421
  if (this.configuration && this.configuration.accessToken) {
421
422
  const token = this.configuration.accessToken;
422
423
  const tokenString = yield token("bearerAuth", []);
@@ -431,11 +432,12 @@ export class WorkflowRunsApi extends runtime.BaseAPI {
431
432
  method: 'POST',
432
433
  headers: headerParameters,
433
434
  query: queryParameters,
435
+ body: StartWorkflowRunRequestToJSON(requestParameters['startWorkflowRunRequest']),
434
436
  };
435
437
  });
436
438
  }
437
439
  /**
438
- * Flip a NOT_STARTED run to IN_PROGRESS and dispatch its agent run. Idempotent on IN_PROGRESS (returns the row). Terminal states → 409. Inputs still ingesting or in a failed terminal state → 409. The snapshot is built at this point (KB DOCUMENTs resolve to active versions, uploaded DVs are walked from inputs/, KB FOLDERs stay live).
440
+ * Flip a NOT_STARTED run to IN_PROGRESS and dispatch its agent run. Idempotent on IN_PROGRESS (returns the row). Terminal states → 409. Inputs still ingesting or in a failed terminal state → 409. The snapshot is built at this point (KB DOCUMENTs resolve to active versions, uploaded DVs are walked from inputs/, KB FOLDERs stay live). The body is optional; ``user_message`` (when sent) is pinned into the snapshot and shown in the run thread (see ``StartWorkflowRunRequest``).
439
441
  * Start Workflow Run Handler
440
442
  */
441
443
  startWorkflowRunRaw(requestParameters, initOverrides) {
@@ -446,7 +448,7 @@ export class WorkflowRunsApi extends runtime.BaseAPI {
446
448
  });
447
449
  }
448
450
  /**
449
- * Flip a NOT_STARTED run to IN_PROGRESS and dispatch its agent run. Idempotent on IN_PROGRESS (returns the row). Terminal states → 409. Inputs still ingesting or in a failed terminal state → 409. The snapshot is built at this point (KB DOCUMENTs resolve to active versions, uploaded DVs are walked from inputs/, KB FOLDERs stay live).
451
+ * Flip a NOT_STARTED run to IN_PROGRESS and dispatch its agent run. Idempotent on IN_PROGRESS (returns the row). Terminal states → 409. Inputs still ingesting or in a failed terminal state → 409. The snapshot is built at this point (KB DOCUMENTs resolve to active versions, uploaded DVs are walked from inputs/, KB FOLDERs stay live). The body is optional; ``user_message`` (when sent) is pinned into the snapshot and shown in the run thread (see ``StartWorkflowRunRequest``).
450
452
  * Start Workflow Run Handler
451
453
  */
452
454
  startWorkflowRun(requestParameters, initOverrides) {
@@ -0,0 +1,53 @@
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
+ * Optional JSON body for ``POST /v1/workflow-runs/{id}/start``.
14
+ *
15
+ * The whole body is optional: an absent body starts the run with just
16
+ * the localized "Started workflow: X" opening message, exactly as
17
+ * before. When ``user_message`` is set it is appended to that opening
18
+ * thread message AND injected into the runner's first user turn, so the
19
+ * agent acts on it as guidance layered on the workflow instruction.
20
+ * @export
21
+ * @interface StartWorkflowRunRequest
22
+ */
23
+ export interface StartWorkflowRunRequest {
24
+ /**
25
+ * Free-text instruction shown in the run thread and passed to the agent as additional guidance on top of the workflow instruction. Optional.
26
+ * @type {string}
27
+ * @memberof StartWorkflowRunRequest
28
+ */
29
+ userMessage?: string | null;
30
+ }
31
+ export declare const StartWorkflowRunRequestPropertyValidationAttributesMap: {
32
+ [property: string]: {
33
+ maxLength?: number;
34
+ minLength?: number;
35
+ pattern?: string;
36
+ maximum?: number;
37
+ exclusiveMaximum?: boolean;
38
+ minimum?: number;
39
+ exclusiveMinimum?: boolean;
40
+ multipleOf?: number;
41
+ maxItems?: number;
42
+ minItems?: number;
43
+ uniqueItems?: boolean;
44
+ };
45
+ };
46
+ /**
47
+ * Check if a given object implements the StartWorkflowRunRequest interface.
48
+ */
49
+ export declare function instanceOfStartWorkflowRunRequest(value: object): value is StartWorkflowRunRequest;
50
+ export declare function StartWorkflowRunRequestFromJSON(json: any): StartWorkflowRunRequest;
51
+ export declare function StartWorkflowRunRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): StartWorkflowRunRequest;
52
+ export declare function StartWorkflowRunRequestToJSON(json: any): StartWorkflowRunRequest;
53
+ export declare function StartWorkflowRunRequestToJSONTyped(value?: StartWorkflowRunRequest | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,46 @@
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
+ export const StartWorkflowRunRequestPropertyValidationAttributesMap = {
15
+ userMessage: {
16
+ maxLength: 4000,
17
+ },
18
+ };
19
+ /**
20
+ * Check if a given object implements the StartWorkflowRunRequest interface.
21
+ */
22
+ export function instanceOfStartWorkflowRunRequest(value) {
23
+ return true;
24
+ }
25
+ export function StartWorkflowRunRequestFromJSON(json) {
26
+ return StartWorkflowRunRequestFromJSONTyped(json, false);
27
+ }
28
+ export function StartWorkflowRunRequestFromJSONTyped(json, ignoreDiscriminator) {
29
+ if (json == null) {
30
+ return json;
31
+ }
32
+ return {
33
+ 'userMessage': json['user_message'] == null ? undefined : json['user_message'],
34
+ };
35
+ }
36
+ export function StartWorkflowRunRequestToJSON(json) {
37
+ return StartWorkflowRunRequestToJSONTyped(json, false);
38
+ }
39
+ export function StartWorkflowRunRequestToJSONTyped(value, ignoreDiscriminator = false) {
40
+ if (value == null) {
41
+ return value;
42
+ }
43
+ return {
44
+ 'user_message': value['userMessage'],
45
+ };
46
+ }
@@ -49,6 +49,12 @@ export interface WorkflowRunSnapshot {
49
49
  * @memberof WorkflowRunSnapshot
50
50
  */
51
51
  inputs: Array<InputSnapshot>;
52
+ /**
53
+ * Optional free-text message the caller supplied at Start. Pinned here so the runner injects it into the agent's first user turn and it survives retry, redrive, and workflow-thread follow-ups (all of which re-assemble the prompt from this snapshot).
54
+ * @type {string}
55
+ * @memberof WorkflowRunSnapshot
56
+ */
57
+ userMessage?: string | null;
52
58
  }
53
59
  export declare const WorkflowRunSnapshotPropertyValidationAttributesMap: {
54
60
  [property: string]: {
@@ -13,7 +13,11 @@
13
13
  */
14
14
  import { InputSnapshotFromJSON, InputSnapshotToJSON, } from './InputSnapshot';
15
15
  import { InstructionSnapshotFromJSON, InstructionSnapshotToJSON, } from './InstructionSnapshot';
16
- export const WorkflowRunSnapshotPropertyValidationAttributesMap = {};
16
+ export const WorkflowRunSnapshotPropertyValidationAttributesMap = {
17
+ userMessage: {
18
+ maxLength: 4000,
19
+ },
20
+ };
17
21
  /**
18
22
  * Check if a given object implements the WorkflowRunSnapshot interface.
19
23
  */
@@ -40,6 +44,7 @@ export function WorkflowRunSnapshotFromJSONTyped(json, ignoreDiscriminator) {
40
44
  'maxRunDurationSeconds': json['max_run_duration_seconds'],
41
45
  'instruction': InstructionSnapshotFromJSON(json['instruction']),
42
46
  'inputs': (json['inputs'].map(InputSnapshotFromJSON)),
47
+ 'userMessage': json['user_message'] == null ? undefined : json['user_message'],
43
48
  };
44
49
  }
45
50
  export function WorkflowRunSnapshotToJSON(json) {
@@ -54,5 +59,6 @@ export function WorkflowRunSnapshotToJSONTyped(value, ignoreDiscriminator = fals
54
59
  'max_run_duration_seconds': value['maxRunDurationSeconds'],
55
60
  'instruction': InstructionSnapshotToJSON(value['instruction']),
56
61
  'inputs': (value['inputs'].map(InputSnapshotToJSON)),
62
+ 'user_message': value['userMessage'],
57
63
  };
58
64
  }
@@ -211,6 +211,7 @@ export * from './SetApprovalStateRequest';
211
211
  export * from './SetWorkflowRunApprovalRequest';
212
212
  export * from './SignInRequest';
213
213
  export * from './SortDirection';
214
+ export * from './StartWorkflowRunRequest';
214
215
  export * from './StepInput';
215
216
  export * from './StepKind';
216
217
  export * from './StepOutput';
@@ -213,6 +213,7 @@ export * from './SetApprovalStateRequest';
213
213
  export * from './SetWorkflowRunApprovalRequest';
214
214
  export * from './SignInRequest';
215
215
  export * from './SortDirection';
216
+ export * from './StartWorkflowRunRequest';
216
217
  export * from './StepInput';
217
218
  export * from './StepKind';
218
219
  export * from './StepOutput';
@@ -0,0 +1,53 @@
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
+ * Optional JSON body for ``POST /v1/workflow-runs/{id}/start``.
14
+ *
15
+ * The whole body is optional: an absent body starts the run with just
16
+ * the localized "Started workflow: X" opening message, exactly as
17
+ * before. When ``user_message`` is set it is appended to that opening
18
+ * thread message AND injected into the runner's first user turn, so the
19
+ * agent acts on it as guidance layered on the workflow instruction.
20
+ * @export
21
+ * @interface StartWorkflowRunRequest
22
+ */
23
+ export interface StartWorkflowRunRequest {
24
+ /**
25
+ * Free-text instruction shown in the run thread and passed to the agent as additional guidance on top of the workflow instruction. Optional.
26
+ * @type {string}
27
+ * @memberof StartWorkflowRunRequest
28
+ */
29
+ userMessage?: string | null;
30
+ }
31
+ export declare const StartWorkflowRunRequestPropertyValidationAttributesMap: {
32
+ [property: string]: {
33
+ maxLength?: number;
34
+ minLength?: number;
35
+ pattern?: string;
36
+ maximum?: number;
37
+ exclusiveMaximum?: boolean;
38
+ minimum?: number;
39
+ exclusiveMinimum?: boolean;
40
+ multipleOf?: number;
41
+ maxItems?: number;
42
+ minItems?: number;
43
+ uniqueItems?: boolean;
44
+ };
45
+ };
46
+ /**
47
+ * Check if a given object implements the StartWorkflowRunRequest interface.
48
+ */
49
+ export declare function instanceOfStartWorkflowRunRequest(value: object): value is StartWorkflowRunRequest;
50
+ export declare function StartWorkflowRunRequestFromJSON(json: any): StartWorkflowRunRequest;
51
+ export declare function StartWorkflowRunRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): StartWorkflowRunRequest;
52
+ export declare function StartWorkflowRunRequestToJSON(json: any): StartWorkflowRunRequest;
53
+ export declare function StartWorkflowRunRequestToJSONTyped(value?: StartWorkflowRunRequest | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Knowledge Stack API
6
+ * Knowledge Stack backend API for authentication and knowledge management
7
+ *
8
+ * The version of the OpenAPI document: 0.1.0
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.StartWorkflowRunRequestPropertyValidationAttributesMap = void 0;
17
+ exports.instanceOfStartWorkflowRunRequest = instanceOfStartWorkflowRunRequest;
18
+ exports.StartWorkflowRunRequestFromJSON = StartWorkflowRunRequestFromJSON;
19
+ exports.StartWorkflowRunRequestFromJSONTyped = StartWorkflowRunRequestFromJSONTyped;
20
+ exports.StartWorkflowRunRequestToJSON = StartWorkflowRunRequestToJSON;
21
+ exports.StartWorkflowRunRequestToJSONTyped = StartWorkflowRunRequestToJSONTyped;
22
+ exports.StartWorkflowRunRequestPropertyValidationAttributesMap = {
23
+ userMessage: {
24
+ maxLength: 4000,
25
+ },
26
+ };
27
+ /**
28
+ * Check if a given object implements the StartWorkflowRunRequest interface.
29
+ */
30
+ function instanceOfStartWorkflowRunRequest(value) {
31
+ return true;
32
+ }
33
+ function StartWorkflowRunRequestFromJSON(json) {
34
+ return StartWorkflowRunRequestFromJSONTyped(json, false);
35
+ }
36
+ function StartWorkflowRunRequestFromJSONTyped(json, ignoreDiscriminator) {
37
+ if (json == null) {
38
+ return json;
39
+ }
40
+ return {
41
+ 'userMessage': json['user_message'] == null ? undefined : json['user_message'],
42
+ };
43
+ }
44
+ function StartWorkflowRunRequestToJSON(json) {
45
+ return StartWorkflowRunRequestToJSONTyped(json, false);
46
+ }
47
+ function StartWorkflowRunRequestToJSONTyped(value, ignoreDiscriminator = false) {
48
+ if (value == null) {
49
+ return value;
50
+ }
51
+ return {
52
+ 'user_message': value['userMessage'],
53
+ };
54
+ }
@@ -49,6 +49,12 @@ export interface WorkflowRunSnapshot {
49
49
  * @memberof WorkflowRunSnapshot
50
50
  */
51
51
  inputs: Array<InputSnapshot>;
52
+ /**
53
+ * Optional free-text message the caller supplied at Start. Pinned here so the runner injects it into the agent's first user turn and it survives retry, redrive, and workflow-thread follow-ups (all of which re-assemble the prompt from this snapshot).
54
+ * @type {string}
55
+ * @memberof WorkflowRunSnapshot
56
+ */
57
+ userMessage?: string | null;
52
58
  }
53
59
  export declare const WorkflowRunSnapshotPropertyValidationAttributesMap: {
54
60
  [property: string]: {
@@ -21,7 +21,11 @@ exports.WorkflowRunSnapshotToJSON = WorkflowRunSnapshotToJSON;
21
21
  exports.WorkflowRunSnapshotToJSONTyped = WorkflowRunSnapshotToJSONTyped;
22
22
  const InputSnapshot_1 = require("./InputSnapshot");
23
23
  const InstructionSnapshot_1 = require("./InstructionSnapshot");
24
- exports.WorkflowRunSnapshotPropertyValidationAttributesMap = {};
24
+ exports.WorkflowRunSnapshotPropertyValidationAttributesMap = {
25
+ userMessage: {
26
+ maxLength: 4000,
27
+ },
28
+ };
25
29
  /**
26
30
  * Check if a given object implements the WorkflowRunSnapshot interface.
27
31
  */
@@ -48,6 +52,7 @@ function WorkflowRunSnapshotFromJSONTyped(json, ignoreDiscriminator) {
48
52
  'maxRunDurationSeconds': json['max_run_duration_seconds'],
49
53
  'instruction': (0, InstructionSnapshot_1.InstructionSnapshotFromJSON)(json['instruction']),
50
54
  'inputs': (json['inputs'].map(InputSnapshot_1.InputSnapshotFromJSON)),
55
+ 'userMessage': json['user_message'] == null ? undefined : json['user_message'],
51
56
  };
52
57
  }
53
58
  function WorkflowRunSnapshotToJSON(json) {
@@ -62,5 +67,6 @@ function WorkflowRunSnapshotToJSONTyped(value, ignoreDiscriminator = false) {
62
67
  'max_run_duration_seconds': value['maxRunDurationSeconds'],
63
68
  'instruction': (0, InstructionSnapshot_1.InstructionSnapshotToJSON)(value['instruction']),
64
69
  'inputs': (value['inputs'].map(InputSnapshot_1.InputSnapshotToJSON)),
70
+ 'user_message': value['userMessage'],
65
71
  };
66
72
  }
@@ -211,6 +211,7 @@ export * from './SetApprovalStateRequest';
211
211
  export * from './SetWorkflowRunApprovalRequest';
212
212
  export * from './SignInRequest';
213
213
  export * from './SortDirection';
214
+ export * from './StartWorkflowRunRequest';
214
215
  export * from './StepInput';
215
216
  export * from './StepKind';
216
217
  export * from './StepOutput';
@@ -229,6 +229,7 @@ __exportStar(require("./SetApprovalStateRequest"), exports);
229
229
  __exportStar(require("./SetWorkflowRunApprovalRequest"), exports);
230
230
  __exportStar(require("./SignInRequest"), exports);
231
231
  __exportStar(require("./SortDirection"), exports);
232
+ __exportStar(require("./StartWorkflowRunRequest"), exports);
232
233
  __exportStar(require("./StepInput"), exports);
233
234
  __exportStar(require("./StepKind"), exports);
234
235
  __exportStar(require("./StepOutput"), exports);
@@ -0,0 +1,35 @@
1
+
2
+ # StartWorkflowRunRequest
3
+
4
+ Optional JSON body for ``POST /v1/workflow-runs/{id}/start``. The whole body is optional: an absent body starts the run with just the localized \"Started workflow: X\" opening message, exactly as before. When ``user_message`` is set it is appended to that opening thread message AND injected into the runner\'s first user turn, so the agent acts on it as guidance layered on the workflow instruction.
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `userMessage` | string
11
+
12
+ ## Example
13
+
14
+ ```typescript
15
+ import type { StartWorkflowRunRequest } from '@knowledge-stack/ksapi'
16
+
17
+ // TODO: Update the object below with actual values
18
+ const example = {
19
+ "userMessage": null,
20
+ } satisfies StartWorkflowRunRequest
21
+
22
+ console.log(example)
23
+
24
+ // Convert the instance to a JSON string
25
+ const exampleJSON: string = JSON.stringify(example)
26
+ console.log(exampleJSON)
27
+
28
+ // Parse the JSON string back to an object
29
+ const exampleParsed = JSON.parse(exampleJSON) as StartWorkflowRunRequest
30
+ console.log(exampleParsed)
31
+ ```
32
+
33
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
34
+
35
+
@@ -11,6 +11,7 @@ Name | Type
11
11
  `maxRunDurationSeconds` | number
12
12
  `instruction` | [InstructionSnapshot](InstructionSnapshot.md)
13
13
  `inputs` | [Array&lt;InputSnapshot&gt;](InputSnapshot.md)
14
+ `userMessage` | string
14
15
 
15
16
  ## Example
16
17
 
@@ -23,6 +24,7 @@ const example = {
23
24
  "maxRunDurationSeconds": null,
24
25
  "instruction": null,
25
26
  "inputs": null,
27
+ "userMessage": null,
26
28
  } satisfies WorkflowRunSnapshot
27
29
 
28
30
  console.log(example)
@@ -11,7 +11,7 @@ All URIs are relative to *http://localhost:8000*
11
11
  | [**listWorkflowRunsForTenant**](WorkflowRunsApi.md#listworkflowrunsfortenant) | **GET** /v1/workflow-runs | List Workflow Runs For Tenant Handler |
12
12
  | [**retryWorkflowRun**](WorkflowRunsApi.md#retryworkflowrun) | **POST** /v1/workflow-runs/{run_id}/retry | Retry Workflow Run Handler |
13
13
  | [**setWorkflowRunApproval**](WorkflowRunsApi.md#setworkflowrunapprovaloperation) | **POST** /v1/workflow-runs/{run_id}/approval | Set Workflow Run Approval Handler |
14
- | [**startWorkflowRun**](WorkflowRunsApi.md#startworkflowrun) | **POST** /v1/workflow-runs/{run_id}/start | Start Workflow Run Handler |
14
+ | [**startWorkflowRun**](WorkflowRunsApi.md#startworkflowrunoperation) | **POST** /v1/workflow-runs/{run_id}/start | Start Workflow Run Handler |
15
15
  | [**stopWorkflowRun**](WorkflowRunsApi.md#stopworkflowrun) | **POST** /v1/workflow-runs/{run_id}/stop | Stop Workflow Run Handler |
16
16
  | [**updateWorkflowRun**](WorkflowRunsApi.md#updateworkflowrunoperation) | **PATCH** /v1/workflow-runs/{run_id} | Update Workflow Run Handler |
17
17
  | [**workflowRunCallback**](WorkflowRunsApi.md#workflowruncallbackoperation) | **POST** /v1/workflow-runs/{run_id}/callback | Workflow Run Callback Handler |
@@ -589,11 +589,11 @@ example().catch(console.error);
589
589
 
590
590
  ## startWorkflowRun
591
591
 
592
- > WorkflowRunResponse startWorkflowRun(runId)
592
+ > WorkflowRunResponse startWorkflowRun(runId, startWorkflowRunRequest)
593
593
 
594
594
  Start Workflow Run Handler
595
595
 
596
- Flip a NOT_STARTED run to IN_PROGRESS and dispatch its agent run. Idempotent on IN_PROGRESS (returns the row). Terminal states → 409. Inputs still ingesting or in a failed terminal state → 409. The snapshot is built at this point (KB DOCUMENTs resolve to active versions, uploaded DVs are walked from inputs/, KB FOLDERs stay live).
596
+ Flip a NOT_STARTED run to IN_PROGRESS and dispatch its agent run. Idempotent on IN_PROGRESS (returns the row). Terminal states → 409. Inputs still ingesting or in a failed terminal state → 409. The snapshot is built at this point (KB DOCUMENTs resolve to active versions, uploaded DVs are walked from inputs/, KB FOLDERs stay live). The body is optional; &#x60;&#x60;user_message&#x60;&#x60; (when sent) is pinned into the snapshot and shown in the run thread (see &#x60;&#x60;StartWorkflowRunRequest&#x60;&#x60;).
597
597
 
598
598
  ### Example
599
599
 
@@ -602,7 +602,7 @@ import {
602
602
  Configuration,
603
603
  WorkflowRunsApi,
604
604
  } from '@knowledge-stack/ksapi';
605
- import type { StartWorkflowRunRequest } from '@knowledge-stack/ksapi';
605
+ import type { StartWorkflowRunOperationRequest } from '@knowledge-stack/ksapi';
606
606
 
607
607
  async function example() {
608
608
  console.log("🚀 Testing @knowledge-stack/ksapi SDK...");
@@ -617,7 +617,9 @@ async function example() {
617
617
  const body = {
618
618
  // string
619
619
  runId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
620
- } satisfies StartWorkflowRunRequest;
620
+ // StartWorkflowRunRequest (optional)
621
+ startWorkflowRunRequest: ...,
622
+ } satisfies StartWorkflowRunOperationRequest;
621
623
 
622
624
  try {
623
625
  const data = await api.startWorkflowRun(body);
@@ -637,6 +639,7 @@ example().catch(console.error);
637
639
  | Name | Type | Description | Notes |
638
640
  |------------- | ------------- | ------------- | -------------|
639
641
  | **runId** | `string` | | [Defaults to `undefined`] |
642
+ | **startWorkflowRunRequest** | [StartWorkflowRunRequest](StartWorkflowRunRequest.md) | | [Optional] |
640
643
 
641
644
  ### Return type
642
645
 
@@ -648,7 +651,7 @@ example().catch(console.error);
648
651
 
649
652
  ### HTTP request headers
650
653
 
651
- - **Content-Type**: Not defined
654
+ - **Content-Type**: `application/json`
652
655
  - **Accept**: `application/json`
653
656
 
654
657
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knowledge-stack/ksapi",
3
- "version": "1.104.0",
3
+ "version": "1.105.0",
4
4
  "description": "OpenAPI client for @knowledge-stack/ksapi",
5
5
  "author": "OpenAPI-Generator",
6
6
  "repository": {
@@ -21,6 +21,7 @@ import type {
21
21
  PaginatedResponseWorkflowRunResponse,
22
22
  SetWorkflowRunApprovalRequest,
23
23
  SortDirection,
24
+ StartWorkflowRunRequest,
24
25
  UpdateWorkflowRunRequest,
25
26
  WorkflowCallbackResponse,
26
27
  WorkflowExecutionState,
@@ -42,6 +43,8 @@ import {
42
43
  SetWorkflowRunApprovalRequestToJSON,
43
44
  SortDirectionFromJSON,
44
45
  SortDirectionToJSON,
46
+ StartWorkflowRunRequestFromJSON,
47
+ StartWorkflowRunRequestToJSON,
45
48
  UpdateWorkflowRunRequestFromJSON,
46
49
  UpdateWorkflowRunRequestToJSON,
47
50
  WorkflowCallbackResponseFromJSON,
@@ -102,8 +105,9 @@ export interface SetWorkflowRunApprovalOperationRequest {
102
105
  setWorkflowRunApprovalRequest: SetWorkflowRunApprovalRequest;
103
106
  }
104
107
 
105
- export interface StartWorkflowRunRequest {
108
+ export interface StartWorkflowRunOperationRequest {
106
109
  runId: string;
110
+ startWorkflowRunRequest?: StartWorkflowRunRequest | null;
107
111
  }
108
112
 
109
113
  export interface StopWorkflowRunRequest {
@@ -328,26 +332,28 @@ export interface WorkflowRunsApiInterface {
328
332
  /**
329
333
  * Creates request options for startWorkflowRun without sending the request
330
334
  * @param {string} runId
335
+ * @param {StartWorkflowRunRequest} [startWorkflowRunRequest]
331
336
  * @throws {RequiredError}
332
337
  * @memberof WorkflowRunsApiInterface
333
338
  */
334
- startWorkflowRunRequestOpts(requestParameters: StartWorkflowRunRequest): Promise<runtime.RequestOpts>;
339
+ startWorkflowRunRequestOpts(requestParameters: StartWorkflowRunOperationRequest): Promise<runtime.RequestOpts>;
335
340
 
336
341
  /**
337
- * Flip a NOT_STARTED run to IN_PROGRESS and dispatch its agent run. Idempotent on IN_PROGRESS (returns the row). Terminal states → 409. Inputs still ingesting or in a failed terminal state → 409. The snapshot is built at this point (KB DOCUMENTs resolve to active versions, uploaded DVs are walked from inputs/, KB FOLDERs stay live).
342
+ * Flip a NOT_STARTED run to IN_PROGRESS and dispatch its agent run. Idempotent on IN_PROGRESS (returns the row). Terminal states → 409. Inputs still ingesting or in a failed terminal state → 409. The snapshot is built at this point (KB DOCUMENTs resolve to active versions, uploaded DVs are walked from inputs/, KB FOLDERs stay live). The body is optional; ``user_message`` (when sent) is pinned into the snapshot and shown in the run thread (see ``StartWorkflowRunRequest``).
338
343
  * @summary Start Workflow Run Handler
339
344
  * @param {string} runId
345
+ * @param {StartWorkflowRunRequest} [startWorkflowRunRequest]
340
346
  * @param {*} [options] Override http request option.
341
347
  * @throws {RequiredError}
342
348
  * @memberof WorkflowRunsApiInterface
343
349
  */
344
- startWorkflowRunRaw(requestParameters: StartWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WorkflowRunResponse>>;
350
+ startWorkflowRunRaw(requestParameters: StartWorkflowRunOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WorkflowRunResponse>>;
345
351
 
346
352
  /**
347
- * Flip a NOT_STARTED run to IN_PROGRESS and dispatch its agent run. Idempotent on IN_PROGRESS (returns the row). Terminal states → 409. Inputs still ingesting or in a failed terminal state → 409. The snapshot is built at this point (KB DOCUMENTs resolve to active versions, uploaded DVs are walked from inputs/, KB FOLDERs stay live).
353
+ * Flip a NOT_STARTED run to IN_PROGRESS and dispatch its agent run. Idempotent on IN_PROGRESS (returns the row). Terminal states → 409. Inputs still ingesting or in a failed terminal state → 409. The snapshot is built at this point (KB DOCUMENTs resolve to active versions, uploaded DVs are walked from inputs/, KB FOLDERs stay live). The body is optional; ``user_message`` (when sent) is pinned into the snapshot and shown in the run thread (see ``StartWorkflowRunRequest``).
348
354
  * Start Workflow Run Handler
349
355
  */
350
- startWorkflowRun(requestParameters: StartWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowRunResponse>;
356
+ startWorkflowRun(requestParameters: StartWorkflowRunOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowRunResponse>;
351
357
 
352
358
  /**
353
359
  * Creates request options for stopWorkflowRun without sending the request
@@ -883,7 +889,7 @@ export class WorkflowRunsApi extends runtime.BaseAPI implements WorkflowRunsApiI
883
889
  /**
884
890
  * Creates request options for startWorkflowRun without sending the request
885
891
  */
886
- async startWorkflowRunRequestOpts(requestParameters: StartWorkflowRunRequest): Promise<runtime.RequestOpts> {
892
+ async startWorkflowRunRequestOpts(requestParameters: StartWorkflowRunOperationRequest): Promise<runtime.RequestOpts> {
887
893
  if (requestParameters['runId'] == null) {
888
894
  throw new runtime.RequiredError(
889
895
  'runId',
@@ -895,6 +901,8 @@ export class WorkflowRunsApi extends runtime.BaseAPI implements WorkflowRunsApiI
895
901
 
896
902
  const headerParameters: runtime.HTTPHeaders = {};
897
903
 
904
+ headerParameters['Content-Type'] = 'application/json';
905
+
898
906
  if (this.configuration && this.configuration.accessToken) {
899
907
  const token = this.configuration.accessToken;
900
908
  const tokenString = await token("bearerAuth", []);
@@ -912,14 +920,15 @@ export class WorkflowRunsApi extends runtime.BaseAPI implements WorkflowRunsApiI
912
920
  method: 'POST',
913
921
  headers: headerParameters,
914
922
  query: queryParameters,
923
+ body: StartWorkflowRunRequestToJSON(requestParameters['startWorkflowRunRequest']),
915
924
  };
916
925
  }
917
926
 
918
927
  /**
919
- * Flip a NOT_STARTED run to IN_PROGRESS and dispatch its agent run. Idempotent on IN_PROGRESS (returns the row). Terminal states → 409. Inputs still ingesting or in a failed terminal state → 409. The snapshot is built at this point (KB DOCUMENTs resolve to active versions, uploaded DVs are walked from inputs/, KB FOLDERs stay live).
928
+ * Flip a NOT_STARTED run to IN_PROGRESS and dispatch its agent run. Idempotent on IN_PROGRESS (returns the row). Terminal states → 409. Inputs still ingesting or in a failed terminal state → 409. The snapshot is built at this point (KB DOCUMENTs resolve to active versions, uploaded DVs are walked from inputs/, KB FOLDERs stay live). The body is optional; ``user_message`` (when sent) is pinned into the snapshot and shown in the run thread (see ``StartWorkflowRunRequest``).
920
929
  * Start Workflow Run Handler
921
930
  */
922
- async startWorkflowRunRaw(requestParameters: StartWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WorkflowRunResponse>> {
931
+ async startWorkflowRunRaw(requestParameters: StartWorkflowRunOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WorkflowRunResponse>> {
923
932
  const requestOptions = await this.startWorkflowRunRequestOpts(requestParameters);
924
933
  const response = await this.request(requestOptions, initOverrides);
925
934
 
@@ -927,10 +936,10 @@ export class WorkflowRunsApi extends runtime.BaseAPI implements WorkflowRunsApiI
927
936
  }
928
937
 
929
938
  /**
930
- * Flip a NOT_STARTED run to IN_PROGRESS and dispatch its agent run. Idempotent on IN_PROGRESS (returns the row). Terminal states → 409. Inputs still ingesting or in a failed terminal state → 409. The snapshot is built at this point (KB DOCUMENTs resolve to active versions, uploaded DVs are walked from inputs/, KB FOLDERs stay live).
939
+ * Flip a NOT_STARTED run to IN_PROGRESS and dispatch its agent run. Idempotent on IN_PROGRESS (returns the row). Terminal states → 409. Inputs still ingesting or in a failed terminal state → 409. The snapshot is built at this point (KB DOCUMENTs resolve to active versions, uploaded DVs are walked from inputs/, KB FOLDERs stay live). The body is optional; ``user_message`` (when sent) is pinned into the snapshot and shown in the run thread (see ``StartWorkflowRunRequest``).
931
940
  * Start Workflow Run Handler
932
941
  */
933
- async startWorkflowRun(requestParameters: StartWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowRunResponse> {
942
+ async startWorkflowRun(requestParameters: StartWorkflowRunOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowRunResponse> {
934
943
  const response = await this.startWorkflowRunRaw(requestParameters, initOverrides);
935
944
  return await response.value();
936
945
  }
@@ -0,0 +1,91 @@
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
+ import { mapValues } from '../runtime';
16
+ /**
17
+ * Optional JSON body for ``POST /v1/workflow-runs/{id}/start``.
18
+ *
19
+ * The whole body is optional: an absent body starts the run with just
20
+ * the localized "Started workflow: X" opening message, exactly as
21
+ * before. When ``user_message`` is set it is appended to that opening
22
+ * thread message AND injected into the runner's first user turn, so the
23
+ * agent acts on it as guidance layered on the workflow instruction.
24
+ * @export
25
+ * @interface StartWorkflowRunRequest
26
+ */
27
+ export interface StartWorkflowRunRequest {
28
+ /**
29
+ * Free-text instruction shown in the run thread and passed to the agent as additional guidance on top of the workflow instruction. Optional.
30
+ * @type {string}
31
+ * @memberof StartWorkflowRunRequest
32
+ */
33
+ userMessage?: string | null;
34
+ }
35
+ export const StartWorkflowRunRequestPropertyValidationAttributesMap: {
36
+ [property: string]: {
37
+ maxLength?: number,
38
+ minLength?: number,
39
+ pattern?: string,
40
+ maximum?: number,
41
+ exclusiveMaximum?: boolean,
42
+ minimum?: number,
43
+ exclusiveMinimum?: boolean,
44
+ multipleOf?: number,
45
+ maxItems?: number,
46
+ minItems?: number,
47
+ uniqueItems?: boolean
48
+ }
49
+ } = {
50
+ userMessage: {
51
+ maxLength: 4000,
52
+ },
53
+ }
54
+
55
+
56
+ /**
57
+ * Check if a given object implements the StartWorkflowRunRequest interface.
58
+ */
59
+ export function instanceOfStartWorkflowRunRequest(value: object): value is StartWorkflowRunRequest {
60
+ return true;
61
+ }
62
+
63
+ export function StartWorkflowRunRequestFromJSON(json: any): StartWorkflowRunRequest {
64
+ return StartWorkflowRunRequestFromJSONTyped(json, false);
65
+ }
66
+
67
+ export function StartWorkflowRunRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): StartWorkflowRunRequest {
68
+ if (json == null) {
69
+ return json;
70
+ }
71
+ return {
72
+
73
+ 'userMessage': json['user_message'] == null ? undefined : json['user_message'],
74
+ };
75
+ }
76
+
77
+ export function StartWorkflowRunRequestToJSON(json: any): StartWorkflowRunRequest {
78
+ return StartWorkflowRunRequestToJSONTyped(json, false);
79
+ }
80
+
81
+ export function StartWorkflowRunRequestToJSONTyped(value?: StartWorkflowRunRequest | null, ignoreDiscriminator: boolean = false): any {
82
+ if (value == null) {
83
+ return value;
84
+ }
85
+
86
+ return {
87
+
88
+ 'user_message': value['userMessage'],
89
+ };
90
+ }
91
+
@@ -66,6 +66,12 @@ export interface WorkflowRunSnapshot {
66
66
  * @memberof WorkflowRunSnapshot
67
67
  */
68
68
  inputs: Array<InputSnapshot>;
69
+ /**
70
+ * Optional free-text message the caller supplied at Start. Pinned here so the runner injects it into the agent's first user turn and it survives retry, redrive, and workflow-thread follow-ups (all of which re-assemble the prompt from this snapshot).
71
+ * @type {string}
72
+ * @memberof WorkflowRunSnapshot
73
+ */
74
+ userMessage?: string | null;
69
75
  }
70
76
  export const WorkflowRunSnapshotPropertyValidationAttributesMap: {
71
77
  [property: string]: {
@@ -82,6 +88,9 @@ export const WorkflowRunSnapshotPropertyValidationAttributesMap: {
82
88
  uniqueItems?: boolean
83
89
  }
84
90
  } = {
91
+ userMessage: {
92
+ maxLength: 4000,
93
+ },
85
94
  }
86
95
 
87
96
 
@@ -110,6 +119,7 @@ export function WorkflowRunSnapshotFromJSONTyped(json: any, ignoreDiscriminator:
110
119
  'maxRunDurationSeconds': json['max_run_duration_seconds'],
111
120
  'instruction': InstructionSnapshotFromJSON(json['instruction']),
112
121
  'inputs': ((json['inputs'] as Array<any>).map(InputSnapshotFromJSON)),
122
+ 'userMessage': json['user_message'] == null ? undefined : json['user_message'],
113
123
  };
114
124
  }
115
125
 
@@ -128,6 +138,7 @@ export function WorkflowRunSnapshotToJSONTyped(value?: WorkflowRunSnapshot | nul
128
138
  'max_run_duration_seconds': value['maxRunDurationSeconds'],
129
139
  'instruction': InstructionSnapshotToJSON(value['instruction']),
130
140
  'inputs': ((value['inputs'] as Array<any>).map(InputSnapshotToJSON)),
141
+ 'user_message': value['userMessage'],
131
142
  };
132
143
  }
133
144
 
@@ -213,6 +213,7 @@ export * from './SetApprovalStateRequest';
213
213
  export * from './SetWorkflowRunApprovalRequest';
214
214
  export * from './SignInRequest';
215
215
  export * from './SortDirection';
216
+ export * from './StartWorkflowRunRequest';
216
217
  export * from './StepInput';
217
218
  export * from './StepKind';
218
219
  export * from './StepOutput';