windmill-cli 1.782.0 → 1.784.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 +306 -181
  2. package/package.json +1 -1
package/esm/main.js CHANGED
@@ -16784,7 +16784,7 @@ var init_OpenAPI = __esm(() => {
16784
16784
  PASSWORD: undefined,
16785
16785
  TOKEN: getEnv3("WM_TOKEN"),
16786
16786
  USERNAME: undefined,
16787
- VERSION: "1.782.0",
16787
+ VERSION: "1.784.0",
16788
16788
  WITH_CREDENTIALS: true,
16789
16789
  interceptors: {
16790
16790
  request: new Interceptors,
@@ -17210,6 +17210,7 @@ __export(exports_services_gen, {
17210
17210
  resumeSuspendedFlowAsOwner: () => resumeSuspendedFlowAsOwner,
17211
17211
  resumeSuspended: () => resumeSuspended,
17212
17212
  resultById: () => resultById,
17213
+ restoreResourceVersion: () => restoreResourceVersion,
17213
17214
  restartWorkerGroup: () => restartWorkerGroup,
17214
17215
  restartFlowAtStep: () => restartFlowAtStep,
17215
17216
  resolveNpmPackageVersion: () => resolveNpmPackageVersion,
@@ -17487,9 +17488,11 @@ __export(exports_services_gen, {
17487
17488
  getRuffConfig: () => getRuffConfig,
17488
17489
  getRootJobId: () => getRootJobId,
17489
17490
  getResumeUrls: () => getResumeUrls,
17491
+ getResourceVersion: () => getResourceVersion,
17490
17492
  getResourceValueInterpolated: () => getResourceValueInterpolated,
17491
17493
  getResourceValue: () => getResourceValue,
17492
17494
  getResourceType: () => getResourceType,
17495
+ getResourceHistory: () => getResourceHistory,
17493
17496
  getResource: () => getResource,
17494
17497
  getRawAppData: () => getRawAppData,
17495
17498
  getQueuePosition: () => getQueuePosition,
@@ -17533,6 +17536,7 @@ __export(exports_services_gen, {
17533
17536
  getJobViewToken: () => getJobViewToken,
17534
17537
  getJobUpdatesSse: () => getJobUpdatesSse,
17535
17538
  getJobUpdates: () => getJobUpdates,
17539
+ getJobPublicViewToken: () => getJobPublicViewToken,
17536
17540
  getJobProgress: () => getJobProgress,
17537
17541
  getJobOtelTraces: () => getJobOtelTraces,
17538
17542
  getJobMetrics: () => getJobMetrics,
@@ -17832,6 +17836,7 @@ __export(exports_services_gen, {
17832
17836
  compareWorkspaces: () => compareWorkspaces,
17833
17837
  commitKafkaOffsets: () => commitKafkaOffsets,
17834
17838
  closeDeploymentRequestMerged: () => closeDeploymentRequestMerged,
17839
+ clearResourceHistory: () => clearResourceHistory,
17835
17840
  clearIndex: () => clearIndex,
17836
17841
  checkSchemaContracts: () => checkSchemaContracts,
17837
17842
  checkS3FolderExists: () => checkS3FolderExists,
@@ -20334,6 +20339,42 @@ var backendVersion = () => {
20334
20339
  body: data3.requestBody,
20335
20340
  mediaType: "application/json"
20336
20341
  });
20342
+ }, getResourceHistory = (data3) => {
20343
+ return request(OpenAPI, {
20344
+ method: "GET",
20345
+ url: "/w/{workspace}/resources/history/p/{path}",
20346
+ path: {
20347
+ workspace: data3.workspace,
20348
+ path: data3.path
20349
+ }
20350
+ });
20351
+ }, clearResourceHistory = (data3) => {
20352
+ return request(OpenAPI, {
20353
+ method: "DELETE",
20354
+ url: "/w/{workspace}/resources/history/p/{path}",
20355
+ path: {
20356
+ workspace: data3.workspace,
20357
+ path: data3.path
20358
+ }
20359
+ });
20360
+ }, getResourceVersion = (data3) => {
20361
+ return request(OpenAPI, {
20362
+ method: "GET",
20363
+ url: "/w/{workspace}/resources/history/v/{version}",
20364
+ path: {
20365
+ workspace: data3.workspace,
20366
+ version: data3.version
20367
+ }
20368
+ });
20369
+ }, restoreResourceVersion = (data3) => {
20370
+ return request(OpenAPI, {
20371
+ method: "POST",
20372
+ url: "/w/{workspace}/resources/history/restore/v/{version}",
20373
+ path: {
20374
+ workspace: data3.workspace,
20375
+ version: data3.version
20376
+ }
20377
+ });
20337
20378
  }, getResource = (data3) => {
20338
20379
  return request(OpenAPI, {
20339
20380
  method: "GET",
@@ -21411,6 +21452,15 @@ var backendVersion = () => {
21411
21452
  id: data3.id
21412
21453
  }
21413
21454
  });
21455
+ }, getJobPublicViewToken = (data3) => {
21456
+ return request(OpenAPI, {
21457
+ method: "GET",
21458
+ url: "/w/{workspace}/jobs/job_public_view_token/{id}",
21459
+ path: {
21460
+ workspace: data3.workspace,
21461
+ id: data3.id
21462
+ }
21463
+ });
21414
21464
  }, listFlowPaths = (data3) => {
21415
21465
  return request(OpenAPI, {
21416
21466
  method: "GET",
@@ -26588,6 +26638,7 @@ __export(exports_gen, {
26588
26638
  resumeSuspendedFlowAsOwner: () => resumeSuspendedFlowAsOwner,
26589
26639
  resumeSuspended: () => resumeSuspended,
26590
26640
  resultById: () => resultById,
26641
+ restoreResourceVersion: () => restoreResourceVersion,
26591
26642
  restartWorkerGroup: () => restartWorkerGroup,
26592
26643
  restartFlowAtStep: () => restartFlowAtStep,
26593
26644
  resolveNpmPackageVersion: () => resolveNpmPackageVersion,
@@ -26865,9 +26916,11 @@ __export(exports_gen, {
26865
26916
  getRuffConfig: () => getRuffConfig,
26866
26917
  getRootJobId: () => getRootJobId,
26867
26918
  getResumeUrls: () => getResumeUrls,
26919
+ getResourceVersion: () => getResourceVersion,
26868
26920
  getResourceValueInterpolated: () => getResourceValueInterpolated,
26869
26921
  getResourceValue: () => getResourceValue,
26870
26922
  getResourceType: () => getResourceType,
26923
+ getResourceHistory: () => getResourceHistory,
26871
26924
  getResource: () => getResource,
26872
26925
  getRawAppData: () => getRawAppData,
26873
26926
  getQueuePosition: () => getQueuePosition,
@@ -26911,6 +26964,7 @@ __export(exports_gen, {
26911
26964
  getJobViewToken: () => getJobViewToken,
26912
26965
  getJobUpdatesSse: () => getJobUpdatesSse,
26913
26966
  getJobUpdates: () => getJobUpdates,
26967
+ getJobPublicViewToken: () => getJobPublicViewToken,
26914
26968
  getJobProgress: () => getJobProgress,
26915
26969
  getJobOtelTraces: () => getJobOtelTraces,
26916
26970
  getJobMetrics: () => getJobMetrics,
@@ -27210,6 +27264,7 @@ __export(exports_gen, {
27210
27264
  compareWorkspaces: () => compareWorkspaces,
27211
27265
  commitKafkaOffsets: () => commitKafkaOffsets,
27212
27266
  closeDeploymentRequestMerged: () => closeDeploymentRequestMerged,
27267
+ clearResourceHistory: () => clearResourceHistory,
27213
27268
  clearIndex: () => clearIndex,
27214
27269
  checkSchemaContracts: () => checkSchemaContracts,
27215
27270
  checkS3FolderExists: () => checkS3FolderExists,
@@ -27372,7 +27427,7 @@ var init_auth = __esm(async () => {
27372
27427
  });
27373
27428
 
27374
27429
  // src/core/constants.ts
27375
- var WM_FORK_PREFIX = "wm-fork", VERSION = "1.782.0";
27430
+ var WM_FORK_PREFIX = "wm-fork", VERSION = "1.784.0";
27376
27431
 
27377
27432
  // src/utils/git.ts
27378
27433
  var exports_git = {};
@@ -31045,9 +31100,13 @@ __export(exports_context, {
31045
31100
  validatePath: () => validatePath,
31046
31101
  tryResolveVersion: () => tryResolveVersion,
31047
31102
  tryResolveBranchWorkspace: () => tryResolveBranchWorkspace,
31103
+ toSyncRootRelativePath: () => toSyncRootRelativePath,
31048
31104
  resolveWorkspace: () => resolveWorkspace,
31049
- fetchVersion: () => fetchVersion
31105
+ fetchVersion: () => fetchVersion,
31106
+ assertRemotePath: () => assertRemotePath
31050
31107
  });
31108
+ import { existsSync as existsSync5, realpathSync } from "node:fs";
31109
+ import { basename as basename4, dirname as dirname7, isAbsolute as isAbsolute3, join as join9, relative as relative6, resolve as resolve6 } from "node:path";
31051
31110
  async function selectFromMultipleProfiles(profiles, baseUrl2, workspaceId, context, configDir) {
31052
31111
  if (profiles.length === 1) {
31053
31112
  return profiles[0];
@@ -31454,6 +31513,34 @@ async function tryResolveVersion(opts) {
31454
31513
  return;
31455
31514
  }
31456
31515
  }
31516
+ function syncRoot() {
31517
+ const wmillYaml = getWmillYamlPath();
31518
+ return wmillYaml ? dirname7(wmillYaml) : process.cwd();
31519
+ }
31520
+ function toSyncRootRelativePath(arg, cwdBeforeConfig) {
31521
+ const root = syncRoot();
31522
+ const candidates = isAbsolute3(arg) ? [arg] : [resolve6(cwdBeforeConfig, arg), resolve6(root, arg)];
31523
+ const abs = candidates.find((c) => existsSync5(c)) ?? candidates.find((c) => existsSync5(dirname7(c))) ?? candidates.at(-1);
31524
+ const rel = relative6(root, abs);
31525
+ if (rel === "")
31526
+ return ".";
31527
+ if (!rel.startsWith(".."))
31528
+ return rel;
31529
+ try {
31530
+ const resolved = relative6(realpathSync(root), realpathOfNamed(abs));
31531
+ return resolved === "" ? "." : resolved;
31532
+ } catch {
31533
+ return rel;
31534
+ }
31535
+ }
31536
+ function realpathOfNamed(p) {
31537
+ return existsSync5(p) ? realpathSync(p) : join9(realpathSync(dirname7(p)), basename4(p));
31538
+ }
31539
+ function assertRemotePath(remotePath, arg) {
31540
+ if (REMOTE_PATH_RE.test(remotePath))
31541
+ return;
31542
+ throw new Error(`Cannot derive a Windmill path from '${arg}'` + (remotePath ? ` (it maps to '${remotePath}')` : "") + `: a preview runs under the path of the file it previews, which must sit inside the wmill.yaml root and be of the form <u|g|f>/<username|group|folder>/<name>.`);
31543
+ }
31457
31544
  function validatePath(path5) {
31458
31545
  if (!(path5.startsWith("g") || path5.startsWith("u") || path5.startsWith("f"))) {
31459
31546
  infoStderr(colors.red("Given remote path looks invalid. Remote paths are typically of the form <u|g|f>/<username|group|folder>/..."));
@@ -31461,6 +31548,7 @@ function validatePath(path5) {
31461
31548
  }
31462
31549
  return true;
31463
31550
  }
31551
+ var REMOTE_PATH_RE;
31464
31552
  var init_context = __esm(async () => {
31465
31553
  init_colors2();
31466
31554
  init_log();
@@ -31478,6 +31566,7 @@ var init_context = __esm(async () => {
31478
31566
  init_branch_profiles(),
31479
31567
  init_conf()
31480
31568
  ]);
31569
+ REMOTE_PATH_RE = /^[ufg](\/[^/]+){2,}$/;
31481
31570
  });
31482
31571
 
31483
31572
  // src/commands/sync/global.ts
@@ -33686,13 +33775,13 @@ return schema
33686
33775
  import { createServer as createServer2 } from "node:net";
33687
33776
  import { execSync as execSync3 } from "node:child_process";
33688
33777
  function isPortFree(port, host) {
33689
- return new Promise((resolve6) => {
33778
+ return new Promise((resolve7) => {
33690
33779
  const s = createServer2();
33691
33780
  s.once("error", (err) => {
33692
33781
  const code2 = err.code ?? "";
33693
- resolve6(code2 !== "EADDRINUSE" && code2 !== "EACCES");
33782
+ resolve7(code2 !== "EADDRINUSE" && code2 !== "EACCES");
33694
33783
  });
33695
- s.once("listening", () => s.close(() => resolve6(true)));
33784
+ s.once("listening", () => s.close(() => resolve7(true)));
33696
33785
  s.listen(port, host);
33697
33786
  });
33698
33787
  }
@@ -37821,8 +37910,8 @@ var require_streamx = __commonJS((exports, module) => {
37821
37910
  return this;
37822
37911
  },
37823
37912
  next() {
37824
- return new Promise(function(resolve6, reject) {
37825
- promiseResolve = resolve6;
37913
+ return new Promise(function(resolve7, reject) {
37914
+ promiseResolve = resolve7;
37826
37915
  promiseReject = reject;
37827
37916
  const data3 = stream.read();
37828
37917
  if (data3 !== null)
@@ -37859,14 +37948,14 @@ var require_streamx = __commonJS((exports, module) => {
37859
37948
  }
37860
37949
  function destroy(err) {
37861
37950
  stream.destroy(err);
37862
- return new Promise((resolve6, reject) => {
37951
+ return new Promise((resolve7, reject) => {
37863
37952
  if (stream._duplexState & DESTROYED)
37864
- return resolve6({ value: undefined, done: true });
37953
+ return resolve7({ value: undefined, done: true });
37865
37954
  stream.once("close", function() {
37866
37955
  if (err)
37867
37956
  reject(err);
37868
37957
  else
37869
- resolve6({ value: undefined, done: true });
37958
+ resolve7({ value: undefined, done: true });
37870
37959
  });
37871
37960
  });
37872
37961
  }
@@ -37918,8 +38007,8 @@ var require_streamx = __commonJS((exports, module) => {
37918
38007
  return Promise.resolve(true);
37919
38008
  if (state.drains === null)
37920
38009
  state.drains = [];
37921
- return new Promise((resolve6) => {
37922
- state.drains.push({ writes, resolve: resolve6 });
38010
+ return new Promise((resolve7) => {
38011
+ state.drains.push({ writes, resolve: resolve7 });
37923
38012
  });
37924
38013
  }
37925
38014
  write(data3) {
@@ -38033,11 +38122,11 @@ var require_streamx = __commonJS((exports, module) => {
38033
38122
  cb(null);
38034
38123
  }
38035
38124
  function pipelinePromise(...streams) {
38036
- return new Promise((resolve6, reject) => {
38125
+ return new Promise((resolve7, reject) => {
38037
38126
  return pipeline(...streams, (err) => {
38038
38127
  if (err)
38039
38128
  return reject(err);
38040
- resolve6();
38129
+ resolve7();
38041
38130
  });
38042
38131
  });
38043
38132
  }
@@ -38743,16 +38832,16 @@ var require_extract = __commonJS((exports, module) => {
38743
38832
  entryCallback = null;
38744
38833
  cb(err);
38745
38834
  }
38746
- function onnext(resolve6, reject) {
38835
+ function onnext(resolve7, reject) {
38747
38836
  if (error2) {
38748
38837
  return reject(error2);
38749
38838
  }
38750
38839
  if (entryStream) {
38751
- resolve6({ value: entryStream, done: false });
38840
+ resolve7({ value: entryStream, done: false });
38752
38841
  entryStream = null;
38753
38842
  return;
38754
38843
  }
38755
- promiseResolve = resolve6;
38844
+ promiseResolve = resolve7;
38756
38845
  promiseReject = reject;
38757
38846
  consumeCallback(null);
38758
38847
  if (extract._finished && promiseResolve) {
@@ -38783,14 +38872,14 @@ var require_extract = __commonJS((exports, module) => {
38783
38872
  function destroy(err) {
38784
38873
  extract.destroy(err);
38785
38874
  consumeCallback(err);
38786
- return new Promise((resolve6, reject) => {
38875
+ return new Promise((resolve7, reject) => {
38787
38876
  if (extract.destroyed)
38788
- return resolve6({ value: undefined, done: true });
38877
+ return resolve7({ value: undefined, done: true });
38789
38878
  extract.once("close", function() {
38790
38879
  if (err)
38791
38880
  reject(err);
38792
38881
  else
38793
- resolve6({ value: undefined, done: true });
38882
+ resolve7({ value: undefined, done: true });
38794
38883
  });
38795
38884
  });
38796
38885
  }
@@ -39199,8 +39288,8 @@ async function extractTarball(body, destDir) {
39199
39288
  ws.on("error", next);
39200
39289
  stream.on("error", next);
39201
39290
  });
39202
- await new Promise((resolve7, reject) => {
39203
- extract.on("finish", resolve7);
39291
+ await new Promise((resolve8, reject) => {
39292
+ extract.on("finish", resolve8);
39204
39293
  extract.on("error", reject);
39205
39294
  Readable.fromWeb(body).pipe(createGunzip()).on("error", reject).pipe(extract).on("error", reject);
39206
39295
  });
@@ -39253,14 +39342,43 @@ function detectFrameworks(appDir) {
39253
39342
  return { svelte: false, vue: false };
39254
39343
  }
39255
39344
  }
39345
+ function esmConditionTarget(subpath) {
39346
+ if (typeof subpath === "string")
39347
+ return subpath;
39348
+ if (!subpath || typeof subpath !== "object" || Array.isArray(subpath)) {
39349
+ return;
39350
+ }
39351
+ for (const [condition, target] of Object.entries(subpath)) {
39352
+ if (!ESM_CONDITIONS.includes(condition))
39353
+ continue;
39354
+ const entry = esmConditionTarget(target);
39355
+ if (entry)
39356
+ return entry;
39357
+ }
39358
+ return;
39359
+ }
39360
+ function resolveAppSvelteCompiler(appDir) {
39361
+ const requireFromApp = createRequire2(path6.join(path6.resolve(appDir), "package.json"));
39362
+ try {
39363
+ const pkgPath = requireFromApp.resolve("svelte/package.json");
39364
+ const exportsMap = JSON.parse(readTextFileSync(pkgPath))?.exports;
39365
+ const target = esmConditionTarget(exportsMap?.["./compiler"]);
39366
+ if (target?.startsWith(".")) {
39367
+ const entry = path6.resolve(path6.dirname(pkgPath), target);
39368
+ if (fs9.existsSync(entry))
39369
+ return entry;
39370
+ }
39371
+ } catch {}
39372
+ return requireFromApp.resolve("svelte/compiler");
39373
+ }
39256
39374
  async function loadSvelteCompiler(appDir) {
39375
+ let mod;
39257
39376
  try {
39258
- const requireFromApp = createRequire2(path6.join(path6.resolve(appDir), "package.json"));
39259
- const entry = requireFromApp.resolve("svelte/compiler");
39260
- return await import(pathToFileURL2(entry).href);
39377
+ mod = await import(pathToFileURL2(resolveAppSvelteCompiler(appDir)).href);
39261
39378
  } catch {
39262
- return await import("svelte/compiler");
39379
+ mod = await import("svelte/compiler");
39263
39380
  }
39381
+ return typeof mod?.compile === "function" ? mod : mod?.default ?? mod;
39264
39382
  }
39265
39383
  function createSveltePlugin(appDir) {
39266
39384
  let compilerPromise;
@@ -39338,13 +39456,13 @@ async function ensureNodeModules(appDir) {
39338
39456
  const nodeModulesPath = path6.join(targetDir, "node_modules");
39339
39457
  if (!fs9.existsSync(nodeModulesPath)) {
39340
39458
  info(colors.yellow("\uD83D\uDCE6 node_modules not found, running npm install..."));
39341
- const code2 = await new Promise((resolve8, reject) => {
39459
+ const code2 = await new Promise((resolve9, reject) => {
39342
39460
  const npmInstall = spawn("npm", ["install"], {
39343
39461
  cwd: targetDir,
39344
39462
  stdio: "inherit",
39345
39463
  shell: true
39346
39464
  });
39347
- npmInstall.on("close", (code3) => resolve8(code3 ?? 0));
39465
+ npmInstall.on("close", (code3) => resolve9(code3 ?? 0));
39348
39466
  npmInstall.on("error", reject);
39349
39467
  });
39350
39468
  if (code2 !== 0) {
@@ -39472,7 +39590,7 @@ function getDevBuildOptions(entryPoint = "index.tsx", svelte = false) {
39472
39590
  }
39473
39591
  };
39474
39592
  }
39475
- var DEFAULT_BUILD_OPTIONS;
39593
+ var DEFAULT_BUILD_OPTIONS, ESM_CONDITIONS;
39476
39594
  var init_bundle = __esm(async () => {
39477
39595
  init_log();
39478
39596
  init_colors2();
@@ -39492,6 +39610,7 @@ var init_bundle = __esm(async () => {
39492
39610
  logLevel: "info",
39493
39611
  write: true
39494
39612
  };
39613
+ ESM_CONDITIONS = ["node", "import", "default"];
39495
39614
  });
39496
39615
 
39497
39616
  // src/commands/app/wmillTsDev.ts
@@ -39739,7 +39858,7 @@ async function pollJobWithQueueLogging(workspace, jobId, options) {
39739
39858
  info(colors.gray(`${label}${jobId}: still polling, queue status unavailable...`));
39740
39859
  }
39741
39860
  const delayMs = Date.now() - startedAt < fastPollDurationMs ? fastPollIntervalMs : slowPollIntervalMs;
39742
- await new Promise((resolve8) => setTimeout(resolve8, delayMs));
39861
+ await new Promise((resolve9) => setTimeout(resolve9, delayMs));
39743
39862
  }
39744
39863
  }
39745
39864
  var DEFAULT_FAST_POLL_INTERVAL_MS = 100, DEFAULT_FAST_POLL_DURATION_MS = 2000, DEFAULT_SLOW_POLL_INTERVAL_MS = 2000, QUEUE_LOG_INTERVAL_MS = 5000, HEARTBEAT_INTERVAL_MS = 60000, MAX_CONSECUTIVE_POLL_ERRORS = 10;
@@ -41687,7 +41806,7 @@ var require_BufferList = __commonJS((exports, module) => {
41687
41806
  this.head = this.tail = null;
41688
41807
  this.length = 0;
41689
41808
  };
41690
- BufferList.prototype.join = function join11(s) {
41809
+ BufferList.prototype.join = function join12(s) {
41691
41810
  if (this.length === 0)
41692
41811
  return "";
41693
41812
  var p = this.head;
@@ -43699,8 +43818,8 @@ var require_lib2 = __commonJS((exports, module) => {
43699
43818
  return this;
43700
43819
  }
43701
43820
  var p = this.constructor;
43702
- return this.then(resolve9, reject2);
43703
- function resolve9(value) {
43821
+ return this.then(resolve10, reject2);
43822
+ function resolve10(value) {
43704
43823
  function yes() {
43705
43824
  return value;
43706
43825
  }
@@ -43853,8 +43972,8 @@ var require_lib2 = __commonJS((exports, module) => {
43853
43972
  }
43854
43973
  return out;
43855
43974
  }
43856
- Promise2.resolve = resolve8;
43857
- function resolve8(value) {
43975
+ Promise2.resolve = resolve9;
43976
+ function resolve9(value) {
43858
43977
  if (value instanceof this) {
43859
43978
  return value;
43860
43979
  }
@@ -44208,10 +44327,10 @@ var require_utils = __commonJS((exports) => {
44208
44327
  var promise = external.Promise.resolve(inputData).then(function(data3) {
44209
44328
  var isBlob2 = support.blob && (data3 instanceof Blob || ["[object File]", "[object Blob]"].indexOf(Object.prototype.toString.call(data3)) !== -1);
44210
44329
  if (isBlob2 && typeof FileReader !== "undefined") {
44211
- return new external.Promise(function(resolve8, reject) {
44330
+ return new external.Promise(function(resolve9, reject) {
44212
44331
  var reader = new FileReader;
44213
44332
  reader.onload = function(e) {
44214
- resolve8(e.target.result);
44333
+ resolve9(e.target.result);
44215
44334
  };
44216
44335
  reader.onerror = function(e) {
44217
44336
  reject(e.target.error);
@@ -44675,7 +44794,7 @@ var require_StreamHelper = __commonJS((exports, module) => {
44675
44794
  }
44676
44795
  }
44677
44796
  function accumulate(helper, updateCallback) {
44678
- return new external.Promise(function(resolve8, reject) {
44797
+ return new external.Promise(function(resolve9, reject) {
44679
44798
  var dataArray = [];
44680
44799
  var { _internalType: chunkType, _outputType: resultType, _mimeType: mimeType } = helper;
44681
44800
  helper.on("data", function(data3, meta) {
@@ -44689,7 +44808,7 @@ var require_StreamHelper = __commonJS((exports, module) => {
44689
44808
  }).on("end", function() {
44690
44809
  try {
44691
44810
  var result = transformZipOutput(resultType, concat(chunkType, dataArray), mimeType);
44692
- resolve8(result);
44811
+ resolve9(result);
44693
44812
  } catch (e) {
44694
44813
  reject(e);
44695
44814
  }
@@ -50266,7 +50385,7 @@ var require_load = __commonJS((exports, module) => {
50266
50385
  var Crc32Probe = require_Crc32Probe();
50267
50386
  var nodejsUtils = require_nodejsUtils();
50268
50387
  function checkEntryCRC32(zipEntry) {
50269
- return new external.Promise(function(resolve8, reject) {
50388
+ return new external.Promise(function(resolve9, reject) {
50270
50389
  var worker = zipEntry.decompressed.getContentWorker().pipe(new Crc32Probe);
50271
50390
  worker.on("error", function(e) {
50272
50391
  reject(e);
@@ -50274,7 +50393,7 @@ var require_load = __commonJS((exports, module) => {
50274
50393
  if (worker.streamInfo.crc32 !== zipEntry.decompressed.crc32) {
50275
50394
  reject(new Error("Corrupted zip : CRC32 mismatch"));
50276
50395
  } else {
50277
- resolve8();
50396
+ resolve9();
50278
50397
  }
50279
50398
  }).resume();
50280
50399
  });
@@ -50389,9 +50508,9 @@ class TarAsZip {
50389
50508
  const sub = new TarAsZip(new Map);
50390
50509
  for (const [name, file] of Object.entries(this.files)) {
50391
50510
  if (name.startsWith(normalized)) {
50392
- const relative7 = name.slice(normalized.length);
50393
- if (relative7) {
50394
- sub.files[relative7] = { ...file, name: relative7 };
50511
+ const relative8 = name.slice(normalized.length);
50512
+ if (relative8) {
50513
+ sub.files[relative8] = { ...file, name: relative8 };
50395
50514
  }
50396
50515
  }
50397
50516
  }
@@ -50402,7 +50521,7 @@ async function parseTarResponse(response) {
50402
50521
  const buffer = Buffer.from(await response.arrayBuffer());
50403
50522
  const entries = new Map;
50404
50523
  const ex = $extract();
50405
- return new Promise((resolve8, reject) => {
50524
+ return new Promise((resolve9, reject) => {
50406
50525
  ex.on("entry", (header, stream, next) => {
50407
50526
  const chunks = [];
50408
50527
  stream.on("data", (chunk) => chunks.push(chunk));
@@ -50416,7 +50535,7 @@ async function parseTarResponse(response) {
50416
50535
  stream.on("error", reject);
50417
50536
  stream.resume();
50418
50537
  });
50419
- ex.on("finish", () => resolve8(new TarAsZip(entries)));
50538
+ ex.on("finish", () => resolve9(new TarAsZip(entries)));
50420
50539
  ex.on("error", reject);
50421
50540
  Readable2.from(buffer).pipe(ex);
50422
50541
  });
@@ -53368,7 +53487,7 @@ var require_compile = __commonJS((exports) => {
53368
53487
  const schOrFunc = root.refs[ref];
53369
53488
  if (schOrFunc)
53370
53489
  return schOrFunc;
53371
- let _sch = resolve8.call(this, root, ref);
53490
+ let _sch = resolve9.call(this, root, ref);
53372
53491
  if (_sch === undefined) {
53373
53492
  const schema = (_a = root.localRefs) === null || _a === undefined ? undefined : _a[ref];
53374
53493
  const { schemaId } = this.opts;
@@ -53395,7 +53514,7 @@ var require_compile = __commonJS((exports) => {
53395
53514
  function sameSchemaEnv(s1, s2) {
53396
53515
  return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;
53397
53516
  }
53398
- function resolve8(root, ref) {
53517
+ function resolve9(root, ref) {
53399
53518
  let sch;
53400
53519
  while (typeof (sch = this.refs[ref]) == "string")
53401
53520
  ref = sch;
@@ -53903,54 +54022,54 @@ var require_fast_uri = __commonJS((exports, module) => {
53903
54022
  }
53904
54023
  return uri;
53905
54024
  }
53906
- function resolve8(baseURI, relativeURI, options) {
54025
+ function resolve9(baseURI, relativeURI, options) {
53907
54026
  const schemelessOptions = Object.assign({ scheme: "null" }, options);
53908
54027
  const resolved = resolveComponents(parse7(baseURI, schemelessOptions), parse7(relativeURI, schemelessOptions), schemelessOptions, true);
53909
54028
  return serialize(resolved, { ...schemelessOptions, skipEscape: true });
53910
54029
  }
53911
- function resolveComponents(base, relative7, options, skipNormalization) {
54030
+ function resolveComponents(base, relative8, options, skipNormalization) {
53912
54031
  const target = {};
53913
54032
  if (!skipNormalization) {
53914
54033
  base = parse7(serialize(base, options), options);
53915
- relative7 = parse7(serialize(relative7, options), options);
54034
+ relative8 = parse7(serialize(relative8, options), options);
53916
54035
  }
53917
54036
  options = options || {};
53918
- if (!options.tolerant && relative7.scheme) {
53919
- target.scheme = relative7.scheme;
53920
- target.userinfo = relative7.userinfo;
53921
- target.host = relative7.host;
53922
- target.port = relative7.port;
53923
- target.path = removeDotSegments(relative7.path || "");
53924
- target.query = relative7.query;
54037
+ if (!options.tolerant && relative8.scheme) {
54038
+ target.scheme = relative8.scheme;
54039
+ target.userinfo = relative8.userinfo;
54040
+ target.host = relative8.host;
54041
+ target.port = relative8.port;
54042
+ target.path = removeDotSegments(relative8.path || "");
54043
+ target.query = relative8.query;
53925
54044
  } else {
53926
- if (relative7.userinfo !== undefined || relative7.host !== undefined || relative7.port !== undefined) {
53927
- target.userinfo = relative7.userinfo;
53928
- target.host = relative7.host;
53929
- target.port = relative7.port;
53930
- target.path = removeDotSegments(relative7.path || "");
53931
- target.query = relative7.query;
54045
+ if (relative8.userinfo !== undefined || relative8.host !== undefined || relative8.port !== undefined) {
54046
+ target.userinfo = relative8.userinfo;
54047
+ target.host = relative8.host;
54048
+ target.port = relative8.port;
54049
+ target.path = removeDotSegments(relative8.path || "");
54050
+ target.query = relative8.query;
53932
54051
  } else {
53933
- if (!relative7.path) {
54052
+ if (!relative8.path) {
53934
54053
  target.path = base.path;
53935
- if (relative7.query !== undefined) {
53936
- target.query = relative7.query;
54054
+ if (relative8.query !== undefined) {
54055
+ target.query = relative8.query;
53937
54056
  } else {
53938
54057
  target.query = base.query;
53939
54058
  }
53940
54059
  } else {
53941
- if (relative7.path.charAt(0) === "/") {
53942
- target.path = removeDotSegments(relative7.path);
54060
+ if (relative8.path.charAt(0) === "/") {
54061
+ target.path = removeDotSegments(relative8.path);
53943
54062
  } else {
53944
54063
  if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) {
53945
- target.path = "/" + relative7.path;
54064
+ target.path = "/" + relative8.path;
53946
54065
  } else if (!base.path) {
53947
- target.path = relative7.path;
54066
+ target.path = relative8.path;
53948
54067
  } else {
53949
- target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative7.path;
54068
+ target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative8.path;
53950
54069
  }
53951
54070
  target.path = removeDotSegments(target.path);
53952
54071
  }
53953
- target.query = relative7.query;
54072
+ target.query = relative8.query;
53954
54073
  }
53955
54074
  target.userinfo = base.userinfo;
53956
54075
  target.host = base.host;
@@ -53958,7 +54077,7 @@ var require_fast_uri = __commonJS((exports, module) => {
53958
54077
  }
53959
54078
  target.scheme = base.scheme;
53960
54079
  }
53961
- target.fragment = relative7.fragment;
54080
+ target.fragment = relative8.fragment;
53962
54081
  return target;
53963
54082
  }
53964
54083
  function equal2(uriA, uriB, options) {
@@ -54136,7 +54255,7 @@ var require_fast_uri = __commonJS((exports, module) => {
54136
54255
  var fastUri = {
54137
54256
  SCHEMES,
54138
54257
  normalize: normalize5,
54139
- resolve: resolve8,
54258
+ resolve: resolve9,
54140
54259
  resolveComponents,
54141
54260
  equal: equal2,
54142
54261
  serialize,
@@ -56818,11 +56937,11 @@ var require_tslib = __commonJS((exports, module) => {
56818
56937
  };
56819
56938
  __awaiter2 = function(thisArg, _arguments, P, generator) {
56820
56939
  function adopt(value) {
56821
- return value instanceof P ? value : new P(function(resolve8) {
56822
- resolve8(value);
56940
+ return value instanceof P ? value : new P(function(resolve9) {
56941
+ resolve9(value);
56823
56942
  });
56824
56943
  }
56825
- return new (P || (P = Promise))(function(resolve8, reject) {
56944
+ return new (P || (P = Promise))(function(resolve9, reject) {
56826
56945
  function fulfilled(value) {
56827
56946
  try {
56828
56947
  step(generator.next(value));
@@ -56838,7 +56957,7 @@ var require_tslib = __commonJS((exports, module) => {
56838
56957
  }
56839
56958
  }
56840
56959
  function step(result) {
56841
- result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected);
56960
+ result.done ? resolve9(result.value) : adopt(result.value).then(fulfilled, rejected);
56842
56961
  }
56843
56962
  step((generator = generator.apply(thisArg, _arguments || [])).next());
56844
56963
  });
@@ -57067,14 +57186,14 @@ var require_tslib = __commonJS((exports, module) => {
57067
57186
  }, i);
57068
57187
  function verb(n) {
57069
57188
  i[n] = o[n] && function(v) {
57070
- return new Promise(function(resolve8, reject) {
57071
- v = o[n](v), settle(resolve8, reject, v.done, v.value);
57189
+ return new Promise(function(resolve9, reject) {
57190
+ v = o[n](v), settle(resolve9, reject, v.done, v.value);
57072
57191
  });
57073
57192
  };
57074
57193
  }
57075
- function settle(resolve8, reject, d, v) {
57194
+ function settle(resolve9, reject, d, v) {
57076
57195
  Promise.resolve(v).then(function(v2) {
57077
- resolve8({ value: v2, done: d });
57196
+ resolve9({ value: v2, done: d });
57078
57197
  }, reject);
57079
57198
  }
57080
57199
  };
@@ -61589,7 +61708,7 @@ var init_openflow = __esm(() => {
61589
61708
  openflow_default = {
61590
61709
  openapi: "3.0.3",
61591
61710
  info: {
61592
- version: "1.782.0",
61711
+ version: "1.784.0",
61593
61712
  title: "OpenFlow Spec",
61594
61713
  contact: {
61595
61714
  name: "Ruben Fiszel",
@@ -65613,11 +65732,11 @@ var init_specific_items = __esm(async () => {
65613
65732
 
65614
65733
  // src/utils/tar.ts
65615
65734
  function createTarBlob(entries) {
65616
- return new Promise((resolve8, reject) => {
65735
+ return new Promise((resolve9, reject) => {
65617
65736
  const p = $pack();
65618
65737
  const chunks = [];
65619
65738
  p.on("data", (chunk) => chunks.push(new Uint8Array(chunk)));
65620
- p.on("end", () => resolve8(new Blob(chunks)));
65739
+ p.on("end", () => resolve9(new Blob(chunks)));
65621
65740
  p.on("error", reject);
65622
65741
  for (const entry of entries) {
65623
65742
  p.entry({ name: entry.name }, Buffer.from(entry.content));
@@ -66358,7 +66477,7 @@ function collectPathScriptPaths(flowValue) {
66358
66477
  }
66359
66478
 
66360
66479
  // src/commands/flow/flow_metadata.ts
66361
- import { existsSync as existsSync7 } from "node:fs";
66480
+ import { existsSync as existsSync8 } from "node:fs";
66362
66481
  import { rm } from "node:fs/promises";
66363
66482
  import * as path8 from "node:path";
66364
66483
  import { sep as SEP4 } from "node:path";
@@ -66527,7 +66646,7 @@ async function generateFlowLockInternal(folder, dryRun, workspace, opts, justUpd
66527
66646
  if (inlineScripts.some((other) => other.path === legacyRelPath))
66528
66647
  continue;
66529
66648
  const legacyAbsPath = process.cwd() + SEP4 + folder + SEP4 + legacyRelPath;
66530
- if (existsSync7(legacyAbsPath)) {
66649
+ if (existsSync8(legacyAbsPath)) {
66531
66650
  try {
66532
66651
  await rm(legacyAbsPath);
66533
66652
  info(colors.gray(`Removed legacy lock file ${legacyRelPath} (renamed to canonical name)`));
@@ -67689,7 +67808,7 @@ async function list4(opts) {
67689
67808
  new Table2().header(["path", "summary", "language", "created by"]).padding(2).border(true).body(total.map((x) => [x.path, x.summary, x.language, x.created_by])).render();
67690
67809
  }
67691
67810
  }
67692
- async function resolve8(input) {
67811
+ async function resolve9(input) {
67693
67812
  if (!input) {
67694
67813
  throw new Error("No data given");
67695
67814
  }
@@ -67715,7 +67834,7 @@ async function run2(opts, path10) {
67715
67834
  }
67716
67835
  const workspace = await resolveWorkspace(opts);
67717
67836
  await requireLogin(opts);
67718
- const input = opts.data ? await resolve8(opts.data) : {};
67837
+ const input = opts.data ? await resolve9(opts.data) : {};
67719
67838
  if (!opts.data) {
67720
67839
  try {
67721
67840
  const script = await getScriptByPath({
@@ -67781,7 +67900,7 @@ ${script.lock_error_logs}`);
67781
67900
  break;
67782
67901
  } catch {
67783
67902
  retries++;
67784
- await new Promise((resolve9) => setTimeout(resolve9, 100));
67903
+ await new Promise((resolve10) => setTimeout(resolve10, 100));
67785
67904
  }
67786
67905
  }
67787
67906
  if (retries >= MAX_RETRIES) {
@@ -67818,7 +67937,7 @@ async function track_job(workspace, id) {
67818
67937
  info("failed to get job updated. skipping log streaming.");
67819
67938
  break;
67820
67939
  }
67821
- await new Promise((resolve9) => setTimeout(resolve9, 500));
67940
+ await new Promise((resolve10) => setTimeout(resolve10, 500));
67822
67941
  continue;
67823
67942
  }
67824
67943
  if (!running && updates.running === true) {
@@ -67838,7 +67957,7 @@ async function track_job(workspace, id) {
67838
67957
  info(colors.yellow("Job suspended. Waiting for it to continue..."));
67839
67958
  }
67840
67959
  }
67841
- await new Promise((resolve9, _) => setTimeout(() => resolve9(undefined), 1000));
67960
+ await new Promise((resolve10, _) => setTimeout(() => resolve10(undefined), 1000));
67842
67961
  try {
67843
67962
  const final_job = await getCompletedJob({ workspace, id });
67844
67963
  if ((final_job.logs?.length ?? -1) > logOffset) {
@@ -68007,12 +68126,14 @@ async function preview(opts, filePath) {
68007
68126
  if (opts.silent) {
68008
68127
  setSilent(true);
68009
68128
  }
68129
+ const cwdBeforeConfig = process.cwd();
68010
68130
  opts = await mergeConfigWithConfigFile(opts);
68011
68131
  const workspace = await resolveWorkspace(opts);
68012
68132
  await requireLogin(opts);
68013
- if (!validatePath(filePath)) {
68014
- return;
68015
- }
68133
+ const argPath = filePath;
68134
+ filePath = toSyncRootRelativePath(filePath, cwdBeforeConfig);
68135
+ const remotePath = scriptPathToRemotePath(filePath);
68136
+ assertRemotePath(remotePath, argPath);
68016
68137
  const absentDescriptor = await stat4(filePath).then(() => false, (e) => isMissingDbtDescriptor(filePath, e));
68017
68138
  if (!absentDescriptor) {
68018
68139
  const fstat = await stat4(filePath);
@@ -68026,7 +68147,7 @@ async function preview(opts, filePath) {
68026
68147
  const codebases = await listSyncCodebases(opts);
68027
68148
  const language = inferContentTypeFromFilePath(filePath, opts?.defaultTs);
68028
68149
  const content = await readScriptContent(filePath);
68029
- const input = opts.data ? await resolve8(opts.data) : {};
68150
+ const input = opts.data ? await resolve9(opts.data) : {};
68030
68151
  const isFolderLayout = isModuleEntryPoint(filePath);
68031
68152
  const isDbt = language === "dbt";
68032
68153
  const moduleFolderPath = isFolderLayout ? path9.dirname(filePath) : filePath.substring(0, filePath.indexOf(".")) + getModuleFolderSuffix(language);
@@ -68034,7 +68155,7 @@ async function preview(opts, filePath) {
68034
68155
  const codebase = language == "bun" ? findCodebase(filePath, codebases) : undefined;
68035
68156
  let tempScriptRefs = undefined;
68036
68157
  const { extractRelativeImports: extractRelativeImports2 } = await init_relative_imports().then(() => exports_relative_imports);
68037
- const relImports = await extractRelativeImports2(content, scriptPathToRemotePath(filePath), language);
68158
+ const relImports = await extractRelativeImports2(content, remotePath, language);
68038
68159
  if (relImports.length > 0) {
68039
68160
  const { buildPreviewTempScriptRefs: buildPreviewTempScriptRefs2 } = await init_generate_metadata().then(() => exports_generate_metadata);
68040
68161
  tempScriptRefs = await buildPreviewTempScriptRefs2(workspace, opts, codebases, { kind: "script", path: filePath });
@@ -68116,7 +68237,7 @@ async function preview(opts, filePath) {
68116
68237
  const form = new FormData;
68117
68238
  const previewPayload = {
68118
68239
  content,
68119
- path: filePath.substring(0, filePath.indexOf(".")).replaceAll(SEP6, "/"),
68240
+ path: remotePath,
68120
68241
  args: input,
68121
68242
  language,
68122
68243
  tag: opts.tag,
@@ -68158,7 +68279,7 @@ async function preview(opts, filePath) {
68158
68279
  }
68159
68280
  break;
68160
68281
  } catch {
68161
- await new Promise((resolve9) => setTimeout(resolve9, 100));
68282
+ await new Promise((resolve10) => setTimeout(resolve10, 100));
68162
68283
  }
68163
68284
  }
68164
68285
  } else {
@@ -68166,7 +68287,7 @@ async function preview(opts, filePath) {
68166
68287
  workspace: workspace.workspaceId,
68167
68288
  requestBody: {
68168
68289
  content,
68169
- path: filePath.substring(0, filePath.indexOf(".")).replaceAll(SEP6, "/"),
68290
+ path: remotePath,
68170
68291
  args: input,
68171
68292
  language,
68172
68293
  tag: opts.tag,
@@ -69343,7 +69464,7 @@ import {
69343
69464
  copyFile,
69344
69465
  mkdir as mkdir5
69345
69466
  } from "node:fs/promises";
69346
- import { existsSync as existsSync9 } from "node:fs";
69467
+ import { existsSync as existsSync10 } from "node:fs";
69347
69468
  import * as path12 from "node:path";
69348
69469
  import { sep as SEP9 } from "node:path";
69349
69470
  function configKeyForItemKind(kind) {
@@ -71125,8 +71246,8 @@ async function pushParentScriptForModule(modulePath, workspace, alreadySynced, m
71125
71246
  return;
71126
71247
  const moduleFolderPath = scriptBasePath + getModuleFolderSuffix(isDbt ? "dbt" : undefined);
71127
71248
  if (isDbt) {
71128
- const hasMetadata = existsSync9(scriptBasePath + ".script.yaml") || existsSync9(scriptBasePath + ".script.json");
71129
- if (!existsSync9(moduleFolderPath + "/dbt_project.yml")) {
71249
+ const hasMetadata = existsSync10(scriptBasePath + ".script.yaml") || existsSync10(scriptBasePath + ".script.json");
71250
+ if (!existsSync10(moduleFolderPath + "/dbt_project.yml")) {
71130
71251
  if (hasMetadata) {
71131
71252
  throw new Error(`${moduleFolderPath} has no dbt_project.yml but ${scriptBasePath}.script.yaml ` + `remains, so there is no dbt project left to push. Delete the metadata too to ` + `archive the script, or restore the project.`);
71132
71253
  }
@@ -71956,11 +72077,11 @@ Run 'wmill folder add-missing' to create them locally, then push again.`;
71956
72077
  }
71957
72078
  const rules = folderRulesCache.get(folderName2);
71958
72079
  const remotePath = change.path.replace(/\.(script|schedule|http_trigger|websocket_trigger|kafka_trigger|nats_trigger|postgres_trigger|mqtt_trigger|amqp_trigger|sqs_trigger|gcp_trigger|azure_trigger|email_trigger)\.(yaml|json)$/, "").replace(/(\.flow|__flow)\/flow\.(yaml|json)$/, "").replace(/\.(app|raw_app)(\/app\.(yaml|json))?$/, "");
71959
- const relative7 = remotePath.slice(`f/${folderName2}/`.length);
71960
- if (!relative7)
72080
+ const relative8 = remotePath.slice(`f/${folderName2}/`.length);
72081
+ if (!relative8)
71961
72082
  continue;
71962
72083
  for (const rule of rules) {
71963
- if (minimatch(relative7, rule.path_glob)) {
72084
+ if (minimatch(relative8, rule.path_glob)) {
71964
72085
  folderDefaultAnnotations.set(change.path, rule.permissioned_as);
71965
72086
  break;
71966
72087
  }
@@ -72693,7 +72814,7 @@ var init_sync = __esm(async () => {
72693
72814
  aliasDuplicateObjects: false,
72694
72815
  singleQuote: true
72695
72816
  };
72696
- command8 = new Command().description("sync local with a remote workspaces or the opposite (push or pull)").action(() => info("2 actions available, pull and push. Use -h to display help.")).command("pull").description("Pull any remote changes and apply them locally.").option("--yes", "Pull without needing confirmation").option("--dry-run", "Show changes that would be pulled without actually pushing").option("--plain-secrets", "Pull secrets as plain text").option("--json", "Use JSON instead of YAML").option("--skip-variables", "Skip syncing variables (including secrets)").option("--skip-secrets", "Skip syncing only secrets variables").option("--include-secrets", "Include secrets in sync (overrides skipSecrets in wmill.yaml)").option("--skip-resources", "Skip syncing resources").option("--skip-resource-types", "Skip syncing resource types").option("--skip-scripts", "Skip syncing scripts").option("--skip-flows", "Skip syncing flows").option("--skip-apps", "Skip syncing apps").option("--skip-folders", "Skip syncing folders").option("--skip-workspace-dependencies", "Skip syncing workspace dependencies").option("--include-schedules", "Include syncing schedules").option("--include-triggers", "Include syncing triggers").option("--include-users", "Include syncing users").option("--include-groups", "Include syncing groups").option("--include-settings", "Include syncing workspace settings").option("--include-key", "Include workspace encryption key").option("--skip-branch-validation", "Skip git branch validation and prompts").option("--json-output", "Output results in JSON format").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). Overrides wmill.yaml includes").option("-e --excludes <patterns:file[]>", "Comma separated patterns to specify which file to NOT take into account. Overrides wmill.yaml excludes").option("--extra-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). Useful to still take wmill.yaml into account and act as a second pattern to satisfy").option("--repository <repo:string>", "Specify repository path (e.g., u/user/repo) when multiple repositories exist").option("--promotion <branch:string>", "Use promotionOverrides from the specified branch instead of regular overrides").option("--branch, --env <branch:string>", "[Deprecated: use --workspace] Override the current git branch/environment").action(pull).command("push").description("Push any local changes and apply them remotely.").option("--yes", "Push without needing confirmation").option("--dry-run", "Show changes that would be pushed without actually pushing").option("--plain-secrets", "Push secrets as plain text").option("--json", "Use JSON instead of YAML").option("--skip-variables", "Skip syncing variables (including secrets)").option("--skip-secrets", "Skip syncing only secrets variables").option("--include-secrets", "Include secrets in sync (overrides skipSecrets in wmill.yaml)").option("--skip-resources", "Skip syncing resources").option("--skip-resource-types", "Skip syncing resource types").option("--skip-scripts", "Skip syncing scripts").option("--skip-flows", "Skip syncing flows").option("--skip-apps", "Skip syncing apps").option("--skip-folders", "Skip syncing folders").option("--skip-workspace-dependencies", "Skip syncing workspace dependencies").option("--include-schedules", "Include syncing schedules").option("--include-triggers", "Include syncing triggers").option("--include-users", "Include syncing users").option("--include-groups", "Include syncing groups").option("--include-settings", "Include syncing workspace settings").option("--include-key", "Include workspace encryption key").option("--skip-reencrypt-on-key-change", "When the pushed encryption key differs from the remote, do NOT re-encrypt existing remote secrets. Only safe if they are already encrypted with the new key (e.g. workspace/instance migration). Default is to re-encrypt.").option("--skip-branch-validation", "Skip git branch validation and prompts").option("--json-output", "Output results in JSON format").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.").option("--extra-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). Useful to still take wmill.yaml into account and act as a second pattern to satisfy").option("--message <message:string>", "Include a message that will be added to all scripts/flows/apps updated during this push").option("--parallel <number>", "Number of changes to process in parallel").option("--repository <repo:string>", "Specify repository path (e.g., u/user/repo) when multiple repositories exist").option("--branch, --env <branch:string>", "[Deprecated: use --workspace] Override the current git branch/environment").option("--lint", "Run lint validation before pushing").option("--locks-required", "Fail if scripts or flow inline scripts that need locks have no locks").option("--auto-metadata", "Automatically regenerate stale metadata (locks and schemas) before pushing").option("--accept-overriding-permissioned-as-with-self", "Accept that items with a different permissioned_as will be updated with your own user").action(push4).command("git-deploy").hidden().description("Internal git-sync deployment-callback step (used by the git-sync hub script). Runs inside an existing clone: switches to the wm_deploy/fork branch when applicable, pulls workspace content, then commits and pushes.").option("--repository <repo:string>", "Repository resource path (e.g. u/user/repo)").option("--git-deploy-items <json:string>", "JSON array of {path_type,path,parent_path,commit_msg} being deployed").option("--use-individual-branch", "Push each deployed object to its own wm_deploy/<workspace>/<...> branch").option("--group-by-folder", "With --use-individual-branch, group deployed objects per folder branch").option("--only-create-branch", "Only create/push the deploy branch, skip pulling and committing files").option("--parent-workspace-id <id:string>", "Parent workspace id, used to root a fork-of-a-fork branch").option("--dev-workspace-label <label:string>", "Environment label of a dev workspace (dev/staging); its deploys go to that branch").option("--parent-dev-workspace-label <label:string>", "Environment label of the parent dev workspace; roots a fork-of-dev branch on it").option("--skip-secrets", "Skip syncing only secrets variables").option("--git-committer-email <email:string>", "Committer email for the deploy commit (GPG-signed repos pass the GPG key email; defaults to WM_EMAIL)").option("--git-committer-name <name:string>", "Committer name for the deploy commit (defaults to WM_USERNAME)").action(gitDeploy);
72817
+ command8 = new Command().description("sync local with a remote workspaces or the opposite (push or pull)").action(() => info("2 actions available, pull and push. Use -h to display help.")).command("pull").description("Pull any remote changes and apply them locally.").option("--yes", "Pull without needing confirmation").option("--dry-run", "Show changes that would be pulled without actually pushing").option("--plain-secrets", "Pull secrets as plain text").option("--json", "Use JSON instead of YAML").option("--skip-variables", "Skip syncing variables (including secrets)").option("--skip-secrets", "Skip syncing only secrets variables").option("--include-secrets", "Include secrets in sync (overrides skipSecrets in wmill.yaml)").option("--skip-resources", "Skip syncing resources").option("--skip-resource-types", "Skip syncing resource types").option("--skip-scripts", "Skip syncing scripts").option("--skip-flows", "Skip syncing flows").option("--skip-apps", "Skip syncing apps").option("--skip-folders", "Skip syncing folders").option("--skip-workspace-dependencies", "Skip syncing workspace dependencies").option("--include-schedules", "Include syncing schedules").option("--include-triggers", "Include syncing triggers").option("--include-users", "Include syncing users").option("--include-groups", "Include syncing groups").option("--include-settings", "Include syncing workspace settings").option("--include-key", "Include workspace encryption key").option("--skip-branch-validation", "Skip git branch validation and prompts").option("--json-output", "Output results in JSON format").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). Overrides wmill.yaml includes").option("-e --excludes <patterns:file[]>", "Comma separated patterns to specify which file to NOT take into account. Overrides wmill.yaml excludes").option("--extra-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). Useful to still take wmill.yaml into account and act as a second pattern to satisfy").option("--repository <repo:string>", "Specify repository path (e.g., u/user/repo) when multiple repositories exist").option("--promotion <branch:string>", "Use promotionOverrides from the specified branch instead of regular overrides").option("--branch, --env <branch:string>", "[Deprecated: use --workspace] Override the current git branch/environment").action(pull).command("push").description("Push any local changes and apply them remotely.").option("--yes", "Push without needing confirmation").option("--dry-run", "Show changes that would be pushed without actually pushing").option("--plain-secrets", "Push secrets as plain text").option("--json", "Use JSON instead of YAML").option("--skip-variables", "Skip syncing variables (including secrets)").option("--skip-secrets", "Skip syncing only secrets variables").option("--include-secrets", "Include secrets in sync (overrides skipSecrets in wmill.yaml)").option("--skip-resources", "Skip syncing resources").option("--skip-resource-types", "Skip syncing resource types").option("--skip-scripts", "Skip syncing scripts").option("--skip-flows", "Skip syncing flows").option("--skip-apps", "Skip syncing apps").option("--skip-folders", "Skip syncing folders").option("--skip-workspace-dependencies", "Skip syncing workspace dependencies").option("--include-schedules", "Include syncing schedules").option("--include-triggers", "Include syncing triggers").option("--include-users", "Include syncing users").option("--include-groups", "Include syncing groups").option("--include-settings", "Include syncing workspace settings").option("--include-key", "Include workspace encryption key").option("--skip-reencrypt-on-key-change", "When the pushed encryption key differs from the remote, do NOT re-encrypt existing remote secrets. Only safe if they are already encrypted with the new key (e.g. workspace/instance migration). Default is to re-encrypt.").option("--skip-branch-validation", "Skip git branch validation and prompts").option("--json-output", "Output results in JSON format").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.").option("--extra-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). Useful to still take wmill.yaml into account and act as a second pattern to satisfy").option("--message <message:string>", "Include a message that will be added to all scripts/flows/apps updated during this push").option("--parallel <number>", "Number of changes to process in parallel").option("--repository <repo:string>", "Specify repository path (e.g., u/user/repo) when multiple repositories exist").option("--branch, --env <branch:string>", "[Deprecated: use --workspace] Override the current git branch/environment").option("--lint", "Run lint validation before pushing").option("--locks-required", "Fail if scripts or flow inline scripts that need locks have no locks").option("--auto-metadata", "Automatically regenerate stale metadata (locks and schemas) before pushing").option("--accept-overriding-permissioned-as-with-self", "Accept that items with a different permissioned_as will be updated with your own user").action(push4).command("git-deploy").hidden().description("Internal git-sync deployment-callback step (used by the git-sync hub script). Runs inside an existing clone: switches to the wm_deploy/fork branch when applicable, pulls workspace content, then commits and pushes.").option("--repository <repo:string>", "Repository resource path (e.g. u/user/repo)").option("--git-deploy-items <json:string>", "JSON array of {path_type,path,parent_path,commit_msg} being deployed").option("--use-individual-branch", "Push each deployed object to its own wm_deploy/<workspace>/<...> branch").option("--group-by-folder", "With --use-individual-branch, group deployed objects per folder branch").option("--only-create-branch", "Only create/push the deploy branch, skip pulling and committing files").option("--parent-workspace-id <id:string>", "Parent workspace id, used to root a fork-of-a-fork branch").option("--dev-workspace-label <label:string>", "Environment label of a dev workspace (dev, staging, uat, ...); its deploys go to that branch").option("--parent-dev-workspace-label <label:string>", "Environment label of the parent dev workspace; roots a fork-of-dev branch on it").option("--skip-secrets", "Skip syncing only secrets variables").option("--git-committer-email <email:string>", "Committer email for the deploy commit (GPG-signed repos pass the GPG key email; defaults to WM_EMAIL)").option("--git-committer-name <name:string>", "Committer name for the deploy commit (defaults to WM_USERNAME)").action(gitDeploy);
72697
72818
  sync_default = command8;
72698
72819
  });
72699
72820
 
@@ -72901,7 +73022,7 @@ var init_parse_schema = __esm(() => {
72901
73022
  // src/utils/metadata.ts
72902
73023
  import { sep as SEP10 } from "node:path";
72903
73024
  import { writeFile as writeFile8, stat as stat8, rm as rm3, readdir as readdir5 } from "node:fs/promises";
72904
- import { readFileSync as readFileSync3, existsSync as existsSync10, readdirSync as readdirSync2, statSync as statSync3, writeFileSync as writeFileSync5 } from "node:fs";
73025
+ import { readFileSync as readFileSync3, existsSync as existsSync11, readdirSync as readdirSync2, statSync as statSync3, writeFileSync as writeFileSync5 } from "node:fs";
72905
73026
  import * as path13 from "node:path";
72906
73027
  import { createRequire as createRequire3 } from "node:module";
72907
73028
  function loadParser(pkgName) {
@@ -73005,7 +73126,7 @@ async function generateScriptMetadataInternal(scriptPath, workspace, opts, dryRu
73005
73126
  const metadataContent = await readTextFile(metadataWithType.path);
73006
73127
  const filteredRawWorkspaceDependencies = filterWorkspaceDependencies(rawWorkspaceDependencies, scriptContent, language);
73007
73128
  const moduleFolderPath = isFolderLayout ? path13.dirname(scriptPath) : scriptPath.substring(0, scriptPath.indexOf(".")) + getModuleFolderSuffix(language);
73008
- const hasModules = existsSync10(moduleFolderPath) && statSync3(moduleFolderPath).isDirectory();
73129
+ const hasModules = existsSync11(moduleFolderPath) && statSync3(moduleFolderPath).isDirectory();
73009
73130
  const depsForHash = tree ? {} : filteredRawWorkspaceDependencies;
73010
73131
  let hash2 = await generateScriptHash(depsForHash, scriptContent, metadataContent);
73011
73132
  let moduleHashes = {};
@@ -73298,7 +73419,7 @@ async function updateScriptLock(workspace, scriptContent, language, remotePath,
73298
73419
  if (!languageNeedsLock(language)) {
73299
73420
  if (language === "dbt") {
73300
73421
  const lockPath2 = lockPathOverride ?? remotePath + ".script.lock";
73301
- if (existsSync10(lockPath2)) {
73422
+ if (existsSync11(lockPath2)) {
73302
73423
  metadataContent.lock = "!inline " + lockPath2.replaceAll(SEP10, "/");
73303
73424
  }
73304
73425
  }
@@ -73356,7 +73477,7 @@ async function updateModuleLocks(workspace, dirPath, relPrefix, scriptRemotePath
73356
73477
  writeFileSync5(lockPath, lock, "utf-8");
73357
73478
  } else {
73358
73479
  try {
73359
- if (existsSync10(lockPath)) {
73480
+ if (existsSync11(lockPath)) {
73360
73481
  const { rm: rmAsync } = await import("node:fs/promises");
73361
73482
  await rmAsync(lockPath);
73362
73483
  }
@@ -76034,7 +76155,7 @@ async function waitForJob(workspace, jobId) {
76034
76155
  }
76035
76156
  let syncIteration = 0;
76036
76157
  let lastQueueLogAt = Date.now();
76037
- return new Promise((resolve10, reject) => {
76158
+ return new Promise((resolve11, reject) => {
76038
76159
  async function checkJob() {
76039
76160
  try {
76040
76161
  const maybeJob = await getCompletedJobResultMaybe({
@@ -76046,7 +76167,7 @@ async function waitForJob(workspace, jobId) {
76046
76167
  if (!maybeJob.success && typeof maybeJob.result === "object" && maybeJob.result !== null && "error" in maybeJob.result) {
76047
76168
  reject(maybeJob.result.error);
76048
76169
  } else {
76049
- resolve10(maybeJob.result);
76170
+ resolve11(maybeJob.result);
76050
76171
  }
76051
76172
  return;
76052
76173
  }
@@ -77076,8 +77197,8 @@ This folder is for SQL migration files that will be applied to datatables during
77076
77197
  process.stdout.write(`\r${colors.gray(`${frames[i++ % frames.length]} Creating Claude session...`)}`);
77077
77198
  }, 80);
77078
77199
  try {
77079
- await new Promise((resolve11, reject) => {
77080
- exec(`claude --session-id "${sessionId}" -p "Say: Your app is ready, click on preview to test it!"`, { cwd: absAppDir }, (error2) => error2 ? reject(error2) : resolve11());
77200
+ await new Promise((resolve12, reject) => {
77201
+ exec(`claude --session-id "${sessionId}" -p "Say: Your app is ready, click on preview to test it!"`, { cwd: absAppDir }, (error2) => error2 ? reject(error2) : resolve12());
77081
77202
  });
77082
77203
  } finally {
77083
77204
  clearInterval(spinner);
@@ -77272,7 +77393,7 @@ var init_new = __esm(async () => {
77272
77393
  });
77273
77394
 
77274
77395
  // src/commands/app/app.ts
77275
- import { sep as SEP14, isAbsolute as isAbsolute4, resolve as pathResolve, relative as pathRelative, basename as basename8 } from "node:path";
77396
+ import { sep as SEP14, isAbsolute as isAbsolute5, resolve as pathResolve, relative as pathRelative, basename as basename9 } from "node:path";
77276
77397
  import { stat as stat10 } from "node:fs/promises";
77277
77398
  function respecializeFields(fields) {
77278
77399
  Object.entries(fields).forEach(([k, v]) => {
@@ -77473,9 +77594,9 @@ async function push5(opts, filePath, remotePath) {
77473
77594
  if (!filePath) {
77474
77595
  filePath = originalCwd;
77475
77596
  }
77476
- const absoluteFilePath = isAbsolute4(filePath) ? filePath : pathResolve(originalCwd, filePath);
77597
+ const absoluteFilePath = isAbsolute5(filePath) ? filePath : pathResolve(originalCwd, filePath);
77477
77598
  const normalizedPath = absoluteFilePath.endsWith(SEP14) ? absoluteFilePath.slice(0, -1) : absoluteFilePath;
77478
- const dirName = basename8(normalizedPath);
77599
+ const dirName = basename9(normalizedPath);
77479
77600
  const isRawAppByName = dirName.endsWith("__raw_app") || dirName.endsWith(".raw_app");
77480
77601
  const isAppByName = dirName.endsWith("__app") || dirName.endsWith(".app");
77481
77602
  let hasRawAppYaml = false;
@@ -77502,7 +77623,7 @@ async function push5(opts, filePath, remotePath) {
77502
77623
  }
77503
77624
  const wmillRoot = process.cwd();
77504
77625
  let inferred = pathRelative(wmillRoot, normalizedPath).replaceAll(SEP14, "/");
77505
- if (inferred.startsWith("..") || isAbsolute4(inferred)) {
77626
+ if (inferred.startsWith("..") || isAbsolute5(inferred)) {
77506
77627
  error(colors.red(`Could not infer remote path: '${filePath}' is outside the wmill.yaml root (${wmillRoot}). Move the folder under the root or pass <remote_path> explicitly.`));
77507
77628
  return;
77508
77629
  }
@@ -77798,24 +77919,24 @@ var init_folder = __esm(async () => {
77798
77919
  error(`Path '${testPath}' is not under folder '${folderName2}' (expected prefix '${prefix}')`);
77799
77920
  return;
77800
77921
  }
77801
- const relative8 = testPath.slice(prefix.length);
77922
+ const relative9 = testPath.slice(prefix.length);
77802
77923
  const { minimatch: minimatch2 } = await Promise.resolve().then(() => (init_esm2(), exports_esm));
77803
77924
  for (let i = 0;i < rules.length; i++) {
77804
77925
  const rule = rules[i];
77805
- if (minimatch2(relative8, rule.path_glob)) {
77926
+ if (minimatch2(relative9, rule.path_glob)) {
77806
77927
  if (opts.json) {
77807
- console.log(JSON.stringify({ matched: true, rule_index: i, rule, relative_path: relative8 }));
77928
+ console.log(JSON.stringify({ matched: true, rule_index: i, rule, relative_path: relative9 }));
77808
77929
  } else {
77809
77930
  info(colors.green(`✓ Rule #${i + 1} matches: path_glob='${rule.path_glob}' → permissioned_as='${rule.permissioned_as}'`));
77810
- info(colors.gray(` (relative path tested: '${relative8}')`));
77931
+ info(colors.gray(` (relative path tested: '${relative9}')`));
77811
77932
  }
77812
77933
  return;
77813
77934
  }
77814
77935
  }
77815
77936
  if (opts.json) {
77816
- console.log(JSON.stringify({ matched: false, relative_path: relative8 }));
77937
+ console.log(JSON.stringify({ matched: false, relative_path: relative9 }));
77817
77938
  } else {
77818
- info(colors.yellow(`No rule matches path '${testPath}' (relative: '${relative8}')`));
77939
+ info(colors.yellow(`No rule matches path '${testPath}' (relative: '${relative9}')`));
77819
77940
  }
77820
77941
  });
77821
77942
  folder_default = command15;
@@ -77823,7 +77944,7 @@ var init_folder = __esm(async () => {
77823
77944
 
77824
77945
  // src/commands/variable/variable.ts
77825
77946
  import { mkdir as mkdir9, stat as stat12, writeFile as writeFile12 } from "node:fs/promises";
77826
- import { dirname as dirname15 } from "node:path";
77947
+ import { dirname as dirname16 } from "node:path";
77827
77948
  import { sep as SEP16 } from "node:path";
77828
77949
  async function list8(opts) {
77829
77950
  if (opts.json)
@@ -77861,7 +77982,7 @@ async function newVariable(opts, path21) {
77861
77982
  is_secret: false,
77862
77983
  description: ""
77863
77984
  };
77864
- await mkdir9(dirname15(filePath), { recursive: true });
77985
+ await mkdir9(dirname16(filePath), { recursive: true });
77865
77986
  await writeFile12(filePath, import_yaml26.stringify(template), {
77866
77987
  flag: "wx",
77867
77988
  encoding: "utf-8"
@@ -78046,7 +78167,7 @@ var init_variable = __esm(async () => {
78046
78167
 
78047
78168
  // src/commands/schedule/schedule.ts
78048
78169
  import { mkdir as mkdir10, stat as stat13, writeFile as writeFile13 } from "node:fs/promises";
78049
- import { dirname as dirname16 } from "node:path";
78170
+ import { dirname as dirname17 } from "node:path";
78050
78171
  import { sep as SEP17 } from "node:path";
78051
78172
  async function list9(opts) {
78052
78173
  if (opts.json)
@@ -78083,7 +78204,7 @@ async function newSchedule(opts, path21) {
78083
78204
  is_flow: false,
78084
78205
  enabled: false
78085
78206
  };
78086
- await mkdir10(dirname16(filePath), { recursive: true });
78207
+ await mkdir10(dirname17(filePath), { recursive: true });
78087
78208
  await writeFile13(filePath, import_yaml27.stringify(template), {
78088
78209
  flag: "wx",
78089
78210
  encoding: "utf-8"
@@ -79845,7 +79966,7 @@ var init_dependencies = __esm(async () => {
79845
79966
 
79846
79967
  // src/commands/trigger/trigger.ts
79847
79968
  import { mkdir as mkdir12, stat as stat15, writeFile as writeFile17 } from "node:fs/promises";
79848
- import { dirname as dirname17 } from "node:path";
79969
+ import { dirname as dirname18 } from "node:path";
79849
79970
  import { sep as SEP18 } from "node:path";
79850
79971
  async function getTrigger(triggerType, workspace, path22) {
79851
79972
  const triggerFunctions = {
@@ -80046,7 +80167,7 @@ async function newTrigger(opts, path22) {
80046
80167
  throw e;
80047
80168
  }
80048
80169
  const template = triggerTemplates[kind];
80049
- await mkdir12(dirname17(filePath), { recursive: true });
80170
+ await mkdir12(dirname18(filePath), { recursive: true });
80050
80171
  await writeFile17(filePath, import_yaml34.stringify(template), {
80051
80172
  flag: "wx",
80052
80173
  encoding: "utf-8"
@@ -80778,7 +80899,7 @@ var init_local_path_scripts = __esm(async () => {
80778
80899
  });
80779
80900
 
80780
80901
  // src/commands/flow/flow.ts
80781
- import { dirname as dirname18, sep as SEP20 } from "node:path";
80902
+ import { dirname as dirname19, sep as SEP20 } from "node:path";
80782
80903
  import { mkdirSync as mkdirSync8, writeFileSync as writeFileSync8 } from "node:fs";
80783
80904
  function normalizeOptionalString(value) {
80784
80905
  return typeof value === "string" && value.trim() === "" ? undefined : value ?? undefined;
@@ -81028,7 +81149,7 @@ async function run3(opts, path23) {
81028
81149
  }
81029
81150
  const workspace = await resolveWorkspace(opts);
81030
81151
  await requireLogin(opts);
81031
- const input = opts.data ? await resolve8(opts.data) : {};
81152
+ const input = opts.data ? await resolve9(opts.data) : {};
81032
81153
  if (!opts.data) {
81033
81154
  try {
81034
81155
  const flow = await getFlowByPath({
@@ -81109,7 +81230,7 @@ async function run3(opts, path23) {
81109
81230
  forLoopFailed = refreshedModule.type === "Failure";
81110
81231
  break;
81111
81232
  }
81112
- await new Promise((resolve11) => setTimeout(resolve11, 200));
81233
+ await new Promise((resolve12) => setTimeout(resolve12, 200));
81113
81234
  }
81114
81235
  if (forLoopFailed)
81115
81236
  break;
@@ -81125,7 +81246,7 @@ async function run3(opts, path23) {
81125
81246
  info(colors.dim(status));
81126
81247
  lastStatus = status;
81127
81248
  }
81128
- await new Promise((resolve11, _) => setTimeout(() => resolve11(undefined), 100));
81249
+ await new Promise((resolve12, _) => setTimeout(() => resolve12(undefined), 100));
81129
81250
  if (isCompleted)
81130
81251
  break;
81131
81252
  continue;
@@ -81161,7 +81282,7 @@ async function run3(opts, path23) {
81161
81282
  break;
81162
81283
  } catch {
81163
81284
  retries++;
81164
- await new Promise((resolve11) => setTimeout(resolve11, 100));
81285
+ await new Promise((resolve12) => setTimeout(resolve12, 100));
81165
81286
  }
81166
81287
  }
81167
81288
  if (retries >= MAX_RETRIES) {
@@ -81173,16 +81294,19 @@ async function preview2(opts, flowPath) {
81173
81294
  setSilent(true);
81174
81295
  }
81175
81296
  const useLocalPathScripts = !opts.remote;
81297
+ const cwdBeforeConfig = process.cwd();
81176
81298
  if (useLocalPathScripts) {
81177
81299
  opts = await mergeConfigWithConfigFile(opts);
81178
81300
  }
81179
81301
  const workspace = await resolveWorkspace(opts);
81180
81302
  await requireLogin(opts);
81181
81303
  const codebases = useLocalPathScripts ? listSyncCodebases(opts) : [];
81304
+ const argPath = flowPath;
81305
+ flowPath = toSyncRootRelativePath(flowPath, cwdBeforeConfig);
81182
81306
  const isFlowDir = flowPath.endsWith(".flow") || flowPath.endsWith(".flow" + SEP20) || flowPath.endsWith("__flow") || flowPath.endsWith("__flow" + SEP20);
81183
81307
  if (!isFlowDir) {
81184
81308
  if (flowPath.endsWith("flow.yaml") || flowPath.endsWith("flow.json")) {
81185
- flowPath = dirname18(flowPath);
81309
+ flowPath = dirname19(flowPath);
81186
81310
  } else {
81187
81311
  throw new Error("Flow path must be a .flow/__flow directory or a flow.yaml file");
81188
81312
  }
@@ -81190,6 +81314,8 @@ async function preview2(opts, flowPath) {
81190
81314
  if (!flowPath.endsWith(SEP20)) {
81191
81315
  flowPath += SEP20;
81192
81316
  }
81317
+ const flowWmPath = stripFlowSuffix(flowPath).replaceAll(SEP20, "/");
81318
+ assertRemotePath(flowWmPath, argPath);
81193
81319
  const localFlow = await yamlParseFile(flowPath + "flow.yaml");
81194
81320
  const fileReader = async (path23) => await readTextFile(flowPath + path23);
81195
81321
  await replaceInlineScripts(localFlow.value.modules, fileReader, exports_log, flowPath, SEP20);
@@ -81224,9 +81350,8 @@ async function preview2(opts, flowPath) {
81224
81350
  const resolvedCodebases = await Promise.resolve(codebases);
81225
81351
  tempScriptRefs = await buildPreviewTempScriptRefs2(workspace, opts, resolvedCodebases, { kind: "flow", folder: flowPath });
81226
81352
  }
81227
- const input = opts.data ? await resolve8(opts.data) : {};
81353
+ const input = opts.data ? await resolve9(opts.data) : {};
81228
81354
  debug(`Flow value: ${JSON.stringify(localFlow.value, null, 2)}`);
81229
- const flowWmPath = stripFlowSuffix(flowPath).replaceAll(SEP20, "/");
81230
81355
  if (opts.step) {
81231
81356
  await previewStep(opts.step, localFlow, flowWmPath, workspace, input, tempScriptRefs, opts.silent, opts.tag);
81232
81357
  return;
@@ -91924,7 +92049,7 @@ __export(exports_tsconfig, {
91924
92049
  });
91925
92050
  import { execSync as execSync6 } from "node:child_process";
91926
92051
  import { createHash as createHash2 } from "node:crypto";
91927
- import { existsSync as existsSync18, readFileSync as readFileSync5, writeFileSync as writeFileSync9 } from "node:fs";
92052
+ import { existsSync as existsSync19, readFileSync as readFileSync5, writeFileSync as writeFileSync9 } from "node:fs";
91928
92053
  import path24 from "node:path";
91929
92054
  import process25 from "node:process";
91930
92055
  function buildManagedTsconfig() {
@@ -92051,7 +92176,7 @@ async function refreshManagedDenoImportMap(mode) {
92051
92176
  });
92052
92177
  }
92053
92178
  async function ensureUserReferencesManaged(opts) {
92054
- const existing = [opts.file, ...opts.altFiles ?? []].map((f) => path24.join(process25.cwd(), f)).find((p) => existsSync18(p));
92179
+ const existing = [opts.file, ...opts.altFiles ?? []].map((f) => path24.join(process25.cwd(), f)).find((p) => existsSync19(p));
92055
92180
  if (!existing) {
92056
92181
  const userPath = path24.join(process25.cwd(), opts.file);
92057
92182
  writeFileSync9(userPath, JSON.stringify(opts.create, null, 2) + `
@@ -92103,7 +92228,7 @@ async function ensureUserReferencesManaged(opts) {
92103
92228
  }
92104
92229
  function ensureBunTypesAvailable() {
92105
92230
  const cwd = process25.cwd();
92106
- if (existsSync18(path24.join(cwd, "node_modules", "bun-types"))) {
92231
+ if (existsSync19(path24.join(cwd, "node_modules", "bun-types"))) {
92107
92232
  return true;
92108
92233
  }
92109
92234
  try {
@@ -92126,7 +92251,7 @@ function ensureBunTypesAvailable() {
92126
92251
  async function warnIfTsconfigStale(opts) {
92127
92252
  const cwd = opts?.cwd ?? process25.cwd();
92128
92253
  const managedPath = path24.join(cwd, MANAGED_TSCONFIG);
92129
- if (!existsSync18(managedPath))
92254
+ if (!existsSync19(managedPath))
92130
92255
  return;
92131
92256
  let managedText;
92132
92257
  try {
@@ -93379,7 +93504,7 @@ await __promiseAll([
93379
93504
  init_user(),
93380
93505
  init_variable()
93381
93506
  ]);
93382
- import { realpathSync } from "node:fs";
93507
+ import { realpathSync as realpathSync2 } from "node:fs";
93383
93508
  import { fileURLToPath as fileURLToPath2 } from "node:url";
93384
93509
 
93385
93510
  // src/commands/hub/hub.ts
@@ -93565,18 +93690,18 @@ await __promiseAll([
93565
93690
  init_context()
93566
93691
  ]);
93567
93692
  var import_yaml40 = __toESM(require_dist(), 1);
93568
- import { existsSync as existsSync15 } from "node:fs";
93693
+ import { existsSync as existsSync16 } from "node:fs";
93569
93694
  import { writeFile as writeFile19 } from "node:fs/promises";
93570
- import { dirname as dirname19, join as join21 } from "node:path";
93695
+ import { dirname as dirname20, join as join22 } from "node:path";
93571
93696
  var PROTECTION_RULES_FILENAME = "protection-rules.yaml";
93572
93697
  function getProtectionRulesPath() {
93573
93698
  const wmillPath = getWmillYamlPath();
93574
93699
  if (!wmillPath)
93575
93700
  return null;
93576
- return join21(dirname19(wmillPath), PROTECTION_RULES_FILENAME);
93701
+ return join22(dirname20(wmillPath), PROTECTION_RULES_FILENAME);
93577
93702
  }
93578
93703
  async function readProtectionRulesFile(path23) {
93579
- if (!existsSync15(path23))
93704
+ if (!existsSync16(path23))
93580
93705
  return {};
93581
93706
  const parsed = await yamlParseFile(path23);
93582
93707
  return parsed ?? {};
@@ -93787,7 +93912,7 @@ await __promiseAll([
93787
93912
  init_conf()
93788
93913
  ]);
93789
93914
  import process24 from "node:process";
93790
- import { existsSync as existsSync16 } from "node:fs";
93915
+ import { existsSync as existsSync17 } from "node:fs";
93791
93916
  async function pushProtectionRules(opts, workspaceArg) {
93792
93917
  if (opts.jsonOutput)
93793
93918
  setSilent(true);
@@ -93797,7 +93922,7 @@ async function pushProtectionRules(opts, workspaceArg) {
93797
93922
  error: "No wmill.yaml found. Run 'wmill init' first — protection-rules.yaml lives next to it."
93798
93923
  });
93799
93924
  }
93800
- if (!existsSync16(prPath)) {
93925
+ if (!existsSync17(prPath)) {
93801
93926
  fail(opts, {
93802
93927
  error: "No protection-rules.yaml found. Run 'wmill protection-rules pull' first."
93803
93928
  });
@@ -94759,7 +94884,7 @@ async function dev2(opts) {
94759
94884
  }
94760
94885
  socket.destroy();
94761
94886
  });
94762
- return new Promise((resolve11) => {
94887
+ return new Promise((resolve12) => {
94763
94888
  proxyServer.listen(proxyPort, BIND_HOST, () => {
94764
94889
  console.log(`Dev proxy listening on http://localhost:${proxyPort}`);
94765
94890
  if (opts.path) {
@@ -94769,7 +94894,7 @@ async function dev2(opts) {
94769
94894
  console.log("(pass --path <path> to skip the picker)");
94770
94895
  }
94771
94896
  maybeOpenBrowser(`http://localhost:${proxyPort}/`);
94772
- resolve11();
94897
+ resolve12();
94773
94898
  });
94774
94899
  });
94775
94900
  }
@@ -94875,9 +95000,9 @@ class NpmProvider extends Provider {
94875
95000
  if (verbose)
94876
95001
  process.stderr.write(d);
94877
95002
  });
94878
- const exitCode = await new Promise((resolve11, reject) => {
95003
+ const exitCode = await new Promise((resolve12, reject) => {
94879
95004
  proc.on("error", reject);
94880
- proc.on("close", resolve11);
95005
+ proc.on("close", resolve12);
94881
95006
  }).catch((e) => {
94882
95007
  throw new Error(`failed to run npm: ${e instanceof Error ? e.message : e}
94883
95008
 
@@ -95573,7 +95698,7 @@ await __promiseAll([
95573
95698
  init_freshness()
95574
95699
  ]);
95575
95700
  import { cp, mkdir as mkdir13, readdir as readdir11, rm as rm6, stat as stat19, writeFile as writeFile21 } from "node:fs/promises";
95576
- import { join as join23 } from "node:path";
95701
+ import { join as join24 } from "node:path";
95577
95702
  var WMILL_INIT_AI_SKILLS_SOURCE_ENV = "WMILL_INIT_AI_SKILLS_SOURCE";
95578
95703
  var WMILL_INIT_AI_AGENTS_SOURCE_ENV = "WMILL_INIT_AI_AGENTS_SOURCE";
95579
95704
  var WMILL_INIT_AI_CLAUDE_SOURCE_ENV = "WMILL_INIT_AI_CLAUDE_SOURCE";
@@ -95586,20 +95711,20 @@ async function writeAiGuidanceFiles(options) {
95586
95711
  const skillMetadata = options.skillsSourcePath ? await readSkillMetadataFromDirectory(options.skillsSourcePath) : getGeneratedSkillMetadata();
95587
95712
  const rawAgentsCliContent = options.agentsSourcePath != null ? await readTextFile(options.agentsSourcePath) : generateAgentsCliMdContent(buildSkillsReference(skillMetadata));
95588
95713
  const agentsCliContent = injectPromptsHashMarker(rawAgentsCliContent, currentPromptsHash(nonDottedPaths));
95589
- const agentsCliPath = join23(options.targetDir, AGENTS_WMILL_FILENAME);
95714
+ const agentsCliPath = join24(options.targetDir, AGENTS_WMILL_FILENAME);
95590
95715
  await writeFile21(agentsCliPath, agentsCliContent, "utf8");
95591
95716
  const agentsCliWritten = true;
95592
95717
  const legacyManagedRemoved = await migrateLegacyManagedFile(options.targetDir);
95593
95718
  const resolveMigration = cacheOnce(options.resolveAgentsMdMigration);
95594
95719
  const agentsMdResult = await reconcileIncludingFile({
95595
- path: join23(options.targetDir, "AGENTS.md"),
95720
+ path: join24(options.targetDir, "AGENTS.md"),
95596
95721
  includeLine: AGENTS_WMILL_INCLUDE_LINE,
95597
95722
  skeleton: generateAgentsMdSkeleton(),
95598
95723
  resolveMigration
95599
95724
  });
95600
95725
  const claudeSkeleton = options.claudeSourcePath != null ? await readTextFile(options.claudeSourcePath) : CLAUDE_MD_DEFAULT;
95601
95726
  const claudeMdResult = await reconcileIncludingFile({
95602
- path: join23(options.targetDir, "CLAUDE.md"),
95727
+ path: join24(options.targetDir, "CLAUDE.md"),
95603
95728
  includeLine: CLAUDE_MD_INCLUDE_LINE,
95604
95729
  skeleton: claudeSkeleton,
95605
95730
  resolveMigration
@@ -95621,7 +95746,7 @@ async function writeAiGuidanceFiles(options) {
95621
95746
  }
95622
95747
  async function migrateLegacyManagedFile(targetDir) {
95623
95748
  for (const fileName of ["AGENTS.md", "CLAUDE.md"]) {
95624
- const filePath = join23(targetDir, fileName);
95749
+ const filePath = join24(targetDir, fileName);
95625
95750
  const existing = await readTextFile(filePath).catch(() => null);
95626
95751
  if (existing == null)
95627
95752
  continue;
@@ -95630,7 +95755,7 @@ async function migrateLegacyManagedFile(targetDir) {
95630
95755
  await writeFile21(filePath, rewritten, "utf8");
95631
95756
  }
95632
95757
  }
95633
- const legacyPath = join23(targetDir, LEGACY_AGENTS_CLI_FILENAME);
95758
+ const legacyPath = join24(targetDir, LEGACY_AGENTS_CLI_FILENAME);
95634
95759
  const legacyExists = await stat19(legacyPath).catch(() => null) != null;
95635
95760
  if (legacyExists) {
95636
95761
  await rm6(legacyPath, { force: true });
@@ -95707,9 +95832,9 @@ async function copySkillsFromSource(targetDir, skillsSourcePath) {
95707
95832
  async function writeGeneratedSkills(targetDir, nonDottedPaths) {
95708
95833
  const skillsDirs = await ensureSkillsDirectories(targetDir);
95709
95834
  await Promise.all(skillsDirs.flatMap((skillsDir) => SKILLS.map(async (skill) => {
95710
- const skillDir = join23(skillsDir, skill.name);
95835
+ const skillDir = join24(skillsDir, skill.name);
95711
95836
  await mkdir13(skillDir, { recursive: true });
95712
- await writeFile21(join23(skillDir, "SKILL.md"), renderGeneratedSkillContent(skill.name, nonDottedPaths), "utf8");
95837
+ await writeFile21(join24(skillDir, "SKILL.md"), renderGeneratedSkillContent(skill.name, nonDottedPaths), "utf8");
95713
95838
  })));
95714
95839
  return SKILLS.map((skill) => ({
95715
95840
  ...skill,
@@ -95723,14 +95848,14 @@ function getGeneratedSkillMetadata() {
95723
95848
  }));
95724
95849
  }
95725
95850
  async function ensureSkillsDirectories(targetDir) {
95726
- const skillsDirs = SKILL_TARGET_ROOTS.map((root) => join23(targetDir, root, "skills"));
95851
+ const skillsDirs = SKILL_TARGET_ROOTS.map((root) => join24(targetDir, root, "skills"));
95727
95852
  await Promise.all(skillsDirs.map((skillsDir) => mkdir13(skillsDir, { recursive: true })));
95728
95853
  return skillsDirs;
95729
95854
  }
95730
95855
  async function copyDirectoryContents(sourceDir, targetDir) {
95731
95856
  const entries = await readdir11(sourceDir, { withFileTypes: true });
95732
95857
  await Promise.all(entries.map(async (entry) => {
95733
- await cp(join23(sourceDir, entry.name), join23(targetDir, entry.name), {
95858
+ await cp(join24(sourceDir, entry.name), join24(targetDir, entry.name), {
95734
95859
  recursive: true,
95735
95860
  force: true
95736
95861
  });
@@ -95773,7 +95898,7 @@ async function readSkillMetadataFromDirectory(skillsDir) {
95773
95898
  if (!entry.isDirectory()) {
95774
95899
  continue;
95775
95900
  }
95776
- const skillPath = join23(skillsDir, entry.name, "SKILL.md");
95901
+ const skillPath = join24(skillsDir, entry.name, "SKILL.md");
95777
95902
  if (!await stat19(skillPath).catch(() => null)) {
95778
95903
  continue;
95779
95904
  }
@@ -98365,16 +98490,16 @@ async function startServe(opts) {
98365
98490
  error(`server error: ${err.message}`);
98366
98491
  process.exitCode = 1;
98367
98492
  });
98368
- await new Promise((resolve11) => server.listen(port, host, () => resolve11()));
98493
+ await new Promise((resolve12) => server.listen(port, host, () => resolve12()));
98369
98494
  return {
98370
98495
  host,
98371
98496
  port,
98372
98497
  user: DEFAULT_USER,
98373
98498
  password,
98374
98499
  connectionString: (datatableName) => `postgresql://${DEFAULT_USER}:${encodeURIComponent(password)}@${host}:${port}/${encodeURIComponent(datatableName)}`,
98375
- close: () => new Promise((resolve11) => {
98376
- server.close(() => resolve11());
98377
- setTimeout(resolve11, 1000).unref();
98500
+ close: () => new Promise((resolve12) => {
98501
+ server.close(() => resolve12());
98502
+ setTimeout(resolve12, 1000).unref();
98378
98503
  })
98379
98504
  };
98380
98505
  }
@@ -98883,13 +99008,13 @@ async function psql(opts) {
98883
99008
  }
98884
99009
  handle.close().finally(() => process.exit(1));
98885
99010
  });
98886
- const exitCode = await new Promise((resolve11) => {
99011
+ const exitCode = await new Promise((resolve12) => {
98887
99012
  child.on("exit", (code2, signal) => {
98888
99013
  if (signal && typeof signal === "string") {
98889
99014
  const num = signalToNumber(signal);
98890
- resolve11(num !== undefined ? 128 + num : 1);
99015
+ resolve12(num !== undefined ? 128 + num : 1);
98891
99016
  } else {
98892
- resolve11(code2 ?? 0);
99017
+ resolve12(code2 ?? 0);
98893
99018
  }
98894
99019
  });
98895
99020
  });
@@ -100292,7 +100417,7 @@ await __promiseAll([
100292
100417
  init_conf()
100293
100418
  ]);
100294
100419
  import { writeFile as writeFile25 } from "node:fs/promises";
100295
- import { existsSync as existsSync20, readFileSync as readFileSync8 } from "node:fs";
100420
+ import { existsSync as existsSync21, readFileSync as readFileSync8 } from "node:fs";
100296
100421
  import * as path27 from "node:path";
100297
100422
  var ASSET_KINDS = "s3object,ducklake,datatable,volume,dbt";
100298
100423
  function assetUri(kind, p3) {
@@ -100512,7 +100637,7 @@ async function generatePipelineDocs(opts, folder) {
100512
100637
  ];
100513
100638
  for (const [name, content] of pointers) {
100514
100639
  const p3 = path27.join(folderDir, name);
100515
- if (existsSync20(p3)) {
100640
+ if (existsSync21(p3)) {
100516
100641
  let existing;
100517
100642
  try {
100518
100643
  existing = readFileSync8(p3, "utf-8");
@@ -100531,7 +100656,7 @@ async function generatePipelineDocs(opts, folder) {
100531
100656
  }
100532
100657
 
100533
100658
  // src/commands/pipeline/pipelineUpload.ts
100534
- import { basename as basename10 } from "node:path";
100659
+ import { basename as basename11 } from "node:path";
100535
100660
  function parseUploadBinding(spec) {
100536
100661
  const eq = spec.indexOf("=");
100537
100662
  const left = eq < 0 ? "" : spec.slice(0, eq).trim();
@@ -100573,7 +100698,7 @@ function s3ObjectParams(schema) {
100573
100698
  return Object.keys(props).filter((k2) => isS3Object(props[k2]?.format));
100574
100699
  }
100575
100700
  function devUploadKey(scriptPath, param, source) {
100576
- return `wmilldev/pipeline/${scriptPath}/${param}/${basename10(source)}`;
100701
+ return `wmilldev/pipeline/${scriptPath}/${param}/${basename11(source)}`;
100577
100702
  }
100578
100703
  function parseS3Uri(source) {
100579
100704
  const m3 = source.match(/^s3:\/\/([^/]*)\/(.*)$/);
@@ -101218,7 +101343,7 @@ await __promiseAll([
101218
101343
  ]);
101219
101344
  import { Buffer as Buffer6 } from "node:buffer";
101220
101345
  import { readFile as readFile4, writeFile as writeFile26 } from "node:fs/promises";
101221
- import { basename as basename11 } from "node:path";
101346
+ import { basename as basename12 } from "node:path";
101222
101347
  function formatBytes(n2) {
101223
101348
  if (n2 == null)
101224
101349
  return "-";
@@ -101319,7 +101444,7 @@ async function download(opts, fileKey, outputPath) {
101319
101444
  process.stdout.write(buf);
101320
101445
  return;
101321
101446
  }
101322
- const dest = outputPath ?? basename11(fileKey);
101447
+ const dest = outputPath ?? basename12(fileKey);
101323
101448
  await writeFile26(dest, buf);
101324
101449
  info(colors.green(`Downloaded ${fileKey} -> ${dest}`));
101325
101450
  }
@@ -101523,7 +101648,7 @@ function isMain() {
101523
101648
  const scriptPath = process.argv[1];
101524
101649
  if (!scriptPath)
101525
101650
  return false;
101526
- const realScriptPath = realpathSync(scriptPath);
101651
+ const realScriptPath = realpathSync2(scriptPath);
101527
101652
  const modulePath = fileURLToPath2(import.meta.url);
101528
101653
  return realScriptPath === modulePath;
101529
101654
  } catch {