windmill-cli 1.672.0 → 1.674.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 (2) hide show
  1. package/esm/main.js +276 -127
  2. package/package.json +1 -1
package/esm/main.js CHANGED
@@ -11812,7 +11812,7 @@ var init_OpenAPI = __esm(() => {
11812
11812
  PASSWORD: undefined,
11813
11813
  TOKEN: getEnv2("WM_TOKEN"),
11814
11814
  USERNAME: undefined,
11815
- VERSION: "1.672.0",
11815
+ VERSION: "1.674.0",
11816
11816
  WITH_CREDENTIALS: true,
11817
11817
  interceptors: {
11818
11818
  request: new Interceptors,
@@ -12139,6 +12139,7 @@ __export(exports_services_gen, {
12139
12139
  testKafkaConnection: () => testKafkaConnection,
12140
12140
  testGcpConnection: () => testGcpConnection,
12141
12141
  testCriticalChannels: () => testCriticalChannels,
12142
+ testAzureKvBackend: () => testAzureKvBackend,
12142
12143
  syncNativeTriggers: () => syncNativeTriggers,
12143
12144
  submitOnboardingData: () => submitOnboardingData,
12144
12145
  storeRawScriptTemp: () => storeRawScriptTemp,
@@ -12210,6 +12211,7 @@ __export(exports_services_gen, {
12210
12211
  resumeSuspendedFlowAsOwner: () => resumeSuspendedFlowAsOwner,
12211
12212
  resumeSuspended: () => resumeSuspended,
12212
12213
  resultById: () => resultById,
12214
+ restartWorkerGroup: () => restartWorkerGroup,
12213
12215
  restartFlowAtStep: () => restartFlowAtStep,
12214
12216
  resolveNpmPackageVersion: () => resolveNpmPackageVersion,
12215
12217
  resetPassword: () => resetPassword,
@@ -12246,6 +12248,8 @@ __export(exports_services_gen, {
12246
12248
  moveCapturesAndConfigs: () => moveCapturesAndConfigs,
12247
12249
  migrateSecretsToVault: () => migrateSecretsToVault,
12248
12250
  migrateSecretsToDatabase: () => migrateSecretsToDatabase,
12251
+ migrateSecretsToAzureKv: () => migrateSecretsToAzureKv,
12252
+ migrateSecretsFromAzureKv: () => migrateSecretsFromAzureKv,
12249
12253
  mcpOauthCallback: () => mcpOauthCallback,
12250
12254
  logout: () => logout,
12251
12255
  loginWithOauth: () => loginWithOauth,
@@ -12358,7 +12362,9 @@ __export(exports_services_gen, {
12358
12362
  listAssets: () => listAssets,
12359
12363
  listApps: () => listApps,
12360
12364
  listAppPathsFromWorkspaceRunnable: () => listAppPathsFromWorkspaceRunnable,
12365
+ listAllWorkspaceDependencies: () => listAllWorkspaceDependencies,
12361
12366
  listAllTgoogleTopicSubscriptions: () => listAllTgoogleTopicSubscriptions,
12367
+ listAllDedicatedWithDeps: () => listAllDedicatedWithDeps,
12362
12368
  leaveWorkspace: () => leaveWorkspace,
12363
12369
  leaveInstance: () => leaveInstance,
12364
12370
  isValidPostgresConfiguration: () => isValidPostgresConfiguration,
@@ -13168,6 +13174,14 @@ var backendVersion = () => {
13168
13174
  method: "POST",
13169
13175
  url: "/settings/send_stats"
13170
13176
  });
13177
+ }, restartWorkerGroup = (data2) => {
13178
+ return request(OpenAPI, {
13179
+ method: "POST",
13180
+ url: "/settings/restart_worker_group/{worker_group}",
13181
+ path: {
13182
+ worker_group: data2.workerGroup
13183
+ }
13184
+ });
13171
13185
  }, getStats = () => {
13172
13186
  return request(OpenAPI, {
13173
13187
  method: "GET",
@@ -13249,6 +13263,27 @@ var backendVersion = () => {
13249
13263
  body: data2.requestBody,
13250
13264
  mediaType: "application/json"
13251
13265
  });
13266
+ }, testAzureKvBackend = (data2) => {
13267
+ return request(OpenAPI, {
13268
+ method: "POST",
13269
+ url: "/settings/test_azure_kv_backend",
13270
+ body: data2.requestBody,
13271
+ mediaType: "application/json"
13272
+ });
13273
+ }, migrateSecretsToAzureKv = (data2) => {
13274
+ return request(OpenAPI, {
13275
+ method: "POST",
13276
+ url: "/settings/migrate_secrets_to_azure_kv",
13277
+ body: data2.requestBody,
13278
+ mediaType: "application/json"
13279
+ });
13280
+ }, migrateSecretsFromAzureKv = (data2) => {
13281
+ return request(OpenAPI, {
13282
+ method: "POST",
13283
+ url: "/settings/migrate_secrets_from_azure_kv",
13284
+ body: data2.requestBody,
13285
+ mediaType: "application/json"
13286
+ });
13252
13287
  }, getCurrentEmail = () => {
13253
13288
  return request(OpenAPI, {
13254
13289
  method: "GET",
@@ -14230,7 +14265,8 @@ var backendVersion = () => {
14230
14265
  value: data2.value,
14231
14266
  broad_filter: data2.broadFilter,
14232
14267
  page: data2.page,
14233
- per_page: data2.perPage
14268
+ per_page: data2.perPage,
14269
+ label: data2.label
14234
14270
  }
14235
14271
  });
14236
14272
  }, listContextualVariables = (data2) => {
@@ -14617,7 +14653,8 @@ var backendVersion = () => {
14617
14653
  path: data2.path,
14618
14654
  description: data2.description,
14619
14655
  value: data2.value,
14620
- broad_filter: data2.broadFilter
14656
+ broad_filter: data2.broadFilter,
14657
+ label: data2.label
14621
14658
  }
14622
14659
  });
14623
14660
  }, listSearchResource = (data2) => {
@@ -14901,7 +14938,8 @@ var backendVersion = () => {
14901
14938
  with_deployment_msg: data2.withDeploymentMsg,
14902
14939
  languages: data2.languages,
14903
14940
  without_description: data2.withoutDescription,
14904
- dedicated_worker: data2.dedicatedWorker
14941
+ dedicated_worker: data2.dedicatedWorker,
14942
+ label: data2.label
14905
14943
  }
14906
14944
  });
14907
14945
  }, listScriptPaths = (data2) => {
@@ -15571,7 +15609,8 @@ var backendVersion = () => {
15571
15609
  include_draft_only: data2.includeDraftOnly,
15572
15610
  with_deployment_msg: data2.withDeploymentMsg,
15573
15611
  without_description: data2.withoutDescription,
15574
- dedicated_worker: data2.dedicatedWorker
15612
+ dedicated_worker: data2.dedicatedWorker,
15613
+ label: data2.label
15575
15614
  }
15576
15615
  });
15577
15616
  }, getFlowHistory = (data2) => {
@@ -15787,7 +15826,8 @@ var backendVersion = () => {
15787
15826
  created_by: data2.createdBy,
15788
15827
  path_start: data2.pathStart,
15789
15828
  path_exact: data2.pathExact,
15790
- starred_only: data2.starredOnly
15829
+ starred_only: data2.starredOnly,
15830
+ label: data2.label
15791
15831
  }
15792
15832
  });
15793
15833
  }, getRawAppData = (data2) => {
@@ -15823,7 +15863,8 @@ var backendVersion = () => {
15823
15863
  path_exact: data2.pathExact,
15824
15864
  starred_only: data2.starredOnly,
15825
15865
  include_draft_only: data2.includeDraftOnly,
15826
- with_deployment_msg: data2.withDeploymentMsg
15866
+ with_deployment_msg: data2.withDeploymentMsg,
15867
+ label: data2.label
15827
15868
  }
15828
15869
  });
15829
15870
  }, createApp = (data2) => {
@@ -17108,7 +17149,8 @@ var backendVersion = () => {
17108
17149
  schedule_path: data2.schedulePath,
17109
17150
  description: data2.description,
17110
17151
  summary: data2.summary,
17111
- broad_filter: data2.broadFilter
17152
+ broad_filter: data2.broadFilter,
17153
+ label: data2.label
17112
17154
  }
17113
17155
  });
17114
17156
  }, listSchedulesWithJobs = (data2) => {
@@ -17214,7 +17256,8 @@ var backendVersion = () => {
17214
17256
  per_page: data2.perPage,
17215
17257
  path: data2.path,
17216
17258
  is_flow: data2.isFlow,
17217
- path_start: data2.pathStart
17259
+ path_start: data2.pathStart,
17260
+ label: data2.label
17218
17261
  }
17219
17262
  });
17220
17263
  }, existsHttpTrigger = (data2) => {
@@ -17298,7 +17341,8 @@ var backendVersion = () => {
17298
17341
  per_page: data2.perPage,
17299
17342
  path: data2.path,
17300
17343
  is_flow: data2.isFlow,
17301
- path_start: data2.pathStart
17344
+ path_start: data2.pathStart,
17345
+ label: data2.label
17302
17346
  }
17303
17347
  });
17304
17348
  }, existsWebsocketTrigger = (data2) => {
@@ -17382,7 +17426,8 @@ var backendVersion = () => {
17382
17426
  per_page: data2.perPage,
17383
17427
  path: data2.path,
17384
17428
  is_flow: data2.isFlow,
17385
- path_start: data2.pathStart
17429
+ path_start: data2.pathStart,
17430
+ label: data2.label
17386
17431
  }
17387
17432
  });
17388
17433
  }, existsKafkaTrigger = (data2) => {
@@ -17486,7 +17531,8 @@ var backendVersion = () => {
17486
17531
  per_page: data2.perPage,
17487
17532
  path: data2.path,
17488
17533
  is_flow: data2.isFlow,
17489
- path_start: data2.pathStart
17534
+ path_start: data2.pathStart,
17535
+ label: data2.label
17490
17536
  }
17491
17537
  });
17492
17538
  }, existsNatsTrigger = (data2) => {
@@ -17570,7 +17616,8 @@ var backendVersion = () => {
17570
17616
  per_page: data2.perPage,
17571
17617
  path: data2.path,
17572
17618
  is_flow: data2.isFlow,
17573
- path_start: data2.pathStart
17619
+ path_start: data2.pathStart,
17620
+ label: data2.label
17574
17621
  }
17575
17622
  });
17576
17623
  }, existsSqsTrigger = (data2) => {
@@ -17737,7 +17784,8 @@ var backendVersion = () => {
17737
17784
  page: data2.page,
17738
17785
  per_page: data2.perPage,
17739
17786
  path: data2.path,
17740
- is_flow: data2.isFlow
17787
+ is_flow: data2.isFlow,
17788
+ label: data2.label
17741
17789
  }
17742
17790
  });
17743
17791
  }, existsNativeTrigger = (data2) => {
@@ -17860,7 +17908,8 @@ var backendVersion = () => {
17860
17908
  per_page: data2.perPage,
17861
17909
  path: data2.path,
17862
17910
  is_flow: data2.isFlow,
17863
- path_start: data2.pathStart
17911
+ path_start: data2.pathStart,
17912
+ label: data2.label
17864
17913
  }
17865
17914
  });
17866
17915
  }, existsMqttTrigger = (data2) => {
@@ -17944,7 +17993,8 @@ var backendVersion = () => {
17944
17993
  per_page: data2.perPage,
17945
17994
  path: data2.path,
17946
17995
  is_flow: data2.isFlow,
17947
- path_start: data2.pathStart
17996
+ path_start: data2.pathStart,
17997
+ label: data2.label
17948
17998
  }
17949
17999
  });
17950
18000
  }, existsGcpTrigger = (data2) => {
@@ -18180,7 +18230,8 @@ var backendVersion = () => {
18180
18230
  per_page: data2.perPage,
18181
18231
  path: data2.path,
18182
18232
  is_flow: data2.isFlow,
18183
- path_start: data2.pathStart
18233
+ path_start: data2.pathStart,
18234
+ label: data2.label
18184
18235
  }
18185
18236
  });
18186
18237
  }, existsPostgresTrigger = (data2) => {
@@ -18264,7 +18315,8 @@ var backendVersion = () => {
18264
18315
  per_page: data2.perPage,
18265
18316
  path: data2.path,
18266
18317
  is_flow: data2.isFlow,
18267
- path_start: data2.pathStart
18318
+ path_start: data2.pathStart,
18319
+ label: data2.label
18268
18320
  }
18269
18321
  });
18270
18322
  }, existsEmailTrigger = (data2) => {
@@ -18679,6 +18731,16 @@ var backendVersion = () => {
18679
18731
  method: "GET",
18680
18732
  url: "/configs/list_available_python_versions"
18681
18733
  });
18734
+ }, listAllWorkspaceDependencies = () => {
18735
+ return request(OpenAPI, {
18736
+ method: "GET",
18737
+ url: "/configs/list_all_workspace_dependencies"
18738
+ });
18739
+ }, listAllDedicatedWithDeps = () => {
18740
+ return request(OpenAPI, {
18741
+ method: "GET",
18742
+ url: "/configs/list_all_dedicated_with_deps"
18743
+ });
18682
18744
  }, createAgentToken = (data2) => {
18683
18745
  return request(OpenAPI, {
18684
18746
  method: "POST",
@@ -59217,6 +59279,12 @@ function isAppInlineScriptPath2(filePath) {
59217
59279
  function isFlowInlineScriptPath2(filePath) {
59218
59280
  return isFlowInlineScriptPath(filePath);
59219
59281
  }
59282
+ async function computePushMetadataHash(filePath, content) {
59283
+ const remotePath = removeExtensionToPath(filePath).replaceAll(SEP4, "/");
59284
+ const metadataWithType = await parseMetadataFile(remotePath, undefined);
59285
+ const metadataContent = await readFile5(metadataWithType.path, "utf-8");
59286
+ return await generateScriptHash({}, content, metadataContent);
59287
+ }
59220
59288
  async function push(opts, filePath) {
59221
59289
  opts = await mergeConfigWithConfigFile(opts);
59222
59290
  const workspace = await resolveWorkspace(opts);
@@ -59234,7 +59302,7 @@ async function push(opts, filePath) {
59234
59302
  try {
59235
59303
  const content = await readFile5(filePath, "utf-8");
59236
59304
  const remotePath = removeExtensionToPath(filePath).replaceAll(SEP4, "/");
59237
- const contentHash = await generateHash(content + remotePath);
59305
+ const contentHash = await computePushMetadataHash(filePath, content);
59238
59306
  const conf = await readLockfile();
59239
59307
  const hasLockEntry = conf.locks && (conf.locks[remotePath] !== undefined || conf.locks[`${remotePath}.ts`] !== undefined);
59240
59308
  if (!hasLockEntry) {
@@ -59426,7 +59494,8 @@ async function handleFile(path6, workspace, alreadySynced, message, opts, rawWor
59426
59494
  timeout: typed?.timeout,
59427
59495
  on_behalf_of_email: typed?.on_behalf_of_email,
59428
59496
  envs: typed?.envs,
59429
- modules
59497
+ modules,
59498
+ labels: typed?.labels
59430
59499
  };
59431
59500
  if (remote) {
59432
59501
  if (content === remote.content) {
@@ -59809,6 +59878,19 @@ async function track_job(workspace, id) {
59809
59878
  info("Job appears to have completed, but no data can be retrieved");
59810
59879
  }
59811
59880
  }
59881
+ async function pollForJobResult(workspace, jobId) {
59882
+ while (true) {
59883
+ const maybeResult = await getCompletedJobResultMaybe({
59884
+ workspace,
59885
+ id: jobId,
59886
+ getStarted: false
59887
+ });
59888
+ if (maybeResult.completed) {
59889
+ return { result: maybeResult.result, success: maybeResult.success ?? false };
59890
+ }
59891
+ await new Promise((resolve7) => setTimeout(resolve7, POLL_INTERVAL_MS));
59892
+ }
59893
+ }
59812
59894
  async function show(opts, path6) {
59813
59895
  const workspace = await resolveWorkspace(opts);
59814
59896
  await requireLogin(opts);
@@ -59892,7 +59974,7 @@ async function bootstrap(opts, scriptPath, language) {
59892
59974
  }
59893
59975
  async function generateMetadata(opts, scriptPath) {
59894
59976
  warn(colors.yellow('This command is deprecated. Use "wmill generate-metadata" instead.'));
59895
- info("This command only works for workspace scripts, for flows inline scripts use `wmill flow generate-locks`");
59977
+ info("This command only works for workspace scripts. For flows or apps, run `wmill generate-metadata` from the affected folder.");
59896
59978
  if (scriptPath == "") {
59897
59979
  scriptPath = undefined;
59898
59980
  }
@@ -60081,7 +60163,7 @@ async function preview(opts, filePath) {
60081
60163
  }
60082
60164
  }
60083
60165
  } else {
60084
- const result = await runScriptPreviewAndWaitResult({
60166
+ const jobId = await runScriptPreview({
60085
60167
  workspace: workspace.workspaceId,
60086
60168
  requestBody: {
60087
60169
  content,
@@ -60091,8 +60173,19 @@ async function preview(opts, filePath) {
60091
60173
  modules: modules ?? undefined
60092
60174
  }
60093
60175
  });
60176
+ const { result, success } = await pollForJobResult(workspace.workspaceId, jobId);
60177
+ if (!success) {
60178
+ if (opts.silent) {
60179
+ console.log(JSON.stringify(result));
60180
+ } else {
60181
+ info(colors.red.bold("Preview failed"));
60182
+ info(JSON.stringify(result, null, 2));
60183
+ }
60184
+ process.exitCode = 1;
60185
+ return;
60186
+ }
60094
60187
  if (opts.silent) {
60095
- console.log(JSON.stringify(result, null, 2));
60188
+ console.log(JSON.stringify(result));
60096
60189
  } else {
60097
60190
  info(colors.bold.underline.green("Preview completed"));
60098
60191
  info(JSON.stringify(result, null, 2));
@@ -60124,7 +60217,7 @@ async function history(opts, scriptPath) {
60124
60217
  ])).render();
60125
60218
  }
60126
60219
  }
60127
- var import_yaml5, exts, languageAliases, command3, script_default;
60220
+ var import_yaml5, exts, POLL_INTERVAL_MS = 2000, languageAliases, command3, script_default;
60128
60221
  var init_script = __esm(async () => {
60129
60222
  init_colors2();
60130
60223
  init_mod3();
@@ -60181,7 +60274,7 @@ var init_script = __esm(async () => {
60181
60274
  languageAliases = {
60182
60275
  python: "python3"
60183
60276
  };
60184
- command3 = new Command().description("script related commands").option("--show-archived", "Show archived scripts instead of active ones").option("--json", "Output as JSON (for piping to jq)").action(list3).command("list", "list all scripts").option("--show-archived", "Show archived scripts instead of active ones").option("--json", "Output as JSON (for piping to jq)").action(list3).command("push", "push a local script spec. This overrides any remote versions. Use the script file (.ts, .js, .py, .sh)").arguments("<path:file>").option("--message <message:string>", "Deployment message").action(push).command("get", "get a script's details").arguments("<path:file>").option("--json", "Output as JSON (for piping to jq)").action(get).command("show", "show a script's content (alias for get)").arguments("<path:file>").action(show).command("run", "run a script by path").arguments("<path:file>").option("-d --data <data:file>", "Inputs specified as a JSON string or a file using @<filename> or stdin using @-.").option("-s --silent", "Do not output anything other then the final output. Useful for scripting.").action(run2).command("preview", "preview a local script without deploying it. Supports both regular and codebase scripts.").arguments("<path:file>").option("-d --data <data:file>", "Inputs specified as a JSON string or a file using @<filename> or stdin using @-.").option("-s --silent", "Do not output anything other than the final output. Useful for scripting.").action(preview).command("new", "create a new script").arguments("<path:file> <language:string>").option("--summary <summary:string>", "script summary").option("--description <description:string>", "script description").action(bootstrap).command("bootstrap", "create a new script (alias for new)").arguments("<path:file> <language:string>").option("--summary <summary:string>", "script summary").option("--description <description:string>", "script description").action(bootstrap).command("generate-metadata", "re-generate the metadata file updating the lock and the script schema (for flows, use `wmill flow generate-locks`)").arguments("[script:file]").option("--yes", "Skip confirmation prompt").option("--dry-run", "Perform a dry run without making changes").option("--lock-only", "re-generate only the lock").option("--schema-only", "re-generate only script schema").option("-i --includes <patterns:file[]>", "Comma separated patterns to specify which file to take into account (among files that are compatible with windmill). Patterns can include * (any string until '/') and ** (any string)").option("-e --excludes <patterns:file[]>", "Comma separated patterns to specify which file to NOT take into account.").action(generateMetadata).command("history", "show version history for a script").arguments("<path:string>").option("--json", "Output as JSON (for piping to jq)").action(history);
60277
+ command3 = new Command().description("script related commands").option("--show-archived", "Show archived scripts instead of active ones").option("--json", "Output as JSON (for piping to jq)").action(list3).command("list", "list all scripts").option("--show-archived", "Show archived scripts instead of active ones").option("--json", "Output as JSON (for piping to jq)").action(list3).command("push", "push a local script spec. This overrides any remote versions. Use the script file (.ts, .js, .py, .sh)").arguments("<path:file>").option("--message <message:string>", "Deployment message").action(push).command("get", "get a script's details").arguments("<path:file>").option("--json", "Output as JSON (for piping to jq)").action(get).command("show", "show a script's content (alias for get)").arguments("<path:file>").action(show).command("run", "run a script by path").arguments("<path:file>").option("-d --data <data:file>", "Inputs specified as a JSON string or a file using @<filename> or stdin using @-.").option("-s --silent", "Do not output anything other then the final output. Useful for scripting.").action(run2).command("preview", "preview a local script without deploying it. Supports both regular and codebase scripts.").arguments("<path:file>").option("-d --data <data:file>", "Inputs specified as a JSON string or a file using @<filename> or stdin using @-.").option("-s --silent", "Do not output anything other than the final output. Useful for scripting.").action(preview).command("new", "create a new script").arguments("<path:file> <language:string>").option("--summary <summary:string>", "script summary").option("--description <description:string>", "script description").action(bootstrap).command("bootstrap", "create a new script (alias for new)").arguments("<path:file> <language:string>").option("--summary <summary:string>", "script summary").option("--description <description:string>", "script description").action(bootstrap).command("generate-metadata", 'DEPRECATED: re-generate script metadata. Use top-level "wmill generate-metadata" instead.').arguments("[script:file]").option("--yes", "Skip confirmation prompt").option("--dry-run", "Perform a dry run without making changes").option("--lock-only", "re-generate only the lock").option("--schema-only", "re-generate only script schema").option("-i --includes <patterns:file[]>", "Comma separated patterns to specify which file to take into account (among files that are compatible with windmill). Patterns can include * (any string until '/') and ** (any string)").option("-e --excludes <patterns:file[]>", "Comma separated patterns to specify which file to NOT take into account.").action(generateMetadata).command("history", "show version history for a script").arguments("<path:string>").option("--json", "Output as JSON (for piping to jq)").action(history);
60185
60278
  script_default = command3;
60186
60279
  });
60187
60280
 
@@ -60369,7 +60462,7 @@ async function checkRawAppRunnables(backendDir, rawAppYamlPath, defaultTs) {
60369
60462
  path: rawAppYamlPath,
60370
60463
  target: "raw_app_inline_script",
60371
60464
  errors: [
60372
- `Missing lock for ${language} runnable '${runnableId}'. Run 'wmill app generate-locks' to generate locks.`
60465
+ `Missing lock for ${language} runnable '${runnableId}'. Run 'wmill generate-metadata' to generate locks.`
60373
60466
  ]
60374
60467
  });
60375
60468
  }
@@ -60413,7 +60506,7 @@ async function checkRawAppRunnables(backendDir, rawAppYamlPath, defaultTs) {
60413
60506
  path: rawAppYamlPath,
60414
60507
  target: "raw_app_inline_script",
60415
60508
  errors: [
60416
- `Missing lock for ${language} runnable '${runnableId}'. Run 'wmill app generate-locks' to generate locks.`
60509
+ `Missing lock for ${language} runnable '${runnableId}'. Run 'wmill generate-metadata' to generate locks.`
60417
60510
  ]
60418
60511
  });
60419
60512
  }
@@ -60481,7 +60574,7 @@ async function checkMissingLocks(opts, directory) {
60481
60574
  path: yamlPath,
60482
60575
  target: "script",
60483
60576
  errors: [
60484
- `Missing lock for ${language} script. Run 'wmill script generate-metadata' to generate locks.`
60577
+ `Missing lock for ${language} script. Run 'wmill generate-metadata' to generate locks.`
60485
60578
  ]
60486
60579
  });
60487
60580
  }
@@ -60506,7 +60599,7 @@ async function checkMissingLocks(opts, directory) {
60506
60599
  path: flowYamlPath,
60507
60600
  target: "flow_inline_script",
60508
60601
  errors: [
60509
- `Missing lock for ${script.language} inline script '${script.id}'. Run 'wmill flow generate-locks' to generate locks.`
60602
+ `Missing lock for ${script.language} inline script '${script.id}'. Run 'wmill generate-metadata' to generate locks.`
60510
60603
  ]
60511
60604
  });
60512
60605
  }
@@ -60531,7 +60624,7 @@ async function checkMissingLocks(opts, directory) {
60531
60624
  path: appYamlPath,
60532
60625
  target: "app_inline_script",
60533
60626
  errors: [
60534
- `Missing lock for ${script.language} inline script at '${script.path}'. Run 'wmill app generate-locks' to generate locks.`
60627
+ `Missing lock for ${script.language} inline script at '${script.path}'. Run 'wmill generate-metadata' to generate locks.`
60535
60628
  ]
60536
60629
  });
60537
60630
  }
@@ -61347,7 +61440,7 @@ async function generateFlowHash(rawWorkspaceDependencies, folder, defaultTs) {
61347
61440
  }
61348
61441
  return { ...hashes, [TOP_HASH]: await generateHash(JSON.stringify(hashes)) };
61349
61442
  }
61350
- async function generateFlowLockInternal(folder, dryRun, workspace, opts, justUpdateMetadataLock, noStaleMessage, legacyBehaviour, tree) {
61443
+ async function generateFlowLockInternal(folder, dryRun, workspace, opts, justUpdateMetadataLock, noStaleMessage, tree) {
61351
61444
  if (folder.endsWith(SEP7)) {
61352
61445
  folder = folder.substring(0, folder.length - 1);
61353
61446
  }
@@ -61360,7 +61453,7 @@ async function generateFlowLockInternal(folder, dryRun, workspace, opts, justUpd
61360
61453
  const inlineScriptsForTree = extractInlineScripts(structuredClone(flowValue.value.modules), {}, SEP7, opts.defaultTs).filter((s) => !s.is_lock);
61361
61454
  let filteredDeps = {};
61362
61455
  const conf = await readLockfile();
61363
- if (!legacyBehaviour && tree) {
61456
+ if (tree) {
61364
61457
  if (dryRun) {
61365
61458
  const inlineScriptPaths = [];
61366
61459
  for (const script of inlineScriptsForTree) {
@@ -61427,7 +61520,7 @@ async function generateFlowLockInternal(folder, dryRun, workspace, opts, justUpd
61427
61520
  }
61428
61521
  const fileReader = async (path8) => await readFile7(folder + SEP7 + path8, "utf-8");
61429
61522
  const currentMapping = extractCurrentMapping(flowValue.value.modules, {}, flowValue.value.failure_module, flowValue.value.preprocessor_module);
61430
- const locksToRemove = tree && !legacyBehaviour ? Object.keys(hashes).filter((k) => {
61523
+ const locksToRemove = tree ? Object.keys(hashes).filter((k) => {
61431
61524
  if (k === TOP_HASH)
61432
61525
  return false;
61433
61526
  const treePath = fileToTreePath.get(k) ?? folderNormalized + "/" + path7.basename(k, path7.extname(k));
@@ -61463,7 +61556,7 @@ async function generateFlowLockInternal(folder, dryRun, workspace, opts, justUpd
61463
61556
  });
61464
61557
  writeIfChanged(process.cwd() + SEP7 + folder + SEP7 + "flow.yaml", import_yaml8.stringify(flowValue, yamlOptions));
61465
61558
  }
61466
- const depsForHash = tree && !legacyBehaviour ? {} : filteredDeps;
61559
+ const depsForHash = tree ? {} : filteredDeps;
61467
61560
  const finalHashes = await generateFlowHash(depsForHash, folder, opts.defaultTs);
61468
61561
  await clearGlobalLock(folder);
61469
61562
  for (const [path8, hash2] of Object.entries(finalHashes)) {
@@ -61472,7 +61565,7 @@ async function generateFlowLockInternal(folder, dryRun, workspace, opts, justUpd
61472
61565
  if (!noStaleMessage) {
61473
61566
  info(colors.green(`Flow ${remote_path} lockfiles updated`));
61474
61567
  }
61475
- const relocked = tree && !legacyBehaviour ? Object.keys(finalHashes).filter((k) => {
61568
+ const relocked = tree ? Object.keys(finalHashes).filter((k) => {
61476
61569
  if (k === TOP_HASH)
61477
61570
  return false;
61478
61571
  const treePath = fileToTreePath.get(k) ?? folderNormalized + "/" + path7.basename(k, path7.extname(k));
@@ -61798,7 +61891,7 @@ ${tables3.length > 0 ? tables3.map((t) => ` - ${t}`).join(`
61798
61891
 
61799
61892
  ## Quick Reference
61800
61893
 
61801
- **Backend runnable:** Add \`backend/<name>.ts\` (or .py, etc.), then run \`wmill app generate-locks\`
61894
+ **Backend runnable:** Add \`backend/<name>.ts\` (or .py, etc.), then run \`wmill generate-metadata\`
61802
61895
 
61803
61896
  **Call from frontend:**
61804
61897
  \`\`\`typescript
@@ -63215,7 +63308,7 @@ Push aborted: ${lockIssues.length} script(s) missing locks.`));
63215
63308
  if (autoRegenerate) {
63216
63309
  info("Auto-regenerated metadata for stale scripts:");
63217
63310
  } else {
63218
- warn("Stale scripts metadata found, you may want to update them using 'wmill script generate-metadata' before pushing:");
63311
+ warn("Stale scripts metadata found, you may want to update them using 'wmill generate-metadata' before pushing:");
63219
63312
  }
63220
63313
  for (const stale of staleScripts) {
63221
63314
  if (autoRegenerate) {
@@ -63236,7 +63329,7 @@ Push aborted: ${lockIssues.length} script(s) missing locks.`));
63236
63329
  if (autoRegenerate) {
63237
63330
  info("Auto-regenerated locks for stale flows:");
63238
63331
  } else {
63239
- warn("Stale flows locks found, you may want to update them using 'wmill flow generate-locks' before pushing:");
63332
+ warn("Stale flows locks found, you may want to update them using 'wmill generate-metadata' before pushing:");
63240
63333
  }
63241
63334
  for (const stale of staleFlows) {
63242
63335
  if (autoRegenerate) {
@@ -63263,7 +63356,7 @@ Push aborted: ${lockIssues.length} script(s) missing locks.`));
63263
63356
  if (autoRegenerate) {
63264
63357
  info("Auto-regenerated locks for stale apps:");
63265
63358
  } else {
63266
- warn("Stale apps locks found, you may want to update them using 'wmill app generate-locks' before pushing:");
63359
+ warn("Stale apps locks found, you may want to update them using 'wmill generate-metadata' before pushing:");
63267
63360
  }
63268
63361
  for (const stale of staleApps) {
63269
63362
  if (autoRegenerate) {
@@ -63310,9 +63403,22 @@ Push aborted: ${lockIssues.length} script(s) missing locks.`));
63310
63403
  }
63311
63404
  }
63312
63405
  for (const folderName of folderNames) {
63313
- try {
63314
- await stat6(path8.join("f", folderName, "folder.meta.yaml"));
63315
- } catch {
63406
+ const basePath = path8.join("f", folderName, "folder.meta.yaml");
63407
+ const branchPath = getBranchSpecificPath(`f/${folderName}/folder.meta.yaml`, specificItems, opts.branch);
63408
+ let found = false;
63409
+ if (branchPath) {
63410
+ try {
63411
+ await stat6(branchPath);
63412
+ found = true;
63413
+ } catch {}
63414
+ }
63415
+ if (!found) {
63416
+ try {
63417
+ await stat6(basePath);
63418
+ found = true;
63419
+ } catch {}
63420
+ }
63421
+ if (!found) {
63316
63422
  missingFolders.push(folderName);
63317
63423
  }
63318
63424
  }
@@ -64177,7 +64283,7 @@ async function blueColor() {
64177
64283
  const isWin2 = await getIsWin();
64178
64284
  return isWin2 ? colors.black : colors.blue;
64179
64285
  }
64180
- async function generateScriptMetadataInternal(scriptPath, workspace, opts, dryRun, noStaleMessage, rawWorkspaceDependencies, codebases, justUpdateMetadataLock, legacyBehaviour, tree) {
64286
+ async function generateScriptMetadataInternal(scriptPath, workspace, opts, dryRun, noStaleMessage, rawWorkspaceDependencies, codebases, justUpdateMetadataLock, tree) {
64181
64287
  const isFolderLayout = isModuleEntryPoint(scriptPath);
64182
64288
  const remotePath = isFolderLayout ? getScriptBasePathFromModulePath(scriptPath).replaceAll(SEP9, "/") : scriptPath.substring(0, scriptPath.indexOf(".")).replaceAll(SEP9, "/");
64183
64289
  const language = inferContentTypeFromFilePath(scriptPath, opts.defaultTs);
@@ -64187,11 +64293,11 @@ async function generateScriptMetadataInternal(scriptPath, workspace, opts, dryRu
64187
64293
  const filteredRawWorkspaceDependencies = filterWorkspaceDependencies(rawWorkspaceDependencies, scriptContent, language);
64188
64294
  const moduleFolderPath = isFolderLayout ? path9.dirname(scriptPath) : scriptPath.substring(0, scriptPath.indexOf(".")) + getModuleFolderSuffix();
64189
64295
  const hasModules = existsSync4(moduleFolderPath) && statSync(moduleFolderPath).isDirectory();
64190
- const depsForHash = !legacyBehaviour && tree ? {} : filteredRawWorkspaceDependencies;
64296
+ const depsForHash = tree ? {} : filteredRawWorkspaceDependencies;
64191
64297
  let hash2 = await generateScriptHash(depsForHash, scriptContent, metadataContent);
64192
64298
  let moduleHashes = {};
64193
64299
  if (hasModules) {
64194
- moduleHashes = await computeModuleHashes(moduleFolderPath, opts.defaultTs, !legacyBehaviour && tree ? {} : rawWorkspaceDependencies, isFolderLayout);
64300
+ moduleHashes = await computeModuleHashes(moduleFolderPath, opts.defaultTs, tree ? {} : rawWorkspaceDependencies, isFolderLayout);
64195
64301
  }
64196
64302
  const hasModuleHashes = Object.keys(moduleHashes).length > 0;
64197
64303
  let checkHash = hash2;
@@ -64203,7 +64309,7 @@ async function generateScriptMetadataInternal(scriptPath, workspace, opts, dryRu
64203
64309
  }
64204
64310
  const conf = await readLockfile();
64205
64311
  const isDirectlyStale = !await checkifMetadataUptodate(remotePath, checkHash, conf, checkSubpath);
64206
- if (!legacyBehaviour && tree) {
64312
+ if (tree) {
64207
64313
  if (dryRun) {
64208
64314
  const imports = await extractRelativeImports(scriptContent, remotePath, language);
64209
64315
  await tree.addNode(remotePath, scriptContent, language, metadataContent, imports, "script", remotePath, scriptPath, isDirectlyStale);
@@ -64733,8 +64839,8 @@ async function parseMetadataFile(scriptPath, generateMetadataIfMissing) {
64733
64839
  }
64734
64840
  }
64735
64841
  }
64736
- info((await blueColor())(`Creating script metadata file for ${metadataFilePath}`));
64737
64842
  metadataFilePath = scriptPath + ".script.yaml";
64843
+ info((await blueColor())(`Creating script metadata file for ${metadataFilePath}`));
64738
64844
  let scriptInitialMetadata = defaultScriptMetadata();
64739
64845
  const lockPath = scriptPath + ".script.lock";
64740
64846
  scriptInitialMetadata.lock = "!inline " + lockPath;
@@ -65231,7 +65337,7 @@ async function generateAppHash(rawReqs, folder, rawApp, defaultTs) {
65231
65337
  }
65232
65338
  return { ...hashes, [TOP_HASH2]: await generateHash(JSON.stringify(hashes)) };
65233
65339
  }
65234
- async function generateAppLocksInternal(appFolder, rawApp, dryRun, workspace, opts, justUpdateMetadataLock, noStaleMessage, legacyBehaviour, tree) {
65340
+ async function generateAppLocksInternal(appFolder, rawApp, dryRun, workspace, opts, justUpdateMetadataLock, noStaleMessage, tree) {
65235
65341
  if (appFolder.endsWith(SEP11)) {
65236
65342
  appFolder = appFolder.substring(0, appFolder.length - 1);
65237
65343
  }
@@ -65245,7 +65351,7 @@ async function generateAppLocksInternal(appFolder, rawApp, dryRun, workspace, op
65245
65351
  const folderNormalized = appFolder.replaceAll(SEP11, "/");
65246
65352
  let filteredDeps = {};
65247
65353
  const conf = await readLockfile();
65248
- if (!legacyBehaviour && tree) {
65354
+ if (tree) {
65249
65355
  if (dryRun) {
65250
65356
  const hashes = await generateAppHash({}, appFolder, rawApp, opts.defaultTs);
65251
65357
  const isDirectlyStale = !await checkifMetadataUptodate(appFolder, hashes[TOP_HASH2], conf, TOP_HASH2);
@@ -65312,7 +65418,7 @@ async function generateAppLocksInternal(appFolder, rawApp, dryRun, workspace, op
65312
65418
  }
65313
65419
  }
65314
65420
  const tempScriptRefs = tree?.getTempScriptRefs(folderNormalized);
65315
- if (changedScripts.length > 0 || tree && !legacyBehaviour) {
65421
+ if (changedScripts.length > 0 || tree) {
65316
65422
  if (!noStaleMessage) {
65317
65423
  info(`Recomputing locks of ${changedScripts.join(", ")} in ${appFolder}`);
65318
65424
  }
@@ -65337,7 +65443,7 @@ async function generateAppLocksInternal(appFolder, rawApp, dryRun, workspace, op
65337
65443
  info(colors.gray(`No scripts changed in ${appFolder}`));
65338
65444
  }
65339
65445
  }
65340
- const depsForHash = tree && !legacyBehaviour ? {} : filteredDeps;
65446
+ const depsForHash = tree ? {} : filteredDeps;
65341
65447
  const finalHashes = await generateAppHash(depsForHash, appFolder, rawApp, opts.defaultTs);
65342
65448
  await clearGlobalLock(appFolder);
65343
65449
  for (const [scriptPath, hash2] of Object.entries(finalHashes)) {
@@ -67838,7 +67944,7 @@ var init_app = __esm(async () => {
67838
67944
  init_generate_agents()
67839
67945
  ]);
67840
67946
  alreadySynced2 = [];
67841
- command11 = new Command().description("app related commands").option("--json", "Output as JSON (for piping to jq)").action(list5).command("list", "list all apps").option("--json", "Output as JSON (for piping to jq)").action(list5).command("get", "get an app's details").arguments("<path:string>").option("--json", "Output as JSON (for piping to jq)").action(get3).command("push", "push a local app ").arguments("<file_path:string> <remote_path:string>").action(push4).command("dev", dev_default).command("lint", lint_default2).command("new", new_default).command("generate-agents", generate_agents_default).command("generate-locks", "re-generate the lockfiles for app runnables inline scripts that have changed").arguments("[app_folder:string]").option("--yes", "Skip confirmation prompt").option("--dry-run", "Perform a dry run without making changes").option("--default-ts <runtime:string>", "Default TypeScript runtime (bun or deno)").action(async (opts, appFolder) => {
67947
+ command11 = new Command().description("app related commands").option("--json", "Output as JSON (for piping to jq)").action(list5).command("list", "list all apps").option("--json", "Output as JSON (for piping to jq)").action(list5).command("get", "get an app's details").arguments("<path:string>").option("--json", "Output as JSON (for piping to jq)").action(get3).command("push", "push a local app ").arguments("<file_path:string> <remote_path:string>").action(push4).command("dev", dev_default).command("lint", lint_default2).command("new", new_default).command("generate-agents", generate_agents_default).command("generate-locks", 'DEPRECATED: re-generate app lockfiles. Use "wmill generate-metadata" instead.').arguments("[app_folder:string]").option("--yes", "Skip confirmation prompt").option("--dry-run", "Perform a dry run without making changes").option("--default-ts <runtime:string>", "Default TypeScript runtime (bun or deno)").action(async (opts, appFolder) => {
67842
67948
  warn(colors.yellow('This command is deprecated. Use "wmill generate-metadata" instead.'));
67843
67949
  const { generateLocksCommand: generateLocksCommand2 } = await init_app_metadata().then(() => exports_app_metadata);
67844
67950
  await generateLocksCommand2(opts, appFolder);
@@ -71368,30 +71474,24 @@ async function preview2(opts, flowPath) {
71368
71474
  info(colors.yellow(`Running flow preview for ${flowPath}...`));
71369
71475
  }
71370
71476
  debug(`Flow value: ${JSON.stringify(localFlow.value, null, 2)}`);
71371
- let result;
71372
- try {
71373
- result = await runFlowPreviewAndWaitResult({
71374
- workspace: workspace.workspaceId,
71375
- requestBody: {
71376
- value: localFlow.value,
71377
- path: flowPath.substring(0, flowPath.indexOf(".flow")).replaceAll(SEP19, "/"),
71378
- args: input
71379
- }
71380
- });
71381
- } catch (e) {
71382
- if (e.body) {
71383
- if (e.body.result !== undefined) {
71384
- if (opts.silent) {
71385
- console.log(JSON.stringify(e.body.result));
71386
- } else {
71387
- info(colors.yellow.bold("Flow failed, error handler result:"));
71388
- info(JSON.stringify(e.body.result, null, 2));
71389
- }
71390
- process.exitCode = 1;
71391
- return;
71392
- }
71477
+ const jobId = await runFlowPreview({
71478
+ workspace: workspace.workspaceId,
71479
+ requestBody: {
71480
+ value: localFlow.value,
71481
+ path: flowPath.substring(0, flowPath.indexOf(".flow")).replaceAll(SEP19, "/"),
71482
+ args: input
71393
71483
  }
71394
- throw e;
71484
+ });
71485
+ const { result, success } = await pollForJobResult(workspace.workspaceId, jobId);
71486
+ if (!success) {
71487
+ if (opts.silent) {
71488
+ console.log(JSON.stringify(result));
71489
+ } else {
71490
+ info(colors.yellow.bold("Flow failed, error handler result:"));
71491
+ info(JSON.stringify(result, null, 2));
71492
+ }
71493
+ process.exitCode = 1;
71494
+ return;
71395
71495
  }
71396
71496
  if (opts.silent) {
71397
71497
  console.log(JSON.stringify(result));
@@ -71531,7 +71631,7 @@ var init_flow = __esm(async () => {
71531
71631
  ]);
71532
71632
  import_yaml36 = __toESM(require_dist(), 1);
71533
71633
  alreadySynced3 = [];
71534
- command21 = new Command().description("flow related commands").option("--show-archived", "Enable archived flows in output").option("--json", "Output as JSON (for piping to jq)").action(list12).command("list", "list all flows").option("--show-archived", "Enable archived flows in output").option("--json", "Output as JSON (for piping to jq)").action(list12).command("get", "get a flow's details").arguments("<path:string>").option("--json", "Output as JSON (for piping to jq)").action(get9).command("push", "push a local flow spec. This overrides any remote versions.").arguments("<file_path:string> <remote_path:string>").option("--message <message:string>", "Deployment message").action(push11).command("run", "run a flow by path.").arguments("<path:string>").option("-d --data <data:string>", "Inputs specified as a JSON string or a file using @<filename> or stdin using @-.").option("-s --silent", "Do not ouput anything other then the final output. Useful for scripting.").action(run3).command("preview", "preview a local flow without deploying it. Runs the flow definition from local files and uses local PathScripts by default.").arguments("<flow_path:string>").option("-d --data <data:string>", "Inputs specified as a JSON string or a file using @<filename> or stdin using @-.").option("-s --silent", "Do not output anything other then the final output. Useful for scripting.").option("--remote", "Use deployed workspace scripts for PathScript steps instead of local files.").action(preview2).command("generate-locks", "re-generate the lock files of all inline scripts of all updated flows").arguments("[flow:file]").option("--yes", "Skip confirmation prompt").option("--dry-run", "Perform a dry run without making changes").option("-i --includes <patterns:file[]>", "Comma separated patterns to specify which file to take into account (among files that are compatible with windmill). Patterns can include * (any string until '/') and ** (any string)").option("-e --excludes <patterns:file[]>", "Comma separated patterns to specify which file to NOT take into account.").action(generateLocks).command("new", "create a new empty flow").arguments("<flow_path:string>").option("--summary <summary:string>", "flow summary").option("--description <description:string>", "flow description").action(bootstrap2).command("bootstrap", "create a new empty flow (alias for new)").arguments("<flow_path:string>").option("--summary <summary:string>", "flow summary").option("--description <description:string>", "flow description").action(bootstrap2).command("history", "Show version history for a flow").arguments("<path:string>").option("--json", "Output as JSON (for piping to jq)").action(history2).command("show-version", "Show a specific version of a flow").arguments("<path:string> <version:string>").option("--json", "Output as JSON (for piping to jq)").action(showVersion);
71634
+ command21 = new Command().description("flow related commands").option("--show-archived", "Enable archived flows in output").option("--json", "Output as JSON (for piping to jq)").action(list12).command("list", "list all flows").option("--show-archived", "Enable archived flows in output").option("--json", "Output as JSON (for piping to jq)").action(list12).command("get", "get a flow's details").arguments("<path:string>").option("--json", "Output as JSON (for piping to jq)").action(get9).command("push", "push a local flow spec. This overrides any remote versions.").arguments("<file_path:string> <remote_path:string>").option("--message <message:string>", "Deployment message").action(push11).command("run", "run a flow by path.").arguments("<path:string>").option("-d --data <data:string>", "Inputs specified as a JSON string or a file using @<filename> or stdin using @-.").option("-s --silent", "Do not ouput anything other then the final output. Useful for scripting.").action(run3).command("preview", "preview a local flow without deploying it. Runs the flow definition from local files and uses local PathScripts by default.").arguments("<flow_path:string>").option("-d --data <data:string>", "Inputs specified as a JSON string or a file using @<filename> or stdin using @-.").option("-s --silent", "Do not output anything other then the final output. Useful for scripting.").option("--remote", "Use deployed workspace scripts for PathScript steps instead of local files.").action(preview2).command("generate-locks", 'DEPRECATED: re-generate flow lock files. Use "wmill generate-metadata" instead.').arguments("[flow:file]").option("--yes", "Skip confirmation prompt").option("--dry-run", "Perform a dry run without making changes").option("-i --includes <patterns:file[]>", "Comma separated patterns to specify which file to take into account (among files that are compatible with windmill). Patterns can include * (any string until '/') and ** (any string)").option("-e --excludes <patterns:file[]>", "Comma separated patterns to specify which file to NOT take into account.").action(generateLocks).command("new", "create a new empty flow").arguments("<flow_path:string>").option("--summary <summary:string>", "flow summary").option("--description <description:string>", "flow description").action(bootstrap2).command("bootstrap", "create a new empty flow (alias for new)").arguments("<flow_path:string>").option("--summary <summary:string>", "flow summary").option("--description <description:string>", "flow description").action(bootstrap2).command("history", "Show version history for a flow").arguments("<path:string>").option("--json", "Output as JSON (for piping to jq)").action(history2).command("show-version", "Show a specific version of a flow").arguments("<path:string> <version:string>").option("--json", "Output as JSON (for piping to jq)").action(showVersion);
71535
71635
  flow_default = command21;
71536
71636
  });
71537
71637
 
@@ -74484,7 +74584,7 @@ description: MUST use when writing Bash scripts.
74484
74584
  ## CLI Commands
74485
74585
 
74486
74586
  Place scripts in a folder. After writing, tell the user they can run:
74487
- - \`wmill script generate-metadata\` - Generate .script.yaml and .lock files
74587
+ - \`wmill generate-metadata\` - Generate .script.yaml and .lock files
74488
74588
  - \`wmill sync push\` - Deploy to Windmill
74489
74589
 
74490
74590
  Do NOT run these commands yourself. Instead, inform the user that they should run them.
@@ -74549,7 +74649,7 @@ description: MUST use when writing BigQuery queries.
74549
74649
  ## CLI Commands
74550
74650
 
74551
74651
  Place scripts in a folder. After writing, tell the user they can run:
74552
- - \`wmill script generate-metadata\` - Generate .script.yaml and .lock files
74652
+ - \`wmill generate-metadata\` - Generate .script.yaml and .lock files
74553
74653
  - \`wmill sync push\` - Deploy to Windmill
74554
74654
 
74555
74655
  Do NOT run these commands yourself. Instead, inform the user that they should run them.
@@ -74576,7 +74676,7 @@ description: MUST use when writing Bun/TypeScript scripts.
74576
74676
  ## CLI Commands
74577
74677
 
74578
74678
  Place scripts in a folder. After writing, tell the user they can run:
74579
- - \`wmill script generate-metadata\` - Generate .script.yaml and .lock files
74679
+ - \`wmill generate-metadata\` - Generate .script.yaml and .lock files
74580
74680
  - \`wmill sync push\` - Deploy to Windmill
74581
74681
 
74582
74682
  Do NOT run these commands yourself. Instead, inform the user that they should run them.
@@ -74701,6 +74801,8 @@ const result: S3Object = await wmill.writeS3File(
74701
74801
 
74702
74802
  Import: import * as wmill from 'windmill-client'
74703
74803
 
74804
+ workerHasInternalServer(): boolean
74805
+
74704
74806
  /**
74705
74807
  * Initialize the Windmill client with authentication token and base URL
74706
74808
  * @param token - Authentication token (defaults to WM_TOKEN env variable)
@@ -75241,7 +75343,7 @@ description: MUST use when writing Bun Native scripts.
75241
75343
  ## CLI Commands
75242
75344
 
75243
75345
  Place scripts in a folder. After writing, tell the user they can run:
75244
- - \`wmill script generate-metadata\` - Generate .script.yaml and .lock files
75346
+ - \`wmill generate-metadata\` - Generate .script.yaml and .lock files
75245
75347
  - \`wmill sync push\` - Deploy to Windmill
75246
75348
 
75247
75349
  Do NOT run these commands yourself. Instead, inform the user that they should run them.
@@ -75364,6 +75466,8 @@ const result: S3Object = await wmill.writeS3File(
75364
75466
 
75365
75467
  Import: import * as wmill from 'windmill-client'
75366
75468
 
75469
+ workerHasInternalServer(): boolean
75470
+
75367
75471
  /**
75368
75472
  * Initialize the Windmill client with authentication token and base URL
75369
75473
  * @param token - Authentication token (defaults to WM_TOKEN env variable)
@@ -75904,7 +76008,7 @@ description: MUST use when writing C# scripts.
75904
76008
  ## CLI Commands
75905
76009
 
75906
76010
  Place scripts in a folder. After writing, tell the user they can run:
75907
- - \`wmill script generate-metadata\` - Generate .script.yaml and .lock files
76011
+ - \`wmill generate-metadata\` - Generate .script.yaml and .lock files
75908
76012
  - \`wmill sync push\` - Deploy to Windmill
75909
76013
 
75910
76014
  Do NOT run these commands yourself. Instead, inform the user that they should run them.
@@ -75961,7 +76065,7 @@ description: MUST use when writing Deno/TypeScript scripts.
75961
76065
  ## CLI Commands
75962
76066
 
75963
76067
  Place scripts in a folder. After writing, tell the user they can run:
75964
- - \`wmill script generate-metadata\` - Generate .script.yaml and .lock files
76068
+ - \`wmill generate-metadata\` - Generate .script.yaml and .lock files
75965
76069
  - \`wmill sync push\` - Deploy to Windmill
75966
76070
 
75967
76071
  Do NOT run these commands yourself. Instead, inform the user that they should run them.
@@ -76090,6 +76194,8 @@ const result: S3Object = await wmill.writeS3File(
76090
76194
 
76091
76195
  Import: import * as wmill from 'windmill-client'
76092
76196
 
76197
+ workerHasInternalServer(): boolean
76198
+
76093
76199
  /**
76094
76200
  * Initialize the Windmill client with authentication token and base URL
76095
76201
  * @param token - Authentication token (defaults to WM_TOKEN env variable)
@@ -76630,7 +76736,7 @@ description: MUST use when writing DuckDB queries.
76630
76736
  ## CLI Commands
76631
76737
 
76632
76738
  Place scripts in a folder. After writing, tell the user they can run:
76633
- - \`wmill script generate-metadata\` - Generate .script.yaml and .lock files
76739
+ - \`wmill generate-metadata\` - Generate .script.yaml and .lock files
76634
76740
  - \`wmill sync push\` - Deploy to Windmill
76635
76741
 
76636
76742
  Do NOT run these commands yourself. Instead, inform the user that they should run them.
@@ -76697,7 +76803,7 @@ description: MUST use when writing Go scripts.
76697
76803
  ## CLI Commands
76698
76804
 
76699
76805
  Place scripts in a folder. After writing, tell the user they can run:
76700
- - \`wmill script generate-metadata\` - Generate .script.yaml and .lock files
76806
+ - \`wmill generate-metadata\` - Generate .script.yaml and .lock files
76701
76807
  - \`wmill sync push\` - Deploy to Windmill
76702
76808
 
76703
76809
  Do NOT run these commands yourself. Instead, inform the user that they should run them.
@@ -76771,7 +76877,7 @@ description: MUST use when writing GraphQL queries.
76771
76877
  ## CLI Commands
76772
76878
 
76773
76879
  Place scripts in a folder. After writing, tell the user they can run:
76774
- - \`wmill script generate-metadata\` - Generate .script.yaml and .lock files
76880
+ - \`wmill generate-metadata\` - Generate .script.yaml and .lock files
76775
76881
  - \`wmill sync push\` - Deploy to Windmill
76776
76882
 
76777
76883
  Do NOT run these commands yourself. Instead, inform the user that they should run them.
@@ -76832,7 +76938,7 @@ description: MUST use when writing Java scripts.
76832
76938
  ## CLI Commands
76833
76939
 
76834
76940
  Place scripts in a folder. After writing, tell the user they can run:
76835
- - \`wmill script generate-metadata\` - Generate .script.yaml and .lock files
76941
+ - \`wmill generate-metadata\` - Generate .script.yaml and .lock files
76836
76942
  - \`wmill sync push\` - Deploy to Windmill
76837
76943
 
76838
76944
  Do NOT run these commands yourself. Instead, inform the user that they should run them.
@@ -76886,7 +76992,7 @@ description: MUST use when writing MS SQL Server queries.
76886
76992
  ## CLI Commands
76887
76993
 
76888
76994
  Place scripts in a folder. After writing, tell the user they can run:
76889
- - \`wmill script generate-metadata\` - Generate .script.yaml and .lock files
76995
+ - \`wmill generate-metadata\` - Generate .script.yaml and .lock files
76890
76996
  - \`wmill sync push\` - Deploy to Windmill
76891
76997
 
76892
76998
  Do NOT run these commands yourself. Instead, inform the user that they should run them.
@@ -76913,7 +77019,7 @@ description: MUST use when writing MySQL queries.
76913
77019
  ## CLI Commands
76914
77020
 
76915
77021
  Place scripts in a folder. After writing, tell the user they can run:
76916
- - \`wmill script generate-metadata\` - Generate .script.yaml and .lock files
77022
+ - \`wmill generate-metadata\` - Generate .script.yaml and .lock files
76917
77023
  - \`wmill sync push\` - Deploy to Windmill
76918
77024
 
76919
77025
  Do NOT run these commands yourself. Instead, inform the user that they should run them.
@@ -76940,7 +77046,7 @@ description: MUST use when writing Native TypeScript scripts.
76940
77046
  ## CLI Commands
76941
77047
 
76942
77048
  Place scripts in a folder. After writing, tell the user they can run:
76943
- - \`wmill script generate-metadata\` - Generate .script.yaml and .lock files
77049
+ - \`wmill generate-metadata\` - Generate .script.yaml and .lock files
76944
77050
  - \`wmill sync push\` - Deploy to Windmill
76945
77051
 
76946
77052
  Do NOT run these commands yourself. Instead, inform the user that they should run them.
@@ -77030,6 +77136,8 @@ export async function preprocessor(event: Event) {
77030
77136
 
77031
77137
  Import: import * as wmill from 'windmill-client'
77032
77138
 
77139
+ workerHasInternalServer(): boolean
77140
+
77033
77141
  /**
77034
77142
  * Initialize the Windmill client with authentication token and base URL
77035
77143
  * @param token - Authentication token (defaults to WM_TOKEN env variable)
@@ -77570,7 +77678,7 @@ description: MUST use when writing PHP scripts.
77570
77678
  ## CLI Commands
77571
77679
 
77572
77680
  Place scripts in a folder. After writing, tell the user they can run:
77573
- - \`wmill script generate-metadata\` - Generate .script.yaml and .lock files
77681
+ - \`wmill generate-metadata\` - Generate .script.yaml and .lock files
77574
77682
  - \`wmill sync push\` - Deploy to Windmill
77575
77683
 
77576
77684
  Do NOT run these commands yourself. Instead, inform the user that they should run them.
@@ -77643,7 +77751,7 @@ description: MUST use when writing PostgreSQL queries.
77643
77751
  ## CLI Commands
77644
77752
 
77645
77753
  Place scripts in a folder. After writing, tell the user they can run:
77646
- - \`wmill script generate-metadata\` - Generate .script.yaml and .lock files
77754
+ - \`wmill generate-metadata\` - Generate .script.yaml and .lock files
77647
77755
  - \`wmill sync push\` - Deploy to Windmill
77648
77756
 
77649
77757
  Do NOT run these commands yourself. Instead, inform the user that they should run them.
@@ -77670,7 +77778,7 @@ description: MUST use when writing PowerShell scripts.
77670
77778
  ## CLI Commands
77671
77779
 
77672
77780
  Place scripts in a folder. After writing, tell the user they can run:
77673
- - \`wmill script generate-metadata\` - Generate .script.yaml and .lock files
77781
+ - \`wmill generate-metadata\` - Generate .script.yaml and .lock files
77674
77782
  - \`wmill sync push\` - Deploy to Windmill
77675
77783
 
77676
77784
  Do NOT run these commands yourself. Instead, inform the user that they should run them.
@@ -77741,7 +77849,7 @@ description: MUST use when writing Python scripts.
77741
77849
  ## CLI Commands
77742
77850
 
77743
77851
  Place scripts in a folder. After writing, tell the user they can run:
77744
- - \`wmill script generate-metadata\` - Generate .script.yaml and .lock files
77852
+ - \`wmill generate-metadata\` - Generate .script.yaml and .lock files
77745
77853
  - \`wmill sync push\` - Deploy to Windmill
77746
77854
 
77747
77855
  Do NOT run these commands yourself. Instead, inform the user that they should run them.
@@ -77872,6 +77980,8 @@ result: S3Object = wmill.write_s3_file(
77872
77980
 
77873
77981
  Import: import wmill
77874
77982
 
77983
+ def worker_has_internal_server() -> bool
77984
+
77875
77985
  def get_mocked_api() -> Optional[dict]
77876
77986
 
77877
77987
  # Get the HTTP client instance.
@@ -77936,7 +78046,10 @@ def run_script_by_path(path: str, args: dict = None, timeout: dt.timedelta | int
77936
78046
  # Run script by hash synchronously and return its result.
77937
78047
  def run_script_by_hash(hash_: str, args: dict = None, timeout: dt.timedelta | int | float | None = None, verbose: bool = False, cleanup: bool = True, assert_result_is_not_none: bool = False) -> Any
77938
78048
 
77939
- # Run a script on the current worker without creating a job
78049
+ # Run a script on the current worker without creating a job.
78050
+ #
78051
+ # On agent workers (no internal server), falls back to running a normal
78052
+ # preview job and waiting for the result.
77940
78053
  def run_inline_script_preview(content: str, language: str, args: dict = None) -> Any
77941
78054
 
77942
78055
  # Wait for a job to complete and return its result.
@@ -78562,7 +78675,7 @@ description: MUST use when writing R scripts.
78562
78675
  ## CLI Commands
78563
78676
 
78564
78677
  Place scripts in a folder. After writing, tell the user they can run:
78565
- - \`wmill script generate-metadata\` - Generate .script.yaml and .lock files
78678
+ - \`wmill generate-metadata\` - Generate .script.yaml and .lock files
78566
78679
  - \`wmill sync push\` - Deploy to Windmill
78567
78680
 
78568
78681
  Do NOT run these commands yourself. Instead, inform the user that they should run them.
@@ -78663,7 +78776,7 @@ description: MUST use when writing Rust scripts.
78663
78776
  ## CLI Commands
78664
78777
 
78665
78778
  Place scripts in a folder. After writing, tell the user they can run:
78666
- - \`wmill script generate-metadata\` - Generate .script.yaml and .lock files
78779
+ - \`wmill generate-metadata\` - Generate .script.yaml and .lock files
78667
78780
  - \`wmill sync push\` - Deploy to Windmill
78668
78781
 
78669
78782
  Do NOT run these commands yourself. Instead, inform the user that they should run them.
@@ -78754,7 +78867,7 @@ description: MUST use when writing Snowflake queries.
78754
78867
  ## CLI Commands
78755
78868
 
78756
78869
  Place scripts in a folder. After writing, tell the user they can run:
78757
- - \`wmill script generate-metadata\` - Generate .script.yaml and .lock files
78870
+ - \`wmill generate-metadata\` - Generate .script.yaml and .lock files
78758
78871
  - \`wmill sync push\` - Deploy to Windmill
78759
78872
 
78760
78873
  Do NOT run these commands yourself. Instead, inform the user that they should run them.
@@ -78785,7 +78898,7 @@ description: MUST use when creating flows.
78785
78898
  Create a folder ending with \`{{FLOW_SUFFIX}}\` and add a \`flow.yaml\` file with the flow definition.
78786
78899
  For rawscript modules, use \`!inline path/to/script.ts\` for the content key. {{INLINE_SCRIPT_NAMING}}
78787
78900
  After writing, tell the user they can run:
78788
- - \`wmill flow generate-locks <path_to_flow_folder> --yes\` - Generate lock files for the specific flow you modified (e.g. \`wmill flow generate-locks f/my_folder/my_flow{{FLOW_SUFFIX}} --yes\`)
78901
+ - \`wmill generate-metadata\` - Generate lock files for the flow you modified
78789
78902
  - \`wmill sync push\` - Deploy to Windmill
78790
78903
 
78791
78904
  Do NOT run these commands yourself. Instead, inform the user that they should run them.
@@ -78933,7 +79046,7 @@ my_app{{RAW_APP_SUFFIX}}/
78933
79046
  ├── backend/ # Backend runnables (server-side scripts)
78934
79047
  │ ├── <id>.<ext> # Code file (e.g., get_user.ts)
78935
79048
  │ ├── <id>.yaml # Optional: config for fields, or to reference existing scripts
78936
- │ └── <id>.lock # Lock file (run 'wmill app generate-locks' to create)
79049
+ │ └── <id>.lock # Lock file (run 'wmill generate-metadata' to create/update)
78937
79050
  └── sql_to_apply/ # SQL migrations (dev only, not synced)
78938
79051
  └── *.sql # SQL files to apply via dev server
78939
79052
  \`\`\`
@@ -78989,7 +79102,7 @@ export async function main(user_id: string) {
78989
79102
 
78990
79103
  After creating, tell the user they can generate lock files by running:
78991
79104
  \`\`\`bash
78992
- wmill app generate-locks
79105
+ wmill generate-metadata
78993
79106
  \`\`\`
78994
79107
 
78995
79108
  ### Optional YAML Configuration
@@ -79147,7 +79260,7 @@ Tell the user they can run these commands (do NOT run them yourself):
79147
79260
  | \`wmill app new\` | Create a new raw app interactively |
79148
79261
  | \`wmill app dev\` | Start dev server with live reload |
79149
79262
  | \`wmill app generate-agents\` | Refresh AGENTS.md and DATATABLES.md |
79150
- | \`wmill app generate-locks\` | Generate lock files for backend runnables |
79263
+ | \`wmill generate-metadata\` | Generate lock files for backend runnables |
79151
79264
  | \`wmill sync push\` | Deploy app to Windmill |
79152
79265
  | \`wmill sync pull\` | Pull latest from Windmill |
79153
79266
 
@@ -79158,7 +79271,7 @@ Tell the user they can run these commands (do NOT run them yourself):
79158
79271
  3. **Keep runnables focused** - one function per file
79159
79272
  4. **Use descriptive IDs** - \`get_user.ts\` not \`a.ts\`
79160
79273
  5. **Always whitelist tables** - add to \`data.tables\` before querying
79161
- 6. **Generate locks** - tell the user to run \`wmill app generate-locks\` after adding/modifying backend runnables
79274
+ 6. **Generate locks** - tell the user to run \`wmill generate-metadata\` after adding/modifying backend runnables
79162
79275
  `,
79163
79276
  triggers: `---
79164
79277
  name: triggers
@@ -79535,10 +79648,6 @@ app related commands
79535
79648
  - \`--fix\` - Attempt to fix common issues (not implemented yet)
79536
79649
  - \`app new\` - create a new raw app from a template
79537
79650
  - \`app generate-agents [app_folder:string]\` - regenerate AGENTS.md and DATATABLES.md from remote workspace
79538
- - \`app generate-locks [app_folder:string]\` - re-generate the lockfiles for app runnables inline scripts that have changed
79539
- - \`--yes\` - Skip confirmation prompt
79540
- - \`--dry-run\` - Perform a dry run without making changes
79541
- - \`--default-ts <runtime:string>\` - Default TypeScript runtime (bun or deno)
79542
79651
 
79543
79652
  ### audit
79544
79653
 
@@ -79607,11 +79716,6 @@ flow related commands
79607
79716
  - \`-d --data <data:string>\` - Inputs specified as a JSON string or a file using @<filename> or stdin using @-.
79608
79717
  - \`-s --silent\` - Do not output anything other then the final output. Useful for scripting.
79609
79718
  - \`--remote\` - Use deployed workspace scripts for PathScript steps instead of local files.
79610
- - \`flow generate-locks [flow:file]\` - re-generate the lock files of all inline scripts of all updated flows
79611
- - \`--yes\` - Skip confirmation prompt
79612
- - \`--dry-run\` - Perform a dry run without making changes
79613
- - \`-i --includes <patterns:file[]>\` - Comma separated patterns to specify which file to take into account (among files that are compatible with windmill). Patterns can include * (any string until '/') and ** (any string)
79614
- - \`-e --excludes <patterns:file[]>\` - Comma separated patterns to specify which file to NOT take into account.
79615
79719
  - \`flow new <flow_path:string>\` - create a new empty flow
79616
79720
  - \`--summary <summary:string>\` - flow summary
79617
79721
  - \`--description <description:string>\` - flow description
@@ -79895,13 +79999,6 @@ script related commands
79895
79999
  - \`script bootstrap <path:file> <language:string>\` - create a new script (alias for new)
79896
80000
  - \`--summary <summary:string>\` - script summary
79897
80001
  - \`--description <description:string>\` - script description
79898
- - \`script generate-metadata [script:file]\` - re-generate the metadata file updating the lock and the script schema (for flows, use \`wmill flow generate-locks\`)
79899
- - \`--yes\` - Skip confirmation prompt
79900
- - \`--dry-run\` - Perform a dry run without making changes
79901
- - \`--lock-only\` - re-generate only the lock
79902
- - \`--schema-only\` - re-generate only script schema
79903
- - \`-i --includes <patterns:file[]>\` - Comma separated patterns to specify which file to take into account (among files that are compatible with windmill). Patterns can include * (any string until '/') and ** (any string)
79904
- - \`-e --excludes <patterns:file[]>\` - Comma separated patterns to specify which file to NOT take into account.
79905
80002
  - \`script history <path:string>\` - show version history for a script
79906
80003
  - \`--json\` - Output as JSON (for piping to jq)
79907
80004
 
@@ -80113,6 +80210,10 @@ properties:
80113
80210
  is_flow:
80114
80211
  type: boolean
80115
80212
  description: True if script_path points to a flow, false if it points to a script
80213
+ labels:
80214
+ type: array
80215
+ items:
80216
+ type: string
80116
80217
  gcp_resource_path:
80117
80218
  type: string
80118
80219
  description: Path to the GCP resource containing service account credentials for
@@ -80210,6 +80311,10 @@ properties:
80210
80311
  is_flow:
80211
80312
  type: boolean
80212
80313
  description: True if script_path points to a flow, false if it points to a script
80314
+ labels:
80315
+ type: array
80316
+ items:
80317
+ type: string
80213
80318
  route_path:
80214
80319
  type: string
80215
80320
  description: The URL route path that will trigger this endpoint (e.g., 'api/myendpoint').
@@ -80340,6 +80445,10 @@ properties:
80340
80445
  is_flow:
80341
80446
  type: boolean
80342
80447
  description: True if script_path points to a flow, false if it points to a script
80448
+ labels:
80449
+ type: array
80450
+ items:
80451
+ type: string
80343
80452
  kafka_resource_path:
80344
80453
  type: string
80345
80454
  description: Path to the Kafka resource containing connection configuration
@@ -80439,6 +80548,10 @@ properties:
80439
80548
  is_flow:
80440
80549
  type: boolean
80441
80550
  description: True if script_path points to a flow, false if it points to a script
80551
+ labels:
80552
+ type: array
80553
+ items:
80554
+ type: string
80442
80555
  mqtt_resource_path:
80443
80556
  type: string
80444
80557
  description: Path to the MQTT resource containing broker connection configuration
@@ -80529,6 +80642,10 @@ properties:
80529
80642
  is_flow:
80530
80643
  type: boolean
80531
80644
  description: True if script_path points to a flow, false if it points to a script
80645
+ labels:
80646
+ type: array
80647
+ items:
80648
+ type: string
80532
80649
  nats_resource_path:
80533
80650
  type: string
80534
80651
  description: Path to the NATS resource containing connection configuration
@@ -80606,6 +80723,10 @@ properties:
80606
80723
  is_flow:
80607
80724
  type: boolean
80608
80725
  description: True if script_path points to a flow, false if it points to a script
80726
+ labels:
80727
+ type: array
80728
+ items:
80729
+ type: string
80609
80730
  postgres_resource_path:
80610
80731
  type: string
80611
80732
  description: Path to the PostgreSQL resource containing connection configuration
@@ -80784,6 +80905,10 @@ properties:
80784
80905
  type: string
80785
80906
  description: Path to a script that validates scheduled datetimes. Receives scheduled_for
80786
80907
  datetime and returns boolean to skip (true) or run (false)
80908
+ labels:
80909
+ type: array
80910
+ items:
80911
+ type: string
80787
80912
  required:
80788
80913
  - schedule
80789
80914
  - script_path
@@ -80803,6 +80928,10 @@ properties:
80803
80928
  is_flow:
80804
80929
  type: boolean
80805
80930
  description: True if script_path points to a flow, false if it points to a script
80931
+ labels:
80932
+ type: array
80933
+ items:
80934
+ type: string
80806
80935
  queue_url:
80807
80936
  type: string
80808
80937
  description: The full URL of the AWS SQS queue to poll for messages
@@ -80879,6 +81008,10 @@ properties:
80879
81008
  is_flow:
80880
81009
  type: boolean
80881
81010
  description: True if script_path points to a flow, false if it points to a script
81011
+ labels:
81012
+ type: array
81013
+ items:
81014
+ type: string
80882
81015
  url:
80883
81016
  type: string
80884
81017
  description: The WebSocket URL to connect to (can be a static URL or computed
@@ -80916,6 +81049,21 @@ properties:
80916
81049
  can_return_error_result:
80917
81050
  type: boolean
80918
81051
  description: If true, error results are sent back through the WebSocket
81052
+ heartbeat:
81053
+ type: object
81054
+ properties:
81055
+ interval_secs:
81056
+ type: integer
81057
+ minimum: 1
81058
+ description: Interval in seconds between heartbeat messages
81059
+ message:
81060
+ type: string
81061
+ description: Message to send as heartbeat. Use {{state}} as a placeholder
81062
+ for a value extracted from incoming messages (see state_field).
81063
+ state_field:
81064
+ type: string
81065
+ description: Optional. Top-level JSON field to extract from incoming messages.
81066
+ The extracted value replaces {{state}} in the heartbeat message.
80919
81067
  error_handler_path:
80920
81068
  type: string
80921
81069
  description: Path to a script or flow to run when the triggered job fails
@@ -82376,7 +82524,7 @@ async function generateMetadata2(opts, folder) {
82376
82524
  return !isD && !exts.some((ext2) => p.endsWith(ext2)) || ignore(p, isD) || isFolderResourcePathAnyFormat(p) || isScriptModulePath(p) && !isModuleEntryPoint(p);
82377
82525
  }, false, {});
82378
82526
  for (const e of Object.keys(scriptElems)) {
82379
- await generateScriptMetadataInternal(e, workspace, opts, true, true, rawWorkspaceDependencies, codebases, false, false, tree);
82527
+ await generateScriptMetadataInternal(e, workspace, opts, true, true, rawWorkspaceDependencies, codebases, false, tree);
82380
82528
  }
82381
82529
  }
82382
82530
  if (!skipFlows) {
@@ -82384,7 +82532,7 @@ async function generateMetadata2(opts, folder) {
82384
82532
  return ignore(p, isD) || !isD && !p.endsWith(SEP21 + "flow.yaml") && !p.endsWith(SEP21 + "flow.json");
82385
82533
  }, false, {})).map((x) => x.substring(0, x.lastIndexOf(SEP21)));
82386
82534
  for (const flowFolder of flowElems) {
82387
- await generateFlowLockInternal(flowFolder, true, workspace, opts, false, true, false, tree);
82535
+ await generateFlowLockInternal(flowFolder, true, workspace, opts, false, true, tree);
82388
82536
  }
82389
82537
  }
82390
82538
  if (!skipApps) {
@@ -82394,10 +82542,10 @@ async function generateMetadata2(opts, folder) {
82394
82542
  const rawAppFolders = getAppFolders(elems, "raw_app.yaml");
82395
82543
  const appFolders = getAppFolders(elems, "app.yaml");
82396
82544
  for (const appFolder of rawAppFolders) {
82397
- await generateAppLocksInternal(appFolder, true, true, workspace, opts, false, true, false, tree);
82545
+ await generateAppLocksInternal(appFolder, true, true, workspace, opts, false, true, tree);
82398
82546
  }
82399
82547
  for (const appFolder of appFolders) {
82400
- await generateAppLocksInternal(appFolder, false, true, workspace, opts, false, true, false, tree);
82548
+ await generateAppLocksInternal(appFolder, false, true, workspace, opts, false, true, tree);
82401
82549
  }
82402
82550
  }
82403
82551
  tree.propagateStaleness();
@@ -82498,7 +82646,8 @@ async function generateMetadata2(opts, folder) {
82498
82646
  return;
82499
82647
  }
82500
82648
  info("");
82501
- if (!opts.yes && !await Confirm.prompt({
82649
+ const isInteractive = process.stdin.isTTY ?? false;
82650
+ if (!opts.yes && isInteractive && !await Confirm.prompt({
82502
82651
  message: "Update metadata?",
82503
82652
  default: true
82504
82653
  })) {
@@ -82517,7 +82666,7 @@ async function generateMetadata2(opts, folder) {
82517
82666
  current++;
82518
82667
  info(`${formatProgress(current)} script ${item.path}`);
82519
82668
  try {
82520
- await generateScriptMetadataInternal(item.path, workspace, opts, false, true, mismatchedWorkspaceDeps, codebases, false, false, tree);
82669
+ await generateScriptMetadataInternal(item.path, workspace, opts, false, true, mismatchedWorkspaceDeps, codebases, false, tree);
82521
82670
  } catch (e) {
82522
82671
  const msg = e instanceof Error ? e.message : String(e);
82523
82672
  errors.push({ path: item.path, error: msg });
@@ -82527,7 +82676,7 @@ async function generateMetadata2(opts, folder) {
82527
82676
  for (const item of flows) {
82528
82677
  current++;
82529
82678
  try {
82530
- const result2 = await generateFlowLockInternal(item.folder.replaceAll("/", SEP21), false, workspace, opts, false, true, false, tree);
82679
+ const result2 = await generateFlowLockInternal(item.folder.replaceAll("/", SEP21), false, workspace, opts, false, true, tree);
82531
82680
  const flowResult = result2;
82532
82681
  const scriptsInfo = flowResult?.updatedScripts?.length ? colors.dim(colors.white(`: ${flowResult.updatedScripts.join(", ")}`)) : "";
82533
82682
  info(`${formatProgress(current)} flow ${item.path}${scriptsInfo}`);
@@ -82541,7 +82690,7 @@ async function generateMetadata2(opts, folder) {
82541
82690
  for (const item of apps2) {
82542
82691
  current++;
82543
82692
  try {
82544
- const result2 = await generateAppLocksInternal(item.folder.replaceAll("/", SEP21), item.isRawApp, false, workspace, opts, false, true, false, tree);
82693
+ const result2 = await generateAppLocksInternal(item.folder.replaceAll("/", SEP21), item.isRawApp, false, workspace, opts, false, true, tree);
82545
82694
  const appResult = result2;
82546
82695
  const scriptsInfo = appResult?.updatedScripts?.length ? colors.dim(colors.white(`: ${appResult.updatedScripts.join(", ")}`)) : "";
82547
82696
  info(`${formatProgress(current)} app ${item.path}${scriptsInfo}`);
@@ -82657,7 +82806,7 @@ var config_default = command35;
82657
82806
 
82658
82807
  // src/main.ts
82659
82808
  await init_context();
82660
- var VERSION = "1.672.0";
82809
+ var VERSION = "1.674.0";
82661
82810
  var command36 = new Command().name("wmill").action(() => info(`Welcome to Windmill CLI ${VERSION}. Use -h for help.`)).description("Windmill CLI").globalOption("--workspace <workspace:string>", "Specify the target workspace. This overrides the default workspace.").globalOption("--debug --verbose", "Show debug/verbose logs").globalOption("--show-diffs", "Show diff informations when syncing (may show sensitive informations)").globalOption("--token <token:string>", "Specify an API token. This will override any stored token.").globalOption("--base-url <baseUrl:string>", "Specify the base URL of the API. If used, --token and --workspace are required and no local remote/workspace already set will be used.").globalOption("--config-dir <configDir:string>", "Specify a custom config directory. Overrides WMILL_CONFIG_DIR environment variable and default ~/.config location.").env("HEADERS <headers:string>", `Specify headers to use for all requests. e.g: "HEADERS='h1: v1, h2: v2'"`).version(VERSION).versionOption(false).command("init", init_default).command("app", app_default).command("flow", flow_default).command("script", script_default).command("workspace", workspace_default).command("resource", resource_default).command("resource-type", resource_type_default).command("user", user_default).command("variable", variable_default).command("hub", hub_default).command("folder", folder_default).command("schedule", schedule_default).command("trigger", trigger_default).command("dev", dev_default2).command("sync", sync_default).command("lint", lint_default).command("gitsync-settings", gitsync_settings_default).command("instance", instance_default).command("worker-groups", worker_groups_default).command("workers", workers_default).command("queues", queues_default).command("dependencies", dependencies_default).command("jobs", jobs_default).command("job", job_default).command("group", group_default).command("audit", audit_default).command("token", token_default).command("generate-metadata", generate_metadata_default).command("docs", docs_default).command("config", config_default).command("version --version", "Show version information").action(async (opts) => {
82662
82811
  console.log("CLI version: " + VERSION);
82663
82812
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "windmill-cli",
3
- "version": "1.672.0",
3
+ "version": "1.674.0",
4
4
  "description": "CLI for Windmill",
5
5
  "license": "Apache 2.0",
6
6
  "type": "module",