windmill-client 1.795.0 → 1.796.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.
@@ -29,7 +29,7 @@ const OpenAPI = {
29
29
  PASSWORD: void 0,
30
30
  TOKEN: getEnv("WM_TOKEN"),
31
31
  USERNAME: void 0,
32
- VERSION: "1.795.0",
32
+ VERSION: "1.796.0",
33
33
  WITH_CREDENTIALS: !getEnv("WM_RAW_APP"),
34
34
  interceptors: {
35
35
  request: new Interceptors(),
package/dist/index.js CHANGED
@@ -126,7 +126,7 @@ const OpenAPI = {
126
126
  PASSWORD: void 0,
127
127
  TOKEN: getEnv$1("WM_TOKEN"),
128
128
  USERNAME: void 0,
129
- VERSION: "1.795.0",
129
+ VERSION: "1.796.0",
130
130
  WITH_CREDENTIALS: !getEnv$1("WM_RAW_APP"),
131
131
  interceptors: {
132
132
  request: new Interceptors(),
@@ -5279,17 +5279,17 @@ var ResourceService = class {
5279
5279
  * get a single resource version, with its value
5280
5280
  * @param data The data for the request.
5281
5281
  * @param data.workspace
5282
- * @param data.version
5282
+ * @param data.id The version's id, not its number.
5283
5283
  * @returns unknown resource version
5284
5284
  * @throws ApiError
5285
5285
  */
5286
5286
  static getResourceVersion(data) {
5287
5287
  return request(OpenAPI, {
5288
5288
  method: "GET",
5289
- url: "/w/{workspace}/resources/history/v/{version}",
5289
+ url: "/w/{workspace}/resources/history/v/{id}",
5290
5290
  path: {
5291
5291
  workspace: data.workspace,
5292
- version: data.version
5292
+ id: data.id
5293
5293
  }
5294
5294
  });
5295
5295
  }
@@ -5297,17 +5297,17 @@ var ResourceService = class {
5297
5297
  * restore a resource to a previous version
5298
5298
  * @param data The data for the request.
5299
5299
  * @param data.workspace
5300
- * @param data.version
5300
+ * @param data.id The version's id, not its number.
5301
5301
  * @returns string resource restored
5302
5302
  * @throws ApiError
5303
5303
  */
5304
5304
  static restoreResourceVersion(data) {
5305
5305
  return request(OpenAPI, {
5306
5306
  method: "POST",
5307
- url: "/w/{workspace}/resources/history/restore/v/{version}",
5307
+ url: "/w/{workspace}/resources/history/restore/v/{id}",
5308
5308
  path: {
5309
5309
  workspace: data.workspace,
5310
- version: data.version
5310
+ id: data.id
5311
5311
  }
5312
5312
  });
5313
5313
  }
@@ -11070,6 +11070,268 @@ var FlowConversationsService = class {
11070
11070
  });
11071
11071
  }
11072
11072
  };
11073
+ var AiEvalsService = class {
11074
+ /**
11075
+ * list eval datasets
11076
+ * @param data The data for the request.
11077
+ * @param data.workspace
11078
+ * @returns EvalDataset eval datasets list
11079
+ * @throws ApiError
11080
+ */
11081
+ static listEvalDatasets(data) {
11082
+ return request(OpenAPI, {
11083
+ method: "GET",
11084
+ url: "/w/{workspace}/ai_evals/datasets/list",
11085
+ path: { workspace: data.workspace }
11086
+ });
11087
+ }
11088
+ /**
11089
+ * create an eval dataset
11090
+ * @param data The data for the request.
11091
+ * @param data.workspace
11092
+ * @param data.requestBody new eval dataset
11093
+ * @returns string eval dataset created
11094
+ * @throws ApiError
11095
+ */
11096
+ static createEvalDataset(data) {
11097
+ return request(OpenAPI, {
11098
+ method: "POST",
11099
+ url: "/w/{workspace}/ai_evals/datasets/create",
11100
+ path: { workspace: data.workspace },
11101
+ body: data.requestBody,
11102
+ mediaType: "application/json"
11103
+ });
11104
+ }
11105
+ /**
11106
+ * get an eval dataset
11107
+ * @param data The data for the request.
11108
+ * @param data.workspace
11109
+ * @param data.path
11110
+ * @returns EvalDataset eval dataset
11111
+ * @throws ApiError
11112
+ */
11113
+ static getEvalDataset(data) {
11114
+ return request(OpenAPI, {
11115
+ method: "GET",
11116
+ url: "/w/{workspace}/ai_evals/datasets/get/{path}",
11117
+ path: {
11118
+ workspace: data.workspace,
11119
+ path: data.path
11120
+ }
11121
+ });
11122
+ }
11123
+ /**
11124
+ * update an eval dataset
11125
+ * @param data The data for the request.
11126
+ * @param data.workspace
11127
+ * @param data.path
11128
+ * @param data.requestBody updated eval dataset
11129
+ * @returns string eval dataset updated
11130
+ * @throws ApiError
11131
+ */
11132
+ static updateEvalDataset(data) {
11133
+ return request(OpenAPI, {
11134
+ method: "POST",
11135
+ url: "/w/{workspace}/ai_evals/datasets/update/{path}",
11136
+ path: {
11137
+ workspace: data.workspace,
11138
+ path: data.path
11139
+ },
11140
+ body: data.requestBody,
11141
+ mediaType: "application/json"
11142
+ });
11143
+ }
11144
+ /**
11145
+ * delete an eval dataset and all its cases
11146
+ * The cases, the runs and their recorded case sets go with it through the foreign keys; the jobs those runs produced are left alone.
11147
+ *
11148
+ * @param data The data for the request.
11149
+ * @param data.workspace
11150
+ * @param data.path
11151
+ * @returns string eval dataset deleted
11152
+ * @throws ApiError
11153
+ */
11154
+ static deleteEvalDataset(data) {
11155
+ return request(OpenAPI, {
11156
+ method: "POST",
11157
+ url: "/w/{workspace}/ai_evals/datasets/delete/{path}",
11158
+ path: {
11159
+ workspace: data.workspace,
11160
+ path: data.path
11161
+ }
11162
+ });
11163
+ }
11164
+ /**
11165
+ * list the cases of an eval dataset
11166
+ * @param data The data for the request.
11167
+ * @param data.workspace
11168
+ * @param data.path
11169
+ * @param data.page which page to return (start at 1, default 1)
11170
+ * @param data.perPage number of items to return for a given page (default 30, max 100)
11171
+ * @returns unknown eval cases
11172
+ * @throws ApiError
11173
+ */
11174
+ static listEvalCases(data) {
11175
+ return request(OpenAPI, {
11176
+ method: "GET",
11177
+ url: "/w/{workspace}/ai_evals/cases/list/{path}",
11178
+ path: {
11179
+ workspace: data.workspace,
11180
+ path: data.path
11181
+ },
11182
+ query: {
11183
+ page: data.page,
11184
+ per_page: data.perPage
11185
+ }
11186
+ });
11187
+ }
11188
+ /**
11189
+ * what the agent under test is right now
11190
+ * The version it is deployed at. Small on purpose: the results endpoint reports the same thing but harvests scores and reads every job to do it, so it is not something to ask for on its own.
11191
+ *
11192
+ * @param data The data for the request.
11193
+ * @param data.workspace
11194
+ * @param data.path
11195
+ * @returns unknown the subject as it is now
11196
+ * @throws ApiError
11197
+ */
11198
+ static evalSubjectState(data) {
11199
+ return request(OpenAPI, {
11200
+ method: "GET",
11201
+ url: "/w/{workspace}/ai_evals/subject_state",
11202
+ path: { workspace: data.workspace },
11203
+ query: { path: data.path }
11204
+ });
11205
+ }
11206
+ /**
11207
+ * the run one iteration of an eval run answered, as its scorers read it
11208
+ * Called by the step a run's flow places between the agent and its scorers. Every tool call is enriched with the arguments, result, status and duration of the job that ran it, and with the schema of the script version it ran, none of which the flow itself can read.
11209
+ *
11210
+ * @param data The data for the request.
11211
+ * @param data.workspace
11212
+ * @param data.jobId The flow job that answered the case.
11213
+ * @returns unknown the run and its rendering
11214
+ * @throws ApiError
11215
+ */
11216
+ static evalRunPayload(data) {
11217
+ return request(OpenAPI, {
11218
+ method: "GET",
11219
+ url: "/w/{workspace}/ai_evals/run_payload",
11220
+ path: { workspace: data.workspace },
11221
+ query: { job_id: data.jobId }
11222
+ });
11223
+ }
11224
+ /**
11225
+ * what a new judge agent and a new script scorer are created from
11226
+ * @param data The data for the request.
11227
+ * @param data.workspace
11228
+ * @returns unknown scorer defaults
11229
+ * @throws ApiError
11230
+ */
11231
+ static scorerDefaults(data) {
11232
+ return request(OpenAPI, {
11233
+ method: "GET",
11234
+ url: "/w/{workspace}/ai_evals/scorer_defaults",
11235
+ path: { workspace: data.workspace }
11236
+ });
11237
+ }
11238
+ /**
11239
+ * list the scorers already in use in this workspace, most recent first
11240
+ * Filtered twice, both times by what the caller can read: the datasets they come from, and the runnables themselves. A scorer they could not run does not appear.
11241
+ *
11242
+ * @param data The data for the request.
11243
+ * @param data.workspace
11244
+ * @param data.kind only scorers of this kind
11245
+ * @returns unknown recently used scorers
11246
+ * @throws ApiError
11247
+ */
11248
+ static recentScorers(data) {
11249
+ return request(OpenAPI, {
11250
+ method: "GET",
11251
+ url: "/w/{workspace}/ai_evals/scorers/recent",
11252
+ path: { workspace: data.workspace },
11253
+ query: { kind: data.kind }
11254
+ });
11255
+ }
11256
+ /**
11257
+ * run every case of a dataset as one immutable experiment
11258
+ * @param data The data for the request.
11259
+ * @param data.workspace
11260
+ * @param data.requestBody what to run
11261
+ * @returns string id of the created experiment
11262
+ * @throws ApiError
11263
+ */
11264
+ static runExperiment(data) {
11265
+ return request(OpenAPI, {
11266
+ method: "POST",
11267
+ url: "/w/{workspace}/ai_evals/experiments/run",
11268
+ path: { workspace: data.workspace },
11269
+ body: data.requestBody,
11270
+ mediaType: "application/json"
11271
+ });
11272
+ }
11273
+ /**
11274
+ * record what a run produced, so it outlives the jobs that produced it
11275
+ * Called by a run's own flow as its last step. The answers and scores a run produced live in its jobs, which have their own retention; this copies them onto the run's rows. Reading a run does the same, so this is what covers a run nobody opened.
11276
+ *
11277
+ * @param data The data for the request.
11278
+ * @param data.workspace
11279
+ * @param data.id
11280
+ * @returns number how many of the run's cases are recorded
11281
+ * @throws ApiError
11282
+ */
11283
+ static collectExperiment(data) {
11284
+ return request(OpenAPI, {
11285
+ method: "POST",
11286
+ url: "/w/{workspace}/ai_evals/experiments/collect",
11287
+ path: { workspace: data.workspace },
11288
+ query: { id: data.id }
11289
+ });
11290
+ }
11291
+ /**
11292
+ * list every experiment, across datasets
11293
+ * @param data The data for the request.
11294
+ * @param data.workspace
11295
+ * @param data.subjectPath Restrict to one agent's runs, which is what makes the list a history rather than a log. Runs of what is deployed, of a past version, and of the edits waiting on top are all that agent's, so this does not discriminate by kind.
11296
+ *
11297
+ * @returns EvalExperiment The 100 newest experiments, each naming the dataset it is of. Restricted to datasets the caller can read.
11298
+ *
11299
+ * @throws ApiError
11300
+ */
11301
+ static listAllExperiments(data) {
11302
+ return request(OpenAPI, {
11303
+ method: "GET",
11304
+ url: "/w/{workspace}/ai_evals/experiments/list_all",
11305
+ path: { workspace: data.workspace },
11306
+ query: { subject_path: data.subjectPath }
11307
+ });
11308
+ }
11309
+ /**
11310
+ * read an experiment's results, one row per case
11311
+ * @param data The data for the request.
11312
+ * @param data.workspace
11313
+ * @param data.path
11314
+ * @param data.id the experiment to read
11315
+ * @param data.baseline The experiment every column is compared against. A delta is only computed between two scores of the same scorer id, and a column the baseline was never scored with reports it rather than showing a difference.
11316
+ *
11317
+ * @returns unknown experiment results
11318
+ * @throws ApiError
11319
+ */
11320
+ static experimentResults(data) {
11321
+ return request(OpenAPI, {
11322
+ method: "GET",
11323
+ url: "/w/{workspace}/ai_evals/experiments/results/{path}",
11324
+ path: {
11325
+ workspace: data.workspace,
11326
+ path: data.path
11327
+ },
11328
+ query: {
11329
+ id: data.id,
11330
+ baseline: data.baseline
11331
+ }
11332
+ });
11333
+ }
11334
+ };
11073
11335
  var PathAutocompleteService = class {
11074
11336
  /**
11075
11337
  * list all paths in a workspace for client-side autocomplete
@@ -11139,6 +11401,47 @@ var RawAppService = class {
11139
11401
  });
11140
11402
  }
11141
11403
  };
11404
+ var AiService = class {
11405
+ /**
11406
+ * record AI token usage for the calling user
11407
+ * @param data The data for the request.
11408
+ * @param data.workspace
11409
+ * @param data.requestBody
11410
+ * @returns void usage recorded
11411
+ * @throws ApiError
11412
+ */
11413
+ static recordAiUsage(data) {
11414
+ return request(OpenAPI, {
11415
+ method: "POST",
11416
+ url: "/w/{workspace}/ai/usage",
11417
+ path: { workspace: data.workspace },
11418
+ body: data.requestBody,
11419
+ mediaType: "application/json"
11420
+ });
11421
+ }
11422
+ /**
11423
+ * list aggregated AI token usage
11424
+ * @param data The data for the request.
11425
+ * @param data.workspace
11426
+ * @param data.days
11427
+ * @param data.groupBy
11428
+ * @param data.scope workspace-wide usage (admin only) or the calling user's own
11429
+ * @returns unknown usage buckets
11430
+ * @throws ApiError
11431
+ */
11432
+ static listAiUsage(data) {
11433
+ return request(OpenAPI, {
11434
+ method: "GET",
11435
+ url: "/w/{workspace}/ai/usage",
11436
+ path: { workspace: data.workspace },
11437
+ query: {
11438
+ days: data.days,
11439
+ group_by: data.groupBy,
11440
+ scope: data.scope
11441
+ }
11442
+ });
11443
+ }
11444
+ };
11142
11445
  var TriggerService = class {
11143
11446
  /**
11144
11447
  * resume all suspended jobs for a specific trigger
@@ -19170,6 +19473,8 @@ var src_default = wmill;
19170
19473
  //#endregion
19171
19474
  exports.AdminService = AdminService;
19172
19475
  exports.AgentWorkersService = AgentWorkersService;
19476
+ exports.AiEvalsService = AiEvalsService;
19477
+ exports.AiService = AiService;
19173
19478
  exports.AmqpTriggerService = AmqpTriggerService;
19174
19479
  exports.ApiError = ApiError;
19175
19480
  exports.AppService = AppService;
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { ApiError } from "./core/ApiError.mjs";
2
2
  import { CancelError, CancelablePromise } from "./core/CancelablePromise.mjs";
3
3
  import { OpenAPI } from "./core/OpenAPI.mjs";
4
- import { AdminService, AgentWorkersService, AmqpTriggerService, AppService, AssetService, AuditService, AzureTriggerService, CaptureService, ConcurrencyGroupsService, ConfigService, DataMetricService, DbtService, DocumentationService, DraftService, EmailTriggerService, FavoriteService, FlowConversationsService, FlowService, FolderService, GcpTriggerService, GitSyncService, GranularAclService, GroupService, HealthService, HelpersService, HttpTriggerService, HubPublishService, IndexSearchService, InputService, IntegrationService, JobService, KafkaTriggerService, McpOauthService, McpService, MetricsService, MqttTriggerService, NativeTriggerService, NatsTriggerService, NpmProxyService, OauthService, OidcService, OpenapiService, PathAutocompleteService, PostgresTriggerService, RawAppService, ResourceService, ScheduleService, ScriptService, ServiceLogsService, SettingService, SettingsService, SqsTriggerService, TeamsService, TokenService, TriggerService, UserService, VariableService, VolumeService, WebsocketTriggerService, WorkerService, WorkspaceDependenciesService, WorkspaceIntegrationService, WorkspaceService } from "./services.gen.mjs";
4
+ import { AdminService, AgentWorkersService, AiEvalsService, AiService, AmqpTriggerService, AppService, AssetService, AuditService, AzureTriggerService, CaptureService, ConcurrencyGroupsService, ConfigService, DataMetricService, DbtService, DocumentationService, DraftService, EmailTriggerService, FavoriteService, FlowConversationsService, FlowService, FolderService, GcpTriggerService, GitSyncService, GranularAclService, GroupService, HealthService, HelpersService, HttpTriggerService, HubPublishService, IndexSearchService, InputService, IntegrationService, JobService, KafkaTriggerService, McpOauthService, McpService, MetricsService, MqttTriggerService, NativeTriggerService, NatsTriggerService, NpmProxyService, OauthService, OidcService, OpenapiService, PathAutocompleteService, PostgresTriggerService, RawAppService, ResourceService, ScheduleService, ScriptService, ServiceLogsService, SettingService, SettingsService, SqsTriggerService, TeamsService, TokenService, TriggerService, UserService, VariableService, VolumeService, WebsocketTriggerService, WorkerService, WorkspaceDependenciesService, WorkspaceIntegrationService, WorkspaceService } from "./services.gen.mjs";
5
5
  import { parseS3Object } from "./s3Types.mjs";
6
6
  import { appendPartition, datatable, ducklake, upsertPartition } from "./sqlUtils.mjs";
7
7
  import { SHARED_FOLDER, StepSuspend, WorkflowCtx, _workflowCtx, appendToResultStream, base64ToUint8Array, cancelJob, commitKafkaOffsets, databaseUrlFromResource, deleteS3File, denoS3LightClientSettings, getApprovalUrls, getFlowUserState, getIdToken, getInternalState, getPresignedS3PublicUrl, getPresignedS3PublicUrls, getProgress, getResource, getResult, getResultMaybe, getResumeEndpoints, getResumeUrls, getRootJobId, getState, getStatePath, getVariable, getWorkspace, loadS3File, loadS3FileStream, parallel, requestInteractiveSlackApproval, requestInteractiveTeamsApproval, resolveDefaultResource, runFlow, runFlowAsync, runScript, runScriptAsync, runScriptByHash, runScriptByHashAsync, runScriptByPath, runScriptByPathAsync, setClient, setFlowUserState, setInternalState, setProgress, setResource, setState, setVariable, setWorkflowCtx, signS3Object, signS3Objects, sleep, step, streamResult, task, taskFlow, taskScript, uint8ArrayToBase64, usernameToEmail, waitForApproval, waitJob, workflow, writeS3File } from "./client.mjs";
@@ -95,4 +95,4 @@ const wmill = {
95
95
  var src_default = wmill;
96
96
 
97
97
  //#endregion
98
- export { AdminService, AgentWorkersService, AmqpTriggerService, ApiError, AppService, AssetService, AuditService, AzureTriggerService, CancelError, CancelablePromise, CaptureService, ConcurrencyGroupsService, ConfigService, DataMetricService, DbtService, DocumentationService, DraftService, EmailTriggerService, FavoriteService, FlowConversationsService, FlowService, FolderService, GcpTriggerService, GitSyncService, GranularAclService, GroupService, HealthService, HelpersService, HttpTriggerService, HubPublishService, IndexSearchService, InputService, IntegrationService, JobService, KafkaTriggerService, McpOauthService, McpService, MetricsService, MqttTriggerService, NativeTriggerService, NatsTriggerService, NpmProxyService, OauthService, OidcService, OpenAPI, OpenapiService, PathAutocompleteService, PostgresTriggerService, RawAppService, ResourceService, ScheduleService, ScriptService, ServiceLogsService, SettingService, SettingsService, SqsTriggerService, StepSuspend, TeamsService, TokenService, TriggerService, UserService, VariableService, VolumeService, WebsocketTriggerService, WorkerService, WorkflowCtx, WorkspaceDependenciesService, WorkspaceIntegrationService, WorkspaceService, _workflowCtx, appendPartition, appendToResultStream, cancelJob, commitKafkaOffsets, datatable, src_default as default, deleteS3File, denoS3LightClientSettings, ducklake, getApprovalUrls, getFlowUserState, getIdToken, getPresignedS3PublicUrl, getPresignedS3PublicUrls, getProgress, getResource, getResumeUrls, getRootJobId, getState, getVariable, loadS3File, loadS3FileStream, parallel, requestInteractiveSlackApproval, requestInteractiveTeamsApproval, runFlow, runFlowAsync, runScript, runScriptAsync, runScriptByHash, runScriptByHashAsync, runScriptByPath, runScriptByPathAsync, setClient, setFlowUserState, setProgress, setResource, setState, setVariable, setWorkflowCtx, signS3Object, signS3Objects, sleep, step, streamResult, task, taskFlow, taskScript, upsertPartition, usernameToEmail, waitForApproval, waitJob, workflow, writeS3File };
98
+ export { AdminService, AgentWorkersService, AiEvalsService, AiService, AmqpTriggerService, ApiError, AppService, AssetService, AuditService, AzureTriggerService, CancelError, CancelablePromise, CaptureService, ConcurrencyGroupsService, ConfigService, DataMetricService, DbtService, DocumentationService, DraftService, EmailTriggerService, FavoriteService, FlowConversationsService, FlowService, FolderService, GcpTriggerService, GitSyncService, GranularAclService, GroupService, HealthService, HelpersService, HttpTriggerService, HubPublishService, IndexSearchService, InputService, IntegrationService, JobService, KafkaTriggerService, McpOauthService, McpService, MetricsService, MqttTriggerService, NativeTriggerService, NatsTriggerService, NpmProxyService, OauthService, OidcService, OpenAPI, OpenapiService, PathAutocompleteService, PostgresTriggerService, RawAppService, ResourceService, ScheduleService, ScriptService, ServiceLogsService, SettingService, SettingsService, SqsTriggerService, StepSuspend, TeamsService, TokenService, TriggerService, UserService, VariableService, VolumeService, WebsocketTriggerService, WorkerService, WorkflowCtx, WorkspaceDependenciesService, WorkspaceIntegrationService, WorkspaceService, _workflowCtx, appendPartition, appendToResultStream, cancelJob, commitKafkaOffsets, datatable, src_default as default, deleteS3File, denoS3LightClientSettings, ducklake, getApprovalUrls, getFlowUserState, getIdToken, getPresignedS3PublicUrl, getPresignedS3PublicUrls, getProgress, getResource, getResumeUrls, getRootJobId, getState, getVariable, loadS3File, loadS3FileStream, parallel, requestInteractiveSlackApproval, requestInteractiveTeamsApproval, runFlow, runFlowAsync, runScript, runScriptAsync, runScriptByHash, runScriptByHashAsync, runScriptByPath, runScriptByPathAsync, setClient, setFlowUserState, setProgress, setResource, setState, setVariable, setWorkflowCtx, signS3Object, signS3Objects, sleep, step, streamResult, task, taskFlow, taskScript, upsertPartition, usernameToEmail, waitForApproval, waitJob, workflow, writeS3File };