windmill-cli 1.715.0 → 1.717.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 +1019 -807
  2. package/package.json +1 -1
package/esm/main.js CHANGED
@@ -16772,7 +16772,7 @@ var init_OpenAPI = __esm(() => {
16772
16772
  PASSWORD: undefined,
16773
16773
  TOKEN: getEnv3("WM_TOKEN"),
16774
16774
  USERNAME: undefined,
16775
- VERSION: "1.715.0",
16775
+ VERSION: "1.717.0",
16776
16776
  WITH_CREDENTIALS: true,
16777
16777
  interceptors: {
16778
16778
  request: new Interceptors,
@@ -25289,7 +25289,7 @@ var init_auth = __esm(async () => {
25289
25289
  });
25290
25290
 
25291
25291
  // src/core/constants.ts
25292
- var WM_FORK_PREFIX = "wm-fork";
25292
+ var WM_FORK_PREFIX = "wm-fork", VERSION = "1.717.0";
25293
25293
 
25294
25294
  // src/utils/git.ts
25295
25295
  var exports_git = {};
@@ -26943,13 +26943,6 @@ function isFolderResourcePathAnyFormat(p) {
26943
26943
  }
26944
26944
  return false;
26945
26945
  }
26946
- function isRawAppBackendPath(filePath) {
26947
- const suffixes = getFolderSuffixes();
26948
- const normalizedPath = filePath.replaceAll(SEP2, "/");
26949
- const escapedSuffix = suffixes.raw_app.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
26950
- const pattern = new RegExp(`${escapedSuffix}/backend/`);
26951
- return pattern.test(normalizedPath);
26952
- }
26953
26946
  function isAppInlineScriptPath(filePath) {
26954
26947
  const suffixes = getFolderSuffixes();
26955
26948
  const normalizedPath = filePath.replaceAll(SEP2, "/");
@@ -27464,70 +27457,6 @@ var init_conf = __esm(async () => {
27464
27457
  RESERVED_WORKSPACE_KEYS = new Set(["commonSpecificItems"]);
27465
27458
  });
27466
27459
 
27467
- // src/commands/resource-type/tsconfig.ts
27468
- import { execSync as execSync3 } from "node:child_process";
27469
- import { existsSync as existsSync3, writeFileSync } from "node:fs";
27470
- import path3 from "node:path";
27471
- import process10 from "node:process";
27472
- async function generateTsconfigForIde() {
27473
- const tsconfigPath = path3.join(process10.cwd(), "tsconfig.json");
27474
- if (existsSync3(tsconfigPath)) {
27475
- info(colors.gray("tsconfig.json already exists, skipping"));
27476
- return;
27477
- }
27478
- let defaultTs = "bun";
27479
- try {
27480
- const conf = await readConfigFile({ warnIfMissing: false });
27481
- if (conf?.defaultTs === "deno") {
27482
- defaultTs = "deno";
27483
- }
27484
- } catch {}
27485
- const bunTypesAvailable = defaultTs === "bun" ? ensureBunTypesAvailable() : false;
27486
- const tsconfig = {
27487
- compilerOptions: {
27488
- target: "ESNext",
27489
- module: "ESNext",
27490
- moduleResolution: "bundler",
27491
- noEmit: true,
27492
- strict: false
27493
- },
27494
- include: ["**/*.ts", "rt.d.ts"]
27495
- };
27496
- if (bunTypesAvailable) {
27497
- tsconfig.compilerOptions.types = ["bun-types"];
27498
- }
27499
- writeFileSync(tsconfigPath, JSON.stringify(tsconfig, null, 2) + `
27500
- `);
27501
- info(colors.green("Created tsconfig.json for IDE type support."));
27502
- }
27503
- function ensureBunTypesAvailable() {
27504
- const cwd = process10.cwd();
27505
- if (existsSync3(path3.join(cwd, "node_modules", "bun-types"))) {
27506
- return true;
27507
- }
27508
- try {
27509
- execSync3("bun --version", { stdio: "ignore" });
27510
- } catch {
27511
- info(`Install bun (https://bun.sh) then run 'bun add -d bun-types' and add "types": ["bun-types"] to tsconfig.json for Bun API autocompletion.`);
27512
- return false;
27513
- }
27514
- try {
27515
- info(colors.yellow("Installing bun-types with 'bun add -d bun-types'..."));
27516
- execSync3("bun add -d bun-types", { stdio: "inherit" });
27517
- info(colors.green("Installed bun-types."));
27518
- return true;
27519
- } catch (e) {
27520
- warn(`Failed to install bun-types automatically: ${e instanceof Error ? e.message : e}`);
27521
- info(`Run 'bun add -d bun-types' manually and add "types": ["bun-types"] to tsconfig.json for Bun API autocompletion.`);
27522
- return false;
27523
- }
27524
- }
27525
- var init_tsconfig = __esm(async () => {
27526
- init_colors2();
27527
- init_log();
27528
- await init_conf();
27529
- });
27530
-
27531
27460
  // src/utils/resource_types.ts
27532
27461
  function compileResourceTypeToTsType(schema) {
27533
27462
  function rec(x, root = false) {
@@ -27570,10 +27499,10 @@ __export(exports_resource_type, {
27570
27499
  generateRTNamespace: () => generateRTNamespace,
27571
27500
  default: () => resource_type_default
27572
27501
  });
27573
- import { writeFileSync as writeFileSync2 } from "node:fs";
27502
+ import { writeFileSync } from "node:fs";
27574
27503
  import { stat as stat3, writeFile as writeFile2 } from "node:fs/promises";
27575
- import path4 from "node:path";
27576
- import process11 from "node:process";
27504
+ import path3 from "node:path";
27505
+ import process10 from "node:process";
27577
27506
  async function pushResourceType(workspace, remotePath, resource, localResource) {
27578
27507
  remotePath = removeType(remotePath, "resource-type");
27579
27508
  try {
@@ -27658,12 +27587,12 @@ async function newResourceType(opts, name) {
27658
27587
  });
27659
27588
  info(colors.green(`Created ${filePath}`));
27660
27589
  }
27661
- async function get(opts, path5) {
27590
+ async function get(opts, path4) {
27662
27591
  const workspace = await resolveWorkspace(opts);
27663
27592
  await requireLogin(opts);
27664
27593
  const rt = await getResourceType({
27665
27594
  workspace: workspace.workspaceId,
27666
- path: path5
27595
+ path: path4
27667
27596
  });
27668
27597
  if (opts.json) {
27669
27598
  console.log(JSON.stringify(rt));
@@ -27693,9 +27622,8 @@ async function generateRTNamespace(opts) {
27693
27622
  `);
27694
27623
  namespaceContent += `
27695
27624
  }`;
27696
- writeFileSync2(path4.join(process11.cwd(), "rt.d.ts"), namespaceContent);
27625
+ writeFileSync(path3.join(process10.cwd(), "rt.d.ts"), namespaceContent);
27697
27626
  info(colors.green("Created rt.d.ts with resource types namespace (RT) for TypeScript."));
27698
- await generateTsconfigForIde();
27699
27627
  }
27700
27628
  var import_yaml4, command, resource_type_default;
27701
27629
  var init_resource_type = __esm(async () => {
@@ -27708,7 +27636,6 @@ var init_resource_type = __esm(async () => {
27708
27636
  init_types(),
27709
27637
  init_auth(),
27710
27638
  init_context(),
27711
- init_tsconfig(),
27712
27639
  init_utils()
27713
27640
  ]);
27714
27641
  import_yaml4 = __toESM(require_dist(), 1);
@@ -27731,7 +27658,7 @@ __export(exports_workspace, {
27731
27658
  add: () => add
27732
27659
  });
27733
27660
  import { writeFile as writeFile3, open as fsOpen } from "node:fs/promises";
27734
- import process12 from "node:process";
27661
+ import process11 from "node:process";
27735
27662
  async function allWorkspaces(configDirOverride) {
27736
27663
  try {
27737
27664
  const file = await getWorkspaceConfigFilePath(configDirOverride);
@@ -27843,7 +27770,7 @@ async function add(opts, workspaceName, workspaceId, remote) {
27843
27770
  }
27844
27771
  remote = new URL(remote).toString();
27845
27772
  let token = await tryGetLoginInfo(opts);
27846
- if (!token && !(process12.stdin.isTTY ?? false)) {
27773
+ if (!token && !(process11.stdin.isTTY ?? false)) {
27847
27774
  info("Not a TTY, can't login interactively. Pass the token in --token");
27848
27775
  return;
27849
27776
  }
@@ -27885,7 +27812,7 @@ async function add(opts, workspaceName, workspaceId, remote) {
27885
27812
  info(`- ${workspace.id} (name: ${workspace.name})`);
27886
27813
  }
27887
27814
  }
27888
- process12.exit(1);
27815
+ process11.exit(1);
27889
27816
  }
27890
27817
  const added = await addWorkspace({
27891
27818
  name: workspaceName,
@@ -27902,7 +27829,7 @@ async function add(opts, workspaceName, workspaceId, remote) {
27902
27829
  async function addWorkspace(workspace, opts) {
27903
27830
  workspace.remote = new URL(workspace.remote).toString();
27904
27831
  const existingWorkspaces = await allWorkspaces(opts.configDir);
27905
- const isInteractive = (process12.stdin.isTTY ?? false) && (process12.stdout.isTTY ?? false) && !opts.force;
27832
+ const isInteractive = (process11.stdin.isTTY ?? false) && (process11.stdout.isTTY ?? false) && !opts.force;
27906
27833
  const nameConflict = existingWorkspaces.find((w) => w.name === workspace.name);
27907
27834
  if (nameConflict) {
27908
27835
  if (nameConflict.remote === workspace.remote && nameConflict.workspaceId === workspace.workspaceId) {
@@ -28078,7 +28005,7 @@ async function bind(opts, doBind) {
28078
28005
  if (!config.workspaces) {
28079
28006
  config.workspaces = {};
28080
28007
  }
28081
- const isInteractive = !!process12.stdin.isTTY;
28008
+ const isInteractive = !!process11.stdin.isTTY;
28082
28009
  const inGitRepo = isGitRepository2();
28083
28010
  const currentBranch = inGitRepo ? getCurrentGitBranch2() : null;
28084
28011
  if (doBind) {
@@ -28267,16 +28194,16 @@ async function getBranchProfilesPath(configDirOverride) {
28267
28194
  }
28268
28195
  async function loadBranchProfiles(configDirOverride) {
28269
28196
  try {
28270
- const path5 = await getBranchProfilesPath(configDirOverride);
28271
- const content = await readTextFile(path5);
28197
+ const path4 = await getBranchProfilesPath(configDirOverride);
28198
+ const content = await readTextFile(path4);
28272
28199
  return JSON.parse(content);
28273
28200
  } catch {
28274
28201
  return { lastUsed: {} };
28275
28202
  }
28276
28203
  }
28277
28204
  async function saveBranchProfiles(mapping, configDirOverride) {
28278
- const path5 = await getBranchProfilesPath(configDirOverride);
28279
- await writeFile4(path5, JSON.stringify(mapping, null, 2), "utf-8");
28205
+ const path4 = await getBranchProfilesPath(configDirOverride);
28206
+ await writeFile4(path4, JSON.stringify(mapping, null, 2), "utf-8");
28280
28207
  }
28281
28208
  function getBranchProfileKey(branch, baseUrl2, workspaceId) {
28282
28209
  let normalizedUrl;
@@ -28715,8 +28642,8 @@ async function tryResolveVersion(opts) {
28715
28642
  return;
28716
28643
  }
28717
28644
  }
28718
- function validatePath(path5) {
28719
- if (!(path5.startsWith("g") || path5.startsWith("u") || path5.startsWith("f"))) {
28645
+ function validatePath(path4) {
28646
+ if (!(path4.startsWith("g") || path4.startsWith("u") || path4.startsWith("f"))) {
28720
28647
  info(colors.red("Given remote path looks invalid. Remote paths are typically of the form <u|g|f>/<username|group|folder>/..."));
28721
28648
  return false;
28722
28649
  }
@@ -28769,7 +28696,7 @@ var init_global = __esm(() => {
28769
28696
  // src/utils/utils.ts
28770
28697
  import { sep as SEP3 } from "node:path";
28771
28698
  import crypto2 from "node:crypto";
28772
- import { readFileSync, writeFileSync as writeFileSync3 } from "node:fs";
28699
+ import { readFileSync, writeFileSync as writeFileSync2 } from "node:fs";
28773
28700
  import { readdir, readFile } from "node:fs/promises";
28774
28701
  function deepEqual(a, b) {
28775
28702
  if (a === b)
@@ -28856,12 +28783,12 @@ function getHeaders2() {
28856
28783
  return;
28857
28784
  }
28858
28785
  }
28859
- async function digestDir(path5, conf) {
28786
+ async function digestDir(path4, conf) {
28860
28787
  const hashes = [];
28861
- const entries = await readdir(path5, { withFileTypes: true });
28788
+ const entries = await readdir(path4, { withFileTypes: true });
28862
28789
  entries.sort((a, b) => a.name.localeCompare(b.name));
28863
28790
  for (const e of entries) {
28864
- const npath = path5 + "/" + e.name;
28791
+ const npath = path4 + "/" + e.name;
28865
28792
  if (e.isFile()) {
28866
28793
  hashes.push(await generateHashFromBuffer(await readFile(npath)));
28867
28794
  } else if (e.isDirectory() && !e.isSymbolicLink()) {
@@ -28878,19 +28805,19 @@ async function generateHashFromBuffer(content) {
28878
28805
  const hashBuffer = await crypto2.subtle.digest("SHA-256", content);
28879
28806
  return Buffer.from(hashBuffer).toString("hex");
28880
28807
  }
28881
- function decodeBufferAsUtf8(buf, path5) {
28808
+ function decodeBufferAsUtf8(buf, path4) {
28882
28809
  if (buf.length >= 2) {
28883
28810
  if (buf[0] === 255 && buf[1] === 254) {
28884
28811
  if (buf.length >= 4 && buf[2] === 0 && buf[3] === 0) {
28885
- throw new Error(`File ${path5} is encoded as UTF-32 LE, which is not supported. Please convert it to UTF-8.`);
28812
+ throw new Error(`File ${path4} is encoded as UTF-32 LE, which is not supported. Please convert it to UTF-8.`);
28886
28813
  }
28887
- throw new Error(`File ${path5} is encoded as UTF-16 LE, which is not supported. Please convert it to UTF-8.`);
28814
+ throw new Error(`File ${path4} is encoded as UTF-16 LE, which is not supported. Please convert it to UTF-8.`);
28888
28815
  }
28889
28816
  if (buf[0] === 254 && buf[1] === 255) {
28890
- throw new Error(`File ${path5} is encoded as UTF-16 BE, which is not supported. Please convert it to UTF-8.`);
28817
+ throw new Error(`File ${path4} is encoded as UTF-16 BE, which is not supported. Please convert it to UTF-8.`);
28891
28818
  }
28892
28819
  if (buf.length >= 4 && buf[0] === 0 && buf[1] === 0 && buf[2] === 254 && buf[3] === 255) {
28893
- throw new Error(`File ${path5} is encoded as UTF-32 BE, which is not supported. Please convert it to UTF-8.`);
28820
+ throw new Error(`File ${path4} is encoded as UTF-32 BE, which is not supported. Please convert it to UTF-8.`);
28894
28821
  }
28895
28822
  }
28896
28823
  if (buf.length >= 3 && buf[0] === 239 && buf[1] === 187 && buf[2] === 191) {
@@ -28898,32 +28825,32 @@ function decodeBufferAsUtf8(buf, path5) {
28898
28825
  }
28899
28826
  return buf.toString("utf-8");
28900
28827
  }
28901
- async function readTextFile(path5) {
28902
- return decodeBufferAsUtf8(await readFile(path5), path5);
28828
+ async function readTextFile(path4) {
28829
+ return decodeBufferAsUtf8(await readFile(path4), path4);
28903
28830
  }
28904
- function readTextFileSync(path5) {
28905
- return decodeBufferAsUtf8(readFileSync(path5), path5);
28831
+ function readTextFileSync(path4) {
28832
+ return decodeBufferAsUtf8(readFileSync(path4), path4);
28906
28833
  }
28907
- function readInlinePathSync(path5) {
28834
+ function readInlinePathSync(path4) {
28908
28835
  try {
28909
- return readTextFileSync(path5.replaceAll("/", SEP3));
28836
+ return readTextFileSync(path4.replaceAll("/", SEP3));
28910
28837
  } catch (error2) {
28911
- warn(`Error reading inline path: ${path5}, ${error2}`);
28838
+ warn(`Error reading inline path: ${path4}, ${error2}`);
28912
28839
  return "";
28913
28840
  }
28914
28841
  }
28915
- function isFileResource(path5) {
28916
- const splitPath = path5.split(".");
28842
+ function isFileResource(path4) {
28843
+ const splitPath = path4.split(".");
28917
28844
  return splitPath.length >= 4 && splitPath[splitPath.length - 3] == "resource" && splitPath[splitPath.length - 2] == "file";
28918
28845
  }
28919
- function isFilesetResource(path5) {
28920
- return path5.includes(".fileset/") || path5.includes(".fileset\\");
28846
+ function isFilesetResource(path4) {
28847
+ return path4.includes(".fileset/") || path4.includes(".fileset\\");
28921
28848
  }
28922
- function isRawAppFile(path5) {
28923
- return isRawAppPath(path5);
28849
+ function isRawAppFile(path4) {
28850
+ return isRawAppPath(path4);
28924
28851
  }
28925
- function isWorkspaceDependencies(path5) {
28926
- return path5.startsWith("dependencies/");
28852
+ function isWorkspaceDependencies(path4) {
28853
+ return path4.startsWith("dependencies/");
28927
28854
  }
28928
28855
  async function selectRepository(repositories, operation) {
28929
28856
  if (repositories.length === 0) {
@@ -28962,16 +28889,16 @@ async function getIsWin() {
28962
28889
  }
28963
28890
  return isWin;
28964
28891
  }
28965
- function writeIfChanged(path5, content) {
28892
+ function writeIfChanged(path4, content) {
28966
28893
  try {
28967
- const existing = readTextFileSync(path5);
28894
+ const existing = readTextFileSync(path4);
28968
28895
  if (existing === content) {
28969
28896
  return false;
28970
28897
  }
28971
28898
  } catch (error2) {
28972
28899
  if (error2?.code !== "ENOENT") {}
28973
28900
  }
28974
- writeFileSync3(path5, content, "utf-8");
28901
+ writeFileSync2(path4, content, "utf-8");
28975
28902
  return true;
28976
28903
  }
28977
28904
  async function fetchRemoteVersion(workspace) {
@@ -28979,6 +28906,7 @@ async function fetchRemoteVersion(workspace) {
28979
28906
  if (version) {
28980
28907
  updateGlobalVersions(version);
28981
28908
  }
28909
+ info(colors.gray("CLI version: " + VERSION));
28982
28910
  info(colors.gray("Remote version: " + version));
28983
28911
  }
28984
28912
  function toCamel(s) {
@@ -29011,24 +28939,24 @@ var init_utils = __esm(async () => {
29011
28939
  });
29012
28940
 
29013
28941
  // src/utils/yaml.ts
29014
- async function yamlParseFile(path5, options = {}) {
28942
+ async function yamlParseFile(path4, options = {}) {
29015
28943
  try {
29016
- return import_yaml5.parse(await readTextFile(path5), {
28944
+ return import_yaml5.parse(await readTextFile(path4), {
29017
28945
  ...options,
29018
28946
  customTags: [...WINDMILL_CUSTOM_TAGS, ...options.customTags ?? []]
29019
28947
  });
29020
28948
  } catch (e) {
29021
- throw new Error(`Error parsing yaml ${path5}`, { cause: e });
28949
+ throw new Error(`Error parsing yaml ${path4}`, { cause: e });
29022
28950
  }
29023
28951
  }
29024
- function yamlParseContent(path5, content, options = {}) {
28952
+ function yamlParseContent(path4, content, options = {}) {
29025
28953
  try {
29026
28954
  return import_yaml5.parse(content, {
29027
28955
  ...options,
29028
28956
  customTags: [...WINDMILL_CUSTOM_TAGS, ...options.customTags ?? []]
29029
28957
  });
29030
28958
  } catch (e) {
29031
- throw new Error(`Error parsing yaml ${path5}`, { cause: e });
28959
+ throw new Error(`Error parsing yaml ${path4}`, { cause: e });
29032
28960
  }
29033
28961
  }
29034
28962
  var import_yaml5, inlineTag, inlineFilesetTag, WINDMILL_CUSTOM_TAGS;
@@ -30944,7 +30872,7 @@ return schema
30944
30872
 
30945
30873
  // src/utils/port-probe.ts
30946
30874
  import { createServer as createServer2 } from "node:net";
30947
- import { execSync as execSync4 } from "node:child_process";
30875
+ import { execSync as execSync3 } from "node:child_process";
30948
30876
  function isPortFree(port, host) {
30949
30877
  return new Promise((resolve6) => {
30950
30878
  const s = createServer2();
@@ -30965,7 +30893,7 @@ async function isPortFreeOnBothStacks(port) {
30965
30893
  }
30966
30894
  function findPortHolder(port) {
30967
30895
  try {
30968
- const out = execSync4(`lsof -nP -iTCP:${port} -sTCP:LISTEN -F pc 2>/dev/null`, {
30896
+ const out = execSync3(`lsof -nP -iTCP:${port} -sTCP:LISTEN -F pc 2>/dev/null`, {
30969
30897
  encoding: "utf-8",
30970
30898
  stdio: ["ignore", "pipe", "ignore"]
30971
30899
  });
@@ -30982,7 +30910,7 @@ function findPortHolder(port) {
30982
30910
  }
30983
30911
  } catch {}
30984
30912
  try {
30985
- const out = execSync4(`ss -ltnp 2>/dev/null | awk '$4 ~ /:${port}$/ { print $NF }'`, {
30913
+ const out = execSync3(`ss -ltnp 2>/dev/null | awk '$4 ~ /:${port}$/ { print $NF }'`, {
30986
30914
  encoding: "utf-8",
30987
30915
  stdio: ["ignore", "pipe", "ignore"]
30988
30916
  }).trim();
@@ -33854,11 +33782,11 @@ var init_wrapper = __esm(() => {
33854
33782
 
33855
33783
  // src/commands/app/bundle.ts
33856
33784
  import * as fs7 from "node:fs";
33857
- import * as path5 from "node:path";
33858
- import process13 from "node:process";
33785
+ import * as path4 from "node:path";
33786
+ import process12 from "node:process";
33859
33787
  import { spawn } from "node:child_process";
33860
33788
  function detectFrameworks(appDir) {
33861
- const packageJsonPath = path5.join(appDir, "package.json");
33789
+ const packageJsonPath = path4.join(appDir, "package.json");
33862
33790
  if (!fs7.existsSync(packageJsonPath)) {
33863
33791
  return { svelte: false, vue: false };
33864
33792
  }
@@ -33883,7 +33811,7 @@ function createSveltePlugin(appDir) {
33883
33811
  build.onLoad({ filter: /\.svelte$/ }, async (args) => {
33884
33812
  const svelte = await import("svelte/compiler");
33885
33813
  const source = await readTextFile(args.path);
33886
- const filename = path5.relative(process13.cwd(), args.path);
33814
+ const filename = path4.relative(process12.cwd(), args.path);
33887
33815
  const convertMessage = ({ message, start, end }) => {
33888
33816
  let location;
33889
33817
  if (start && end) {
@@ -33924,8 +33852,8 @@ async function createFrameworkPlugins(appDir) {
33924
33852
  return plugins;
33925
33853
  }
33926
33854
  async function ensureNodeModules(appDir) {
33927
- const targetDir = appDir ?? process13.cwd();
33928
- const nodeModulesPath = path5.join(targetDir, "node_modules");
33855
+ const targetDir = appDir ?? process12.cwd();
33856
+ const nodeModulesPath = path4.join(targetDir, "node_modules");
33929
33857
  if (!fs7.existsSync(nodeModulesPath)) {
33930
33858
  info(colors.yellow("\uD83D\uDCE6 node_modules not found, running npm install..."));
33931
33859
  const code2 = await new Promise((resolve6, reject) => {
@@ -33945,7 +33873,7 @@ async function ensureNodeModules(appDir) {
33945
33873
  }
33946
33874
  async function createBundle(options = {}) {
33947
33875
  const esbuild = await import("esbuild");
33948
- const appDir = options.entryPoint ? path5.dirname(options.entryPoint) : process13.cwd();
33876
+ const appDir = options.entryPoint ? path4.dirname(options.entryPoint) : process12.cwd();
33949
33877
  const frameworks = detectFrameworks(appDir);
33950
33878
  const defaultEntry = frameworks.svelte || frameworks.vue ? "index.ts" : "index.tsx";
33951
33879
  const entryPoint = options.entryPoint ?? defaultEntry;
@@ -33958,11 +33886,11 @@ async function createBundle(options = {}) {
33958
33886
  }
33959
33887
  await ensureNodeModules(appDir);
33960
33888
  const frameworkPlugins = await createFrameworkPlugins(appDir);
33961
- const distDir = path5.join(process13.cwd(), outDir);
33889
+ const distDir = path4.join(process12.cwd(), outDir);
33962
33890
  if (!fs7.existsSync(distDir)) {
33963
33891
  fs7.mkdirSync(distDir, { recursive: true });
33964
33892
  }
33965
- const outfile = path5.join(outDir, "bundle.js");
33893
+ const outfile = path4.join(outDir, "bundle.js");
33966
33894
  const wmillTs = rawAppWmillTs_exports.default ?? rawAppWmillTs_exports;
33967
33895
  const wmillPlugin = {
33968
33896
  name: "wmill-virtual",
@@ -33992,11 +33920,11 @@ async function createBundle(options = {}) {
33992
33920
  build.onResolve({ filter: /^\/ui\// }, (args) => {
33993
33921
  const rel = args.path.slice("/ui/".length);
33994
33922
  const candidates = [rel];
33995
- if (!path5.extname(rel)) {
33996
- candidates.push(rel + ".tsx", rel + ".ts", rel + ".jsx", rel + ".js", rel + ".css", path5.join(rel, "index.tsx"), path5.join(rel, "index.ts"));
33923
+ if (!path4.extname(rel)) {
33924
+ candidates.push(rel + ".tsx", rel + ".ts", rel + ".jsx", rel + ".js", rel + ".css", path4.join(rel, "index.tsx"), path4.join(rel, "index.ts"));
33997
33925
  }
33998
33926
  for (const c of candidates) {
33999
- const full = path5.join(sharedUiDir, c);
33927
+ const full = path4.join(sharedUiDir, c);
34000
33928
  if (fs7.existsSync(full)) {
34001
33929
  return { path: full };
34002
33930
  }
@@ -34034,8 +33962,8 @@ async function createBundle(options = {}) {
34034
33962
  throw new Error("Build failed with errors");
34035
33963
  }
34036
33964
  info(colors.green("✅ Bundle created successfully"));
34037
- const jsPath = path5.join(process13.cwd(), outfile);
34038
- const cssPath = path5.join(process13.cwd(), outDir, "bundle.css");
33965
+ const jsPath = path4.join(process12.cwd(), outfile);
33966
+ const cssPath = path4.join(process12.cwd(), outDir, "bundle.css");
34039
33967
  if (!fs7.existsSync(jsPath)) {
34040
33968
  throw new Error(`Expected JS bundle at ${jsPath} but file not found`);
34041
33969
  }
@@ -35887,7 +35815,7 @@ var minimatch = (p, pattern, options = {}) => {
35887
35815
  }, qmarksTestNoExtDot = ([$0]) => {
35888
35816
  const len = $0.length;
35889
35817
  return (f) => f.length === len && f !== "." && f !== "..";
35890
- }, defaultPlatform, path6, sep2, GLOBSTAR, qmark2 = "[^/]", star3, twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?", twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?", filter = (pattern, options = {}) => (p) => minimatch(p, pattern, options), ext = (a, b = {}) => Object.assign({}, a, b), defaults = (def) => {
35818
+ }, defaultPlatform, path5, sep2, GLOBSTAR, qmark2 = "[^/]", star3, twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?", twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?", filter = (pattern, options = {}) => (p) => minimatch(p, pattern, options), ext = (a, b = {}) => Object.assign({}, a, b), defaults = (def) => {
35891
35819
  if (!def || typeof def !== "object" || !Object.keys(def).length) {
35892
35820
  return minimatch;
35893
35821
  }
@@ -35945,11 +35873,11 @@ var init_esm2 = __esm(() => {
35945
35873
  starRE = /^\*+$/;
35946
35874
  qmarksRE = /^\?+([^+@!?\*\[\(]*)?$/;
35947
35875
  defaultPlatform = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
35948
- path6 = {
35876
+ path5 = {
35949
35877
  win32: { sep: "\\" },
35950
35878
  posix: { sep: "/" }
35951
35879
  };
35952
- sep2 = defaultPlatform === "win32" ? path6.win32.sep : path6.posix.sep;
35880
+ sep2 = defaultPlatform === "win32" ? path5.win32.sep : path5.posix.sep;
35953
35881
  minimatch.sep = sep2;
35954
35882
  GLOBSTAR = Symbol("globstar **");
35955
35883
  minimatch.GLOBSTAR = GLOBSTAR;
@@ -38678,8 +38606,8 @@ var require_utils = __commonJS((exports) => {
38678
38606
  var result = transform[inputType][outputType](input);
38679
38607
  return result;
38680
38608
  };
38681
- exports.resolve = function(path7) {
38682
- var parts = path7.split("/");
38609
+ exports.resolve = function(path6) {
38610
+ var parts = path6.split("/");
38683
38611
  var result = [];
38684
38612
  for (var index = 0;index < parts.length; index++) {
38685
38613
  var part = parts[index];
@@ -44129,18 +44057,18 @@ var require_object = __commonJS((exports, module) => {
44129
44057
  var object = new ZipObject(name, zipObjectContent, o);
44130
44058
  this.files[name] = object;
44131
44059
  };
44132
- var parentFolder = function(path7) {
44133
- if (path7.slice(-1) === "/") {
44134
- path7 = path7.substring(0, path7.length - 1);
44060
+ var parentFolder = function(path6) {
44061
+ if (path6.slice(-1) === "/") {
44062
+ path6 = path6.substring(0, path6.length - 1);
44135
44063
  }
44136
- var lastSlash = path7.lastIndexOf("/");
44137
- return lastSlash > 0 ? path7.substring(0, lastSlash) : "";
44064
+ var lastSlash = path6.lastIndexOf("/");
44065
+ return lastSlash > 0 ? path6.substring(0, lastSlash) : "";
44138
44066
  };
44139
- var forceTrailingSlash = function(path7) {
44140
- if (path7.slice(-1) !== "/") {
44141
- path7 += "/";
44067
+ var forceTrailingSlash = function(path6) {
44068
+ if (path6.slice(-1) !== "/") {
44069
+ path6 += "/";
44142
44070
  }
44143
- return path7;
44071
+ return path6;
44144
44072
  };
44145
44073
  var folderAdd = function(name, createFolders) {
44146
44074
  createFolders = typeof createFolders !== "undefined" ? createFolders : defaults2.createFolders;
@@ -50645,8 +50573,8 @@ var require_utils2 = __commonJS((exports, module) => {
50645
50573
  }
50646
50574
  return ind;
50647
50575
  }
50648
- function removeDotSegments(path7) {
50649
- let input = path7;
50576
+ function removeDotSegments(path6) {
50577
+ let input = path6;
50650
50578
  const output = [];
50651
50579
  let nextSlash = -1;
50652
50580
  let len = 0;
@@ -50836,8 +50764,8 @@ var require_schemes = __commonJS((exports, module) => {
50836
50764
  wsComponent.secure = undefined;
50837
50765
  }
50838
50766
  if (wsComponent.resourceName) {
50839
- const [path7, query] = wsComponent.resourceName.split("?");
50840
- wsComponent.path = path7 && path7 !== "/" ? path7 : undefined;
50767
+ const [path6, query] = wsComponent.resourceName.split("?");
50768
+ wsComponent.path = path6 && path6 !== "/" ? path6 : undefined;
50841
50769
  wsComponent.query = query;
50842
50770
  wsComponent.resourceName = undefined;
50843
50771
  }
@@ -54270,13 +54198,13 @@ var require_tslib = __commonJS((exports, module) => {
54270
54198
  }
54271
54199
  return next();
54272
54200
  };
54273
- __rewriteRelativeImportExtension = function(path7, preserveJsx) {
54274
- if (typeof path7 === "string" && /^\.\.?\//.test(path7)) {
54275
- return path7.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext2, cm) {
54201
+ __rewriteRelativeImportExtension = function(path6, preserveJsx) {
54202
+ if (typeof path6 === "string" && /^\.\.?\//.test(path6)) {
54203
+ return path6.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext2, cm) {
54276
54204
  return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext2 || !cm) ? m : d + ext2 + "." + cm.toLowerCase() + "js";
54277
54205
  });
54278
54206
  }
54279
- return path7;
54207
+ return path6;
54280
54208
  };
54281
54209
  exporter("__extends", __extends2);
54282
54210
  exporter("__assign", __assign2);
@@ -57580,19 +57508,19 @@ var require_buildJsonPath = __commonJS((exports) => {
57580
57508
  var types_1 = require_types2();
57581
57509
  var utils_1 = require_utils3();
57582
57510
  function buildJsonPath(node) {
57583
- const path7 = [];
57511
+ const path6 = [];
57584
57512
  let prevNode = node;
57585
57513
  while (node) {
57586
57514
  switch (node.kind) {
57587
57515
  case types_1.Kind.SCALAR:
57588
- path7.unshift(node.value);
57516
+ path6.unshift(node.value);
57589
57517
  break;
57590
57518
  case types_1.Kind.MAPPING:
57591
57519
  if (prevNode !== node.key) {
57592
- if (path7.length > 0 && utils_1.isObject(node.value) && node.value.value === path7[0]) {
57593
- path7[0] = node.key.value;
57520
+ if (path6.length > 0 && utils_1.isObject(node.value) && node.value.value === path6[0]) {
57521
+ path6[0] = node.key.value;
57594
57522
  } else {
57595
- path7.unshift(node.key.value);
57523
+ path6.unshift(node.key.value);
57596
57524
  }
57597
57525
  }
57598
57526
  break;
@@ -57600,9 +57528,9 @@ var require_buildJsonPath = __commonJS((exports) => {
57600
57528
  if (prevNode) {
57601
57529
  const index = node.items.indexOf(prevNode);
57602
57530
  if (prevNode.kind === types_1.Kind.SCALAR) {
57603
- path7[0] = index;
57531
+ path6[0] = index;
57604
57532
  } else if (index !== -1) {
57605
- path7.unshift(index);
57533
+ path6.unshift(index);
57606
57534
  }
57607
57535
  }
57608
57536
  break;
@@ -57610,7 +57538,7 @@ var require_buildJsonPath = __commonJS((exports) => {
57610
57538
  prevNode = node;
57611
57539
  node = node.parent;
57612
57540
  }
57613
- return path7;
57541
+ return path6;
57614
57542
  }
57615
57543
  exports.buildJsonPath = buildJsonPath;
57616
57544
  });
@@ -57669,10 +57597,10 @@ var require_getJsonPathForPosition = __commonJS((exports) => {
57669
57597
  const node = findClosestScalar(ast, Math.min(lineMap[line] - 1, startOffset + character), line, lineMap);
57670
57598
  if (!utils_1.isObject(node))
57671
57599
  return;
57672
- const path7 = buildJsonPath_1.buildJsonPath(node);
57673
- if (path7.length === 0)
57600
+ const path6 = buildJsonPath_1.buildJsonPath(node);
57601
+ if (path6.length === 0)
57674
57602
  return;
57675
- return path7;
57603
+ return path6;
57676
57604
  };
57677
57605
  function* walk(node) {
57678
57606
  switch (node.kind) {
@@ -57793,8 +57721,8 @@ var require_getLocationForJsonPath = __commonJS((exports) => {
57793
57721
  var lineForPosition_1 = require_lineForPosition();
57794
57722
  var types_1 = require_types2();
57795
57723
  var utils_1 = require_utils3();
57796
- exports.getLocationForJsonPath = ({ ast, lineMap, metadata }, path7, closest = false) => {
57797
- const node = findNodeAtPath(ast, path7, { closest, mergeKeys: metadata !== undefined && metadata.mergeKeys === true });
57724
+ exports.getLocationForJsonPath = ({ ast, lineMap, metadata }, path6, closest = false) => {
57725
+ const node = findNodeAtPath(ast, path6, { closest, mergeKeys: metadata !== undefined && metadata.mergeKeys === true });
57798
57726
  if (node === undefined)
57799
57727
  return;
57800
57728
  return getLoc(lineMap, {
@@ -57845,9 +57773,9 @@ var require_getLocationForJsonPath = __commonJS((exports) => {
57845
57773
  }
57846
57774
  return node.endPosition;
57847
57775
  }
57848
- function findNodeAtPath(node, path7, { closest, mergeKeys }) {
57776
+ function findNodeAtPath(node, path6, { closest, mergeKeys }) {
57849
57777
  pathLoop:
57850
- for (const segment of path7) {
57778
+ for (const segment of path6) {
57851
57779
  if (!utils_1.isObject(node)) {
57852
57780
  return closest ? node : undefined;
57853
57781
  }
@@ -61787,14 +61715,14 @@ var require_yaml_validator = __commonJS((exports) => {
61787
61715
  email: email_json_1.default
61788
61716
  };
61789
61717
  function getValidationTargetFromFilename(filePath) {
61790
- const path7 = filePath.toLowerCase();
61791
- if (/[/\\]flow\.ya?ml$/.test(path7) || /^flow\.ya?ml$/.test(path7)) {
61718
+ const path6 = filePath.toLowerCase();
61719
+ if (/[/\\]flow\.ya?ml$/.test(path6) || /^flow\.ya?ml$/.test(path6)) {
61792
61720
  return { type: "flow" };
61793
61721
  }
61794
- if (/\.schedule\.ya?ml$/.test(path7)) {
61722
+ if (/\.schedule\.ya?ml$/.test(path6)) {
61795
61723
  return { type: "schedule" };
61796
61724
  }
61797
- const triggerMatch = path7.match(/\.(http|websocket|kafka|nats|postgres|mqtt|sqs|gcp|email)_trigger\.ya?ml$/);
61725
+ const triggerMatch = path6.match(/\.(http|websocket|kafka|nats|postgres|mqtt|sqs|gcp|email)_trigger\.ya?ml$/);
61798
61726
  if (triggerMatch) {
61799
61727
  return {
61800
61728
  type: "trigger",
@@ -61948,7 +61876,7 @@ function formatError(e) {
61948
61876
  return String(e);
61949
61877
  }
61950
61878
  }
61951
- async function applyExtraPermsDiff(workspace, kind, path7, local, remote) {
61879
+ async function applyExtraPermsDiff(workspace, kind, path6, local, remote) {
61952
61880
  if (local === undefined || local === null) {
61953
61881
  return 0;
61954
61882
  }
@@ -61976,13 +61904,13 @@ async function applyExtraPermsDiff(workspace, kind, path7, local, remote) {
61976
61904
  await addGranularAcls({
61977
61905
  workspace,
61978
61906
  kind,
61979
- path: path7,
61907
+ path: path6,
61980
61908
  requestBody: { owner, write }
61981
61909
  });
61982
- info(colors.green(` extra_perms: granted ${access} to ${owner} on ${kind}/${path7}`));
61910
+ info(colors.green(` extra_perms: granted ${access} to ${owner} on ${kind}/${path6}`));
61983
61911
  calls += 1;
61984
61912
  } catch (e) {
61985
- error(colors.red(` extra_perms: failed to grant ${access} to ${owner} on ${kind}/${path7}: ${formatError(e)}`));
61913
+ error(colors.red(` extra_perms: failed to grant ${access} to ${owner} on ${kind}/${path6}: ${formatError(e)}`));
61986
61914
  }
61987
61915
  }
61988
61916
  for (const owner of toRevoke) {
@@ -61990,13 +61918,13 @@ async function applyExtraPermsDiff(workspace, kind, path7, local, remote) {
61990
61918
  await removeGranularAcls({
61991
61919
  workspace,
61992
61920
  kind,
61993
- path: path7,
61921
+ path: path6,
61994
61922
  requestBody: { owner }
61995
61923
  });
61996
- info(colors.green(` extra_perms: revoked ${owner} on ${kind}/${path7}`));
61924
+ info(colors.green(` extra_perms: revoked ${owner} on ${kind}/${path6}`));
61997
61925
  calls += 1;
61998
61926
  } catch (e) {
61999
- error(colors.red(` extra_perms: failed to revoke ${owner} on ${kind}/${path7}: ${formatError(e)}`));
61927
+ error(colors.red(` extra_perms: failed to revoke ${owner} on ${kind}/${path6}: ${formatError(e)}`));
62000
61928
  }
62001
61929
  }
62002
61930
  return calls;
@@ -62021,20 +61949,20 @@ function getWorkspaceSpecificTypeKinds() {
62021
61949
  ...TRIGGER_TYPES.map((t) => `${t}_trigger`)
62022
61950
  ];
62023
61951
  }
62024
- function isTriggerFile(path7) {
62025
- return TRIGGER_TYPES.some((type) => path7.endsWith(`.${type}_trigger.yaml`) || path7.endsWith(`.${type}_trigger.json`));
61952
+ function isTriggerFile(path6) {
61953
+ return TRIGGER_TYPES.some((type) => path6.endsWith(`.${type}_trigger.yaml`) || path6.endsWith(`.${type}_trigger.json`));
62026
61954
  }
62027
- function isScheduleFile(path7) {
62028
- return path7.endsWith(".schedule.yaml") || path7.endsWith(".schedule.json");
61955
+ function isScheduleFile(path6) {
61956
+ return path6.endsWith(".schedule.yaml") || path6.endsWith(".schedule.json");
62029
61957
  }
62030
- function getFileTypeSuffix(path7) {
61958
+ function getFileTypeSuffix(path6) {
62031
61959
  for (const kind of getWorkspaceSpecificTypeKinds()) {
62032
- if (path7.endsWith(`.${kind}.yaml`))
61960
+ if (path6.endsWith(`.${kind}.yaml`))
62033
61961
  return `.${kind}.yaml`;
62034
- if (path7.endsWith(`.${kind}.json`))
61962
+ if (path6.endsWith(`.${kind}.json`))
62035
61963
  return `.${kind}.json`;
62036
61964
  }
62037
- const resourceFileMatch = path7.match(/(\.resource\.file\..+)$/);
61965
+ const resourceFileMatch = path6.match(/(\.resource\.file\..+)$/);
62038
61966
  if (resourceFileMatch) {
62039
61967
  return resourceFileMatch[1];
62040
61968
  }
@@ -62105,76 +62033,76 @@ function getSpecificItemsForCurrentBranch(config, workspaceNameOverride) {
62105
62033
  }
62106
62034
  return merged;
62107
62035
  }
62108
- function matchesPatterns(path7, patterns) {
62109
- return patterns.some((pattern) => minimatch(path7, pattern));
62036
+ function matchesPatterns(path6, patterns) {
62037
+ return patterns.some((pattern) => minimatch(path6, pattern));
62110
62038
  }
62111
- function normalizeJsonToYaml(path7) {
62112
- return path7.endsWith(".json") ? path7.slice(0, -".json".length) + ".yaml" : path7;
62039
+ function normalizeJsonToYaml(path6) {
62040
+ return path6.endsWith(".json") ? path6.slice(0, -".json".length) + ".yaml" : path6;
62113
62041
  }
62114
- function isItemTypeConfigured(path7, specificItems) {
62042
+ function isItemTypeConfigured(path6, specificItems) {
62115
62043
  if (!specificItems) {
62116
62044
  return false;
62117
62045
  }
62118
- path7 = normalizeJsonToYaml(path7);
62119
- if (path7.endsWith(".variable.yaml")) {
62046
+ path6 = normalizeJsonToYaml(path6);
62047
+ if (path6.endsWith(".variable.yaml")) {
62120
62048
  return specificItems.variables !== undefined;
62121
62049
  }
62122
- if (path7.endsWith(".resource.yaml")) {
62050
+ if (path6.endsWith(".resource.yaml")) {
62123
62051
  return specificItems.resources !== undefined;
62124
62052
  }
62125
- if (isTriggerFile(path7)) {
62053
+ if (isTriggerFile(path6)) {
62126
62054
  return specificItems.triggers !== undefined;
62127
62055
  }
62128
- if (isScheduleFile(path7)) {
62056
+ if (isScheduleFile(path6)) {
62129
62057
  return specificItems.schedules !== undefined;
62130
62058
  }
62131
- if (path7.endsWith("/folder.meta.yaml")) {
62059
+ if (path6.endsWith("/folder.meta.yaml")) {
62132
62060
  return specificItems.folders !== undefined;
62133
62061
  }
62134
- if (path7 === "settings.yaml") {
62062
+ if (path6 === "settings.yaml") {
62135
62063
  return specificItems.settings !== undefined;
62136
62064
  }
62137
- if (isFileResource(path7) || isFilesetResource(path7)) {
62065
+ if (isFileResource(path6) || isFilesetResource(path6)) {
62138
62066
  return specificItems.resources !== undefined;
62139
62067
  }
62140
62068
  return false;
62141
62069
  }
62142
- function isSpecificItem(path7, specificItems) {
62070
+ function isSpecificItem(path6, specificItems) {
62143
62071
  if (!specificItems) {
62144
62072
  return false;
62145
62073
  }
62146
- path7 = normalizeJsonToYaml(path7);
62147
- if (path7.endsWith(".variable.yaml")) {
62148
- return specificItems.variables ? matchesPatterns(path7, specificItems.variables) : false;
62074
+ path6 = normalizeJsonToYaml(path6);
62075
+ if (path6.endsWith(".variable.yaml")) {
62076
+ return specificItems.variables ? matchesPatterns(path6, specificItems.variables) : false;
62149
62077
  }
62150
- if (path7.endsWith(".resource.yaml")) {
62151
- return specificItems.resources ? matchesPatterns(path7, specificItems.resources) : false;
62078
+ if (path6.endsWith(".resource.yaml")) {
62079
+ return specificItems.resources ? matchesPatterns(path6, specificItems.resources) : false;
62152
62080
  }
62153
- if (isTriggerFile(path7)) {
62154
- return specificItems.triggers ? matchesPatterns(path7, specificItems.triggers) : false;
62081
+ if (isTriggerFile(path6)) {
62082
+ return specificItems.triggers ? matchesPatterns(path6, specificItems.triggers) : false;
62155
62083
  }
62156
- if (isScheduleFile(path7)) {
62157
- return specificItems.schedules ? matchesPatterns(path7, specificItems.schedules) : false;
62084
+ if (isScheduleFile(path6)) {
62085
+ return specificItems.schedules ? matchesPatterns(path6, specificItems.schedules) : false;
62158
62086
  }
62159
- if (path7.endsWith("/folder.meta.yaml")) {
62087
+ if (path6.endsWith("/folder.meta.yaml")) {
62160
62088
  if (specificItems.folders) {
62161
- const folderPath = path7.slice(0, -"/folder.meta.yaml".length);
62089
+ const folderPath = path6.slice(0, -"/folder.meta.yaml".length);
62162
62090
  return matchesPatterns(folderPath, specificItems.folders);
62163
62091
  }
62164
62092
  return false;
62165
62093
  }
62166
- if (path7 === "settings.yaml") {
62094
+ if (path6 === "settings.yaml") {
62167
62095
  return specificItems.settings === true;
62168
62096
  }
62169
- if (isFileResource(path7)) {
62170
- const basePathMatch = path7.match(/^(.+?)\.resource\.file\./);
62097
+ if (isFileResource(path6)) {
62098
+ const basePathMatch = path6.match(/^(.+?)\.resource\.file\./);
62171
62099
  if (basePathMatch && specificItems.resources) {
62172
62100
  const basePath = basePathMatch[1] + ".resource.yaml";
62173
62101
  return matchesPatterns(basePath, specificItems.resources);
62174
62102
  }
62175
62103
  }
62176
- if (isFilesetResource(path7)) {
62177
- const basePathMatch = path7.match(/^(.+?)\.fileset[/\\]/);
62104
+ if (isFilesetResource(path6)) {
62105
+ const basePathMatch = path6.match(/^(.+?)\.fileset[/\\]/);
62178
62106
  if (basePathMatch && specificItems.resources) {
62179
62107
  const basePath = basePathMatch[1] + ".resource.yaml";
62180
62108
  return matchesPatterns(basePath, specificItems.resources);
@@ -62258,7 +62186,7 @@ function getWorkspaceSpecificPath(basePath, specificItems, workspaceNameOverride
62258
62186
  }
62259
62187
  return;
62260
62188
  }
62261
- function isCurrentWorkspaceFile(path7, workspaceNameOverride) {
62189
+ function isCurrentWorkspaceFile(path6, workspaceNameOverride) {
62262
62190
  let currentWorkspace = null;
62263
62191
  if (workspaceNameOverride) {
62264
62192
  currentWorkspace = workspaceNameOverride;
@@ -62275,11 +62203,11 @@ function isCurrentWorkspaceFile(path7, workspaceNameOverride) {
62275
62203
  pattern = new RegExp(`\\.${escapedName}\\.${buildItemTypePattern()}\\.(yaml|json)$|` + `\\.${escapedName}\\.resource\\.file\\..+$|` + `/folder\\.${escapedName}\\.meta\\.(yaml|json)$|` + `^settings\\.${escapedName}\\.(yaml|json)$`);
62276
62204
  workspacePatternCache.set(currentWorkspace, pattern);
62277
62205
  }
62278
- return pattern.test(path7);
62206
+ return pattern.test(path6);
62279
62207
  }
62280
- function isWorkspaceSpecificFile(path7) {
62208
+ function isWorkspaceSpecificFile(path6) {
62281
62209
  const typePattern = buildItemTypePattern();
62282
- return new RegExp(`\\.[^.]+\\.${typePattern}\\.(yaml|json)$|` + `\\.[^.]+\\.resource\\.file\\..+$|` + `/folder\\.[^.]+\\.meta\\.(yaml|json)$|` + `^settings\\.[^.]+\\.(yaml|json)$`).test(path7);
62210
+ return new RegExp(`\\.[^.]+\\.${typePattern}\\.(yaml|json)$|` + `\\.[^.]+\\.resource\\.file\\..+$|` + `/folder\\.[^.]+\\.meta\\.(yaml|json)$|` + `^settings\\.[^.]+\\.(yaml|json)$`).test(path6);
62283
62211
  }
62284
62212
  var workspacePatternCache;
62285
62213
  var init_specific_items = __esm(async () => {
@@ -62320,22 +62248,22 @@ __export(exports_dependency_tree, {
62320
62248
  async function uploadScripts(tree, workspace) {
62321
62249
  const scriptHashes = {};
62322
62250
  const workspaceDeps = [];
62323
- for (const path7 of tree.allPaths()) {
62324
- const content = tree.getContent(path7);
62325
- const itemType = tree.getItemType(path7);
62251
+ for (const path6 of tree.allPaths()) {
62252
+ const content = tree.getContent(path6);
62253
+ const itemType = tree.getItemType(path6);
62326
62254
  if (itemType === "dependencies") {
62327
62255
  if (content === undefined)
62328
62256
  continue;
62329
- const info2 = workspaceDependenciesPathToLanguageAndFilename(path7);
62257
+ const info2 = workspaceDependenciesPathToLanguageAndFilename(path6);
62330
62258
  if (info2) {
62331
62259
  const hash2 = await generateHash(content);
62332
- workspaceDeps.push({ path: path7, language: info2.language, name: info2.name, hash: hash2 });
62260
+ workspaceDeps.push({ path: path6, language: info2.language, name: info2.name, hash: hash2 });
62333
62261
  }
62334
62262
  } else if (itemType === "script") {
62335
62263
  if (!content)
62336
62264
  continue;
62337
62265
  const hash2 = await generateHash(content);
62338
- scriptHashes[path7] = hash2;
62266
+ scriptHashes[path6] = hash2;
62339
62267
  }
62340
62268
  }
62341
62269
  if (Object.keys(scriptHashes).length === 0 && workspaceDeps.length === 0)
@@ -62347,19 +62275,19 @@ async function uploadScripts(tree, workspace) {
62347
62275
  workspace_deps: workspaceDeps
62348
62276
  }
62349
62277
  });
62350
- for (const path7 of mismatched) {
62351
- const content = tree.getContent(path7);
62352
- const itemType = tree.getItemType(path7);
62278
+ for (const path6 of mismatched) {
62279
+ const content = tree.getContent(path6);
62280
+ const itemType = tree.getItemType(path6);
62353
62281
  if (itemType === "dependencies") {
62354
62282
  if (content !== undefined) {
62355
- tree.setContentHash(path7, "mismatched");
62283
+ tree.setContentHash(path6, "mismatched");
62356
62284
  }
62357
62285
  } else if (content) {
62358
62286
  const hash2 = await storeRawScriptTemp({
62359
62287
  workspace: workspace.workspaceId,
62360
62288
  requestBody: content
62361
62289
  });
62362
- tree.setContentHash(path7, hash2);
62290
+ tree.setContentHash(path6, hash2);
62363
62291
  }
62364
62292
  }
62365
62293
  }
@@ -62370,12 +62298,12 @@ class DoubleLinkedDependencyTree {
62370
62298
  setWorkspaceDeps(deps) {
62371
62299
  this.workspaceDeps = deps;
62372
62300
  }
62373
- async addNode(path7, content, language, metadata, imports, itemType, folder, originalPath, isDirectlyStale, isRawApp) {
62301
+ async addNode(path6, content, language, metadata, imports, itemType, folder, originalPath, isDirectlyStale, isRawApp) {
62374
62302
  const hasWorkspaceDeps = itemType === "script" || itemType === "inline_script";
62375
62303
  const filteredDeps = hasWorkspaceDeps ? filterWorkspaceDependencies(this.workspaceDeps, content, language) : {};
62376
62304
  const stalenessHash = await generateScriptHash({}, content, metadata);
62377
- if (!this.nodes.has(path7)) {
62378
- this.nodes.set(path7, {
62305
+ if (!this.nodes.has(path6)) {
62306
+ this.nodes.set(path6, {
62379
62307
  content: "",
62380
62308
  stalenessHash: "",
62381
62309
  language: "deno",
@@ -62388,7 +62316,7 @@ class DoubleLinkedDependencyTree {
62388
62316
  isDirectlyStale: false
62389
62317
  });
62390
62318
  }
62391
- const node = this.nodes.get(path7);
62319
+ const node = this.nodes.get(path6);
62392
62320
  node.content = content;
62393
62321
  node.stalenessHash = stalenessHash;
62394
62322
  node.language = language;
@@ -62435,59 +62363,59 @@ class DoubleLinkedDependencyTree {
62435
62363
  isDirectlyStale: false
62436
62364
  });
62437
62365
  }
62438
- this.nodes.get(importPath).importedBy.add(path7);
62366
+ this.nodes.get(importPath).importedBy.add(path6);
62439
62367
  }
62440
62368
  }
62441
- getContent(path7) {
62442
- return this.nodes.get(path7)?.content;
62369
+ getContent(path6) {
62370
+ return this.nodes.get(path6)?.content;
62443
62371
  }
62444
- getStalenessHash(path7) {
62445
- return this.nodes.get(path7)?.stalenessHash;
62372
+ getStalenessHash(path6) {
62373
+ return this.nodes.get(path6)?.stalenessHash;
62446
62374
  }
62447
- getContentHash(path7) {
62448
- return this.nodes.get(path7)?.contentHash;
62375
+ getContentHash(path6) {
62376
+ return this.nodes.get(path6)?.contentHash;
62449
62377
  }
62450
- setContentHash(path7, hash2) {
62451
- const node = this.nodes.get(path7);
62378
+ setContentHash(path6, hash2) {
62379
+ const node = this.nodes.get(path6);
62452
62380
  if (node) {
62453
62381
  node.contentHash = hash2;
62454
62382
  }
62455
62383
  }
62456
- getLanguage(path7) {
62457
- return this.nodes.get(path7)?.language;
62384
+ getLanguage(path6) {
62385
+ return this.nodes.get(path6)?.language;
62458
62386
  }
62459
- getMetadata(path7) {
62460
- return this.nodes.get(path7)?.metadata;
62387
+ getMetadata(path6) {
62388
+ return this.nodes.get(path6)?.metadata;
62461
62389
  }
62462
- getStaleReason(path7) {
62463
- return this.nodes.get(path7)?.staleReason;
62390
+ getStaleReason(path6) {
62391
+ return this.nodes.get(path6)?.staleReason;
62464
62392
  }
62465
- getItemType(path7) {
62466
- return this.nodes.get(path7)?.itemType;
62393
+ getItemType(path6) {
62394
+ return this.nodes.get(path6)?.itemType;
62467
62395
  }
62468
- getFolder(path7) {
62469
- return this.nodes.get(path7)?.folder;
62396
+ getFolder(path6) {
62397
+ return this.nodes.get(path6)?.folder;
62470
62398
  }
62471
- getIsRawApp(path7) {
62472
- return this.nodes.get(path7)?.isRawApp;
62399
+ getIsRawApp(path6) {
62400
+ return this.nodes.get(path6)?.isRawApp;
62473
62401
  }
62474
- getIsDirectlyStale(path7) {
62475
- return this.nodes.get(path7)?.isDirectlyStale ?? false;
62402
+ getIsDirectlyStale(path6) {
62403
+ return this.nodes.get(path6)?.isDirectlyStale ?? false;
62476
62404
  }
62477
- getOriginalPath(path7) {
62478
- return this.nodes.get(path7)?.originalPath;
62405
+ getOriginalPath(path6) {
62406
+ return this.nodes.get(path6)?.originalPath;
62479
62407
  }
62480
- getImports(path7) {
62481
- return this.nodes.get(path7)?.imports;
62408
+ getImports(path6) {
62409
+ return this.nodes.get(path6)?.imports;
62482
62410
  }
62483
- isStale(path7) {
62484
- return this.nodes.get(path7)?.staleReason !== undefined;
62411
+ isStale(path6) {
62412
+ return this.nodes.get(path6)?.staleReason !== undefined;
62485
62413
  }
62486
62414
  propagateStaleness() {
62487
62415
  const directlyStale = new Set;
62488
- for (const [path7, node] of this.nodes.entries()) {
62416
+ for (const [path6, node] of this.nodes.entries()) {
62489
62417
  if (node.isDirectlyStale) {
62490
- directlyStale.add(path7);
62418
+ directlyStale.add(path6);
62491
62419
  node.staleReason = "content changed";
62492
62420
  }
62493
62421
  }
@@ -62539,20 +62467,20 @@ class DoubleLinkedDependencyTree {
62539
62467
  return this.nodes.keys();
62540
62468
  }
62541
62469
  *stalePaths() {
62542
- for (const [path7, node] of this.nodes.entries()) {
62470
+ for (const [path6, node] of this.nodes.entries()) {
62543
62471
  if (node.staleReason) {
62544
- yield path7;
62472
+ yield path6;
62545
62473
  }
62546
62474
  }
62547
62475
  }
62548
- has(path7) {
62549
- return this.nodes.has(path7);
62476
+ has(path6) {
62477
+ return this.nodes.has(path6);
62550
62478
  }
62551
62479
  getMismatchedWorkspaceDeps() {
62552
62480
  const result = {};
62553
- for (const [path7, node] of this.nodes.entries()) {
62481
+ for (const [path6, node] of this.nodes.entries()) {
62554
62482
  if (node.itemType === "dependencies" && node.contentHash && node.content !== undefined) {
62555
- result[path7] = node.content;
62483
+ result[path6] = node.content;
62556
62484
  }
62557
62485
  }
62558
62486
  return result;
@@ -62567,11 +62495,11 @@ class DoubleLinkedDependencyTree {
62567
62495
  return result;
62568
62496
  }
62569
62497
  async persistDepsHashes(depsPaths) {
62570
- for (const path7 of depsPaths) {
62571
- const node = this.nodes.get(path7);
62498
+ for (const path6 of depsPaths) {
62499
+ const node = this.nodes.get(path6);
62572
62500
  if (node?.itemType === "dependencies" && node.content !== undefined) {
62573
- const hash2 = await generateHash(node.content + path7);
62574
- await updateMetadataGlobalLock(path7, hash2);
62501
+ const hash2 = await generateHash(node.content + path6);
62502
+ await updateMetadataGlobalLock(path6, hash2);
62575
62503
  }
62576
62504
  }
62577
62505
  }
@@ -62749,15 +62677,15 @@ var init_path_assigner = __esm(() => {
62749
62677
  function extractRawscriptInline(id, summary, rawscript, mapping, separator, assigner, failOnInlineDirective) {
62750
62678
  const [basePath, ext2] = assigner.assignPath(summary ?? id, rawscript.language);
62751
62679
  const mappedPath = mapping[id];
62752
- const path7 = mappedPath ?? basePath + ext2;
62680
+ const path6 = mappedPath ?? basePath + ext2;
62753
62681
  const language = rawscript.language;
62754
62682
  const content = rawscript.content;
62755
62683
  if (failOnInlineDirective && typeof content === "string" && content.startsWith("!inline ")) {
62756
62684
  throw new Error(`Refusing to extract corrupted inline script for module '${id}': ` + `rawscript.content is the literal string \`${content.split(`
62757
62685
  `)[0]}\` ` + `instead of script source. The backend's flow_version.value is corrupt — ` + `re-push from a known-good local copy to repair it.`);
62758
62686
  }
62759
- const r = [{ path: path7, content, language, is_lock: false }];
62760
- rawscript.content = "!inline " + path7.replaceAll(separator, "/");
62687
+ const r = [{ path: path6, content, language, is_lock: false }];
62688
+ rawscript.content = "!inline " + path6.replaceAll(separator, "/");
62761
62689
  const lock = rawscript.lock;
62762
62690
  if (lock && lock != "") {
62763
62691
  const dotIdx = mappedPath ? mappedPath.lastIndexOf(".") : -1;
@@ -62844,23 +62772,23 @@ async function replaceRawscriptInline(id, rawscript, fileReader, logger, separat
62844
62772
  if (!rawscript.content || !rawscript.content.startsWith("!inline")) {
62845
62773
  return;
62846
62774
  }
62847
- const path7 = rawscript.content.split(" ")[1];
62848
- const pathSuffix = path7.split(".").slice(1).join(".");
62775
+ const path6 = rawscript.content.split(" ")[1];
62776
+ const pathSuffix = path6.split(".").slice(1).join(".");
62849
62777
  const newPath = id + "." + pathSuffix;
62850
62778
  try {
62851
- rawscript.content = await fileReader(path7);
62779
+ rawscript.content = await fileReader(path6);
62852
62780
  } catch {
62853
- logger.error(`Script file ${path7} not found`);
62781
+ logger.error(`Script file ${path6} not found`);
62854
62782
  try {
62855
62783
  rawscript.content = await fileReader(newPath);
62856
62784
  } catch {
62857
62785
  logger.error(`Script file ${newPath} not found`);
62858
62786
  if (missingFiles)
62859
- missingFiles.push(path7);
62787
+ missingFiles.push(path6);
62860
62788
  }
62861
62789
  }
62862
62790
  const lock = rawscript.lock;
62863
- if (removeLocks && removeLocks.includes(path7)) {
62791
+ if (removeLocks && removeLocks.includes(path6)) {
62864
62792
  rawscript.lock = undefined;
62865
62793
  } else if (lock && typeof lock === "string" && lock.trimStart().startsWith("!inline ")) {
62866
62794
  const lockPath = lock.split(" ")[1];
@@ -63016,7 +62944,7 @@ function collectPathScriptPaths(flowValue) {
63016
62944
  }
63017
62945
 
63018
62946
  // src/commands/flow/flow_metadata.ts
63019
- import * as path7 from "node:path";
62947
+ import * as path6 from "node:path";
63020
62948
  import { sep as SEP4 } from "node:path";
63021
62949
  async function isFlowDirectlyStale(folder, hashes, conf) {
63022
62950
  if (await checkifMetadataUptodate(folder, hashes[TOP_HASH], conf, TOP_HASH)) {
@@ -63032,7 +62960,7 @@ async function isFlowDirectlyStale(folder, hashes, conf) {
63032
62960
  return false;
63033
62961
  }
63034
62962
  async function generateFlowHash(rawWorkspaceDependencies, folder, defaultTs) {
63035
- const elems = await FSFSElement(path7.join(process.cwd(), folder), [], true);
62963
+ const elems = await FSFSElement(path6.join(process.cwd(), folder), [], true);
63036
62964
  const hashes = {};
63037
62965
  for await (const f of elems.getChildren()) {
63038
62966
  if (exts.some((e) => f.path.endsWith(e))) {
@@ -63080,7 +63008,7 @@ async function generateFlowLockInternal(folder, dryRun, workspace, opts, justUpd
63080
63008
  continue;
63081
63009
  }
63082
63010
  }
63083
- const treePath = folderNormalized + "/" + path7.basename(script.path, path7.extname(script.path));
63011
+ const treePath = folderNormalized + "/" + path6.basename(script.path, path6.extname(script.path));
63084
63012
  const language = script.language;
63085
63013
  const imports = await extractRelativeImports(content, treePath, language);
63086
63014
  await tree.addNode(treePath, content, language, "", imports, "inline_script", folderNormalized, folder, false);
@@ -63115,29 +63043,29 @@ async function generateFlowLockInternal(folder, dryRun, workspace, opts, justUpd
63115
63043
  const c = script.content;
63116
63044
  if (c.startsWith("!inline ")) {
63117
63045
  const fileName = c.replace("!inline ", "");
63118
- const treePath = folderNormalized + "/" + path7.basename(script.path, path7.extname(script.path));
63046
+ const treePath = folderNormalized + "/" + path6.basename(script.path, path6.extname(script.path));
63119
63047
  fileToTreePath.set(fileName, treePath);
63120
63048
  }
63121
63049
  }
63122
63050
  if (!justUpdateMetadataLock) {
63123
63051
  const hashes = await generateFlowHash(filteredDeps, folder, opts.defaultTs);
63124
- for (const [path8, hash2] of Object.entries(hashes)) {
63125
- if (path8 == TOP_HASH) {
63052
+ for (const [path7, hash2] of Object.entries(hashes)) {
63053
+ if (path7 == TOP_HASH) {
63126
63054
  continue;
63127
63055
  }
63128
- if (!await checkifMetadataUptodate(folder, hash2, conf, path8)) {
63129
- changedScripts.push(path8);
63056
+ if (!await checkifMetadataUptodate(folder, hash2, conf, path7)) {
63057
+ changedScripts.push(path7);
63130
63058
  }
63131
63059
  }
63132
63060
  if (!noStaleMessage) {
63133
63061
  info(`Recomputing locks of ${changedScripts.join(", ")} in ${folder}`);
63134
63062
  }
63135
- const fileReader = async (path8) => await readTextFile(folder + SEP4 + path8);
63063
+ const fileReader = async (path7) => await readTextFile(folder + SEP4 + path7);
63136
63064
  const currentMapping = extractCurrentMapping(flowValue.value.modules, {}, flowValue.value.failure_module, flowValue.value.preprocessor_module);
63137
63065
  const locksToRemove = tree ? Object.keys(hashes).filter((k) => {
63138
63066
  if (k === TOP_HASH)
63139
63067
  return false;
63140
- const treePath = fileToTreePath.get(k) ?? folderNormalized + "/" + path7.basename(k, path7.extname(k));
63068
+ const treePath = fileToTreePath.get(k) ?? folderNormalized + "/" + path6.basename(k, path6.extname(k));
63141
63069
  return tree.isStale(treePath);
63142
63070
  }) : changedScripts;
63143
63071
  const missingFiles = [];
@@ -63178,8 +63106,8 @@ async function generateFlowLockInternal(folder, dryRun, workspace, opts, justUpd
63178
63106
  const depsForHash = tree ? {} : filteredDeps;
63179
63107
  const finalHashes = await generateFlowHash(depsForHash, folder, opts.defaultTs);
63180
63108
  await clearGlobalLock(folder);
63181
- for (const [path8, hash2] of Object.entries(finalHashes)) {
63182
- await updateMetadataGlobalLock(folder, hash2, path8);
63109
+ for (const [path7, hash2] of Object.entries(finalHashes)) {
63110
+ await updateMetadataGlobalLock(folder, hash2, path7);
63183
63111
  }
63184
63112
  if (!noStaleMessage) {
63185
63113
  info(colors.green(`Flow ${remote_path} lockfiles updated`));
@@ -63187,7 +63115,7 @@ async function generateFlowLockInternal(folder, dryRun, workspace, opts, justUpd
63187
63115
  const relocked = tree ? Object.keys(finalHashes).filter((k) => {
63188
63116
  if (k === TOP_HASH)
63189
63117
  return false;
63190
- const treePath = fileToTreePath.get(k) ?? folderNormalized + "/" + path7.basename(k, path7.extname(k));
63118
+ const treePath = fileToTreePath.get(k) ?? folderNormalized + "/" + path6.basename(k, path6.extname(k));
63191
63119
  return tree.isStale(treePath);
63192
63120
  }) : changedScripts;
63193
63121
  const updatedScripts = relocked.map((p) => {
@@ -63711,8 +63639,8 @@ async function generateMetadata(opts, folder) {
63711
63639
  info("");
63712
63640
  if (errors.length > 0) {
63713
63641
  info(`Done. Updated ${colors.bold(String(succeeded))}/${total} item(s). ${colors.red(String(errors.length) + " failed")}:`);
63714
- for (const { path: path8, error: error2 } of errors) {
63715
- error(` ${path8}: ${error2}`);
63642
+ for (const { path: path7, error: error2 } of errors) {
63643
+ error(` ${path7}: ${error2}`);
63716
63644
  }
63717
63645
  process.exitCode = 1;
63718
63646
  } else {
@@ -63756,12 +63684,9 @@ var init_generate_metadata = __esm(async () => {
63756
63684
  import { writeFile as writeFile5, stat as stat4, mkdir as mkdir3 } from "node:fs/promises";
63757
63685
  import { Buffer as Buffer4 } from "node:buffer";
63758
63686
  import { sep as SEP6 } from "node:path";
63759
- import * as path8 from "node:path";
63687
+ import * as path7 from "node:path";
63760
63688
  import fs8 from "node:fs";
63761
- import { execSync as execSync5 } from "node:child_process";
63762
- function isRawAppBackendPath2(filePath) {
63763
- return isRawAppBackendPath(filePath);
63764
- }
63689
+ import { execSync as execSync4 } from "node:child_process";
63765
63690
  function isAppInlineScriptPath2(filePath) {
63766
63691
  return isAppInlineScriptPath(filePath);
63767
63692
  }
@@ -63805,8 +63730,8 @@ async function push2(opts, filePath) {
63805
63730
  await handleFile(filePath, workspace, [], opts.message, opts, await getRawWorkspaceDependencies(true), codebases);
63806
63731
  info(colors.bold.underline.green(`Script ${filePath} pushed`));
63807
63732
  }
63808
- async function findResourceFile(path9) {
63809
- const splitPath = path9.split(".");
63733
+ async function findResourceFile(path8) {
63734
+ const splitPath = path8.split(".");
63810
63735
  let contentBasePathJSON = splitPath[0] + "." + splitPath[1] + ".json";
63811
63736
  let contentBasePathYAML = splitPath[0] + "." + splitPath[1] + ".yaml";
63812
63737
  const currentBranch = getCurrentGitBranch();
@@ -63828,48 +63753,48 @@ async function findResourceFile(path9) {
63828
63753
  throw new Error("Found two resource files for the same resource" + validCandidates.join(", "));
63829
63754
  }
63830
63755
  if (validCandidates.length < 1) {
63831
- throw new Error(`No resource matching file resource: ${path9}.`);
63756
+ throw new Error(`No resource matching file resource: ${path8}.`);
63832
63757
  }
63833
63758
  return validCandidates[0];
63834
63759
  }
63835
- async function handleScriptMetadata(path9, workspace, alreadySynced, message, rawWorkspaceDependencies, codebases, opts, permissionedAsContext) {
63836
- const isFlatMeta = path9.endsWith(".script.json") || path9.endsWith(".script.yaml") || path9.endsWith(".script.lock");
63837
- const isFolderMeta = !isFlatMeta && isScriptModulePath(path9) && (path9.endsWith("/script.yaml") || path9.endsWith("/script.json") || path9.endsWith("/script.lock"));
63760
+ async function handleScriptMetadata(path8, workspace, alreadySynced, message, rawWorkspaceDependencies, codebases, opts, permissionedAsContext) {
63761
+ const isFlatMeta = path8.endsWith(".script.json") || path8.endsWith(".script.yaml") || path8.endsWith(".script.lock");
63762
+ const isFolderMeta = !isFlatMeta && isScriptModulePath(path8) && (path8.endsWith("/script.yaml") || path8.endsWith("/script.json") || path8.endsWith("/script.lock"));
63838
63763
  if (isFlatMeta || isFolderMeta) {
63839
- const contentPath = await findContentFile(path9);
63764
+ const contentPath = await findContentFile(path8);
63840
63765
  return handleFile(contentPath, workspace, alreadySynced, message, opts, rawWorkspaceDependencies, codebases, permissionedAsContext);
63841
63766
  } else {
63842
63767
  return false;
63843
63768
  }
63844
63769
  }
63845
- async function handleFile(path9, workspace, alreadySynced, message, opts, rawWorkspaceDependencies, codebases, permissionedAsContext) {
63846
- const moduleEntryPoint = isModuleEntryPoint(path9);
63847
- if (!isAppInlineScriptPath2(path9) && !isFlowInlineScriptPath2(path9) && !isRawAppBackendPath2(path9) && (!isScriptModulePath(path9) || moduleEntryPoint) && exts.some((exts2) => path9.endsWith(exts2))) {
63848
- if (alreadySynced.includes(path9)) {
63770
+ async function handleFile(path8, workspace, alreadySynced, message, opts, rawWorkspaceDependencies, codebases, permissionedAsContext) {
63771
+ const moduleEntryPoint = isModuleEntryPoint(path8);
63772
+ if (!isAppInlineScriptPath2(path8) && !isFlowInlineScriptPath2(path8) && !isRawAppPath(path8) && (!isScriptModulePath(path8) || moduleEntryPoint) && exts.some((exts2) => path8.endsWith(exts2))) {
63773
+ if (alreadySynced.includes(path8)) {
63849
63774
  return true;
63850
63775
  }
63851
- debug(`Processing local script ${path9}`);
63852
- alreadySynced.push(path9);
63853
- const remotePath = scriptPathToRemotePath(path9);
63854
- const language = inferContentTypeFromFilePath(path9, opts?.defaultTs);
63855
- const codebase = language == "bun" ? findCodebase(path9, codebases) : undefined;
63776
+ debug(`Processing local script ${path8}`);
63777
+ alreadySynced.push(path8);
63778
+ const remotePath = scriptPathToRemotePath(path8);
63779
+ const language = inferContentTypeFromFilePath(path8, opts?.defaultTs);
63780
+ const codebase = language == "bun" ? findCodebase(path8, codebases) : undefined;
63856
63781
  let bundleContent = undefined;
63857
63782
  let forceTar = false;
63858
63783
  if (codebase) {
63859
63784
  let outputFiles = [];
63860
63785
  if (codebase.customBundler) {
63861
- info(`Using custom bundler ${codebase.customBundler} for ${path9}`);
63862
- bundleContent = execSync5(codebase.customBundler + " " + path9, {
63786
+ info(`Using custom bundler ${codebase.customBundler} for ${path8}`);
63787
+ bundleContent = execSync4(codebase.customBundler + " " + path8, {
63863
63788
  maxBuffer: 1024 * 1024 * 50
63864
63789
  }).toString();
63865
- info("Custom bundler executed for " + path9);
63790
+ info("Custom bundler executed for " + path8);
63866
63791
  } else {
63867
63792
  const esbuild = await import("esbuild");
63868
- info(`Started bundling ${path9} ...`);
63793
+ info(`Started bundling ${path8} ...`);
63869
63794
  const startTime = performance.now();
63870
63795
  const format6 = codebase.format ?? "cjs";
63871
63796
  const out = await esbuild.build({
63872
- entryPoints: [path9],
63797
+ entryPoints: [path8],
63873
63798
  format: format6,
63874
63799
  bundle: true,
63875
63800
  write: false,
@@ -63887,15 +63812,15 @@ async function handleFile(path9, workspace, alreadySynced, message, opts, rawWor
63887
63812
  bundleContent = out.outputFiles[0].text;
63888
63813
  outputFiles = out.outputFiles ?? [];
63889
63814
  if (outputFiles.length == 0) {
63890
- throw new Error(`No output files found for ${path9}`);
63815
+ throw new Error(`No output files found for ${path8}`);
63891
63816
  }
63892
- info(`Finished bundling ${path9}: ${(bundleContent.length / 1024).toFixed(0)}kB (${(endTime - startTime).toFixed(0)}ms)`);
63817
+ info(`Finished bundling ${path8}: ${(bundleContent.length / 1024).toFixed(0)}kB (${(endTime - startTime).toFixed(0)}ms)`);
63893
63818
  }
63894
63819
  if (outputFiles.length > 1) {
63895
- info(`Found multiple output files for ${path9}, creating a tarball... ${outputFiles.map((file) => file.path).join(", ")}`);
63820
+ info(`Found multiple output files for ${path8}, creating a tarball... ${outputFiles.map((file) => file.path).join(", ")}`);
63896
63821
  forceTar = true;
63897
63822
  const startTime = performance.now();
63898
- const mainPath = path9.split(SEP6).pop()?.split(".")[0] + ".js";
63823
+ const mainPath = path8.split(SEP6).pop()?.split(".")[0] + ".js";
63899
63824
  const mainContent = outputFiles.find((file) => file.path == "/" + mainPath)?.text ?? "";
63900
63825
  info(`Main content: ${mainContent.length}chars`);
63901
63826
  const entries = [
@@ -63910,10 +63835,10 @@ async function handleFile(path9, workspace, alreadySynced, message, opts, rawWor
63910
63835
  }
63911
63836
  bundleContent = await createTarBlob(entries);
63912
63837
  const endTime = performance.now();
63913
- info(`Finished creating tarball for ${path9}: ${(bundleContent.size / 1024).toFixed(0)}kB (${(endTime - startTime).toFixed(0)}ms)`);
63838
+ info(`Finished creating tarball for ${path8}: ${(bundleContent.size / 1024).toFixed(0)}kB (${(endTime - startTime).toFixed(0)}ms)`);
63914
63839
  } else {
63915
63840
  if (Array.isArray(codebase.assets) && codebase.assets.length > 0) {
63916
- info(`Using the following asset configuration for ${path9}: ${JSON.stringify(codebase.assets)}`);
63841
+ info(`Using the following asset configuration for ${path8}: ${JSON.stringify(codebase.assets)}`);
63917
63842
  const startTime = performance.now();
63918
63843
  const entries = [
63919
63844
  { name: "main.js", content: bundleContent }
@@ -63924,13 +63849,13 @@ async function handleFile(path9, workspace, alreadySynced, message, opts, rawWor
63924
63849
  }
63925
63850
  bundleContent = await createTarBlob(entries);
63926
63851
  const endTime = performance.now();
63927
- info(`Finished creating tarball for ${path9}: ${(bundleContent.size / 1024).toFixed(0)}kB (${(endTime - startTime).toFixed(0)}ms)`);
63852
+ info(`Finished creating tarball for ${path8}: ${(bundleContent.size / 1024).toFixed(0)}kB (${(endTime - startTime).toFixed(0)}ms)`);
63928
63853
  }
63929
63854
  }
63930
63855
  }
63931
63856
  let typed = opts?.skipScriptsMetadata ? undefined : (await parseMetadataFile(remotePath, opts ? {
63932
63857
  ...opts,
63933
- path: path9,
63858
+ path: path8,
63934
63859
  workspaceRemote: workspace,
63935
63860
  schemaOnly: codebase ? true : undefined,
63936
63861
  rawWorkspaceDependencies,
@@ -63947,14 +63872,14 @@ async function handleFile(path9, workspace, alreadySynced, message, opts, rawWor
63947
63872
  } catch {
63948
63873
  debug(`Script ${remotePath} does not exist on remote`);
63949
63874
  }
63950
- const content = await readTextFile(path9);
63875
+ const content = await readTextFile(path8);
63951
63876
  if (opts?.skipScriptsMetadata) {
63952
63877
  typed = structuredClone(remote);
63953
63878
  }
63954
63879
  if (typed && codebase) {
63955
63880
  typed.codebase = await codebase.getDigest(forceTar);
63956
63881
  }
63957
- const scriptBasePath = moduleEntryPoint ? getScriptBasePathFromModulePath(path9) : path9.substring(0, path9.indexOf("."));
63882
+ const scriptBasePath = moduleEntryPoint ? getScriptBasePathFromModulePath(path8) : path8.substring(0, path8.indexOf("."));
63958
63883
  const moduleFolderPath = scriptBasePath + getModuleFolderSuffix();
63959
63884
  const modules = await readModulesFromDisk(moduleFolderPath, opts?.defaultTs, moduleEntryPoint);
63960
63885
  const requestBodyCommon = {
@@ -64040,7 +63965,7 @@ async function readModulesFromDisk(moduleFolderPath, defaultTs, folderLayout = f
64040
63965
  function readDir2(dirPath, relPrefix) {
64041
63966
  const entries = fs8.readdirSync(dirPath, { withFileTypes: true });
64042
63967
  for (const entry of entries) {
64043
- const fullPath = path8.join(dirPath, entry.name);
63968
+ const fullPath = path7.join(dirPath, entry.name);
64044
63969
  const relPath = relPrefix ? relPrefix + "/" + entry.name : entry.name;
64045
63970
  const isTopLevel = relPrefix === "";
64046
63971
  if (entry.isDirectory()) {
@@ -64050,7 +63975,7 @@ async function readModulesFromDisk(moduleFolderPath, defaultTs, folderLayout = f
64050
63975
  const content = readTextFileSync(fullPath);
64051
63976
  const language = inferContentTypeFromFilePath(entry.name, defaultTs);
64052
63977
  const baseName = entry.name.replace(/\.[^.]+$/, "");
64053
- const lockPath = path8.join(dirPath, baseName + ".lock");
63978
+ const lockPath = path7.join(dirPath, baseName + ".lock");
64054
63979
  let lock;
64055
63980
  if (fs8.existsSync(lockPath)) {
64056
63981
  lock = readTextFileSync(lockPath);
@@ -64192,13 +64117,13 @@ function filePathExtensionFromContentType(language, defaultTs) {
64192
64117
  throw new Error("Invalid language: " + language);
64193
64118
  }
64194
64119
  }
64195
- function removeExtensionToPath(path9) {
64120
+ function removeExtensionToPath(path8) {
64196
64121
  for (const ext2 of exts) {
64197
- if (path9.endsWith(ext2)) {
64198
- return path9.substring(0, path9.length - ext2.length);
64122
+ if (path8.endsWith(ext2)) {
64123
+ return path8.substring(0, path8.length - ext2.length);
64199
64124
  }
64200
64125
  }
64201
- throw new Error("Invalid extension: " + path9);
64126
+ throw new Error("Invalid extension: " + path8);
64202
64127
  }
64203
64128
  async function list4(opts) {
64204
64129
  if (opts.json)
@@ -64249,7 +64174,7 @@ async function resolve6(input) {
64249
64174
  throw e;
64250
64175
  }
64251
64176
  }
64252
- async function run2(opts, path9) {
64177
+ async function run2(opts, path8) {
64253
64178
  if (opts.silent) {
64254
64179
  setSilent(true);
64255
64180
  }
@@ -64260,7 +64185,7 @@ async function run2(opts, path9) {
64260
64185
  try {
64261
64186
  const script = await getScriptByPath({
64262
64187
  workspace: workspace.workspaceId,
64263
- path: path9
64188
+ path: path8
64264
64189
  });
64265
64190
  validateRequiredArgs(script.schema);
64266
64191
  } catch (e) {
@@ -64273,7 +64198,7 @@ async function run2(opts, path9) {
64273
64198
  try {
64274
64199
  id = await runScriptByPath({
64275
64200
  workspace: workspace.workspaceId,
64276
- path: path9,
64201
+ path: path8,
64277
64202
  requestBody: input
64278
64203
  });
64279
64204
  } catch (e) {
@@ -64281,10 +64206,10 @@ async function run2(opts, path9) {
64281
64206
  try {
64282
64207
  const script = await getScriptByPath({
64283
64208
  workspace: workspace.workspaceId,
64284
- path: path9
64209
+ path: path8
64285
64210
  });
64286
64211
  if (script.lock_error_logs) {
64287
- throw new Error(`Script '${path9}' has a deployment error and cannot be run:
64212
+ throw new Error(`Script '${path8}' has a deployment error and cannot be run:
64288
64213
  ${script.lock_error_logs}`);
64289
64214
  }
64290
64215
  } catch (lookupErr) {
@@ -64293,7 +64218,7 @@ ${script.lock_error_logs}`);
64293
64218
  if (lookupErr?.status && lookupErr.status !== 404)
64294
64219
  throw lookupErr;
64295
64220
  }
64296
- throw new Error(`Script '${path9}' not found. Run 'wmill script list' to see available scripts.`);
64221
+ throw new Error(`Script '${path8}' not found. Run 'wmill script list' to see available scripts.`);
64297
64222
  }
64298
64223
  throw e;
64299
64224
  }
@@ -64399,12 +64324,12 @@ async function track_job(workspace, id) {
64399
64324
  async function pollForJobResult(workspace, jobId) {
64400
64325
  return await pollJobWithQueueLogging(workspace, jobId);
64401
64326
  }
64402
- async function show(opts, path9) {
64327
+ async function show(opts, path8) {
64403
64328
  const workspace = await resolveWorkspace(opts);
64404
64329
  await requireLogin(opts);
64405
64330
  const s = await getScriptByPath({
64406
64331
  workspace: workspace.workspaceId,
64407
- path: path9
64332
+ path: path8
64408
64333
  });
64409
64334
  info(colors.underline(s.path));
64410
64335
  if (s.description)
@@ -64412,14 +64337,14 @@ async function show(opts, path9) {
64412
64337
  info("");
64413
64338
  info(s.content);
64414
64339
  }
64415
- async function get2(opts, path9) {
64340
+ async function get2(opts, path8) {
64416
64341
  if (opts.json)
64417
64342
  setSilent(true);
64418
64343
  const workspace = await resolveWorkspace(opts);
64419
64344
  await requireLogin(opts);
64420
64345
  const s = await getScriptByPath({
64421
64346
  workspace: workspace.workspaceId,
64422
- path: path9
64347
+ path: path8
64423
64348
  });
64424
64349
  if (opts.json) {
64425
64350
  console.log(JSON.stringify(s));
@@ -64469,7 +64394,7 @@ async function bootstrap(opts, scriptPath, language) {
64469
64394
  scriptMetadata.description = opts.description;
64470
64395
  }
64471
64396
  const scriptInitialMetadataYaml = import_yaml8.stringify(scriptMetadata, yamlOptions);
64472
- const parentDir = path8.dirname(scriptCodeFileFullPath);
64397
+ const parentDir = path7.dirname(scriptCodeFileFullPath);
64473
64398
  await mkdir3(parentDir, { recursive: true });
64474
64399
  await writeFile5(scriptCodeFileFullPath, scriptInitialCode, {
64475
64400
  flag: "wx",
@@ -64564,7 +64489,7 @@ async function preview(opts, filePath) {
64564
64489
  const content = await readTextFile(filePath);
64565
64490
  const input = opts.data ? await resolve6(opts.data) : {};
64566
64491
  const isFolderLayout = isModuleEntryPoint(filePath);
64567
- const moduleFolderPath = isFolderLayout ? path8.dirname(filePath) : filePath.substring(0, filePath.indexOf(".")) + getModuleFolderSuffix();
64492
+ const moduleFolderPath = isFolderLayout ? path7.dirname(filePath) : filePath.substring(0, filePath.indexOf(".")) + getModuleFolderSuffix();
64568
64493
  const modules = await readModulesFromDisk(moduleFolderPath, opts?.defaultTs, isFolderLayout);
64569
64494
  const codebase = language == "bun" ? findCodebase(filePath, codebases) : undefined;
64570
64495
  let tempScriptRefs = undefined;
@@ -64581,7 +64506,7 @@ async function preview(opts, filePath) {
64581
64506
  if (!opts.silent) {
64582
64507
  info(`Using custom bundler ${codebase.customBundler} for preview`);
64583
64508
  }
64584
- bundledContent = execSync5(codebase.customBundler + " " + filePath, {
64509
+ bundledContent = execSync4(codebase.customBundler + " " + filePath, {
64585
64510
  maxBuffer: 52428800
64586
64511
  }).toString();
64587
64512
  } else {
@@ -64840,8 +64765,8 @@ var init_script = __esm(async () => {
64840
64765
 
64841
64766
  // src/commands/lint/lint.ts
64842
64767
  import { stat as stat5, readdir as readdir2 } from "node:fs/promises";
64843
- import process14 from "node:process";
64844
- import * as path9 from "node:path";
64768
+ import process13 from "node:process";
64769
+ import * as path8 from "node:path";
64845
64770
  import { sep as SEP7 } from "node:path";
64846
64771
  function normalizePath(p) {
64847
64772
  return p.replaceAll(SEP7, "/");
@@ -64900,7 +64825,7 @@ async function isLockResolved(lockValue, baseDir) {
64900
64825
  return true;
64901
64826
  }
64902
64827
  async function checkInlineFile(relativePath, baseDir) {
64903
- const fullPath = path9.join(baseDir, relativePath.trim());
64828
+ const fullPath = path8.join(baseDir, relativePath.trim());
64904
64829
  try {
64905
64830
  const s = await stat5(fullPath);
64906
64831
  return s.size > 0;
@@ -64990,7 +64915,7 @@ async function checkRawAppRunnables(backendDir, rawAppYamlPath, defaultTs) {
64990
64915
  continue;
64991
64916
  const runnableId = fileName.replace(".yaml", "");
64992
64917
  processedIds.add(runnableId);
64993
- const filePath = path9.join(backendDir, fileName);
64918
+ const filePath = path8.join(backendDir, fileName);
64994
64919
  let runnable;
64995
64920
  try {
64996
64921
  runnable = await yamlParseFile(filePath);
@@ -65008,7 +64933,7 @@ async function checkRawAppRunnables(backendDir, rawAppYamlPath, defaultTs) {
65008
64933
  }
65009
64934
  if (!language || !languageNeedsLock(language))
65010
64935
  continue;
65011
- const lockFile = path9.join(backendDir, `${runnableId}.lock`);
64936
+ const lockFile = path8.join(backendDir, `${runnableId}.lock`);
65012
64937
  let hasLock = false;
65013
64938
  try {
65014
64939
  const s = await stat5(lockFile);
@@ -65055,7 +64980,7 @@ async function checkRawAppRunnables(backendDir, rawAppYamlPath, defaultTs) {
65055
64980
  }
65056
64981
  if (!languageNeedsLock(language))
65057
64982
  continue;
65058
- const lockFile = path9.join(backendDir, `${runnableId}.lock`);
64983
+ const lockFile = path8.join(backendDir, `${runnableId}.lock`);
65059
64984
  let hasLock = false;
65060
64985
  try {
65061
64986
  const s = await stat5(lockFile);
@@ -65074,8 +64999,8 @@ async function checkRawAppRunnables(backendDir, rawAppYamlPath, defaultTs) {
65074
64999
  return issues;
65075
65000
  }
65076
65001
  async function checkMissingLocks(opts, directory) {
65077
- const initialCwd = process14.cwd();
65078
- const targetDirectory = directory ? path9.resolve(initialCwd, directory) : process14.cwd();
65002
+ const initialCwd = process13.cwd();
65003
+ const targetDirectory = directory ? path8.resolve(initialCwd, directory) : process13.cwd();
65079
65004
  const { ...syncOpts } = opts;
65080
65005
  const mergedOpts = await mergeConfigWithConfigFile(syncOpts);
65081
65006
  const ignore = await ignoreF(mergedOpts);
@@ -65099,19 +65024,19 @@ async function checkMissingLocks(opts, directory) {
65099
65024
  if (normalizedPath.endsWith("/flow.yaml") && normalizedPath.includes(flowSuffix + "/")) {
65100
65025
  flowYamls.push({
65101
65026
  normalizedPath,
65102
- fullPath: path9.join(targetDirectory, entry.path)
65027
+ fullPath: path8.join(targetDirectory, entry.path)
65103
65028
  });
65104
65029
  }
65105
65030
  if (normalizedPath.endsWith("/app.yaml") && normalizedPath.includes(appSuffix + "/")) {
65106
65031
  appYamls.push({
65107
65032
  normalizedPath,
65108
- fullPath: path9.join(targetDirectory, entry.path)
65033
+ fullPath: path8.join(targetDirectory, entry.path)
65109
65034
  });
65110
65035
  }
65111
65036
  if (normalizedPath.endsWith("/raw_app.yaml") && normalizedPath.includes(rawAppSuffix + "/")) {
65112
65037
  rawAppYamls.push({
65113
65038
  normalizedPath,
65114
- fullPath: path9.join(targetDirectory, entry.path)
65039
+ fullPath: path8.join(targetDirectory, entry.path)
65115
65040
  });
65116
65041
  }
65117
65042
  }
@@ -65120,14 +65045,14 @@ async function checkMissingLocks(opts, directory) {
65120
65045
  let language = null;
65121
65046
  for (const ext2 of exts) {
65122
65047
  try {
65123
- await stat5(path9.join(targetDirectory, basePath + ext2));
65048
+ await stat5(path8.join(targetDirectory, basePath + ext2));
65124
65049
  language = inferContentTypeFromFilePath(basePath + ext2, defaultTs);
65125
65050
  break;
65126
65051
  } catch {}
65127
65052
  }
65128
65053
  if (language && languageNeedsLock(language)) {
65129
65054
  try {
65130
- const metadata = await yamlParseFile(path9.join(targetDirectory, yamlPath));
65055
+ const metadata = await yamlParseFile(path8.join(targetDirectory, yamlPath));
65131
65056
  const lockResolved = await isLockResolved(metadata?.lock, targetDirectory);
65132
65057
  if (!lockResolved) {
65133
65058
  issues.push({
@@ -65144,7 +65069,7 @@ async function checkMissingLocks(opts, directory) {
65144
65069
  }
65145
65070
  }
65146
65071
  for (const { normalizedPath: flowYamlPath, fullPath } of flowYamls) {
65147
- const flowDir = path9.dirname(fullPath);
65072
+ const flowDir = path8.dirname(fullPath);
65148
65073
  try {
65149
65074
  const flowFile = await yamlParseFile(fullPath);
65150
65075
  if (!flowFile?.value?.modules)
@@ -65169,7 +65094,7 @@ async function checkMissingLocks(opts, directory) {
65169
65094
  }
65170
65095
  }
65171
65096
  for (const { normalizedPath: appYamlPath, fullPath } of appYamls) {
65172
- const appDir = path9.dirname(fullPath);
65097
+ const appDir = path8.dirname(fullPath);
65173
65098
  try {
65174
65099
  const appFile = await yamlParseFile(fullPath);
65175
65100
  if (!appFile?.value)
@@ -65194,8 +65119,8 @@ async function checkMissingLocks(opts, directory) {
65194
65119
  }
65195
65120
  }
65196
65121
  for (const { normalizedPath: rawAppYamlPath, fullPath } of rawAppYamls) {
65197
- const rawAppDir = path9.dirname(fullPath);
65198
- const backendDir = path9.join(rawAppDir, "backend");
65122
+ const rawAppDir = path8.dirname(fullPath);
65123
+ const backendDir = path8.join(rawAppDir, "backend");
65199
65124
  try {
65200
65125
  await stat5(backendDir);
65201
65126
  } catch {
@@ -65211,11 +65136,11 @@ async function checkMissingLocks(opts, directory) {
65211
65136
  return issues;
65212
65137
  }
65213
65138
  async function runLint(opts, directory) {
65214
- const initialCwd = process14.cwd();
65215
- const explicitTargetDirectory = directory ? path9.resolve(initialCwd, directory) : undefined;
65139
+ const initialCwd = process13.cwd();
65140
+ const explicitTargetDirectory = directory ? path8.resolve(initialCwd, directory) : undefined;
65216
65141
  const { json: _json, ...syncOpts } = opts;
65217
65142
  const mergedOpts = await mergeConfigWithConfigFile(syncOpts);
65218
- const targetDirectory = explicitTargetDirectory ?? process14.cwd();
65143
+ const targetDirectory = explicitTargetDirectory ?? process13.cwd();
65219
65144
  const stats = await stat5(targetDirectory).catch(() => null);
65220
65145
  if (!stats) {
65221
65146
  throw new Error(`Directory not found: ${targetDirectory}`);
@@ -65223,7 +65148,7 @@ async function runLint(opts, directory) {
65223
65148
  if (!stats.isDirectory()) {
65224
65149
  throw new Error(`Path is not a directory: ${targetDirectory}`);
65225
65150
  }
65226
- const isSubdirectory = explicitTargetDirectory && !await stat5(path9.join(targetDirectory, "wmill.yaml")).catch(() => null);
65151
+ const isSubdirectory = explicitTargetDirectory && !await stat5(path8.join(targetDirectory, "wmill.yaml")).catch(() => null);
65227
65152
  const ignore = isSubdirectory ? (_p, _isDir) => false : await ignoreF(mergedOpts);
65228
65153
  const root = await FSFSElement(targetDirectory, [], false);
65229
65154
  const validator = new import_windmill_yaml_validator.WindmillYamlValidator;
@@ -65330,7 +65255,7 @@ async function lint(opts, directory) {
65330
65255
  const report = await runLint(opts, directory);
65331
65256
  printReport(report, !!opts.json);
65332
65257
  if (report.exitCode !== 0) {
65333
- process14.exit(report.exitCode);
65258
+ process13.exit(report.exitCode);
65334
65259
  }
65335
65260
  } catch (error2) {
65336
65261
  const message = error2 instanceof Error ? error2.message : String(error2);
@@ -65343,17 +65268,17 @@ async function lint(opts, directory) {
65343
65268
  } else {
65344
65269
  error(colors.red(`❌ ${message}`));
65345
65270
  }
65346
- process14.exit(1);
65271
+ process13.exit(1);
65347
65272
  }
65348
65273
  }
65349
65274
  async function lintWatch(opts, directory) {
65350
65275
  const { watch } = await import("node:fs");
65351
- const targetDir = directory ? path9.resolve(process14.cwd(), directory) : process14.cwd();
65276
+ const targetDir = directory ? path8.resolve(process13.cwd(), directory) : process13.cwd();
65352
65277
  info(colors.blue(`Watching ${targetDir} for changes... (Ctrl+C to stop)`));
65353
65278
  async function runAndReport() {
65354
65279
  try {
65355
65280
  const report = await runLint(opts, directory);
65356
- process14.stdout.write("\x1Bc");
65281
+ process13.stdout.write("\x1Bc");
65357
65282
  info(colors.gray(`[${new Date().toLocaleTimeString()}] Lint results:
65358
65283
  `));
65359
65284
  printReport(report, false);
@@ -65394,13 +65319,13 @@ var init_lint = __esm(async () => {
65394
65319
 
65395
65320
  // src/commands/shared_ui.ts
65396
65321
  import * as fs9 from "node:fs";
65397
- import * as path10 from "node:path";
65322
+ import * as path9 from "node:path";
65398
65323
  async function readDirRecursive(dir, rel = "", out = {}) {
65399
65324
  if (!fs9.existsSync(dir))
65400
65325
  return out;
65401
65326
  const entries = await fs9.promises.readdir(dir, { withFileTypes: true });
65402
65327
  for (const entry of entries) {
65403
- const full = path10.join(dir, entry.name);
65328
+ const full = path9.join(dir, entry.name);
65404
65329
  const r = rel ? rel + "/" + entry.name : entry.name;
65405
65330
  if (entry.isDirectory()) {
65406
65331
  await readDirRecursive(full, r, out);
@@ -65411,7 +65336,7 @@ async function readDirRecursive(dir, rel = "", out = {}) {
65411
65336
  return out;
65412
65337
  }
65413
65338
  async function pushSharedUi(workspace) {
65414
- const localDir = path10.join(process.cwd(), SHARED_UI_DIR);
65339
+ const localDir = path9.join(process.cwd(), SHARED_UI_DIR);
65415
65340
  if (!fs9.existsSync(localDir)) {
65416
65341
  return false;
65417
65342
  }
@@ -65433,7 +65358,7 @@ async function pushSharedUi(workspace) {
65433
65358
  return true;
65434
65359
  }
65435
65360
  async function pullSharedUi(workspace) {
65436
- const localDir = path10.join(process.cwd(), SHARED_UI_DIR);
65361
+ const localDir = path9.join(process.cwd(), SHARED_UI_DIR);
65437
65362
  let got;
65438
65363
  try {
65439
65364
  got = await getSharedUi({ workspace });
@@ -65447,8 +65372,8 @@ async function pullSharedUi(workspace) {
65447
65372
  }
65448
65373
  fs9.mkdirSync(localDir, { recursive: true });
65449
65374
  for (const [rel, content] of Object.entries(files)) {
65450
- const full = path10.join(localDir, rel);
65451
- fs9.mkdirSync(path10.dirname(full), { recursive: true });
65375
+ const full = path9.join(localDir, rel);
65376
+ fs9.mkdirSync(path9.dirname(full), { recursive: true });
65452
65377
  let existing;
65453
65378
  try {
65454
65379
  existing = readTextFileSync(full);
@@ -65463,7 +65388,7 @@ async function pullSharedUi(workspace) {
65463
65388
  const local = await readDirRecursive(localDir);
65464
65389
  for (const rel of Object.keys(local)) {
65465
65390
  if (!known.has(rel)) {
65466
- const full = path10.join(localDir, rel);
65391
+ const full = path9.join(localDir, rel);
65467
65392
  try {
65468
65393
  fs9.unlinkSync(full);
65469
65394
  } catch {}
@@ -65744,11 +65669,11 @@ async function list5(opts) {
65744
65669
  new Table2().header(["Path", "Resource Type"]).padding(2).border(true).body(total.map((x) => [x.path, x.resource_type])).render();
65745
65670
  }
65746
65671
  }
65747
- async function newResource(opts, path11) {
65748
- if (!validatePath(path11)) {
65672
+ async function newResource(opts, path10) {
65673
+ if (!validatePath(path10)) {
65749
65674
  return;
65750
65675
  }
65751
- const filePath = path11 + ".resource.yaml";
65676
+ const filePath = path10 + ".resource.yaml";
65752
65677
  try {
65753
65678
  await stat6(filePath);
65754
65679
  throw new Error("File already exists: " + filePath);
@@ -65768,14 +65693,14 @@ async function newResource(opts, path11) {
65768
65693
  });
65769
65694
  info(colors.green(`Created ${filePath}`));
65770
65695
  }
65771
- async function get3(opts, path11) {
65696
+ async function get3(opts, path10) {
65772
65697
  if (opts.json)
65773
65698
  setSilent(true);
65774
65699
  const workspace = await resolveWorkspace(opts);
65775
65700
  await requireLogin(opts);
65776
65701
  const r = await getResource({
65777
65702
  workspace: workspace.workspaceId,
65778
- path: path11
65703
+ path: path10
65779
65704
  });
65780
65705
  if (opts.json) {
65781
65706
  console.log(JSON.stringify(r));
@@ -65829,7 +65754,7 @@ __export(exports_sync, {
65829
65754
  FSFSElement: () => FSFSElement
65830
65755
  });
65831
65756
  import { writeFile as writeFile7, readdir as readdir4, stat as stat7, rm, copyFile, mkdir as mkdir5 } from "node:fs/promises";
65832
- import * as path11 from "node:path";
65757
+ import * as path10 from "node:path";
65833
65758
  import { sep as SEP9 } from "node:path";
65834
65759
  function configKeyForItemKind(kind) {
65835
65760
  switch (kind) {
@@ -65961,8 +65886,8 @@ function mergeCliWithEffectiveOptions(cliOpts, effectiveOpts) {
65961
65886
  async function resolveEffectiveSyncOptions(workspace, localConfig, promotion, workspaceNameOverride) {
65962
65887
  return await getEffectiveSettings(localConfig, promotion, false, false, workspaceNameOverride);
65963
65888
  }
65964
- function findCodebase(path12, codebases) {
65965
- if (!path12.endsWith(".ts")) {
65889
+ function findCodebase(path11, codebases) {
65890
+ if (!path11.endsWith(".ts")) {
65966
65891
  return;
65967
65892
  }
65968
65893
  for (const c of codebases) {
@@ -65978,7 +65903,7 @@ function findCodebase(path12, codebases) {
65978
65903
  if (included) {
65979
65904
  break;
65980
65905
  }
65981
- if (minimatch(path12, r)) {
65906
+ if (minimatch(path11, r)) {
65982
65907
  included = true;
65983
65908
  }
65984
65909
  }
@@ -65986,7 +65911,7 @@ function findCodebase(path12, codebases) {
65986
65911
  c.excludes = [c.excludes];
65987
65912
  }
65988
65913
  for (const r of c.excludes ?? []) {
65989
- if (minimatch(path12, r)) {
65914
+ if (minimatch(path11, r)) {
65990
65915
  excluded = true;
65991
65916
  }
65992
65917
  }
@@ -65995,13 +65920,13 @@ function findCodebase(path12, codebases) {
65995
65920
  }
65996
65921
  }
65997
65922
  }
65998
- async function addCodebaseDigestIfRelevant(path12, content, codebases, ignoreCodebaseChanges) {
65999
- const isScript = path12.endsWith(".script.yaml");
65923
+ async function addCodebaseDigestIfRelevant(path11, content, codebases, ignoreCodebaseChanges) {
65924
+ const isScript = path11.endsWith(".script.yaml");
66000
65925
  if (!isScript) {
66001
65926
  return content;
66002
65927
  }
66003
65928
  let isTs = true;
66004
- const replacedPath = path12.replace(".script.yaml", ".ts");
65929
+ const replacedPath = path11.replace(".script.yaml", ".ts");
66005
65930
  try {
66006
65931
  await stat7(replacedPath);
66007
65932
  } catch {
@@ -66015,9 +65940,9 @@ async function addCodebaseDigestIfRelevant(path12, content, codebases, ignoreCod
66015
65940
  if (c) {
66016
65941
  let parsed;
66017
65942
  try {
66018
- parsed = yamlParseContent(path12, content);
65943
+ parsed = yamlParseContent(path11, content);
66019
65944
  } catch (error2) {
66020
- error(`Failed to parse YAML content for codebase digest at path: ${path12}`);
65945
+ error(`Failed to parse YAML content for codebase digest at path: ${path11}`);
66021
65946
  throw error2;
66022
65947
  }
66023
65948
  if (parsed && typeof parsed == "object") {
@@ -66029,7 +65954,7 @@ async function addCodebaseDigestIfRelevant(path12, content, codebases, ignoreCod
66029
65954
  parsed["lock"] = "";
66030
65955
  return import_yaml11.stringify(parsed, yamlOptions);
66031
65956
  } else {
66032
- throw Error(`Expected local yaml ${path12} to be an object, found: ${content} instead`);
65957
+ throw Error(`Expected local yaml ${path11} to be an object, found: ${content} instead`);
66033
65958
  }
66034
65959
  }
66035
65960
  }
@@ -66046,7 +65971,7 @@ async function FSFSElement(p, codebases, ignoreCodebaseChanges) {
66046
65971
  try {
66047
65972
  const entries = await readdir4(localP, { withFileTypes: true });
66048
65973
  for (const e of entries) {
66049
- yield _internal_element(path11.join(localP, e.name), e.isDirectory(), codebases2);
65974
+ yield _internal_element(path10.join(localP, e.name), e.isDirectory(), codebases2);
66050
65975
  }
66051
65976
  } catch (e) {
66052
65977
  warn(`Error reading dir: ${localP}, ${e}`);
@@ -66356,9 +66281,9 @@ function ZipFSElement(zip, useYaml, defaultTs, resourceTypeToFormatExtension, re
66356
66281
  for (const basePath of moduleScripts) {
66357
66282
  if (normalizedP.startsWith(basePath + ".")) {
66358
66283
  const ext2 = normalizedP.slice(basePath.length);
66359
- const dir = path11.dirname(finalPath);
66360
- const base = path11.basename(basePath);
66361
- finalPath = path11.join(dir, base + getModuleFolderSuffix(), "script" + ext2);
66284
+ const dir = path10.dirname(finalPath);
66285
+ const base = path10.basename(basePath);
66286
+ finalPath = path10.join(dir, base + getModuleFolderSuffix(), "script" + ext2);
66362
66287
  break;
66363
66288
  }
66364
66289
  }
@@ -66394,7 +66319,7 @@ function ZipFSElement(zip, useYaml, defaultTs, resourceTypeToFormatExtension, re
66394
66319
  for (const s of inlineScripts) {
66395
66320
  yield {
66396
66321
  isDirectory: false,
66397
- path: path11.join(finalPath, s.path),
66322
+ path: path10.join(finalPath, s.path),
66398
66323
  async* getChildren() {},
66399
66324
  async getContentText() {
66400
66325
  return s.content;
@@ -66407,7 +66332,7 @@ function ZipFSElement(zip, useYaml, defaultTs, resourceTypeToFormatExtension, re
66407
66332
  }
66408
66333
  yield {
66409
66334
  isDirectory: false,
66410
- path: path11.join(finalPath, "flow.yaml"),
66335
+ path: path10.join(finalPath, "flow.yaml"),
66411
66336
  async* getChildren() {},
66412
66337
  async getContentText() {
66413
66338
  return import_yaml11.stringify(flow, yamlOptions);
@@ -66431,7 +66356,7 @@ function ZipFSElement(zip, useYaml, defaultTs, resourceTypeToFormatExtension, re
66431
66356
  for (const s of inlineScripts) {
66432
66357
  yield {
66433
66358
  isDirectory: false,
66434
- path: path11.join(finalPath, s.path),
66359
+ path: path10.join(finalPath, s.path),
66435
66360
  async* getChildren() {},
66436
66361
  async getContentText() {
66437
66362
  return s.content;
@@ -66444,7 +66369,7 @@ function ZipFSElement(zip, useYaml, defaultTs, resourceTypeToFormatExtension, re
66444
66369
  app.policy = undefined;
66445
66370
  yield {
66446
66371
  isDirectory: false,
66447
- path: path11.join(finalPath, "app.yaml"),
66372
+ path: path10.join(finalPath, "app.yaml"),
66448
66373
  async* getChildren() {},
66449
66374
  async getContentText() {
66450
66375
  return import_yaml11.stringify(app, yamlOptions);
@@ -66499,7 +66424,7 @@ function ZipFSElement(zip, useYaml, defaultTs, resourceTypeToFormatExtension, re
66499
66424
  }
66500
66425
  yield {
66501
66426
  isDirectory: false,
66502
- path: path11.join(finalPath, filePath.substring(1)),
66427
+ path: path10.join(finalPath, filePath.substring(1)),
66503
66428
  async* getChildren() {},
66504
66429
  async getContentText() {
66505
66430
  if (typeof content !== "string") {
@@ -66516,7 +66441,7 @@ function ZipFSElement(zip, useYaml, defaultTs, resourceTypeToFormatExtension, re
66516
66441
  for (const s of inlineScripts) {
66517
66442
  yield {
66518
66443
  isDirectory: false,
66519
- path: path11.join(finalPath, APP_BACKEND_FOLDER, s.path),
66444
+ path: path10.join(finalPath, APP_BACKEND_FOLDER, s.path),
66520
66445
  async* getChildren() {},
66521
66446
  async getContentText() {
66522
66447
  return s.content;
@@ -66552,7 +66477,7 @@ function ZipFSElement(zip, useYaml, defaultTs, resourceTypeToFormatExtension, re
66552
66477
  }
66553
66478
  yield {
66554
66479
  isDirectory: false,
66555
- path: path11.join(finalPath, APP_BACKEND_FOLDER, `${runnableId}.yaml`),
66480
+ path: path10.join(finalPath, APP_BACKEND_FOLDER, `${runnableId}.yaml`),
66556
66481
  async* getChildren() {},
66557
66482
  async getContentText() {
66558
66483
  return import_yaml11.stringify(simplifiedRunnable, yamlOptions);
@@ -66566,7 +66491,7 @@ function ZipFSElement(zip, useYaml, defaultTs, resourceTypeToFormatExtension, re
66566
66491
  delete rawApp?.["value"];
66567
66492
  yield {
66568
66493
  isDirectory: false,
66569
- path: path11.join(finalPath, "raw_app.yaml"),
66494
+ path: path10.join(finalPath, "raw_app.yaml"),
66570
66495
  async* getChildren() {},
66571
66496
  async getContentText() {
66572
66497
  return import_yaml11.stringify(rawApp, yamlOptions);
@@ -66574,7 +66499,7 @@ function ZipFSElement(zip, useYaml, defaultTs, resourceTypeToFormatExtension, re
66574
66499
  };
66575
66500
  yield {
66576
66501
  isDirectory: false,
66577
- path: path11.join(finalPath, "DATATABLES.md"),
66502
+ path: path10.join(finalPath, "DATATABLES.md"),
66578
66503
  async* getChildren() {},
66579
66504
  async getContentText() {
66580
66505
  return generateDatatablesDocumentation(data3);
@@ -66677,12 +66602,12 @@ function ZipFSElement(zip, useYaml, defaultTs, resourceTypeToFormatExtension, re
66677
66602
  const scriptBasePath = removeSuffix(removeSuffix(finalPath, metaExt), ".script");
66678
66603
  const moduleFolderPath = scriptBasePath + getModuleFolderSuffix();
66679
66604
  if (hasModules) {
66680
- r[0].path = path11.join(moduleFolderPath, "script" + metaExt);
66605
+ r[0].path = path10.join(moduleFolderPath, "script" + metaExt);
66681
66606
  }
66682
66607
  if (lock && lock != "") {
66683
66608
  r.push({
66684
66609
  isDirectory: false,
66685
- path: hasModules ? path11.join(moduleFolderPath, "script.lock") : removeSuffix(finalPath, metaExt) + ".lock",
66610
+ path: hasModules ? path10.join(moduleFolderPath, "script.lock") : removeSuffix(finalPath, metaExt) + ".lock",
66686
66611
  async* getChildren() {},
66687
66612
  async getContentText() {
66688
66613
  return lock;
@@ -66697,7 +66622,7 @@ function ZipFSElement(zip, useYaml, defaultTs, resourceTypeToFormatExtension, re
66697
66622
  for (const [relPath, mod] of Object.entries(scriptModules)) {
66698
66623
  yield {
66699
66624
  isDirectory: false,
66700
- path: path11.join(moduleFolderPath, relPath),
66625
+ path: path10.join(moduleFolderPath, relPath),
66701
66626
  async* getChildren() {},
66702
66627
  async getContentText() {
66703
66628
  return mod.content;
@@ -66707,7 +66632,7 @@ function ZipFSElement(zip, useYaml, defaultTs, resourceTypeToFormatExtension, re
66707
66632
  const baseName = relPath.replace(/\.[^.]+$/, "");
66708
66633
  yield {
66709
66634
  isDirectory: false,
66710
- path: path11.join(moduleFolderPath, baseName + ".lock"),
66635
+ path: path10.join(moduleFolderPath, baseName + ".lock"),
66711
66636
  async* getChildren() {},
66712
66637
  async getContentText() {
66713
66638
  return mod.lock;
@@ -66744,7 +66669,7 @@ function ZipFSElement(zip, useYaml, defaultTs, resourceTypeToFormatExtension, re
66744
66669
  if (typeof fileContent === "string") {
66745
66670
  yield {
66746
66671
  isDirectory: false,
66747
- path: path11.join(filesetBasePath, relPath),
66672
+ path: path10.join(filesetBasePath, relPath),
66748
66673
  async* getChildren() {},
66749
66674
  async getContentText() {
66750
66675
  return fileContent;
@@ -66780,7 +66705,7 @@ function ZipFSElement(zip, useYaml, defaultTs, resourceTypeToFormatExtension, re
66780
66705
  async* getChildren() {
66781
66706
  for (const filename in zip2.files) {
66782
66707
  const file = zip2.files[filename];
66783
- const totalPath = path11.join(p, filename);
66708
+ const totalPath = path10.join(p, filename);
66784
66709
  if (file.dir) {
66785
66710
  const e = zip2.folder(file.name);
66786
66711
  yield _internal_folder(totalPath, e);
@@ -66849,15 +66774,15 @@ async function elementsToMap(els, ignore, json, skips, specificItems, branchOver
66849
66774
  if (entry.ignored) {
66850
66775
  continue;
66851
66776
  }
66852
- const path12 = entry.path;
66853
- if (isScriptModulePath(path12)) {
66854
- map[path12] = await entry.getContentText();
66777
+ const path11 = entry.path;
66778
+ if (isScriptModulePath(path11)) {
66779
+ map[path11] = await entry.getContentText();
66855
66780
  continue;
66856
66781
  }
66857
- if (!isFileResource(path12) && !isFilesetResource(path12) && !isRawAppFile(path12) && !isWorkspaceDependencies(path12)) {
66858
- if (json && path12.endsWith(".yaml"))
66782
+ if (!isFileResource(path11) && !isFilesetResource(path11) && !isRawAppFile(path11) && !isWorkspaceDependencies(path11)) {
66783
+ if (json && path11.endsWith(".yaml"))
66859
66784
  continue;
66860
- if (!json && path12.endsWith(".json"))
66785
+ if (!json && path11.endsWith(".json"))
66861
66786
  continue;
66862
66787
  if (![
66863
66788
  "json",
@@ -66879,39 +66804,39 @@ async function elementsToMap(els, ignore, json, skips, specificItems, branchOver
66879
66804
  "java",
66880
66805
  "rb",
66881
66806
  "r"
66882
- ].includes(path12.split(".").pop() ?? "")) {
66807
+ ].includes(path11.split(".").pop() ?? "")) {
66883
66808
  continue;
66884
66809
  }
66885
66810
  }
66886
- if (isRawAppFile(path12)) {
66887
- const suffix = path12.split(getFolderSuffix("raw_app") + SEP9).pop();
66811
+ if (isRawAppFile(path11)) {
66812
+ const suffix = path11.split(getFolderSuffix("raw_app") + SEP9).pop();
66888
66813
  if (suffix?.startsWith("dist/") || suffix == "wmill.d.ts" || suffix == "package-lock.json" || suffix == "DATATABLES.md") {
66889
66814
  continue;
66890
66815
  }
66891
66816
  }
66892
- if (skips.skipResources && (isFileResource(path12) || isFilesetResource(path12)))
66817
+ if (skips.skipResources && (isFileResource(path11) || isFilesetResource(path11)))
66893
66818
  continue;
66894
66819
  const ext2 = json ? ".json" : ".yaml";
66895
- if (!skips.includeSchedules && path12.endsWith(".schedule" + ext2))
66820
+ if (!skips.includeSchedules && path11.endsWith(".schedule" + ext2))
66896
66821
  continue;
66897
- if (!skips.includeTriggers && (path12.endsWith(".http_trigger" + ext2) || path12.endsWith(".websocket_trigger" + ext2) || path12.endsWith(".kafka_trigger" + ext2) || path12.endsWith(".nats_trigger" + ext2) || path12.endsWith(".postgres_trigger" + ext2) || path12.endsWith(".mqtt_trigger" + ext2) || path12.endsWith(".sqs_trigger" + ext2) || path12.endsWith(".gcp_trigger" + ext2) || path12.endsWith(".azure_trigger" + ext2) || path12.endsWith(".email_trigger" + ext2) || path12.endsWith("_native_trigger" + ext2))) {
66822
+ if (!skips.includeTriggers && (path11.endsWith(".http_trigger" + ext2) || path11.endsWith(".websocket_trigger" + ext2) || path11.endsWith(".kafka_trigger" + ext2) || path11.endsWith(".nats_trigger" + ext2) || path11.endsWith(".postgres_trigger" + ext2) || path11.endsWith(".mqtt_trigger" + ext2) || path11.endsWith(".sqs_trigger" + ext2) || path11.endsWith(".gcp_trigger" + ext2) || path11.endsWith(".azure_trigger" + ext2) || path11.endsWith(".email_trigger" + ext2) || path11.endsWith("_native_trigger" + ext2))) {
66898
66823
  continue;
66899
66824
  }
66900
- if (!skips.includeUsers && path12.endsWith(".user" + ext2))
66825
+ if (!skips.includeUsers && path11.endsWith(".user" + ext2))
66901
66826
  continue;
66902
- if (!skips.includeGroups && path12.endsWith(".group" + ext2))
66827
+ if (!skips.includeGroups && path11.endsWith(".group" + ext2))
66903
66828
  continue;
66904
- if (!skips.includeSettings && path12 === "settings" + ext2)
66829
+ if (!skips.includeSettings && path11 === "settings" + ext2)
66905
66830
  continue;
66906
- if (!skips.includeKey && path12 === "encryption_key")
66831
+ if (!skips.includeKey && path11 === "encryption_key")
66907
66832
  continue;
66908
- if (skips.skipResources && path12.endsWith(".resource" + ext2))
66833
+ if (skips.skipResources && path11.endsWith(".resource" + ext2))
66909
66834
  continue;
66910
- if (skips.skipResourceTypes && path12.endsWith(".resource-type" + ext2)) {
66835
+ if (skips.skipResourceTypes && path11.endsWith(".resource-type" + ext2)) {
66911
66836
  continue;
66912
66837
  }
66913
66838
  try {
66914
- const fileType = getTypeStrFromPath(path12);
66839
+ const fileType = getTypeStrFromPath(path11);
66915
66840
  if (skips.skipVariables && fileType === "variable")
66916
66841
  continue;
66917
66842
  if (skips.skipScripts && fileType === "script")
@@ -66925,27 +66850,27 @@ async function elementsToMap(els, ignore, json, skips, specificItems, branchOver
66925
66850
  if (skips.skipWorkspaceDependencies && fileType === "workspace_dependencies")
66926
66851
  continue;
66927
66852
  } catch {}
66928
- if (specificItems && isWorkspaceSpecificFile(path12)) {
66929
- if (!isCurrentWorkspaceFile(path12, cachedWsName)) {
66853
+ if (specificItems && isWorkspaceSpecificFile(path11)) {
66854
+ if (!isCurrentWorkspaceFile(path11, cachedWsName)) {
66930
66855
  continue;
66931
66856
  }
66932
66857
  }
66933
66858
  const content = await entry.getContentText();
66934
- if (skips.skipSecrets && path12.endsWith(".variable" + ext2)) {
66859
+ if (skips.skipSecrets && path11.endsWith(".variable" + ext2)) {
66935
66860
  try {
66936
66861
  let o;
66937
66862
  if (json) {
66938
66863
  try {
66939
66864
  o = JSON.parse(content);
66940
66865
  } catch (error2) {
66941
- error(`Failed to parse JSON variable content at path: ${path12}`);
66866
+ error(`Failed to parse JSON variable content at path: ${path11}`);
66942
66867
  throw error2;
66943
66868
  }
66944
66869
  } else {
66945
66870
  try {
66946
- o = yamlParseContent(path12, content);
66871
+ o = yamlParseContent(path11, content);
66947
66872
  } catch (error2) {
66948
- error(`Failed to parse YAML variable content at path: ${path12}`);
66873
+ error(`Failed to parse YAML variable content at path: ${path11}`);
66949
66874
  throw error2;
66950
66875
  }
66951
66876
  }
@@ -66953,12 +66878,12 @@ async function elementsToMap(els, ignore, json, skips, specificItems, branchOver
66953
66878
  continue;
66954
66879
  }
66955
66880
  } catch (e) {
66956
- warn(`Error reading variable ${path12} to check for secrets`);
66881
+ warn(`Error reading variable ${path11} to check for secrets`);
66957
66882
  }
66958
66883
  }
66959
- if (cachedWsName && isCurrentWorkspaceFile(path12, cachedWsName)) {
66884
+ if (cachedWsName && isCurrentWorkspaceFile(path11, cachedWsName)) {
66960
66885
  const currentBranch = cachedWsName;
66961
- const basePath = fromWorkspaceSpecificPath(path12, currentBranch);
66886
+ const basePath = fromWorkspaceSpecificPath(path11, currentBranch);
66962
66887
  if (!isItemTypeConfigured(basePath, specificItems)) {
66963
66888
  continue;
66964
66889
  }
@@ -66967,14 +66892,14 @@ async function elementsToMap(els, ignore, json, skips, specificItems, branchOver
66967
66892
  }
66968
66893
  map[basePath] = content;
66969
66894
  processedBasePaths.add(basePath);
66970
- } else if (!isWorkspaceSpecificFile(path12)) {
66971
- if (processedBasePaths.has(path12)) {
66895
+ } else if (!isWorkspaceSpecificFile(path11)) {
66896
+ if (processedBasePaths.has(path11)) {
66972
66897
  continue;
66973
66898
  }
66974
- if (!isRemote && isSpecificItem(path12, specificItems)) {
66899
+ if (!isRemote && isSpecificItem(path11, specificItems)) {
66975
66900
  continue;
66976
66901
  }
66977
- map[path12] = content;
66902
+ map[path11] = content;
66978
66903
  }
66979
66904
  }
66980
66905
  if (wrongFormatPaths.length > 0) {
@@ -67359,7 +67284,7 @@ async function pull(opts) {
67359
67284
  throw error2;
67360
67285
  }
67361
67286
  if (opts.stateful) {
67362
- await mkdir5(path11.join(process.cwd(), ".wmill"), { recursive: true });
67287
+ await mkdir5(path10.join(process.cwd(), ".wmill"), { recursive: true });
67363
67288
  }
67364
67289
  const workspace = await resolveWorkspace(opts, wsNameForConfig);
67365
67290
  await requireLogin(opts);
@@ -67433,7 +67358,7 @@ async function pull(opts) {
67433
67358
  } catch {}
67434
67359
  const zipFile = await downloadZip(workspace, opts.plainSecrets, opts.skipVariables, opts.skipResources, opts.skipResourceTypes, opts.skipSecrets, opts.includeSchedules, opts.includeTriggers, opts.includeUsers, opts.includeGroups, opts.includeSettings, opts.includeKey, opts.skipWorkspaceDependencies, opts.defaultTs);
67435
67360
  const remote = ZipFSElement(zipFile, !opts.json, opts.defaultTs ?? "bun", resourceTypeToFormatExtension, resourceTypeToIsFileset, true, parseSyncBehavior(opts.syncBehavior) >= 1);
67436
- const local = !opts.stateful ? await FSFSElement(process.cwd(), codebases, true) : await FSFSElement(path11.join(process.cwd(), ".wmill"), [], true);
67361
+ const local = !opts.stateful ? await FSFSElement(process.cwd(), codebases, true) : await FSFSElement(path10.join(process.cwd(), ".wmill"), [], true);
67437
67362
  const { changes, localMap } = await compareDynFSElement(remote, local, await ignoreF(opts), opts.json ?? false, opts, false, codebases, true, specificItems, wsNameForFiles, true);
67438
67363
  info(`remote (${workspace.name}) -> local: ${changes.length} changes to apply`);
67439
67364
  if (wsSpecificMerge.serverItems && wsSpecificMerge.serverItems.length > 0) {
@@ -67488,8 +67413,8 @@ async function pull(opts) {
67488
67413
  targetPath = workspaceSpecificPath;
67489
67414
  }
67490
67415
  }
67491
- const target = path11.join(process.cwd(), targetPath);
67492
- const stateTarget = path11.join(process.cwd(), ".wmill", targetPath);
67416
+ const target = path10.join(process.cwd(), targetPath);
67417
+ const stateTarget = path10.join(process.cwd(), ".wmill", targetPath);
67493
67418
  if (change.name === "edited") {
67494
67419
  if (opts.stateful) {
67495
67420
  try {
@@ -67522,13 +67447,13 @@ Both local and remote have been modified.`));
67522
67447
  }
67523
67448
  await writeFile7(target, change.after, "utf-8");
67524
67449
  if (opts.stateful) {
67525
- await mkdir5(path11.dirname(stateTarget), { recursive: true });
67450
+ await mkdir5(path10.dirname(stateTarget), { recursive: true });
67526
67451
  await copyFile(target, stateTarget);
67527
67452
  }
67528
67453
  } else if (change.name === "added") {
67529
- await mkdir5(path11.dirname(target), { recursive: true });
67454
+ await mkdir5(path10.dirname(target), { recursive: true });
67530
67455
  if (opts.stateful) {
67531
- await mkdir5(path11.dirname(stateTarget), { recursive: true });
67456
+ await mkdir5(path10.dirname(stateTarget), { recursive: true });
67532
67457
  info(`Adding ${getTypeStrFromPath(change.path)} ${targetPath}${targetPath !== change.path ? colors.gray(` (workspace-specific override for ${change.path})`) : ""}`);
67533
67458
  }
67534
67459
  await writeFile7(target, change.content, "utf-8");
@@ -67796,7 +67721,7 @@ Push aborted: ${lockIssues.length} script(s) missing locks.`));
67796
67721
  resourceTypeToIsFileset = parsed.filesetMap;
67797
67722
  } catch {}
67798
67723
  const remote = ZipFSElement(await downloadZip(workspace, opts.plainSecrets, opts.skipVariables, opts.skipResources, opts.skipResourceTypes, opts.skipSecrets, opts.includeSchedules, opts.includeTriggers, opts.includeUsers, opts.includeGroups, opts.includeSettings, opts.includeKey, opts.skipWorkspaceDependencies, opts.defaultTs), !opts.json, opts.defaultTs ?? "bun", resourceTypeToFormatExtension, resourceTypeToIsFileset, false, parseSyncBehavior(opts.syncBehavior) >= 1);
67799
- const local = await FSFSElement(path11.join(process.cwd(), ""), codebases, false);
67724
+ const local = await FSFSElement(path10.join(process.cwd(), ""), codebases, false);
67800
67725
  const { changes, localMap } = await compareDynFSElement(local, remote, await ignoreF(opts), opts.json ?? false, opts, true, codebases, false, specificItems, wsNameForFiles, false);
67801
67726
  const wsSpecificFlagOnly = computeWsSpecificFlagOnlyPushes(localMap, localSpecificItems, serverWsSpecificItems);
67802
67727
  for (const item of wsSpecificFlagOnly) {
@@ -67956,7 +67881,7 @@ Push aborted: ${lockIssues.length} script(s) missing locks.`));
67956
67881
  }
67957
67882
  }
67958
67883
  for (const folderName2 of folderNames) {
67959
- const basePath = path11.join("f", folderName2, "folder.meta.yaml");
67884
+ const basePath = path10.join("f", folderName2, "folder.meta.yaml");
67960
67885
  const branchPath = getWorkspaceSpecificPath(`f/${folderName2}/folder.meta.yaml`, specificItems, wsNameForFiles);
67961
67886
  let found = false;
67962
67887
  if (branchPath) {
@@ -68078,7 +68003,7 @@ Run 'wmill folder add-missing' to create them locally, then push again.`;
68078
68003
  let stateful = opts.stateful;
68079
68004
  if (stateful) {
68080
68005
  try {
68081
- await stat7(path11.join(process.cwd(), ".wmill"));
68006
+ await stat7(path10.join(process.cwd(), ".wmill"));
68082
68007
  } catch {
68083
68008
  stateful = false;
68084
68009
  }
@@ -68129,7 +68054,7 @@ Run 'wmill folder add-missing' to create them locally, then push again.`;
68129
68054
  let stateTarget = undefined;
68130
68055
  if (stateful) {
68131
68056
  try {
68132
- stateTarget = path11.join(process.cwd(), ".wmill", change.path);
68057
+ stateTarget = path10.join(process.cwd(), ".wmill", change.path);
68133
68058
  await stat7(stateTarget);
68134
68059
  } catch {
68135
68060
  stateTarget = undefined;
@@ -68154,7 +68079,7 @@ Run 'wmill folder add-missing' to create them locally, then push again.`;
68154
68079
  continue;
68155
68080
  }
68156
68081
  if (stateTarget) {
68157
- await mkdir5(path11.dirname(stateTarget), { recursive: true });
68082
+ await mkdir5(path10.dirname(stateTarget), { recursive: true });
68158
68083
  info(`Editing ${getTypeStrFromPath(change.path)} ${change.path}`);
68159
68084
  }
68160
68085
  if (isFileResource(change.path)) {
@@ -68209,7 +68134,7 @@ Run 'wmill folder add-missing' to create them locally, then push again.`;
68209
68134
  await pushFilesetParentResource(change.path, workspace.workspaceId, alreadySynced, cachedWsNameForPush, specificItems);
68210
68135
  continue;
68211
68136
  }
68212
- if (change.path.endsWith(".script.json") || change.path.endsWith(".script.yaml") || change.path.endsWith(".lock") || isFileResource(change.path)) {
68137
+ if (!isRawAppFile(change.path) && (change.path.endsWith(".script.json") || change.path.endsWith(".script.yaml") || change.path.endsWith(".lock") || isFileResource(change.path))) {
68213
68138
  continue;
68214
68139
  } else if (await handleFile(change.path, workspace, alreadySynced, opts.message, opts, rawWorkspaceDependencies, codebases, permissionedAsContext)) {
68215
68140
  continue;
@@ -68218,7 +68143,7 @@ Run 'wmill folder add-missing' to create them locally, then push again.`;
68218
68143
  continue;
68219
68144
  }
68220
68145
  if (stateTarget) {
68221
- await mkdir5(path11.dirname(stateTarget), { recursive: true });
68146
+ await mkdir5(path10.dirname(stateTarget), { recursive: true });
68222
68147
  info(`Adding ${getTypeStrFromPath(change.path)} ${change.path}`);
68223
68148
  }
68224
68149
  const obj = parseFromPath(change.path, change.content);
@@ -68859,8 +68784,8 @@ var init_parse_schema = __esm(() => {
68859
68784
  // src/utils/metadata.ts
68860
68785
  import { sep as SEP10 } from "node:path";
68861
68786
  import { writeFile as writeFile8, stat as stat8, rm as rm2, readdir as readdir5 } from "node:fs/promises";
68862
- import { readFileSync as readFileSync2, existsSync as existsSync6, readdirSync, statSync, writeFileSync as writeFileSync5 } from "node:fs";
68863
- import * as path12 from "node:path";
68787
+ import { readFileSync as readFileSync2, existsSync as existsSync5, readdirSync, statSync, writeFileSync as writeFileSync4 } from "node:fs";
68788
+ import * as path11 from "node:path";
68864
68789
  import { createRequire as createRequire2 } from "node:module";
68865
68790
  function loadParser(pkgName) {
68866
68791
  let p = _parserCache.get(pkgName);
@@ -68902,8 +68827,8 @@ async function getRawWorkspaceDependencies(legacyBehaviour) {
68902
68827
  } catch {}
68903
68828
  return rawWorkspaceDeps;
68904
68829
  }
68905
- function workspaceDependenciesPathToLanguageAndFilename(path13) {
68906
- const relativePath = path13.replace("dependencies/", "");
68830
+ function workspaceDependenciesPathToLanguageAndFilename(path12) {
68831
+ const relativePath = path12.replace("dependencies/", "");
68907
68832
  for (const { filename, language } of workspaceDependenciesLanguages) {
68908
68833
  if (relativePath.endsWith(filename)) {
68909
68834
  return {
@@ -68957,8 +68882,8 @@ async function generateScriptMetadataInternal(scriptPath, workspace, opts, dryRu
68957
68882
  const scriptContent = await readTextFile(scriptPath);
68958
68883
  const metadataContent = await readTextFile(metadataWithType.path);
68959
68884
  const filteredRawWorkspaceDependencies = filterWorkspaceDependencies(rawWorkspaceDependencies, scriptContent, language);
68960
- const moduleFolderPath = isFolderLayout ? path12.dirname(scriptPath) : scriptPath.substring(0, scriptPath.indexOf(".")) + getModuleFolderSuffix();
68961
- const hasModules = existsSync6(moduleFolderPath) && statSync(moduleFolderPath).isDirectory();
68885
+ const moduleFolderPath = isFolderLayout ? path11.dirname(scriptPath) : scriptPath.substring(0, scriptPath.indexOf(".")) + getModuleFolderSuffix();
68886
+ const hasModules = existsSync5(moduleFolderPath) && statSync(moduleFolderPath).isDirectory();
68962
68887
  const depsForHash = tree ? {} : filteredRawWorkspaceDependencies;
68963
68888
  let hash2 = await generateScriptHash(depsForHash, scriptContent, metadataContent);
68964
68889
  let moduleHashes = {};
@@ -69029,7 +68954,7 @@ async function generateScriptMetadataInternal(scriptPath, workspace, opts, dryRu
69029
68954
  const hasCodebase = findCodebase(scriptPath, codebases) != null;
69030
68955
  if (!hasCodebase) {
69031
68956
  const tempScriptRefs = tree?.getTempScriptRefs(remotePath);
69032
- const lockPathOverride = isFolderLayout ? path12.dirname(scriptPath) + "/script.lock" : undefined;
68957
+ const lockPathOverride = isFolderLayout ? path11.dirname(scriptPath) + "/script.lock" : undefined;
69033
68958
  await updateScriptLock(workspace, scriptContent, language, remotePath, metadataParsedContent, filteredRawWorkspaceDependencies, tempScriptRefs, lockPathOverride);
69034
68959
  } else {
69035
68960
  metadataParsedContent.lock = "";
@@ -69060,10 +68985,10 @@ async function generateScriptMetadataInternal(scriptPath, workspace, opts, dryRu
69060
68985
  let newMetadataContent;
69061
68986
  if (isFolderLayout) {
69062
68987
  if (metadataWithType.isJson) {
69063
- metaPath = path12.dirname(scriptPath) + "/script.json";
68988
+ metaPath = path11.dirname(scriptPath) + "/script.json";
69064
68989
  newMetadataContent = JSON.stringify(metadataParsedContent);
69065
68990
  } else {
69066
- metaPath = path12.dirname(scriptPath) + "/script.yaml";
68991
+ metaPath = path11.dirname(scriptPath) + "/script.yaml";
69067
68992
  newMetadataContent = import_yaml13.stringify(metadataParsedContent, yamlOptions);
69068
68993
  }
69069
68994
  } else {
@@ -69093,8 +69018,8 @@ async function generateScriptMetadataInternal(scriptPath, workspace, opts, dryRu
69093
69018
  }
69094
69019
  return `${remotePath} (${language})`;
69095
69020
  }
69096
- async function updateScriptSchema(scriptContent, language, metadataContent, path13) {
69097
- const result = await inferSchema(language, scriptContent, metadataContent.schema, path13);
69021
+ async function updateScriptSchema(scriptContent, language, metadataContent, path12) {
69022
+ const result = await inferSchema(language, scriptContent, metadataContent.schema, path12);
69098
69023
  metadataContent.schema = result.schema;
69099
69024
  if (result.has_preprocessor) {
69100
69025
  metadataContent.has_preprocessor = result.has_preprocessor;
@@ -69256,7 +69181,7 @@ async function updateScriptLock(workspace, scriptContent, language, remotePath,
69256
69181
  async function updateModuleLocks(workspace, dirPath, relPrefix, scriptRemotePath, rawWorkspaceDependencies, defaultTs, changedModules) {
69257
69182
  const entries = readdirSync(dirPath, { withFileTypes: true });
69258
69183
  for (const entry of entries) {
69259
- const fullPath = path12.join(dirPath, entry.name);
69184
+ const fullPath = path11.join(dirPath, entry.name);
69260
69185
  const relPath = relPrefix ? relPrefix + "/" + entry.name : entry.name;
69261
69186
  if (entry.isDirectory()) {
69262
69187
  await updateModuleLocks(workspace, fullPath, relPath, scriptRemotePath, rawWorkspaceDependencies, defaultTs, changedModules);
@@ -69280,12 +69205,12 @@ async function updateModuleLocks(workspace, dirPath, relPrefix, scriptRemotePath
69280
69205
  try {
69281
69206
  const lock = await fetchScriptLock(workspace, moduleContent, modLanguage, moduleRemotePath, rawWorkspaceDependencies);
69282
69207
  const baseName = entry.name.replace(/\.[^.]+$/, "");
69283
- const lockPath = path12.join(dirPath, baseName + ".lock");
69208
+ const lockPath = path11.join(dirPath, baseName + ".lock");
69284
69209
  if (lock != "") {
69285
- writeFileSync5(lockPath, lock, "utf-8");
69210
+ writeFileSync4(lockPath, lock, "utf-8");
69286
69211
  } else {
69287
69212
  try {
69288
- if (existsSync6(lockPath)) {
69213
+ if (existsSync5(lockPath)) {
69289
69214
  const { rm: rmAsync } = await import("node:fs/promises");
69290
69215
  await rmAsync(lockPath);
69291
69216
  }
@@ -69297,7 +69222,7 @@ async function updateModuleLocks(workspace, dirPath, relPrefix, scriptRemotePath
69297
69222
  }
69298
69223
  }
69299
69224
  }
69300
- async function inferSchema(language, content, currentSchema, path13) {
69225
+ async function inferSchema(language, content, currentSchema, path12) {
69301
69226
  let inferedSchema;
69302
69227
  if (language === "python3") {
69303
69228
  const { parse_python } = await loadParser("windmill-parser-wasm-py");
@@ -69400,7 +69325,7 @@ async function inferSchema(language, content, currentSchema, path13) {
69400
69325
  throw new Error("Invalid language: " + language);
69401
69326
  }
69402
69327
  if (inferedSchema.type == "Invalid") {
69403
- info(colors.yellow(`Script ${path13} invalid, it cannot be parsed to infer schema.`));
69328
+ info(colors.yellow(`Script ${path12} invalid, it cannot be parsed to infer schema.`));
69404
69329
  return {
69405
69330
  schema: defaultScriptMetadata().schema,
69406
69331
  has_preprocessor: false,
@@ -69592,15 +69517,15 @@ async function readLockfile() {
69592
69517
  }
69593
69518
  return conf;
69594
69519
  }
69595
- function v2LockPath(path13, subpath) {
69596
- const normalizedPath = normalizeLockPath(path13);
69520
+ function v2LockPath(path12, subpath) {
69521
+ const normalizedPath = normalizeLockPath(path12);
69597
69522
  if (subpath) {
69598
69523
  return `${normalizedPath}+${normalizeLockPath(subpath)}`;
69599
69524
  } else {
69600
69525
  return normalizedPath;
69601
69526
  }
69602
69527
  }
69603
- async function checkifMetadataUptodate(path13, hash2, conf, subpath) {
69528
+ async function checkifMetadataUptodate(path12, hash2, conf, subpath) {
69604
69529
  if (!conf) {
69605
69530
  conf = await readLockfile();
69606
69531
  }
@@ -69609,10 +69534,10 @@ async function checkifMetadataUptodate(path13, hash2, conf, subpath) {
69609
69534
  }
69610
69535
  const isFlatKeyed = conf?.version === "v2";
69611
69536
  if (isFlatKeyed) {
69612
- const key = v2LockPath(path13, subpath);
69537
+ const key = v2LockPath(path12, subpath);
69613
69538
  return conf.locks?.[key] === hash2 || conf.locks?.["./" + key] === hash2;
69614
69539
  }
69615
- for (const p of [path13, "./" + path13]) {
69540
+ for (const p of [path12, "./" + path12]) {
69616
69541
  const obj = conf.locks?.[p];
69617
69542
  const v = subpath && typeof obj == "object" ? obj?.[subpath] : obj;
69618
69543
  if (v === hash2)
@@ -69628,7 +69553,7 @@ async function computeModuleHashes(moduleFolderPath, defaultTs, rawWorkspaceDepe
69628
69553
  async function readDir2(dirPath, relPrefix) {
69629
69554
  const entries = readdirSync(dirPath, { withFileTypes: true });
69630
69555
  for (const entry of entries) {
69631
- const fullPath = path12.join(dirPath, entry.name);
69556
+ const fullPath = path11.join(dirPath, entry.name);
69632
69557
  const relPath = relPrefix ? relPrefix + "/" + entry.name : entry.name;
69633
69558
  const isTopLevel = relPrefix === "";
69634
69559
  if (entry.isDirectory()) {
@@ -69648,14 +69573,14 @@ async function computeModuleHashes(moduleFolderPath, defaultTs, rawWorkspaceDepe
69648
69573
  await readDir2(moduleFolderPath, "");
69649
69574
  return hashes;
69650
69575
  }
69651
- async function clearGlobalLock(path13) {
69576
+ async function clearGlobalLock(path12) {
69652
69577
  const conf = await readLockfile();
69653
69578
  if (!conf?.locks) {
69654
69579
  conf.locks = {};
69655
69580
  }
69656
69581
  const isFlatKeyed = conf?.version === "v2";
69657
69582
  if (isFlatKeyed) {
69658
- const key = v2LockPath(path13);
69583
+ const key = v2LockPath(path12);
69659
69584
  const legacyKey = "./" + key;
69660
69585
  if (conf.locks) {
69661
69586
  Object.keys(conf.locks).forEach((k) => {
@@ -69671,24 +69596,24 @@ async function clearGlobalLock(path13) {
69671
69596
  }
69672
69597
  }
69673
69598
  }
69674
- async function updateMetadataGlobalLock(path13, hash2, subpath) {
69599
+ async function updateMetadataGlobalLock(path12, hash2, subpath) {
69675
69600
  const conf = await readLockfile();
69676
69601
  if (!conf?.locks) {
69677
69602
  conf.locks = {};
69678
69603
  }
69679
69604
  const isFlatKeyed = conf?.version === "v2";
69680
69605
  if (isFlatKeyed) {
69681
- conf.locks[v2LockPath(path13, subpath)] = hash2;
69606
+ conf.locks[v2LockPath(path12, subpath)] = hash2;
69682
69607
  } else {
69683
69608
  if (subpath) {
69684
- let prev = conf.locks[path13];
69609
+ let prev = conf.locks[path12];
69685
69610
  if (!prev || typeof prev != "object") {
69686
69611
  prev = {};
69687
- conf.locks[path13] = prev;
69612
+ conf.locks[path12] = prev;
69688
69613
  }
69689
69614
  prev[subpath] = hash2;
69690
69615
  } else {
69691
- conf.locks[path13] = hash2;
69616
+ conf.locks[path12] = hash2;
69692
69617
  }
69693
69618
  }
69694
69619
  if (!inMemoryLock) {
@@ -69755,7 +69680,7 @@ __export(exports_raw_apps, {
69755
69680
  generatingPolicy: () => generatingPolicy
69756
69681
  });
69757
69682
  import { sep as SEP11 } from "node:path";
69758
- import path13 from "node:path";
69683
+ import path12 from "node:path";
69759
69684
  import { readdir as readdir6 } from "node:fs/promises";
69760
69685
  async function readSiblingLock(backendPath, runnableId, allFiles) {
69761
69686
  const target = `${runnableId.toLowerCase()}.lock`;
@@ -69763,7 +69688,7 @@ async function readSiblingLock(backendPath, runnableId, allFiles) {
69763
69688
  if (!lockFile)
69764
69689
  return;
69765
69690
  try {
69766
- return await readTextFile(path13.join(backendPath, lockFile));
69691
+ return await readTextFile(path12.join(backendPath, lockFile));
69767
69692
  } catch {
69768
69693
  return;
69769
69694
  }
@@ -69780,7 +69705,7 @@ async function findRunnableContentFile(backendPath, runnableId, allFiles) {
69780
69705
  const ext2 = fileName.substring(runnableId.length + 1);
69781
69706
  if (EXTENSION_TO_LANGUAGE[ext2]) {
69782
69707
  try {
69783
- const content = await readTextFile(path13.join(backendPath, fileName));
69708
+ const content = await readTextFile(path12.join(backendPath, fileName));
69784
69709
  return { ext: ext2, content };
69785
69710
  } catch {
69786
69711
  continue;
@@ -69817,7 +69742,7 @@ async function loadRunnablesFromBackend(backendPath, defaultTs = "bun") {
69817
69742
  }
69818
69743
  const runnableId = fileName.replace(".yaml", "");
69819
69744
  processedIds.add(runnableId.toLowerCase());
69820
- const filePath = path13.join(backendPath, fileName);
69745
+ const filePath = path12.join(backendPath, fileName);
69821
69746
  const runnable = await yamlParseFile(filePath);
69822
69747
  if (runnable?.type === "inline") {
69823
69748
  const contentFile = await findRunnableContentFile(backendPath, runnableId, allFiles);
@@ -69878,7 +69803,7 @@ function writeRunnableToBackend(backendPath, runnableId, runnable) {
69878
69803
  ...rest
69879
69804
  };
69880
69805
  }
69881
- const filePath = path13.join(backendPath, `${runnableId}.yaml`);
69806
+ const filePath = path12.join(backendPath, `${runnableId}.yaml`);
69882
69807
  writeIfChanged(filePath, import_yaml16.stringify(runnableToWrite, yamlOptions));
69883
69808
  }
69884
69809
  async function collectAppFiles(localPath) {
@@ -69929,7 +69854,7 @@ async function pushRawApp(workspace, remotePath, localPath, message) {
69929
69854
  }
69930
69855
  const appFilePath = localPath + "raw_app.yaml";
69931
69856
  const localApp = await yamlParseFile(appFilePath);
69932
- const backendPath = path13.join(localPath, APP_BACKEND_FOLDER);
69857
+ const backendPath = path12.join(localPath, APP_BACKEND_FOLDER);
69933
69858
  const runnablesFromBackend = await loadRunnablesFromBackend(backendPath);
69934
69859
  let runnables;
69935
69860
  if (Object.keys(runnablesFromBackend).length > 0) {
@@ -69951,7 +69876,7 @@ async function pushRawApp(workspace, remotePath, localPath, message) {
69951
69876
  const frameworks = detectFrameworks(localPath);
69952
69877
  const entryFile = frameworks.svelte || frameworks.vue ? "index.ts" : "index.tsx";
69953
69878
  const entryPoint = localPath + entryFile;
69954
- const sharedUiDir = path13.join(process.cwd(), "ui");
69879
+ const sharedUiDir = path12.join(process.cwd(), "ui");
69955
69880
  return await createBundle({
69956
69881
  entryPoint,
69957
69882
  production: true,
@@ -70011,13 +69936,13 @@ async function pushRawApp(workspace, remotePath, localPath, message) {
70011
69936
  }
70012
69937
  await applyExtraPermsDiff(workspace, "raw_app", remotePath, localPerms, app?.extra_perms);
70013
69938
  }
70014
- async function generatingPolicy(app, path14, publicApp) {
70015
- info(colors.gray(`Generating fresh policy for app ${path14}...`));
69939
+ async function generatingPolicy(app, path13, publicApp) {
69940
+ info(colors.gray(`Generating fresh policy for app ${path13}...`));
70016
69941
  try {
70017
69942
  app.policy = await updateRawAppPolicy(app.runnables, app.policy);
70018
69943
  app.policy.execution_mode = publicApp ? "anonymous" : "publisher";
70019
69944
  } catch (e) {
70020
- error(colors.red(`Error generating policy for app ${path14}: ${e}`));
69945
+ error(colors.red(`Error generating policy for app ${path13}: ${e}`));
70021
69946
  throw e;
70022
69947
  }
70023
69948
  }
@@ -70056,7 +69981,7 @@ __export(exports_app_metadata, {
70056
69981
  filterWorkspaceDependenciesForApp: () => filterWorkspaceDependenciesForApp,
70057
69982
  APP_BACKEND_FOLDER: () => APP_BACKEND_FOLDER
70058
69983
  });
70059
- import path14 from "node:path";
69984
+ import path13 from "node:path";
70060
69985
  import { mkdir as mkdir6, readdir as readdir7 } from "node:fs/promises";
70061
69986
  import { sep as SEP12 } from "node:path";
70062
69987
  async function isAppDirectlyStale(appFolder, hashes, conf) {
@@ -70073,7 +69998,7 @@ async function isAppDirectlyStale(appFolder, hashes, conf) {
70073
69998
  return false;
70074
69999
  }
70075
70000
  async function generateAppHash(rawReqs, folder, rawApp, defaultTs) {
70076
- const runnablesFolder = rawApp ? path14.join(folder, APP_BACKEND_FOLDER) : folder;
70001
+ const runnablesFolder = rawApp ? path13.join(folder, APP_BACKEND_FOLDER) : folder;
70077
70002
  const hashes = {};
70078
70003
  try {
70079
70004
  const elems = await FSFSElement(runnablesFolder, [], true);
@@ -70116,7 +70041,7 @@ async function generateAppLocksInternal(appFolder, rawApp, dryRun, workspace, op
70116
70041
  if (!justUpdateMetadataLock && !noStaleMessage) {
70117
70042
  info(`Generating locks for app ${appFolder} at ${remote_path}`);
70118
70043
  }
70119
- const appFilePath = path14.join(appFolder, rawApp ? "raw_app.yaml" : "app.yaml");
70044
+ const appFilePath = path13.join(appFolder, rawApp ? "raw_app.yaml" : "app.yaml");
70120
70045
  const appFile = await yamlParseFile(appFilePath);
70121
70046
  const appValue = rawApp ? appFile.runnables : appFile.value;
70122
70047
  const folderNormalized = appFolder.replaceAll(SEP12, "/");
@@ -70128,7 +70053,7 @@ async function generateAppLocksInternal(appFolder, rawApp, dryRun, workspace, op
70128
70053
  const isDirectlyStale = await isAppDirectlyStale(appFolder, hashes, conf);
70129
70054
  let treeAppValue = structuredClone(appValue);
70130
70055
  if (rawApp) {
70131
- const runnablesPath = path14.join(appFolder, APP_BACKEND_FOLDER);
70056
+ const runnablesPath = path13.join(appFolder, APP_BACKEND_FOLDER);
70132
70057
  const runnablesFromFiles = await loadRunnablesFromBackend(runnablesPath);
70133
70058
  if (Object.keys(runnablesFromFiles).length > 0) {
70134
70059
  treeAppValue = runnablesFromFiles;
@@ -70194,7 +70119,7 @@ async function generateAppLocksInternal(appFolder, rawApp, dryRun, workspace, op
70194
70119
  info(`Recomputing locks of ${changedScripts.join(", ")} in ${appFolder}`);
70195
70120
  }
70196
70121
  if (rawApp) {
70197
- const runnablesPath = path14.join(appFolder, APP_BACKEND_FOLDER);
70122
+ const runnablesPath = path13.join(appFolder, APP_BACKEND_FOLDER);
70198
70123
  const rawAppFile = appFile;
70199
70124
  let runnables = await loadRunnablesFromBackend(runnablesPath);
70200
70125
  if (Object.keys(runnables).length === 0 && rawAppFile.runnables) {
@@ -70267,7 +70192,7 @@ async function traverseAndProcessInlineScripts(obj, processor, currentPath = [])
70267
70192
  }
70268
70193
  async function updateRawAppRunnables(workspace, runnables, remotePath, appFolder, rawDeps, defaultTs = "bun", noStaleMessage, tempScriptRefs) {
70269
70194
  const updatedRunnables = [];
70270
- const runnablesFolder = path14.join(appFolder, APP_BACKEND_FOLDER);
70195
+ const runnablesFolder = path13.join(appFolder, APP_BACKEND_FOLDER);
70271
70196
  try {
70272
70197
  await mkdir6(runnablesFolder, { recursive: true });
70273
70198
  } catch {}
@@ -70292,7 +70217,7 @@ async function updateRawAppRunnables(workspace, runnables, remotePath, appFolder
70292
70217
  if (language === "frontend") {
70293
70218
  const [basePathO, ext2] = pathAssigner.assignPath(runnableId, language);
70294
70219
  const basePath = basePathO.replaceAll(SEP12, "/");
70295
- const contentPath = path14.join(runnablesFolder, `${basePath}${ext2}`);
70220
+ const contentPath = path13.join(runnablesFolder, `${basePath}${ext2}`);
70296
70221
  writeIfChanged(contentPath, content);
70297
70222
  const simplifiedRunnable = { type: "inline" };
70298
70223
  for (const [key, value] of Object.entries(runnable)) {
@@ -70310,8 +70235,8 @@ async function updateRawAppRunnables(workspace, runnables, remotePath, appFolder
70310
70235
  const lock = await generateInlineScriptLock(workspace, content, language, `${remotePath}/${runnableId}`, rawDeps, tempScriptRefs);
70311
70236
  const [basePathO, ext2] = pathAssigner.assignPath(runnableId, language);
70312
70237
  const basePath = basePathO.replaceAll(SEP12, "/");
70313
- const contentPath = path14.join(runnablesFolder, `${basePath}${ext2}`);
70314
- const lockPath = path14.join(runnablesFolder, `${basePath}lock`);
70238
+ const contentPath = path13.join(runnablesFolder, `${basePath}${ext2}`);
70239
+ const lockPath = path13.join(runnablesFolder, `${basePath}lock`);
70315
70240
  writeIfChanged(contentPath, content);
70316
70241
  if (lock && lock !== "") {
70317
70242
  writeIfChanged(lockPath, lock);
@@ -70359,8 +70284,8 @@ async function updateAppInlineScripts(workspace, appValue, remotePath, appFolder
70359
70284
  }
70360
70285
  const [basePathO, ext2] = pathAssigner.assignPath(scriptName, language);
70361
70286
  const basePath = basePathO.replaceAll(SEP12, "/");
70362
- const contentPath = path14.join(appFolder, `${basePath}${ext2}`);
70363
- const lockPath = path14.join(appFolder, `${basePath}lock`);
70287
+ const contentPath = path13.join(appFolder, `${basePath}${ext2}`);
70288
+ const lockPath = path13.join(appFolder, `${basePath}lock`);
70364
70289
  writeIfChanged(contentPath, content);
70365
70290
  if (lock && lock !== "") {
70366
70291
  writeIfChanged(lockPath, lock);
@@ -70434,7 +70359,7 @@ ${text}`);
70434
70359
  return lock ?? "";
70435
70360
  }
70436
70361
  async function inferRunnableSchemaFromFile(appFolder, runnableFilePath, defaultTs = "bun") {
70437
- const fileName = path14.basename(runnableFilePath);
70362
+ const fileName = path13.basename(runnableFilePath);
70438
70363
  if (fileName.endsWith(".lock") || fileName.endsWith(".yaml")) {
70439
70364
  return;
70440
70365
  }
@@ -70449,13 +70374,13 @@ async function inferRunnableSchemaFromFile(appFolder, runnableFilePath, defaultT
70449
70374
  if (!runnableId || !ext2) {
70450
70375
  return;
70451
70376
  }
70452
- const runnableFilePath2 = path14.join(appFolder, APP_BACKEND_FOLDER, `${runnableId}.yaml`);
70377
+ const runnableFilePath2 = path13.join(appFolder, APP_BACKEND_FOLDER, `${runnableId}.yaml`);
70453
70378
  let runnable;
70454
70379
  try {
70455
70380
  runnable = await yamlParseFile(runnableFilePath2);
70456
70381
  } catch {
70457
70382
  try {
70458
- const appFilePath = path14.join(appFolder, "raw_app.yaml");
70383
+ const appFilePath = path13.join(appFolder, "raw_app.yaml");
70459
70384
  const appFile = await yamlParseFile(appFilePath);
70460
70385
  if (!appFile.runnables?.[runnableId]) {
70461
70386
  warn(colors.yellow(`Runnable ${runnableId} not found in backend folder or raw_app.yaml`));
@@ -70480,7 +70405,7 @@ async function inferRunnableSchemaFromFile(appFolder, runnableFilePath, defaultT
70480
70405
  warn(colors.yellow(`Could not determine language for ${runnableId} (ext: ${ext2})`));
70481
70406
  return;
70482
70407
  }
70483
- const fullFilePath = path14.join(appFolder, APP_BACKEND_FOLDER, runnableFilePath);
70408
+ const fullFilePath = path13.join(appFolder, APP_BACKEND_FOLDER, runnableFilePath);
70484
70409
  let content;
70485
70410
  try {
70486
70411
  content = await readTextFile(fullFilePath);
@@ -70503,7 +70428,7 @@ async function inferRunnableSchemaFromFile(appFolder, runnableFilePath, defaultT
70503
70428
  }
70504
70429
  async function inferAllInlineSchemas(appFolder, defaultTs = "bun") {
70505
70430
  const schemas = {};
70506
- const backendPath = path14.join(appFolder, APP_BACKEND_FOLDER);
70431
+ const backendPath = path13.join(appFolder, APP_BACKEND_FOLDER);
70507
70432
  let entries;
70508
70433
  try {
70509
70434
  entries = await readdir7(backendPath, { withFileTypes: true });
@@ -70613,8 +70538,8 @@ var init_app_metadata = __esm(async () => {
70613
70538
  // src/commands/app/generate_agents.ts
70614
70539
  import * as fs10 from "node:fs";
70615
70540
  import { writeFile as writeFile9 } from "node:fs/promises";
70616
- import path15 from "node:path";
70617
- import process15 from "node:process";
70541
+ import path14 from "node:path";
70542
+ import process14 from "node:process";
70618
70543
  function generateDatatablesMarkdown(schemas, localData) {
70619
70544
  const defaultDatatable = localData?.datatable;
70620
70545
  const defaultSchema = localData?.schema;
@@ -70713,7 +70638,7 @@ Configure datatables in Workspace Settings > Windmill Data Tables.
70713
70638
  return content;
70714
70639
  }
70715
70640
  async function regenerateAgentDocs(workspaceId, targetDir, silent = false) {
70716
- const rawAppPath = path15.join(targetDir, "raw_app.yaml");
70641
+ const rawAppPath = path14.join(targetDir, "raw_app.yaml");
70717
70642
  if (!fs10.existsSync(rawAppPath)) {
70718
70643
  if (!silent) {
70719
70644
  error(colors.red(`Error: raw_app.yaml not found in ${targetDir}`));
@@ -70740,11 +70665,11 @@ async function regenerateAgentDocs(workspaceId, targetDir, silent = false) {
70740
70665
  }
70741
70666
  } catch {}
70742
70667
  const agentsContent = generateAgentsDocumentation(localData);
70743
- await writeFile9(path15.join(targetDir, "AGENTS.md"), agentsContent, "utf-8");
70744
- await writeFile9(path15.join(targetDir, "CLAUDE.md"), `Instructions are in @AGENTS.md
70668
+ await writeFile9(path14.join(targetDir, "AGENTS.md"), agentsContent, "utf-8");
70669
+ await writeFile9(path14.join(targetDir, "CLAUDE.md"), `Instructions are in @AGENTS.md
70745
70670
  `, "utf-8");
70746
70671
  const datatablesContent = generateDatatablesMarkdown(schemas, localData);
70747
- await writeFile9(path15.join(targetDir, "DATATABLES.md"), datatablesContent, "utf-8");
70672
+ await writeFile9(path14.join(targetDir, "DATATABLES.md"), datatablesContent, "utf-8");
70748
70673
  if (!silent) {
70749
70674
  info(colors.green(`✓ Generated AGENTS.md, CLAUDE.md, and DATATABLES.md`));
70750
70675
  const datatableCount = schemas.length;
@@ -70762,24 +70687,24 @@ async function regenerateAgentDocs(workspaceId, targetDir, silent = false) {
70762
70687
  }
70763
70688
  }
70764
70689
  async function generateAgents(opts, appFolder) {
70765
- const cwd = process15.cwd();
70690
+ const cwd = process14.cwd();
70766
70691
  let targetDir = cwd;
70767
70692
  if (appFolder) {
70768
- targetDir = path15.isAbsolute(appFolder) ? appFolder : path15.join(cwd, appFolder);
70693
+ targetDir = path14.isAbsolute(appFolder) ? appFolder : path14.join(cwd, appFolder);
70769
70694
  }
70770
70695
  await loadNonDottedPathsSetting();
70771
- const dirName = path15.basename(targetDir);
70696
+ const dirName = path14.basename(targetDir);
70772
70697
  if (!hasFolderSuffix(dirName, "raw_app")) {
70773
- if (!hasFolderSuffix(path15.basename(cwd), "raw_app") && !appFolder) {
70698
+ if (!hasFolderSuffix(path14.basename(cwd), "raw_app") && !appFolder) {
70774
70699
  error(colors.red(`Error: Must be run inside a ${getFolderSuffix("raw_app")} folder or specify one as argument.`));
70775
70700
  info(colors.gray("Usage: wmill app generate-agents [app_folder]"));
70776
- process15.exit(1);
70701
+ process14.exit(1);
70777
70702
  }
70778
70703
  }
70779
- const rawAppPath = path15.join(targetDir, "raw_app.yaml");
70704
+ const rawAppPath = path14.join(targetDir, "raw_app.yaml");
70780
70705
  if (!fs10.existsSync(rawAppPath)) {
70781
70706
  error(colors.red(`Error: raw_app.yaml not found in ${targetDir}`));
70782
- process15.exit(1);
70707
+ process14.exit(1);
70783
70708
  }
70784
70709
  const workspace = await resolveWorkspace(opts);
70785
70710
  await requireLogin(opts);
@@ -70806,33 +70731,33 @@ var init_generate_agents = __esm(async () => {
70806
70731
  import { sep as SEP13 } from "node:path";
70807
70732
  import * as http2 from "node:http";
70808
70733
  import * as fs11 from "node:fs";
70809
- import * as path16 from "node:path";
70810
- import process16 from "node:process";
70811
- import { writeFileSync as writeFileSync6 } from "node:fs";
70734
+ import * as path15 from "node:path";
70735
+ import process15 from "node:process";
70736
+ import { writeFileSync as writeFileSync5 } from "node:fs";
70812
70737
  async function dev(opts, appFolder) {
70813
70738
  GLOBAL_CONFIG_OPT.noCdToRoot = true;
70814
70739
  await loadNonDottedPathsSetting();
70815
- const originalCwd = process16.cwd();
70740
+ const originalCwd = process15.cwd();
70816
70741
  let targetDir = originalCwd;
70817
70742
  if (appFolder) {
70818
- targetDir = path16.isAbsolute(appFolder) ? appFolder : path16.join(originalCwd, appFolder);
70743
+ targetDir = path15.isAbsolute(appFolder) ? appFolder : path15.join(originalCwd, appFolder);
70819
70744
  if (!fs11.existsSync(targetDir)) {
70820
70745
  error(colors.red(`Error: Directory not found: ${targetDir}`));
70821
- process16.exit(1);
70746
+ process15.exit(1);
70822
70747
  }
70823
70748
  }
70824
- const targetDirName = path16.basename(targetDir);
70749
+ const targetDirName = path15.basename(targetDir);
70825
70750
  if (!hasFolderSuffix(targetDirName, "raw_app")) {
70826
70751
  error(colors.red(`Error: The dev command must be run inside a ${getFolderSuffix("raw_app")} folder.
70827
70752
  ` + `Target directory: ${targetDirName}
70828
70753
  ` + `Please navigate to a folder ending with '${getFolderSuffix("raw_app")}' or specify one as argument.`));
70829
- process16.exit(1);
70754
+ process15.exit(1);
70830
70755
  }
70831
- const rawAppPath = path16.join(targetDir, "raw_app.yaml");
70756
+ const rawAppPath = path15.join(targetDir, "raw_app.yaml");
70832
70757
  if (!fs11.existsSync(rawAppPath)) {
70833
70758
  error(colors.red(`Error: raw_app.yaml not found in ${targetDir}.
70834
70759
  ` + `The dev command requires a ${getFolderSuffix("raw_app")} folder containing a raw_app.yaml file.`));
70835
- process16.exit(1);
70760
+ process15.exit(1);
70836
70761
  }
70837
70762
  const workspace = await resolveWorkspace(opts);
70838
70763
  await requireLogin(opts);
@@ -70840,25 +70765,25 @@ async function dev(opts, appFolder) {
70840
70765
  let appTempRefs = undefined;
70841
70766
  {
70842
70767
  const wmillYamlPath = getWmillYamlPath();
70843
- const workspaceRoot = wmillYamlPath ? path16.dirname(wmillYamlPath) : originalCwd;
70844
- const relAppFolder = path16.relative(workspaceRoot, targetDir) || ".";
70768
+ const workspaceRoot = wmillYamlPath ? path15.dirname(wmillYamlPath) : originalCwd;
70769
+ const relAppFolder = path15.relative(workspaceRoot, targetDir) || ".";
70845
70770
  const mergedOpts = await mergeConfigWithConfigFile(opts);
70846
70771
  const codebases = await listSyncCodebases(mergedOpts);
70847
70772
  const { buildPreviewTempScriptRefs: buildPreviewTempScriptRefs2 } = await init_generate_metadata().then(() => exports_generate_metadata);
70848
- const savedCwd = process16.cwd();
70773
+ const savedCwd = process15.cwd();
70849
70774
  if (workspaceRoot !== savedCwd) {
70850
- process16.chdir(workspaceRoot);
70775
+ process15.chdir(workspaceRoot);
70851
70776
  }
70852
70777
  try {
70853
70778
  appTempRefs = await buildPreviewTempScriptRefs2(workspace, mergedOpts, codebases, { kind: "app", folder: relAppFolder, rawApp: true });
70854
70779
  } finally {
70855
70780
  if (workspaceRoot !== savedCwd) {
70856
- process16.chdir(savedCwd);
70781
+ process15.chdir(savedCwd);
70857
70782
  }
70858
70783
  }
70859
70784
  }
70860
70785
  if (appFolder) {
70861
- process16.chdir(targetDir);
70786
+ process15.chdir(targetDir);
70862
70787
  }
70863
70788
  const rawApp = await yamlParseFile(rawAppPath);
70864
70789
  const appPath = rawApp?.custom_path ?? "u/unknown/newapp";
@@ -70872,30 +70797,30 @@ async function dev(opts, appFolder) {
70872
70797
  port: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10].map((p) => p + DEFAULT_PORT)
70873
70798
  });
70874
70799
  const shouldOpen = opts.open ?? true;
70875
- const frameworks = detectFrameworks(process16.cwd());
70800
+ const frameworks = detectFrameworks(process15.cwd());
70876
70801
  const defaultEntry = frameworks.svelte || frameworks.vue ? "index.ts" : "index.tsx";
70877
70802
  const entryPoint = opts.entry ?? defaultEntry;
70878
70803
  if (!fs11.existsSync(entryPoint)) {
70879
70804
  error(colors.red(`Entry point "${entryPoint}" not found. Please specify a valid entry point with --entry.`));
70880
- process16.exit(1);
70805
+ process15.exit(1);
70881
70806
  }
70882
- const appDir = path16.dirname(entryPoint) || process16.cwd();
70807
+ const appDir = path15.dirname(entryPoint) || process15.cwd();
70883
70808
  await ensureNodeModules(appDir);
70884
70809
  const inferredSchemas = {};
70885
70810
  try {
70886
- Object.assign(inferredSchemas, await inferAllInlineSchemas(process16.cwd()));
70811
+ Object.assign(inferredSchemas, await inferAllInlineSchemas(process15.cwd()));
70887
70812
  } catch (err) {
70888
70813
  warn(colors.yellow(`Could not seed inline schemas at startup: ${err.message}`));
70889
70814
  }
70890
70815
  const pathRunnableSchemas = {};
70891
70816
  try {
70892
- const initialRunnables = await loadRunnablesFromBackend(path16.join(process16.cwd(), APP_BACKEND_FOLDER));
70817
+ const initialRunnables = await loadRunnablesFromBackend(path15.join(process15.cwd(), APP_BACKEND_FOLDER));
70893
70818
  Object.assign(pathRunnableSchemas, await fetchPathRunnableSchemas(workspaceId, initialRunnables));
70894
70819
  } catch (err) {
70895
70820
  warn(colors.yellow(`Could not fetch schemas for path-based runnables: ${err.message}`));
70896
70821
  }
70897
70822
  await genRunnablesTs(inferredSchemas, pathRunnableSchemas);
70898
- const distDir = path16.join(process16.cwd(), "dist");
70823
+ const distDir = path15.join(process15.cwd(), "dist");
70899
70824
  if (!fs11.existsSync(distDir)) {
70900
70825
  fs11.mkdirSync(distDir);
70901
70826
  }
@@ -70958,7 +70883,7 @@ data: reload
70958
70883
  info(colors.blue(`\uD83D\uDC40 Watching for file changes...
70959
70884
  `));
70960
70885
  await ctx.rebuild();
70961
- const runnablesPath = path16.join(process16.cwd(), APP_BACKEND_FOLDER);
70886
+ const runnablesPath = path15.join(process15.cwd(), APP_BACKEND_FOLDER);
70962
70887
  let runnablesWatcher;
70963
70888
  if (fs11.existsSync(runnablesPath)) {
70964
70889
  info(colors.blue(`\uD83D\uDC41️ Watching runnables folder at: ${runnablesPath}
@@ -70970,8 +70895,8 @@ data: reload
70970
70895
  if (!filename)
70971
70896
  return;
70972
70897
  const fileStr = typeof filename === "string" ? filename : filename.toString();
70973
- const changedPath = path16.join(runnablesPath, fileStr);
70974
- const relativePath = path16.relative(process16.cwd(), changedPath);
70898
+ const changedPath = path15.join(runnablesPath, fileStr);
70899
+ const relativePath = path15.relative(process15.cwd(), changedPath);
70975
70900
  const relativeToRunnables = fileStr;
70976
70901
  if (changedPath.endsWith(".lock")) {
70977
70902
  return;
@@ -70984,7 +70909,7 @@ data: reload
70984
70909
  delete schemaInferenceTimeouts[changedPath];
70985
70910
  try {
70986
70911
  info(colors.cyan(`\uD83D\uDCDD Inferring schema for: ${relativeToRunnables}`));
70987
- const result = await inferRunnableSchemaFromFile(process16.cwd(), relativeToRunnables);
70912
+ const result = await inferRunnableSchemaFromFile(process15.cwd(), relativeToRunnables);
70988
70913
  if (result) {
70989
70914
  inferredSchemas[result.runnableId] = result.schema;
70990
70915
  info(colors.green(` Inferred Schemas: ${JSON.stringify(inferredSchemas, null, 2)}`));
@@ -71022,7 +70947,7 @@ data: reload
71022
70947
  return;
71023
70948
  }
71024
70949
  if (url === "/dist/bundle.js" || url === "/bundle.js") {
71025
- const jsPath = path16.join(process16.cwd(), "dist/bundle.js");
70950
+ const jsPath = path15.join(process15.cwd(), "dist/bundle.js");
71026
70951
  if (fs11.existsSync(jsPath)) {
71027
70952
  res.writeHead(200, { "Content-Type": "application/javascript" });
71028
70953
  res.end(fs11.readFileSync(jsPath));
@@ -71033,7 +70958,7 @@ data: reload
71033
70958
  return;
71034
70959
  }
71035
70960
  if (url === "/dist/bundle.css" || url === "/bundle.css") {
71036
- const cssPath = path16.join(process16.cwd(), "dist/bundle.css");
70961
+ const cssPath = path15.join(process15.cwd(), "dist/bundle.css");
71037
70962
  if (fs11.existsSync(cssPath)) {
71038
70963
  res.writeHead(200, { "Content-Type": "text/css" });
71039
70964
  res.end(fs11.readFileSync(cssPath));
@@ -71044,7 +70969,7 @@ data: reload
71044
70969
  return;
71045
70970
  }
71046
70971
  if (url === "/dist/bundle.js.map" || url === "/bundle.js.map") {
71047
- const mapPath = path16.join(process16.cwd(), "dist/bundle.js.map");
70972
+ const mapPath = path15.join(process15.cwd(), "dist/bundle.js.map");
71048
70973
  if (fs11.existsSync(mapPath)) {
71049
70974
  res.writeHead(200, { "Content-Type": "application/json" });
71050
70975
  res.end(fs11.readFileSync(mapPath));
@@ -71055,7 +70980,7 @@ data: reload
71055
70980
  return;
71056
70981
  }
71057
70982
  if (url === "/dist/bundle.css.map" || url === "/bundle.css.map") {
71058
- const mapPath = path16.join(process16.cwd(), "dist/bundle.css.map");
70983
+ const mapPath = path15.join(process15.cwd(), "dist/bundle.css.map");
71059
70984
  if (fs11.existsSync(mapPath)) {
71060
70985
  res.writeHead(200, { "Content-Type": "application/json" });
71061
70986
  res.end(fs11.readFileSync(mapPath));
@@ -71069,12 +70994,12 @@ data: reload
71069
70994
  res.end(createHTML("/dist/bundle.js", "/dist/bundle.css"));
71070
70995
  });
71071
70996
  const wss = new import_websocket_server.default({ server });
71072
- const sqlToApplyPath = path16.join(process16.cwd(), "sql_to_apply");
70997
+ const sqlToApplyPath = path15.join(process15.cwd(), "sql_to_apply");
71073
70998
  const sqlFileQueue = [];
71074
70999
  let currentSqlFile = null;
71075
71000
  async function getDatatableConfig() {
71076
71001
  try {
71077
- const rawApp2 = await yamlParseFile(path16.join(process16.cwd(), "raw_app.yaml"));
71002
+ const rawApp2 = await yamlParseFile(path15.join(process15.cwd(), "raw_app.yaml"));
71078
71003
  return rawApp2?.data?.datatable;
71079
71004
  } catch {
71080
71005
  return;
@@ -71111,12 +71036,12 @@ data: reload
71111
71036
  }
71112
71037
  const filePath = sqlFileQueue.shift();
71113
71038
  if (!fs11.existsSync(filePath)) {
71114
- info(colors.gray(`File no longer exists: ${path16.basename(filePath)}`));
71039
+ info(colors.gray(`File no longer exists: ${path15.basename(filePath)}`));
71115
71040
  await processNextSqlFile();
71116
71041
  return;
71117
71042
  }
71118
71043
  currentSqlFile = filePath;
71119
- const fileName = path16.basename(filePath);
71044
+ const fileName = path15.basename(filePath);
71120
71045
  try {
71121
71046
  const sqlContent = await readTextFile(filePath);
71122
71047
  if (!sqlContent.trim()) {
@@ -71138,9 +71063,9 @@ data: reload
71138
71063
  if (deleteFile && fs11.existsSync(filePath)) {
71139
71064
  try {
71140
71065
  fs11.unlinkSync(filePath);
71141
- info(colors.green(`✓ Deleted: ${path16.basename(filePath)}`));
71066
+ info(colors.green(`✓ Deleted: ${path15.basename(filePath)}`));
71142
71067
  } catch (error2) {
71143
- error(colors.red(`Failed to delete ${path16.basename(filePath)}: ${error2.message}`));
71068
+ error(colors.red(`Failed to delete ${path15.basename(filePath)}: ${error2.message}`));
71144
71069
  }
71145
71070
  }
71146
71071
  currentSqlFile = null;
@@ -71152,7 +71077,7 @@ data: reload
71152
71077
  try {
71153
71078
  const sqlContent = await readTextFile(currentSqlFile);
71154
71079
  const datatable = await getDatatableConfig();
71155
- const fileName = path16.basename(currentSqlFile);
71080
+ const fileName = path15.basename(currentSqlFile);
71156
71081
  ws.send(JSON.stringify({
71157
71082
  type: "sqlMigration",
71158
71083
  fileName,
@@ -71166,7 +71091,7 @@ data: reload
71166
71091
  const sqlFiles = entries.filter((entry) => entry.endsWith(".sql"));
71167
71092
  if (sqlFiles.length > 0 && sqlFileQueue.length === 0) {
71168
71093
  for (const sqlFile of sqlFiles.sort()) {
71169
- queueSqlFile(path16.join(sqlToApplyPath, sqlFile));
71094
+ queueSqlFile(path15.join(sqlToApplyPath, sqlFile));
71170
71095
  }
71171
71096
  await processNextSqlFile();
71172
71097
  }
@@ -71293,7 +71218,7 @@ data: reload
71293
71218
  await onSqlFileCompleted(currentSqlFile, true);
71294
71219
  }
71295
71220
  try {
71296
- await regenerateAgentDocs(workspaceId, process16.cwd(), true);
71221
+ await regenerateAgentDocs(workspaceId, process15.cwd(), true);
71297
71222
  info(colors.gray(`[SQL Migration] Refreshed AGENTS.md and DATATABLES.md`));
71298
71223
  } catch (regenError) {
71299
71224
  warn(colors.yellow(`[SQL Migration] Could not refresh docs: ${regenError.message}`));
@@ -71345,7 +71270,7 @@ data: reload
71345
71270
  }
71346
71271
  info(colors.blue(`\uD83D\uDD0D Found ${sqlFiles.length} SQL file(s) in sql_to_apply/`));
71347
71272
  for (const sqlFile of sqlFiles) {
71348
- const filePath = path16.join(sqlToApplyPath, sqlFile);
71273
+ const filePath = path15.join(sqlToApplyPath, sqlFile);
71349
71274
  queueSqlFile(filePath);
71350
71275
  }
71351
71276
  await processNextSqlFile();
@@ -71363,11 +71288,11 @@ data: reload
71363
71288
  if (!filename)
71364
71289
  return;
71365
71290
  const fileStr = typeof filename === "string" ? filename : filename.toString();
71366
- const changedPath = path16.join(sqlToApplyPath, fileStr);
71291
+ const changedPath = path15.join(sqlToApplyPath, fileStr);
71367
71292
  if (!changedPath.endsWith(".sql")) {
71368
71293
  return;
71369
71294
  }
71370
- const fileName = path16.basename(changedPath);
71295
+ const fileName = path15.basename(changedPath);
71371
71296
  if (sqlDebounceTimeouts[changedPath]) {
71372
71297
  clearTimeout(sqlDebounceTimeouts[changedPath]);
71373
71298
  }
@@ -71392,7 +71317,7 @@ data: reload
71392
71317
  const url = `http://${host}:${port}`;
71393
71318
  info(colors.bold.green(`\uD83D\uDE80 Dev server running at ${url}`));
71394
71319
  info(colors.cyan(`\uD83D\uDD0C WebSocket server running at ws://${host}:${port}`));
71395
- info(colors.gray(`\uD83D\uDCE6 Serving files from: ${process16.cwd()}`));
71320
+ info(colors.gray(`\uD83D\uDCE6 Serving files from: ${process15.cwd()}`));
71396
71321
  info(colors.gray(`\uD83D\uDD04 Live reload enabled
71397
71322
  `));
71398
71323
  if (shouldOpen) {
@@ -71406,7 +71331,7 @@ data: reload
71406
71331
  }
71407
71332
  }
71408
71333
  });
71409
- process16.on("SIGINT", async () => {
71334
+ process15.on("SIGINT", async () => {
71410
71335
  info(colors.yellow(`
71411
71336
 
71412
71337
  \uD83D\uDED1 Shutting down...`));
@@ -71419,17 +71344,17 @@ data: reload
71419
71344
  sqlWatcher.close();
71420
71345
  }
71421
71346
  await ctx.dispose();
71422
- process16.exit(0);
71347
+ process15.exit(0);
71423
71348
  });
71424
71349
  }
71425
71350
  async function genRunnablesTs(inlineSchemaOverrides = {}, pathSchemaOverrides = {}) {
71426
71351
  info(colors.blue("\uD83D\uDD04 Generating wmill.d.ts..."));
71427
- const localPath = process16.cwd();
71428
- const backendPath = path16.join(localPath, APP_BACKEND_FOLDER);
71352
+ const localPath = process15.cwd();
71353
+ const backendPath = path15.join(localPath, APP_BACKEND_FOLDER);
71429
71354
  let runnables = await loadRunnablesFromBackend(backendPath);
71430
71355
  if (Object.keys(runnables).length === 0) {
71431
71356
  try {
71432
- const rawApp = await yamlParseFile(path16.join(localPath, "raw_app.yaml"));
71357
+ const rawApp = await yamlParseFile(path15.join(localPath, "raw_app.yaml"));
71433
71358
  runnables = rawApp?.["runnables"] ?? {};
71434
71359
  } catch {
71435
71360
  runnables = {};
@@ -71437,7 +71362,7 @@ async function genRunnablesTs(inlineSchemaOverrides = {}, pathSchemaOverrides =
71437
71362
  }
71438
71363
  try {
71439
71364
  const newWmillTs = buildWmillTs(runnables, inlineSchemaOverrides, pathSchemaOverrides);
71440
- writeFileSync6(path16.join(process16.cwd(), "wmill.d.ts"), newWmillTs);
71365
+ writeFileSync5(path15.join(process15.cwd(), "wmill.d.ts"), newWmillTs);
71441
71366
  } catch (error2) {
71442
71367
  error(colors.red(`Failed to generate wmill.d.ts: ${error2.message}`));
71443
71368
  }
@@ -71506,11 +71431,11 @@ function convertRunnablesToApiFormat(runnables) {
71506
71431
  }
71507
71432
  async function loadRunnables() {
71508
71433
  try {
71509
- const localPath = process16.cwd();
71510
- const backendPath = path16.join(localPath, APP_BACKEND_FOLDER);
71434
+ const localPath = process15.cwd();
71435
+ const backendPath = path15.join(localPath, APP_BACKEND_FOLDER);
71511
71436
  let runnables = await loadRunnablesFromBackend(backendPath);
71512
71437
  if (Object.keys(runnables).length === 0) {
71513
- const rawApp = await yamlParseFile(path16.join(localPath, "raw_app.yaml"));
71438
+ const rawApp = await yamlParseFile(path15.join(localPath, "raw_app.yaml"));
71514
71439
  runnables = rawApp?.runnables ?? {};
71515
71440
  }
71516
71441
  convertRunnablesToApiFormat(runnables);
@@ -72014,8 +71939,8 @@ var init_dev = __esm(async () => {
72014
71939
 
72015
71940
  // src/commands/app/lint.ts
72016
71941
  import * as fs12 from "node:fs";
72017
- import * as path17 from "node:path";
72018
- import process17 from "node:process";
71942
+ import * as path16 from "node:path";
71943
+ import process16 from "node:process";
72019
71944
  function validateRawAppYaml(appData) {
72020
71945
  const errors = [];
72021
71946
  const warnings = [];
@@ -72029,7 +71954,7 @@ function validateRawAppYaml(appData) {
72029
71954
  async function validateRunnables(appDir, appData) {
72030
71955
  const errors = [];
72031
71956
  const warnings = [];
72032
- const backendPath = path17.join(appDir, APP_BACKEND_FOLDER);
71957
+ const backendPath = path16.join(appDir, APP_BACKEND_FOLDER);
72033
71958
  const runnablesFromBackend = await loadRunnablesFromBackend(backendPath);
72034
71959
  const hasBackendRunnables = Object.keys(runnablesFromBackend).length > 0;
72035
71960
  const hasYamlRunnables = appData.runnables && typeof appData.runnables === "object" && !Array.isArray(appData.runnables) && Object.keys(appData.runnables).length > 0;
@@ -72052,7 +71977,7 @@ async function validateBuild(appDir) {
72052
71977
  info(colors.blue("\uD83D\uDD28 Testing build..."));
72053
71978
  const frameworks = detectFrameworks(appDir);
72054
71979
  const entryFile = frameworks.svelte || frameworks.vue ? "index.ts" : "index.tsx";
72055
- const entryPoint = path17.join(appDir, entryFile);
71980
+ const entryPoint = path16.join(appDir, entryFile);
72056
71981
  await createBundle({
72057
71982
  entryPoint,
72058
71983
  production: true,
@@ -72067,12 +71992,12 @@ async function validateBuild(appDir) {
72067
71992
  async function lintRawApp(appDir, opts) {
72068
71993
  const errors = [];
72069
71994
  const warnings = [];
72070
- const currentDirName = path17.basename(appDir);
71995
+ const currentDirName = path16.basename(appDir);
72071
71996
  if (!hasFolderSuffix(currentDirName, "raw_app")) {
72072
71997
  errors.push(`Not a raw app folder: '${currentDirName}' does not end with '${getFolderSuffix("raw_app")}'`);
72073
71998
  return { valid: false, errors, warnings };
72074
71999
  }
72075
- const rawAppPath = path17.join(appDir, "raw_app.yaml");
72000
+ const rawAppPath = path16.join(appDir, "raw_app.yaml");
72076
72001
  if (!fs12.existsSync(rawAppPath)) {
72077
72002
  errors.push("Missing raw_app.yaml file");
72078
72003
  return { valid: false, errors, warnings };
@@ -72111,7 +72036,7 @@ async function lintRawApp(appDir, opts) {
72111
72036
  }
72112
72037
  async function lint2(opts, appFolder) {
72113
72038
  await loadNonDottedPathsSetting();
72114
- const targetDir = appFolder ?? process17.cwd();
72039
+ const targetDir = appFolder ?? process16.cwd();
72115
72040
  info(colors.bold.blue(`
72116
72041
  \uD83D\uDD0D Linting raw app: ${targetDir}
72117
72042
  `));
@@ -72132,7 +72057,7 @@ async function lint2(opts, appFolder) {
72132
72057
  info(colors.red(`
72133
72058
  ❌ Lint failed
72134
72059
  `));
72135
- process17.exit(1);
72060
+ process16.exit(1);
72136
72061
  }
72137
72062
  info(colors.green(`
72138
72063
  ✅ All checks passed
@@ -72156,8 +72081,8 @@ var init_lint2 = __esm(async () => {
72156
72081
 
72157
72082
  // src/commands/app/new.ts
72158
72083
  import { stat as stat9, writeFile as writeFile10, mkdir as mkdir7, rm as rm3 } from "node:fs/promises";
72159
- import path18 from "node:path";
72160
- import { execSync as execSync6, exec, execFile as execFile6 } from "node:child_process";
72084
+ import path17 from "node:path";
72085
+ import { execSync as execSync5, exec, execFile as execFile6 } from "node:child_process";
72161
72086
  function validateAppPath(appPath) {
72162
72087
  if (!appPath.startsWith("u/") && !appPath.startsWith("f/")) {
72163
72088
  return {
@@ -72412,7 +72337,7 @@ CREATE SCHEMA IF NOT EXISTS ${schemaName};
72412
72337
  }
72413
72338
  await loadNonDottedPathsSetting();
72414
72339
  const folderName2 = buildFolderPath(appPath, "raw_app");
72415
- const appDir = path18.join(process.cwd(), folderName2);
72340
+ const appDir = path17.join(process.cwd(), folderName2);
72416
72341
  let dirExists = false;
72417
72342
  try {
72418
72343
  await stat9(appDir);
@@ -72437,17 +72362,17 @@ CREATE SCHEMA IF NOT EXISTS ${schemaName};
72437
72362
  await rm3(appDir, { recursive: true, force: true });
72438
72363
  }
72439
72364
  await mkdir7(appDir, { recursive: true });
72440
- await mkdir7(path18.join(appDir, "backend"), { recursive: true });
72441
- await mkdir7(path18.join(appDir, "sql_to_apply"), { recursive: true });
72365
+ await mkdir7(path17.join(appDir, "backend"), { recursive: true });
72366
+ await mkdir7(path17.join(appDir, "sql_to_apply"), { recursive: true });
72442
72367
  const rawAppConfig = {
72443
72368
  summary
72444
72369
  };
72445
72370
  if (dataConfig.datatable) {
72446
72371
  rawAppConfig.data = dataConfig;
72447
72372
  }
72448
- await writeFile10(path18.join(appDir, "raw_app.yaml"), import_yaml22.stringify(rawAppConfig, yamlOptions), "utf-8");
72373
+ await writeFile10(path17.join(appDir, "raw_app.yaml"), import_yaml22.stringify(rawAppConfig, yamlOptions), "utf-8");
72449
72374
  for (const [filePath, content] of Object.entries(template.files)) {
72450
- const fullPath = path18.join(appDir, filePath.slice(1));
72375
+ const fullPath = path17.join(appDir, filePath.slice(1));
72451
72376
  await writeFile10(fullPath, content.trim() + `
72452
72377
  `, "utf-8");
72453
72378
  }
@@ -72457,21 +72382,21 @@ CREATE SCHEMA IF NOT EXISTS ${schemaName};
72457
72382
  schema: dataConfig.schema
72458
72383
  } : undefined;
72459
72384
  const agentsContent = generateAgentsDocumentation(dataForDocs);
72460
- await writeFile10(path18.join(appDir, "AGENTS.md"), agentsContent, "utf-8");
72461
- await writeFile10(path18.join(appDir, "CLAUDE.md"), `Instructions are in @AGENTS.md
72385
+ await writeFile10(path17.join(appDir, "AGENTS.md"), agentsContent, "utf-8");
72386
+ await writeFile10(path17.join(appDir, "CLAUDE.md"), `Instructions are in @AGENTS.md
72462
72387
  `, "utf-8");
72463
72388
  const datatablesContent = generateDatatablesDocumentation(dataForDocs);
72464
- await writeFile10(path18.join(appDir, "DATATABLES.md"), datatablesContent, "utf-8");
72389
+ await writeFile10(path17.join(appDir, "DATATABLES.md"), datatablesContent, "utf-8");
72465
72390
  const exampleRunnable = {
72466
72391
  type: "inline",
72467
72392
  path: undefined
72468
72393
  };
72469
- await writeFile10(path18.join(appDir, "backend", "a.yaml"), import_yaml22.stringify(exampleRunnable, yamlOptions), "utf-8");
72470
- await writeFile10(path18.join(appDir, "backend", "a.ts"), `export async function main(x: number): Promise<string> {
72394
+ await writeFile10(path17.join(appDir, "backend", "a.yaml"), import_yaml22.stringify(exampleRunnable, yamlOptions), "utf-8");
72395
+ await writeFile10(path17.join(appDir, "backend", "a.ts"), `export async function main(x: number): Promise<string> {
72471
72396
  return \`Hello from backend! x = \${x}\`;
72472
72397
  }
72473
72398
  `, "utf-8");
72474
- await writeFile10(path18.join(appDir, "sql_to_apply", "README.md"), `# SQL Migrations Folder
72399
+ await writeFile10(path17.join(appDir, "sql_to_apply", "README.md"), `# SQL Migrations Folder
72475
72400
 
72476
72401
  This folder is for SQL migration files that will be applied to datatables during development.
72477
72402
 
@@ -72499,7 +72424,7 @@ This folder is for SQL migration files that will be applied to datatables during
72499
72424
  - Use idempotent SQL (\`CREATE TABLE IF NOT EXISTS\`, etc.)
72500
72425
  `);
72501
72426
  if (createSchemaSQL && schemaName) {
72502
- await writeFile10(path18.join(appDir, "sql_to_apply", `000_create_schema_${schemaName}.sql`), createSchemaSQL, "utf-8");
72427
+ await writeFile10(path17.join(appDir, "sql_to_apply", `000_create_schema_${schemaName}.sql`), createSchemaSQL, "utf-8");
72503
72428
  }
72504
72429
  info("");
72505
72430
  info(colors.bold.green(`App created successfully at ${folderName2}/`));
@@ -72543,7 +72468,7 @@ This folder is for SQL migration files that will be applied to datatables during
72543
72468
  let hasClaudeDesktop = false;
72544
72469
  if (process.platform === "darwin") {
72545
72470
  try {
72546
- execSync6("ls /Applications/Claude.app", { stdio: "ignore" });
72471
+ execSync5("ls /Applications/Claude.app", { stdio: "ignore" });
72547
72472
  hasClaudeDesktop = true;
72548
72473
  } catch {}
72549
72474
  }
@@ -72555,9 +72480,9 @@ This folder is for SQL migration files that will be applied to datatables during
72555
72480
  });
72556
72481
  if (openInDesktop) {
72557
72482
  try {
72558
- const absAppDir = path18.resolve(appDir);
72559
- const claudeDir = path18.join(absAppDir, ".claude");
72560
- const launchPath = path18.join(claudeDir, "launch.json");
72483
+ const absAppDir = path17.resolve(appDir);
72484
+ const claudeDir = path17.join(absAppDir, ".claude");
72485
+ const launchPath = path17.join(claudeDir, "launch.json");
72561
72486
  if (!await stat9(launchPath).catch(() => null)) {
72562
72487
  const launchJson = JSON.stringify({
72563
72488
  version: "0.0.1",
@@ -72572,7 +72497,7 @@ This folder is for SQL migration files that will be applied to datatables during
72572
72497
  `;
72573
72498
  await mkdir7(claudeDir, { recursive: true });
72574
72499
  await writeFile10(launchPath, launchJson, "utf-8");
72575
- info(colors.gray(`Seeded ${path18.relative(process.cwd(), launchPath)}`));
72500
+ info(colors.gray(`Seeded ${path17.relative(process.cwd(), launchPath)}`));
72576
72501
  }
72577
72502
  const sessionId = crypto.randomUUID();
72578
72503
  const frames = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
@@ -72874,8 +72799,8 @@ async function pushApp(workspace, remotePath, localPath, message, permissionedAs
72874
72799
  if (!localPath.endsWith(SEP14)) {
72875
72800
  localPath += SEP14;
72876
72801
  }
72877
- const path19 = localPath + "app.yaml";
72878
- const localApp = await yamlParseFile(path19);
72802
+ const path18 = localPath + "app.yaml";
72803
+ const localApp = await yamlParseFile(path18);
72879
72804
  replaceInlineScripts2(localApp.value, localPath, true);
72880
72805
  await generatingPolicy2(localApp, remotePath, localApp?.["public"] ?? localApp?.["policy"]?.["execution_mode"] == "anonymous");
72881
72806
  const preserveFields = {};
@@ -72921,13 +72846,13 @@ async function pushApp(workspace, remotePath, localPath, message, permissionedAs
72921
72846
  }
72922
72847
  await applyExtraPermsDiff(workspace, "app", remotePath, localPerms, app?.extra_perms);
72923
72848
  }
72924
- async function generatingPolicy2(app, path19, publicApp) {
72925
- info(colors.gray(`Generating fresh policy for app ${path19}...`));
72849
+ async function generatingPolicy2(app, path18, publicApp) {
72850
+ info(colors.gray(`Generating fresh policy for app ${path18}...`));
72926
72851
  try {
72927
72852
  app.policy = await updatePolicy(app.value, undefined);
72928
72853
  app.policy.execution_mode = publicApp ? "anonymous" : "publisher";
72929
72854
  } catch (e) {
72930
- error(colors.red(`Error generating policy for app ${path19}: ${e}`));
72855
+ error(colors.red(`Error generating policy for app ${path18}: ${e}`));
72931
72856
  throw e;
72932
72857
  }
72933
72858
  }
@@ -72956,12 +72881,12 @@ async function list6(opts) {
72956
72881
  new Table2().header(["path", "summary"]).padding(2).border(true).body(total.map((x) => [x.path, x.summary])).render();
72957
72882
  }
72958
72883
  }
72959
- async function get4(opts, path19) {
72884
+ async function get4(opts, path18) {
72960
72885
  const workspace = await resolveWorkspace(opts);
72961
72886
  await requireLogin(opts);
72962
72887
  const a = await getAppByPath({
72963
72888
  workspace: workspace.workspaceId,
72964
- path: path19
72889
+ path: path18
72965
72890
  });
72966
72891
  if (opts.json) {
72967
72892
  console.log(JSON.stringify(a));
@@ -73347,11 +73272,11 @@ async function list8(opts) {
73347
73272
  ])).render();
73348
73273
  }
73349
73274
  }
73350
- async function newVariable(opts, path19) {
73351
- if (!validatePath(path19)) {
73275
+ async function newVariable(opts, path18) {
73276
+ if (!validatePath(path18)) {
73352
73277
  return;
73353
73278
  }
73354
- const filePath = path19 + ".variable.yaml";
73279
+ const filePath = path18 + ".variable.yaml";
73355
73280
  try {
73356
73281
  await stat12(filePath);
73357
73282
  throw new Error("File already exists: " + filePath);
@@ -73371,14 +73296,14 @@ async function newVariable(opts, path19) {
73371
73296
  });
73372
73297
  info(colors.green(`Created ${filePath}`));
73373
73298
  }
73374
- async function get6(opts, path19) {
73299
+ async function get6(opts, path18) {
73375
73300
  if (opts.json)
73376
73301
  setSilent(true);
73377
73302
  const workspace = await resolveWorkspace(opts);
73378
73303
  await requireLogin(opts);
73379
73304
  const v = await getVariable({
73380
73305
  workspace: workspace.workspaceId,
73381
- path: path19
73306
+ path: path18
73382
73307
  });
73383
73308
  if (opts.json) {
73384
73309
  console.log(JSON.stringify(v));
@@ -73509,11 +73434,11 @@ async function list9(opts) {
73509
73434
  new Table2().header(["Path", "Schedule"]).padding(2).border(true).body(schedules.map((x) => [x.path, x.schedule])).render();
73510
73435
  }
73511
73436
  }
73512
- async function newSchedule(opts, path19) {
73513
- if (!validatePath(path19)) {
73437
+ async function newSchedule(opts, path18) {
73438
+ if (!validatePath(path18)) {
73514
73439
  return;
73515
73440
  }
73516
- const filePath = path19 + ".schedule.yaml";
73441
+ const filePath = path18 + ".schedule.yaml";
73517
73442
  try {
73518
73443
  await stat13(filePath);
73519
73444
  throw new Error("File already exists: " + filePath);
@@ -73537,14 +73462,14 @@ async function newSchedule(opts, path19) {
73537
73462
  });
73538
73463
  info(colors.green(`Created ${filePath}`));
73539
73464
  }
73540
- async function get7(opts, path19) {
73465
+ async function get7(opts, path18) {
73541
73466
  if (opts.json)
73542
73467
  setSilent(true);
73543
73468
  const workspace = await resolveWorkspace(opts);
73544
73469
  await requireLogin(opts);
73545
73470
  const s = await getSchedule({
73546
73471
  workspace: workspace.workspaceId,
73547
- path: path19
73472
+ path: path18
73548
73473
  });
73549
73474
  if (opts.json) {
73550
73475
  console.log(JSON.stringify(s));
@@ -73557,14 +73482,14 @@ async function get7(opts, path19) {
73557
73482
  console.log(colors.bold("Enabled:") + " " + (s.enabled ? "true" : "false"));
73558
73483
  }
73559
73484
  }
73560
- async function pushSchedule(workspace, path19, schedule, localSchedule, permissionedAsContext) {
73561
- path19 = removeType(path19, "schedule").replaceAll(SEP17, "/");
73562
- debug(`Processing local schedule ${path19}`);
73485
+ async function pushSchedule(workspace, path18, schedule, localSchedule, permissionedAsContext) {
73486
+ path18 = removeType(path18, "schedule").replaceAll(SEP17, "/");
73487
+ debug(`Processing local schedule ${path18}`);
73563
73488
  try {
73564
- schedule = await getSchedule({ workspace, path: path19 });
73565
- debug(`Schedule ${path19} exists on remote`);
73489
+ schedule = await getSchedule({ workspace, path: path18 });
73490
+ debug(`Schedule ${path18} exists on remote`);
73566
73491
  } catch {
73567
- debug(`Schedule ${path19} does not exist on remote`);
73492
+ debug(`Schedule ${path18} does not exist on remote`);
73568
73493
  }
73569
73494
  delete localSchedule.has_permissioned_as;
73570
73495
  const preserveFields = {};
@@ -73573,31 +73498,31 @@ async function pushSchedule(workspace, path19, schedule, localSchedule, permissi
73573
73498
  preserveFields.preserve_permissioned_as = true;
73574
73499
  if (schedule.permissioned_as) {
73575
73500
  preserveFields.permissioned_as = schedule.permissioned_as;
73576
- info(`Preserving ${schedule.permissioned_as} as permissioned_as for schedule ${path19}`);
73501
+ info(`Preserving ${schedule.permissioned_as} as permissioned_as for schedule ${path18}`);
73577
73502
  }
73578
73503
  }
73579
73504
  }
73580
73505
  if (schedule) {
73581
73506
  if (isSuperset(localSchedule, schedule)) {
73582
- debug(`Schedule ${path19} is up to date`);
73507
+ debug(`Schedule ${path18} is up to date`);
73583
73508
  return;
73584
73509
  }
73585
- debug(`Updating schedule ${path19}`);
73510
+ debug(`Updating schedule ${path18}`);
73586
73511
  try {
73587
- info(colors.bold.yellow(`Updating schedule ${path19}`));
73512
+ info(colors.bold.yellow(`Updating schedule ${path18}`));
73588
73513
  await updateSchedule({
73589
73514
  workspace,
73590
- path: path19,
73515
+ path: path18,
73591
73516
  requestBody: {
73592
73517
  ...localSchedule,
73593
73518
  ...preserveFields
73594
73519
  }
73595
73520
  });
73596
73521
  if (localSchedule.enabled !== undefined && localSchedule.enabled !== schedule.enabled) {
73597
- info(colors.bold.yellow(`Schedule ${path19} is ${localSchedule.enabled ? "enabled" : "disabled"} locally but not on remote, updating remote`));
73522
+ info(colors.bold.yellow(`Schedule ${path18} is ${localSchedule.enabled ? "enabled" : "disabled"} locally but not on remote, updating remote`));
73598
73523
  await setScheduleEnabled({
73599
73524
  workspace,
73600
- path: path19,
73525
+ path: path18,
73601
73526
  requestBody: {
73602
73527
  enabled: localSchedule.enabled
73603
73528
  }
@@ -73608,12 +73533,12 @@ async function pushSchedule(workspace, path19, schedule, localSchedule, permissi
73608
73533
  throw e;
73609
73534
  }
73610
73535
  } else {
73611
- console.log(colors.bold.yellow("Creating new schedule " + path19));
73536
+ console.log(colors.bold.yellow("Creating new schedule " + path18));
73612
73537
  try {
73613
73538
  await createSchedule({
73614
73539
  workspace,
73615
73540
  requestBody: {
73616
- path: path19,
73541
+ path: path18,
73617
73542
  ...localSchedule,
73618
73543
  ...preserveFields
73619
73544
  }
@@ -73624,26 +73549,26 @@ async function pushSchedule(workspace, path19, schedule, localSchedule, permissi
73624
73549
  }
73625
73550
  }
73626
73551
  }
73627
- async function enable(opts, path19) {
73552
+ async function enable(opts, path18) {
73628
73553
  opts = await mergeConfigWithConfigFile(opts);
73629
73554
  const workspace = await resolveWorkspace(opts);
73630
73555
  await requireLogin(opts);
73631
73556
  try {
73632
73557
  await setScheduleEnabled({
73633
73558
  workspace: workspace.workspaceId,
73634
- path: path19,
73559
+ path: path18,
73635
73560
  requestBody: { enabled: true, force: opts.force }
73636
73561
  });
73637
73562
  } catch (e) {
73638
73563
  const conflict = parseForkConflict(e);
73639
73564
  if (conflict) {
73640
- error(`Cannot enable schedule '${path19}': the parent workspace '${conflict.parentWorkspaceId}' has the same path configured. ` + `Both crons would fire on every tick and the script would run twice per scheduled time.
73565
+ error(`Cannot enable schedule '${path18}': the parent workspace '${conflict.parentWorkspaceId}' has the same path configured. ` + `Both crons would fire on every tick and the script would run twice per scheduled time.
73641
73566
  ` + `Re-run with --force to enable anyway.`);
73642
73567
  process.exit(1);
73643
73568
  }
73644
73569
  throw e;
73645
73570
  }
73646
- info(colors.green(`Schedule ${path19} enabled.`));
73571
+ info(colors.green(`Schedule ${path18} enabled.`));
73647
73572
  }
73648
73573
  function parseForkConflict(e) {
73649
73574
  const body = e?.body;
@@ -73653,16 +73578,16 @@ function parseForkConflict(e) {
73653
73578
  return;
73654
73579
  return { kind: m[1], parentWorkspaceId: m[2].trim() };
73655
73580
  }
73656
- async function disable(opts, path19) {
73581
+ async function disable(opts, path18) {
73657
73582
  opts = await mergeConfigWithConfigFile(opts);
73658
73583
  const workspace = await resolveWorkspace(opts);
73659
73584
  await requireLogin(opts);
73660
73585
  await setScheduleEnabled({
73661
73586
  workspace: workspace.workspaceId,
73662
- path: path19,
73587
+ path: path18,
73663
73588
  requestBody: { enabled: false }
73664
73589
  });
73665
- info(colors.yellow(`Schedule ${path19} disabled.`));
73590
+ info(colors.yellow(`Schedule ${path18} disabled.`));
73666
73591
  }
73667
73592
  async function push8(opts, filePath, remotePath) {
73668
73593
  const workspace = await resolveWorkspace(opts);
@@ -73805,7 +73730,7 @@ async function decrypt(combinedCiphertext, keyString) {
73805
73730
  var init_local_encryption = () => {};
73806
73731
 
73807
73732
  // src/core/settings.ts
73808
- import process18 from "node:process";
73733
+ import process17 from "node:process";
73809
73734
  import { writeFile as writeFile14 } from "node:fs/promises";
73810
73735
  function migrateToGroupedFormat(settings) {
73811
73736
  const result = { name: settings.name ?? "" };
@@ -74109,7 +74034,7 @@ async function pushWorkspaceKey(workspace, _path, key, localKey, opts) {
74109
74034
  }
74110
74035
  if (localKey && key !== localKey) {
74111
74036
  let reencrypt;
74112
- const explicitSkip = opts?.skipReencrypt || (process18.env.WMILL_NO_REENCRYPT_ON_KEY_CHANGE ?? "").toLowerCase() === "true";
74037
+ const explicitSkip = opts?.skipReencrypt || (process17.env.WMILL_NO_REENCRYPT_ON_KEY_CHANGE ?? "").toLowerCase() === "true";
74113
74038
  if (explicitSkip) {
74114
74039
  reencrypt = false;
74115
74040
  info("Workspace encryption key changed; leaving remote ciphertexts untouched (skip re-encryption requested).");
@@ -74148,7 +74073,7 @@ async function readInstanceSettings(opts) {
74148
74073
  return localSettings;
74149
74074
  }
74150
74075
  async function processInstanceSettings(settings, mode) {
74151
- const encKey = process18.env.WMILL_INSTANCE_LOCAL_ENCRYPTION_KEY;
74076
+ const encKey = process17.env.WMILL_INSTANCE_LOCAL_ENCRYPTION_KEY;
74152
74077
  if (encKey) {
74153
74078
  const res = [];
74154
74079
  for (const s of settings) {
@@ -74322,7 +74247,7 @@ var init_settings = __esm(async () => {
74322
74247
  // src/commands/instance/instance.ts
74323
74248
  import { writeFile as writeFile15, readdir as readdir9, mkdir as mkdir11, rm as rm4, stat as stat14 } from "node:fs/promises";
74324
74249
  import { appendFile } from "node:fs/promises";
74325
- import * as path19 from "node:path";
74250
+ import * as path18 from "node:path";
74326
74251
  async function allInstances() {
74327
74252
  try {
74328
74253
  const file = await getInstancesConfigFilePath();
@@ -74514,7 +74439,7 @@ async function instancePull(opts) {
74514
74439
  if (confirm) {
74515
74440
  if (uChanges > 0) {
74516
74441
  if (opts.folderPerInstance && opts.prefixSettings) {
74517
- await mkdir11(path19.join(rootDir, opts.prefix), {
74442
+ await mkdir11(path18.join(rootDir, opts.prefix), {
74518
74443
  recursive: true
74519
74444
  });
74520
74445
  }
@@ -74548,10 +74473,10 @@ Pulling all workspaces`);
74548
74473
  info(`
74549
74474
  Pulling workspace ` + remoteWorkspace.id);
74550
74475
  const workspaceName = opts?.folderPerInstance ? instance.prefix + "/" + remoteWorkspace.id : instance.prefix + "_" + remoteWorkspace.id;
74551
- await mkdir11(path19.join(rootDir, workspaceName), {
74476
+ await mkdir11(path18.join(rootDir, workspaceName), {
74552
74477
  recursive: true
74553
74478
  });
74554
- process.chdir(path19.join(rootDir, workspaceName));
74479
+ process.chdir(path18.join(rootDir, workspaceName));
74555
74480
  await addWorkspace({
74556
74481
  remote: instance.remote,
74557
74482
  name: workspaceName,
@@ -74586,7 +74511,7 @@ Pulling workspace ` + remoteWorkspace.id);
74586
74511
  if (confirmDelete) {
74587
74512
  for (const workspace of localWorkspacesToDelete) {
74588
74513
  await removeWorkspace(workspace.id, false, {});
74589
- await rm4(path19.join(rootDir, workspace.dir), {
74514
+ await rm4(path18.join(rootDir, workspace.dir), {
74590
74515
  recursive: true
74591
74516
  });
74592
74517
  }
@@ -74675,12 +74600,12 @@ Pushing all workspaces: ${localWorkspaces.map((x) => x.id).join(", ")}`);
74675
74600
  info(`
74676
74601
  Pushing workspace ` + localWorkspace.id);
74677
74602
  try {
74678
- process.chdir(path19.join(rootDir, localWorkspace.dir));
74603
+ process.chdir(path18.join(rootDir, localWorkspace.dir));
74679
74604
  } catch (_) {
74680
74605
  throw new Error("Workspace folder not found, are you in the right directory?");
74681
74606
  }
74682
74607
  try {
74683
- const workspaceSettings = await yamlParseFile(path19.join(process.cwd(), "settings.yaml"));
74608
+ const workspaceSettings = await yamlParseFile(path18.join(process.cwd(), "settings.yaml"));
74684
74609
  await add({
74685
74610
  token: instance.token,
74686
74611
  workspace: undefined,
@@ -74944,8 +74869,8 @@ async function createToken2(opts) {
74944
74869
  }
74945
74870
  info("Token: " + await createToken({ requestBody: {} }));
74946
74871
  }
74947
- async function pushWorkspaceUser(workspace, path20, user, localUser) {
74948
- const email = removePathPrefix(removeType(path20, "user"), "users");
74872
+ async function pushWorkspaceUser(workspace, path19, user, localUser) {
74873
+ const email = removePathPrefix(removeType(path19, "user"), "users");
74949
74874
  debug(`Processing local user ${email}`);
74950
74875
  if (!["operator", "developer", "admin"].includes(localUser.role)) {
74951
74876
  throw new Error(`Invalid role for user ${email}: ${localUser.role}`);
@@ -75008,8 +74933,8 @@ async function pushWorkspaceUser(workspace, path20, user, localUser) {
75008
74933
  }
75009
74934
  }
75010
74935
  }
75011
- async function pushGroup(workspace, path20, group, localGroup) {
75012
- const name = removePathPrefix(removeType(path20, "group"), "groups");
74936
+ async function pushGroup(workspace, path19, group, localGroup) {
74937
+ const name = removePathPrefix(removeType(path19, "group"), "groups");
75013
74938
  debug(`Processing local group ${name}`);
75014
74939
  try {
75015
74940
  const remoteGroup = await getGroup({
@@ -75260,10 +75185,10 @@ async function push9(opts, filePath) {
75260
75185
  const content = readTextFileSync(filePath);
75261
75186
  await pushWorkspaceDependencies(workspace.workspaceId, filePath, null, content);
75262
75187
  }
75263
- async function pushWorkspaceDependencies(workspace, path20, _befObj, newDependenciesContent) {
75264
- const res = workspaceDependenciesPathToLanguageAndFilename(path20);
75188
+ async function pushWorkspaceDependencies(workspace, path19, _befObj, newDependenciesContent) {
75189
+ const res = workspaceDependenciesPathToLanguageAndFilename(path19);
75265
75190
  if (!res) {
75266
- throw new Error(`Unknown workspace dependencies file format: ${path20}. ` + `Valid files: package.json, requirements.in, composer.json, go.mod, modules.json`);
75191
+ throw new Error(`Unknown workspace dependencies file format: ${path19}. ` + `Valid files: package.json, requirements.in, composer.json, go.mod, modules.json`);
75267
75192
  }
75268
75193
  const { language, name } = res;
75269
75194
  const displayName = name ? `named dependencies "${name}"` : `workspace default dependencies`;
@@ -75315,7 +75240,7 @@ var init_dependencies = __esm(async () => {
75315
75240
  import { mkdir as mkdir12, stat as stat15, writeFile as writeFile17 } from "node:fs/promises";
75316
75241
  import { dirname as dirname16 } from "node:path";
75317
75242
  import { sep as SEP18 } from "node:path";
75318
- async function getTrigger(triggerType, workspace, path20) {
75243
+ async function getTrigger(triggerType, workspace, path19) {
75319
75244
  const triggerFunctions = {
75320
75245
  http: getHttpTrigger,
75321
75246
  websocket: getWebsocketTrigger,
@@ -75329,10 +75254,10 @@ async function getTrigger(triggerType, workspace, path20) {
75329
75254
  email: getEmailTrigger
75330
75255
  };
75331
75256
  const triggerFunction = triggerFunctions[triggerType];
75332
- const trigger = await triggerFunction({ workspace, path: path20 });
75257
+ const trigger = await triggerFunction({ workspace, path: path19 });
75333
75258
  return trigger;
75334
75259
  }
75335
- async function updateTrigger(triggerType, workspace, path20, trigger) {
75260
+ async function updateTrigger(triggerType, workspace, path19, trigger) {
75336
75261
  const triggerFunctions = {
75337
75262
  http: updateHttpTrigger,
75338
75263
  websocket: updateWebsocketTrigger,
@@ -75346,9 +75271,9 @@ async function updateTrigger(triggerType, workspace, path20, trigger) {
75346
75271
  email: updateEmailTrigger
75347
75272
  };
75348
75273
  const triggerFunction = triggerFunctions[triggerType];
75349
- await triggerFunction({ workspace, path: path20, requestBody: trigger });
75274
+ await triggerFunction({ workspace, path: path19, requestBody: trigger });
75350
75275
  }
75351
- async function createTrigger(triggerType, workspace, path20, trigger) {
75276
+ async function createTrigger(triggerType, workspace, path19, trigger) {
75352
75277
  const triggerFunctions = {
75353
75278
  http: createHttpTrigger,
75354
75279
  websocket: createWebsocketTrigger,
@@ -75362,16 +75287,16 @@ async function createTrigger(triggerType, workspace, path20, trigger) {
75362
75287
  email: createEmailTrigger
75363
75288
  };
75364
75289
  const triggerFunction = triggerFunctions[triggerType];
75365
- await triggerFunction({ workspace, path: path20, requestBody: trigger });
75290
+ await triggerFunction({ workspace, path: path19, requestBody: trigger });
75366
75291
  }
75367
- async function pushTrigger(triggerType, workspace, path20, trigger, localTrigger, permissionedAsContext) {
75368
- path20 = removeType(path20, triggerType + "_trigger").replaceAll(SEP18, "/");
75369
- debug(`Processing local ${triggerType} trigger ${path20}`);
75292
+ async function pushTrigger(triggerType, workspace, path19, trigger, localTrigger, permissionedAsContext) {
75293
+ path19 = removeType(path19, triggerType + "_trigger").replaceAll(SEP18, "/");
75294
+ debug(`Processing local ${triggerType} trigger ${path19}`);
75370
75295
  try {
75371
- trigger = await getTrigger(triggerType, workspace, path20);
75372
- debug(`${triggerType} trigger ${path20} exists on remote`);
75296
+ trigger = await getTrigger(triggerType, workspace, path19);
75297
+ debug(`${triggerType} trigger ${path19} exists on remote`);
75373
75298
  } catch {
75374
- debug(`${triggerType} trigger ${path20} does not exist on remote`);
75299
+ debug(`${triggerType} trigger ${path19} does not exist on remote`);
75375
75300
  }
75376
75301
  delete localTrigger.has_permissioned_as;
75377
75302
  const preserveFields = {};
@@ -75380,33 +75305,33 @@ async function pushTrigger(triggerType, workspace, path20, trigger, localTrigger
75380
75305
  preserveFields.preserve_permissioned_as = true;
75381
75306
  if (trigger.permissioned_as) {
75382
75307
  preserveFields.permissioned_as = trigger.permissioned_as;
75383
- info(`Preserving ${trigger.permissioned_as} as permissioned_as for trigger ${path20}`);
75308
+ info(`Preserving ${trigger.permissioned_as} as permissioned_as for trigger ${path19}`);
75384
75309
  }
75385
75310
  }
75386
75311
  }
75387
75312
  if (trigger) {
75388
75313
  if (isSuperset(localTrigger, trigger)) {
75389
- debug(`${triggerType} trigger ${path20} is up to date`);
75314
+ debug(`${triggerType} trigger ${path19} is up to date`);
75390
75315
  return;
75391
75316
  }
75392
- debug(`${triggerType} trigger ${path20} is not up-to-date, updating...`);
75317
+ debug(`${triggerType} trigger ${path19} is not up-to-date, updating...`);
75393
75318
  try {
75394
- await updateTrigger(triggerType, workspace, path20, {
75319
+ await updateTrigger(triggerType, workspace, path19, {
75395
75320
  ...localTrigger,
75396
75321
  ...preserveFields,
75397
- path: path20
75322
+ path: path19
75398
75323
  });
75399
75324
  } catch (e) {
75400
75325
  console.error(e.body);
75401
75326
  throw e;
75402
75327
  }
75403
75328
  } else {
75404
- console.log(colors.bold.yellow(`Creating new ${triggerType} trigger: ${path20}`));
75329
+ console.log(colors.bold.yellow(`Creating new ${triggerType} trigger: ${path19}`));
75405
75330
  try {
75406
- await createTrigger(triggerType, workspace, path20, {
75331
+ await createTrigger(triggerType, workspace, path19, {
75407
75332
  ...localTrigger,
75408
75333
  ...preserveFields,
75409
- path: path20
75334
+ path: path19
75410
75335
  });
75411
75336
  } catch (e) {
75412
75337
  console.error(e.body);
@@ -75491,8 +75416,8 @@ async function pushNativeTrigger(workspace, filePath, _remoteTrigger, localTrigg
75491
75416
  }
75492
75417
  }
75493
75418
  }
75494
- async function newTrigger(opts, path20) {
75495
- if (!validatePath(path20)) {
75419
+ async function newTrigger(opts, path19) {
75420
+ if (!validatePath(path19)) {
75496
75421
  return;
75497
75422
  }
75498
75423
  if (!opts.kind) {
@@ -75502,7 +75427,7 @@ async function newTrigger(opts, path20) {
75502
75427
  throw new Error("Invalid trigger kind: " + opts.kind + ". Valid kinds: " + TRIGGER_TYPES.join(", "));
75503
75428
  }
75504
75429
  const kind = opts.kind;
75505
- const filePath = `${path20}.${kind}_trigger.yaml`;
75430
+ const filePath = `${path19}.${kind}_trigger.yaml`;
75506
75431
  try {
75507
75432
  await stat15(filePath);
75508
75433
  throw new Error("File already exists: " + filePath);
@@ -75538,7 +75463,7 @@ function printTriggerDetails(trigger, kind) {
75538
75463
  console.log(colors.bold(label + ":") + " " + display);
75539
75464
  }
75540
75465
  }
75541
- async function get8(opts, path20) {
75466
+ async function get8(opts, path19) {
75542
75467
  if (opts.json)
75543
75468
  setSilent(true);
75544
75469
  const workspace = await resolveWorkspace(opts);
@@ -75547,7 +75472,7 @@ async function get8(opts, path20) {
75547
75472
  if (!checkIfValidTrigger(opts.kind)) {
75548
75473
  throw new Error("Invalid trigger kind: " + opts.kind + ". Valid kinds: " + TRIGGER_TYPES.join(", "));
75549
75474
  }
75550
- const trigger = await getTrigger(opts.kind, workspace.workspaceId, path20);
75475
+ const trigger = await getTrigger(opts.kind, workspace.workspaceId, path19);
75551
75476
  if (opts.json) {
75552
75477
  console.log(JSON.stringify(trigger));
75553
75478
  } else {
@@ -75558,12 +75483,12 @@ async function get8(opts, path20) {
75558
75483
  const matches = [];
75559
75484
  for (const kind of TRIGGER_TYPES) {
75560
75485
  try {
75561
- const trigger = await getTrigger(kind, workspace.workspaceId, path20);
75486
+ const trigger = await getTrigger(kind, workspace.workspaceId, path19);
75562
75487
  matches.push({ kind, trigger });
75563
75488
  } catch {}
75564
75489
  }
75565
75490
  if (matches.length === 0) {
75566
- throw new Error("No trigger found at path: " + path20);
75491
+ throw new Error("No trigger found at path: " + path19);
75567
75492
  }
75568
75493
  if (matches.length === 1) {
75569
75494
  const { kind, trigger } = matches[0];
@@ -75574,7 +75499,7 @@ async function get8(opts, path20) {
75574
75499
  }
75575
75500
  return;
75576
75501
  }
75577
- console.log("Multiple triggers found at path " + path20 + ":");
75502
+ console.log("Multiple triggers found at path " + path19 + ":");
75578
75503
  for (const m of matches) {
75579
75504
  console.log(" - " + m.kind);
75580
75505
  }
@@ -75804,7 +75729,7 @@ var init_trigger = __esm(async () => {
75804
75729
  });
75805
75730
 
75806
75731
  // src/types.ts
75807
- import * as path20 from "node:path";
75732
+ import * as path19 from "node:path";
75808
75733
  import { sep as SEP19 } from "node:path";
75809
75734
  function isSuperset(subset, superset) {
75810
75735
  return Object.keys(subset).every((key) => {
@@ -75848,11 +75773,11 @@ function showDiff(local, remote) {
75848
75773
  }
75849
75774
  info(finalString);
75850
75775
  }
75851
- function showConflict(path21, local, remote) {
75852
- info(colors.yellow(`- ${path21}`));
75776
+ function showConflict(path20, local, remote) {
75777
+ info(colors.yellow(`- ${path20}`));
75853
75778
  let isEncryptionKey = false;
75854
75779
  try {
75855
- isEncryptionKey = getTypeStrFromPath(path21) === "encryption_key";
75780
+ isEncryptionKey = getTypeStrFromPath(path20) === "encryption_key";
75856
75781
  } catch {}
75857
75782
  if (isEncryptionKey) {
75858
75783
  showDiff(redactEncryptionKey(local), redactEncryptionKey(remote));
@@ -75979,7 +75904,7 @@ function getTypeStrFromPath(p) {
75979
75904
  if (isFileResource(p) || isFilesetResource(p)) {
75980
75905
  return "resource";
75981
75906
  }
75982
- const parsed = path20.parse(p);
75907
+ const parsed = path19.parse(p);
75983
75908
  if (parsed.ext == ".go" || parsed.ext == ".ts" || parsed.ext == ".sh" || parsed.ext == ".py" || parsed.ext == ".sql" || parsed.ext == ".gql" || parsed.ext == ".ps1" || parsed.ext == ".js" || parsed.ext == ".php" || parsed.ext == ".rs" || parsed.ext == ".cs" || parsed.ext == ".nu" || parsed.ext == ".java" || parsed.ext == ".rb" || parsed.ext == ".r" || parsed.ext == ".yml" && parsed.name.split(".").pop() == "playbook") {
75984
75909
  return "script";
75985
75910
  }
@@ -76003,7 +75928,7 @@ function getTypeStrFromPath(p) {
76003
75928
  }
76004
75929
  }
76005
75930
  function removeType(str, type) {
76006
- const normalizedStr = path20.normalize(str).replaceAll(SEP19, "/");
75931
+ const normalizedStr = path19.normalize(str).replaceAll(SEP19, "/");
76007
75932
  if (normalizedStr.endsWith("." + type + ".yaml") || normalizedStr.endsWith("." + type + ".json")) {
76008
75933
  return normalizedStr.slice(0, normalizedStr.length - type.length - 6);
76009
75934
  }
@@ -76013,7 +75938,7 @@ function removeType(str, type) {
76013
75938
  return normalizedStr;
76014
75939
  }
76015
75940
  function extractNativeTriggerInfo(p) {
76016
- const normalizedPath = path20.normalize(p).replaceAll(SEP19, "/");
75941
+ const normalizedPath = path19.normalize(p).replaceAll(SEP19, "/");
76017
75942
  const withoutExt = normalizedPath.replace(/\.(json|yaml)$/, "");
76018
75943
  const match2 = withoutExt.match(/^(.+)\.(flow|script)\.([^.]+)\.(\w+)_native_trigger$/);
76019
75944
  if (!match2) {
@@ -76027,8 +75952,8 @@ function extractNativeTriggerInfo(p) {
76027
75952
  };
76028
75953
  }
76029
75954
  function removePathPrefix(str, prefix) {
76030
- const normalizedStr = path20.normalize(str).replaceAll(SEP19, "/");
76031
- const normalizedPrefix = path20.normalize(prefix).replaceAll(SEP19, "/");
75955
+ const normalizedStr = path19.normalize(str).replaceAll(SEP19, "/");
75956
+ const normalizedPrefix = path19.normalize(prefix).replaceAll(SEP19, "/");
76032
75957
  if (normalizedStr === normalizedPrefix) {
76033
75958
  return "";
76034
75959
  }
@@ -76201,7 +76126,7 @@ var init_local_path_scripts = __esm(async () => {
76201
76126
 
76202
76127
  // src/commands/flow/flow.ts
76203
76128
  import { dirname as dirname17, sep as SEP20 } from "node:path";
76204
- import { mkdirSync as mkdirSync5, writeFileSync as writeFileSync7 } from "node:fs";
76129
+ import { mkdirSync as mkdirSync5, writeFileSync as writeFileSync6 } from "node:fs";
76205
76130
  function normalizeOptionalString(value) {
76206
76131
  return typeof value === "string" && value.trim() === "" ? undefined : value ?? undefined;
76207
76132
  }
@@ -76243,12 +76168,12 @@ function warnAboutLocalPathScriptDivergence(divergence) {
76243
76168
  const details = [];
76244
76169
  if (divergence.changed.length > 0) {
76245
76170
  details.push(`These workspace scripts differ from the deployed version:
76246
- ${divergence.changed.map((path21) => `- ${path21}`).join(`
76171
+ ${divergence.changed.map((path20) => `- ${path20}`).join(`
76247
76172
  `)}`);
76248
76173
  }
76249
76174
  if (divergence.missing.length > 0) {
76250
76175
  details.push(`These scripts do not exist in the workspace yet:
76251
- ${divergence.missing.map((path21) => `- ${path21}`).join(`
76176
+ ${divergence.missing.map((path20) => `- ${path20}`).join(`
76252
76177
  `)}`);
76253
76178
  }
76254
76179
  warn(`Using local PathScript files for flow preview.
@@ -76273,7 +76198,7 @@ async function pushFlow(workspace, remotePath, localPath, message, permissionedA
76273
76198
  localPath += SEP20;
76274
76199
  }
76275
76200
  const localFlow = await yamlParseFile(localPath + "flow.yaml");
76276
- const fileReader = async (path21) => await readTextFile(localPath + path21);
76201
+ const fileReader = async (path20) => await readTextFile(localPath + path20);
76277
76202
  const missingFiles = [];
76278
76203
  await replaceInlineScripts(localFlow.value.modules, fileReader, exports_log, localPath, SEP20, undefined, missingFiles);
76279
76204
  if (localFlow.value.failure_module) {
@@ -76369,14 +76294,14 @@ async function list12(opts) {
76369
76294
  new Table2().header(["path", "summary", "edited by"]).padding(2).border(true).body(total.map((x) => [x.path, x.summary, x.edited_by])).render();
76370
76295
  }
76371
76296
  }
76372
- async function get9(opts, path21) {
76297
+ async function get9(opts, path20) {
76373
76298
  if (opts.json)
76374
76299
  setSilent(true);
76375
76300
  const workspace = await resolveWorkspace(opts);
76376
76301
  await requireLogin(opts);
76377
76302
  const f = await getFlowByPath({
76378
76303
  workspace: workspace.workspaceId,
76379
- path: path21
76304
+ path: path20
76380
76305
  });
76381
76306
  if (opts.json) {
76382
76307
  console.log(JSON.stringify(f));
@@ -76414,7 +76339,7 @@ async function get9(opts, path21) {
76414
76339
  }
76415
76340
  }
76416
76341
  }
76417
- async function run3(opts, path21) {
76342
+ async function run3(opts, path20) {
76418
76343
  if (opts.silent) {
76419
76344
  setSilent(true);
76420
76345
  }
@@ -76425,7 +76350,7 @@ async function run3(opts, path21) {
76425
76350
  try {
76426
76351
  const flow = await getFlowByPath({
76427
76352
  workspace: workspace.workspaceId,
76428
- path: path21
76353
+ path: path20
76429
76354
  });
76430
76355
  validateRequiredArgs(flow.schema);
76431
76356
  } catch (e) {
@@ -76436,7 +76361,7 @@ async function run3(opts, path21) {
76436
76361
  }
76437
76362
  const id = await runFlowByPath({
76438
76363
  workspace: workspace.workspaceId,
76439
- path: path21,
76364
+ path: path20,
76440
76365
  requestBody: input
76441
76366
  });
76442
76367
  const stepLabels = new Map;
@@ -76582,7 +76507,7 @@ async function preview2(opts, flowPath) {
76582
76507
  flowPath += SEP20;
76583
76508
  }
76584
76509
  const localFlow = await yamlParseFile(flowPath + "flow.yaml");
76585
- const fileReader = async (path21) => await readTextFile(flowPath + path21);
76510
+ const fileReader = async (path20) => await readTextFile(flowPath + path20);
76586
76511
  await replaceInlineScripts(localFlow.value.modules, fileReader, exports_log, flowPath, SEP20);
76587
76512
  if (localFlow.value.failure_module) {
76588
76513
  await replaceInlineScripts([localFlow.value.failure_module], fileReader, exports_log, flowPath, SEP20);
@@ -76854,7 +76779,7 @@ async function bootstrap2(opts, flowPath) {
76854
76779
  const newFlowDefinitionYaml = import_yaml36.stringify(newFlowDefinition);
76855
76780
  const metadataFile = getMetadataFileName("flow", "yaml");
76856
76781
  const flowYamlPath = `${flowDirFullPath}/${metadataFile}`;
76857
- writeFileSync7(flowYamlPath, newFlowDefinitionYaml, { flag: "wx", encoding: "utf-8" });
76782
+ writeFileSync6(flowYamlPath, newFlowDefinitionYaml, { flag: "wx", encoding: "utf-8" });
76858
76783
  info(colors.green(`Created flow at ${flowDirFullPath}`));
76859
76784
  info("");
76860
76785
  info(colors.bold("To preview this flow:"));
@@ -77093,7 +77018,7 @@ class GitSyncSettingsConverter {
77093
77018
  }
77094
77019
 
77095
77020
  // src/commands/gitsync-settings/legacySettings.ts
77096
- import process19 from "node:process";
77021
+ import process18 from "node:process";
77097
77022
  async function handleLegacyRepositoryMigration(selectedRepo, gitSyncSettings, workspace, opts, operationName = "operation") {
77098
77023
  if (selectedRepo.settings) {
77099
77024
  return selectedRepo;
@@ -77103,7 +77028,7 @@ async function handleLegacyRepositoryMigration(selectedRepo, gitSyncSettings, wo
77103
77028
  }
77104
77029
  const workspaceIncludePath = gitSyncSettings.include_path;
77105
77030
  const workspaceIncludeType = gitSyncSettings.include_type;
77106
- if (!!process19.stdout.isTTY && !opts.yes) {
77031
+ if (!!process18.stdout.isTTY && !opts.yes) {
77107
77032
  console.log(colors.yellow(`
77108
77033
  ⚠️ Legacy git-sync settings detected!`));
77109
77034
  console.log(`
@@ -77209,7 +77134,7 @@ Repository "${selectedRepo.git_repo_resource_path}" has legacy settings format.`
77209
77134
  console.error(` wmill gitsync-settings push
77210
77135
  `);
77211
77136
  }
77212
- process19.exit(1);
77137
+ process18.exit(1);
77213
77138
  }
77214
77139
  }
77215
77140
  var init_legacySettings = __esm(async () => {
@@ -77253,8 +77178,8 @@ function outputResult(opts, result) {
77253
77178
  error(colors.red(result.error));
77254
77179
  }
77255
77180
  }
77256
- function normalizeRepoPath(path21) {
77257
- return path21.replace(/^\$res:/, "");
77181
+ function normalizeRepoPath(path20) {
77182
+ return path20.replace(/^\$res:/, "");
77258
77183
  }
77259
77184
  function getOrCreateBranchConfig(config, branchName) {
77260
77185
  if (!config.workspaces) {
@@ -77665,14 +77590,14 @@ var init_pull2 = __esm(async () => {
77665
77590
  });
77666
77591
 
77667
77592
  // src/commands/gitsync-settings/push.ts
77668
- import process20 from "node:process";
77593
+ import process19 from "node:process";
77669
77594
  async function pushGitSyncSettings(opts) {
77670
77595
  try {
77671
77596
  await validateBranchConfiguration({ yes: opts.yes });
77672
77597
  } catch (error2) {
77673
77598
  if (error2 instanceof Error && error2.message.includes("overrides")) {
77674
77599
  error(error2.message);
77675
- process20.exit(1);
77600
+ process19.exit(1);
77676
77601
  }
77677
77602
  throw error2;
77678
77603
  }
@@ -77682,7 +77607,7 @@ async function pushGitSyncSettings(opts) {
77682
77607
  const wmillYamlPath = getWmillYamlPath();
77683
77608
  if (!wmillYamlPath) {
77684
77609
  error(colors.red("No wmill.yaml file found. Please run 'wmill init' first to create the configuration file."));
77685
- process20.exit(1);
77610
+ process19.exit(1);
77686
77611
  }
77687
77612
  const localConfig = await readConfigFile();
77688
77613
  let settings;
@@ -77798,7 +77723,7 @@ async function pushGitSyncSettings(opts) {
77798
77723
  displayChanges(changes);
77799
77724
  }
77800
77725
  }
77801
- if (!opts.yes && !!process20.stdin.isTTY) {
77726
+ if (!opts.yes && !!process19.stdin.isTTY) {
77802
77727
  const confirmed = await Confirm.prompt({
77803
77728
  message: `Do you want to apply these changes to the remote?`,
77804
77729
  default: true
@@ -84495,12 +84420,14 @@ List all queues with their metrics
84495
84420
 
84496
84421
  ### refresh
84497
84422
 
84498
- Refresh wmill-managed project files (AGENTS.cli.md and skills)
84423
+ Refresh wmill-managed project files (AGENTS.cli.md, skills, tsconfig.wmill.json)
84499
84424
 
84500
84425
  **Subcommands:**
84501
84426
 
84502
84427
  - \`refresh prompts\` - Refresh AGENTS.cli.md and managed skills. User-owned AGENTS.md and CLAUDE.md are never overwritten unless you opt in.
84503
- - \`--yes\` - Non-interactive: skip the migration prompt for existing AGENTS.md / CLAUDE.md without the expected include; defaults to appending the include.
84428
+ - \`--yes\` - Non-interactive: append the @AGENTS.cli.md include to an existing AGENTS.md / CLAUDE.md without prompting. Without it, a non-interactive run leaves an unlinked file untouched.
84429
+ - \`refresh tsconfig\` - Refresh the wmill-managed tsconfig.wmill.json (and Deno import map for Deno projects)
84430
+ - \`--yes\` - Non-interactive: wire an existing custom tsconfig.json/deno.json to the managed file without prompting (a previously-generated config is always migrated automatically).
84504
84431
 
84505
84432
  ### resource
84506
84433
 
@@ -86142,12 +86069,12 @@ async function warnIfPromptsStale(opts) {
86142
86069
  if (opts?.argv && !shouldRunFreshnessCheck(opts.argv))
86143
86070
  return;
86144
86071
  const cwd = opts?.cwd ?? process.cwd();
86145
- const path22 = `${cwd}/AGENTS.cli.md`;
86146
- if (!await stat18(path22).catch(() => null))
86072
+ const path21 = `${cwd}/AGENTS.cli.md`;
86073
+ if (!await stat18(path21).catch(() => null))
86147
86074
  return;
86148
86075
  let content;
86149
86076
  try {
86150
- content = await readTextFile(path22);
86077
+ content = await readTextFile(path21);
86151
86078
  } catch {
86152
86079
  return;
86153
86080
  }
@@ -86184,6 +86111,280 @@ var init_freshness = __esm(async () => {
86184
86111
  PROMPTS_HASH_REGEX = /<!-- wmill-prompts-hash: ([0-9a-f]{12}) -->/;
86185
86112
  });
86186
86113
 
86114
+ // src/commands/refresh/tsconfig.ts
86115
+ var exports_tsconfig = {};
86116
+ __export(exports_tsconfig, {
86117
+ warnIfTsconfigStale: () => warnIfTsconfigStale,
86118
+ refreshTsconfig: () => refreshTsconfig,
86119
+ default: () => tsconfig_default
86120
+ });
86121
+ import { execSync as execSync6 } from "node:child_process";
86122
+ import { createHash as createHash2 } from "node:crypto";
86123
+ import { existsSync as existsSync12, readFileSync as readFileSync4, writeFileSync as writeFileSync7 } from "node:fs";
86124
+ import path21 from "node:path";
86125
+ import process22 from "node:process";
86126
+ function buildManagedTsconfig() {
86127
+ const paths = {};
86128
+ for (const dir of WORKSPACE_IMPORT_DIRS) {
86129
+ paths[`/${dir}/*`] = [`./${dir}/*`];
86130
+ }
86131
+ return {
86132
+ compilerOptions: {
86133
+ target: "ESNext",
86134
+ module: "ESNext",
86135
+ moduleResolution: "bundler",
86136
+ allowImportingTsExtensions: true,
86137
+ noEmit: true,
86138
+ strict: false,
86139
+ paths
86140
+ },
86141
+ include: ["**/*.ts", "rt.d.ts"]
86142
+ };
86143
+ }
86144
+ function currentTsconfigHash() {
86145
+ return createHash2("sha256").update(JSON.stringify(buildManagedTsconfig())).digest("hex").slice(0, 12);
86146
+ }
86147
+ function deepEqual2(a, b) {
86148
+ if (a === b)
86149
+ return true;
86150
+ if (Array.isArray(a) || Array.isArray(b)) {
86151
+ if (!Array.isArray(a) || !Array.isArray(b) || a.length !== b.length) {
86152
+ return false;
86153
+ }
86154
+ return a.every((x, i) => deepEqual2(x, b[i]));
86155
+ }
86156
+ if (a && b && typeof a === "object" && typeof b === "object") {
86157
+ const ka = Object.keys(a);
86158
+ const kb = Object.keys(b);
86159
+ if (ka.length !== kb.length)
86160
+ return false;
86161
+ return ka.every((k) => deepEqual2(a[k], b[k]));
86162
+ }
86163
+ return false;
86164
+ }
86165
+ async function refreshTsconfig(opts) {
86166
+ let defaultTs = "bun";
86167
+ try {
86168
+ const conf = await readConfigFile({ warnIfMissing: false });
86169
+ if (conf?.defaultTs === "deno") {
86170
+ defaultTs = "deno";
86171
+ }
86172
+ } catch {}
86173
+ const assumeYes = opts?.yes === true;
86174
+ const mode = {
86175
+ assumeYes,
86176
+ interactive: !!process22.stdin.isTTY && !assumeYes
86177
+ };
86178
+ await refreshManagedTsconfig(defaultTs, mode);
86179
+ if (defaultTs === "deno") {
86180
+ await refreshManagedDenoImportMap(mode);
86181
+ }
86182
+ }
86183
+ async function refreshManagedTsconfig(defaultTs, mode) {
86184
+ const managed = buildManagedTsconfig();
86185
+ const bunTypesAvailable = defaultTs === "bun" ? ensureBunTypesAvailable() : false;
86186
+ if (bunTypesAvailable) {
86187
+ managed.compilerOptions.types = ["bun-types"];
86188
+ }
86189
+ const header = MANAGED_NOTICE + TSCONFIG_HASH_PREFIX + currentTsconfigHash() + `
86190
+ `;
86191
+ writeFileSync7(path21.join(process22.cwd(), MANAGED_TSCONFIG), header + JSON.stringify(managed, null, 2) + `
86192
+ `);
86193
+ info(colors.green(`Refreshed ${MANAGED_TSCONFIG}`));
86194
+ await ensureUserReferencesManaged({
86195
+ file: "tsconfig.json",
86196
+ create: { extends: `./${MANAGED_TSCONFIG}` },
86197
+ legacyFormats: LEGACY_GENERATED_TSCONFIGS,
86198
+ mode,
86199
+ wire: (parsed) => {
86200
+ const co = parsed.compilerOptions;
86201
+ const paths = co && typeof co === "object" && !Array.isArray(co) ? co.paths : undefined;
86202
+ if (paths && typeof paths === "object" && !Array.isArray(paths) && Object.keys(paths).length > 0) {
86203
+ return "defines its own `compilerOptions.paths` (TS won't merge ours in via " + '`extends`); add "/f/*": ["./f/*"] and "/u/*": ["./u/*"] to it';
86204
+ }
86205
+ const ext2 = parsed.extends;
86206
+ const managed2 = `./${MANAGED_TSCONFIG}`;
86207
+ if (ext2 === undefined) {
86208
+ parsed.extends = managed2;
86209
+ } else if (typeof ext2 === "string") {
86210
+ parsed.extends = [managed2, ext2];
86211
+ } else if (Array.isArray(ext2)) {
86212
+ ext2.unshift(managed2);
86213
+ } else {
86214
+ return "unexpected `extends` value";
86215
+ }
86216
+ return true;
86217
+ },
86218
+ token: MANAGED_TSCONFIG,
86219
+ hint: `"extends": "./${MANAGED_TSCONFIG}"`
86220
+ });
86221
+ }
86222
+ async function refreshManagedDenoImportMap(mode) {
86223
+ const imports = {};
86224
+ for (const dir of WORKSPACE_IMPORT_DIRS) {
86225
+ imports[`/${dir}/`] = `./${dir}/`;
86226
+ }
86227
+ writeFileSync7(path21.join(process22.cwd(), MANAGED_IMPORT_MAP), JSON.stringify({ imports }, null, 2) + `
86228
+ `);
86229
+ info(colors.green(`Refreshed ${MANAGED_IMPORT_MAP}`));
86230
+ await ensureUserReferencesManaged({
86231
+ file: "deno.json",
86232
+ altFiles: ["deno.jsonc"],
86233
+ create: { importMap: `./${MANAGED_IMPORT_MAP}` },
86234
+ mode,
86235
+ wire: (parsed) => {
86236
+ if (parsed.imports !== undefined) {
86237
+ return "deno.json already defines `imports` (can't also use importMap)";
86238
+ }
86239
+ if (parsed.importMap !== undefined && parsed.importMap !== `./${MANAGED_IMPORT_MAP}`) {
86240
+ return "deno.json already sets a different `importMap`";
86241
+ }
86242
+ parsed.importMap = `./${MANAGED_IMPORT_MAP}`;
86243
+ return true;
86244
+ },
86245
+ token: MANAGED_IMPORT_MAP,
86246
+ hint: `"importMap": "./${MANAGED_IMPORT_MAP}"`
86247
+ });
86248
+ }
86249
+ async function ensureUserReferencesManaged(opts) {
86250
+ const existing = [opts.file, ...opts.altFiles ?? []].map((f) => path21.join(process22.cwd(), f)).find((p) => existsSync12(p));
86251
+ if (!existing) {
86252
+ const userPath = path21.join(process22.cwd(), opts.file);
86253
+ writeFileSync7(userPath, JSON.stringify(opts.create, null, 2) + `
86254
+ `);
86255
+ info(colors.green(`Created ${opts.file} (references ${opts.token})`));
86256
+ return;
86257
+ }
86258
+ const existingName = path21.basename(existing);
86259
+ let text = "";
86260
+ try {
86261
+ text = readFileSync4(existing, "utf-8");
86262
+ } catch {
86263
+ return;
86264
+ }
86265
+ if (text.includes(opts.token)) {
86266
+ info(colors.gray(`${existingName} already references ${opts.token}, leaving it untouched`));
86267
+ return;
86268
+ }
86269
+ let parsed;
86270
+ try {
86271
+ parsed = JSON.parse(text);
86272
+ } catch {
86273
+ warn(`${existingName} couldn't be auto-edited (it may contain comments). Add ${opts.hint} ` + `to pick up wmill's recommended settings (incl. workspace /f/, /u/ import resolution).`);
86274
+ return;
86275
+ }
86276
+ if (opts.legacyFormats?.some((fmt) => deepEqual2(parsed, fmt))) {
86277
+ writeFileSync7(existing, JSON.stringify(opts.create, null, 2) + `
86278
+ `);
86279
+ info(colors.green(`Migrated previously-generated ${existingName} to reference ${opts.token}`));
86280
+ return;
86281
+ }
86282
+ const next = JSON.parse(JSON.stringify(parsed));
86283
+ const wired = opts.wire(next);
86284
+ if (wired !== true) {
86285
+ warn(`${existingName}: ${wired}. Add ${opts.hint} manually to pick up wmill's ` + `recommended settings (incl. workspace /f/, /u/ import resolution).`);
86286
+ return;
86287
+ }
86288
+ const consent = opts.mode.assumeYes ? true : opts.mode.interactive ? await Confirm.prompt({
86289
+ message: `${existingName} isn't linked to wmill's ${opts.token}. Add ${opts.hint}? ` + `Your settings are preserved (it's inserted first, so your config wins).`,
86290
+ default: true
86291
+ }) : false;
86292
+ if (!consent) {
86293
+ info(colors.gray(`Left ${existingName} unchanged — add ${opts.hint} when ready to enable ` + `workspace /f/, /u/ import resolution (or re-run \`wmill refresh tsconfig\`).`));
86294
+ return;
86295
+ }
86296
+ writeFileSync7(existing, JSON.stringify(next, null, 2) + `
86297
+ `);
86298
+ info(colors.green(`Linked ${existingName} → ${opts.token}`));
86299
+ }
86300
+ function ensureBunTypesAvailable() {
86301
+ const cwd = process22.cwd();
86302
+ if (existsSync12(path21.join(cwd, "node_modules", "bun-types"))) {
86303
+ return true;
86304
+ }
86305
+ try {
86306
+ execSync6("bun --version", { stdio: "ignore" });
86307
+ } catch {
86308
+ info("Install bun (https://bun.sh), run 'bun add -d bun-types', then re-run 'wmill refresh tsconfig' for Bun API autocompletion.");
86309
+ return false;
86310
+ }
86311
+ try {
86312
+ info(colors.yellow("Installing bun-types with 'bun add -d bun-types'..."));
86313
+ execSync6("bun add -d bun-types", { stdio: "inherit" });
86314
+ info(colors.green("Installed bun-types."));
86315
+ return true;
86316
+ } catch (e) {
86317
+ warn(`Failed to install bun-types automatically: ${e instanceof Error ? e.message : e}`);
86318
+ info("Run 'bun add -d bun-types' manually, then 'wmill refresh tsconfig', for Bun API autocompletion.");
86319
+ return false;
86320
+ }
86321
+ }
86322
+ async function warnIfTsconfigStale(opts) {
86323
+ const cwd = opts?.cwd ?? process22.cwd();
86324
+ const managedPath = path21.join(cwd, MANAGED_TSCONFIG);
86325
+ if (!existsSync12(managedPath))
86326
+ return;
86327
+ let managedText;
86328
+ try {
86329
+ managedText = readFileSync4(managedPath, "utf-8");
86330
+ } catch {
86331
+ return;
86332
+ }
86333
+ const match2 = managedText.match(TSCONFIG_HASH_REGEX);
86334
+ if (!match2) {
86335
+ emitTsconfigWarning(`${MANAGED_TSCONFIG} predates versioning. Run \`wmill refresh tsconfig\` to refresh it.`);
86336
+ return;
86337
+ }
86338
+ if (match2[1] !== currentTsconfigHash()) {
86339
+ emitTsconfigWarning(`${MANAGED_TSCONFIG} is out of date. Run \`wmill refresh tsconfig\` to refresh.`);
86340
+ }
86341
+ }
86342
+ function emitTsconfigWarning(message) {
86343
+ process22.stderr.write(`${colors.yellow(message)}
86344
+ `);
86345
+ }
86346
+ var WORKSPACE_IMPORT_DIRS, MANAGED_TSCONFIG = "tsconfig.wmill.json", MANAGED_IMPORT_MAP = "import_map.wmill.json", MANAGED_NOTICE, TSCONFIG_HASH_PREFIX = "// wmill-tsconfig-hash: ", TSCONFIG_HASH_REGEX, LEGACY_GENERATED_TSCONFIGS, command30, tsconfig_default;
86347
+ var init_tsconfig = __esm(async () => {
86348
+ init_colors2();
86349
+ init_mod3();
86350
+ init_log();
86351
+ await __promiseAll([
86352
+ init_confirm(),
86353
+ init_conf()
86354
+ ]);
86355
+ WORKSPACE_IMPORT_DIRS = ["f", "u"];
86356
+ MANAGED_NOTICE = "// Managed by wmill — regenerated by `wmill init` / `wmill refresh tsconfig`.\n" + `// Do not edit; put your overrides in tsconfig.json (which extends this file).
86357
+ `;
86358
+ TSCONFIG_HASH_REGEX = /^\/\/ wmill-tsconfig-hash: ([0-9a-f]{12})/m;
86359
+ LEGACY_GENERATED_TSCONFIGS = [
86360
+ {
86361
+ compilerOptions: {
86362
+ target: "ESNext",
86363
+ module: "ESNext",
86364
+ moduleResolution: "bundler",
86365
+ noEmit: true,
86366
+ strict: false
86367
+ },
86368
+ include: ["**/*.ts", "rt.d.ts"]
86369
+ },
86370
+ {
86371
+ compilerOptions: {
86372
+ target: "ESNext",
86373
+ module: "ESNext",
86374
+ moduleResolution: "bundler",
86375
+ noEmit: true,
86376
+ strict: false,
86377
+ types: ["bun-types"]
86378
+ },
86379
+ include: ["**/*.ts", "rt.d.ts"]
86380
+ }
86381
+ ];
86382
+ command30 = new Command().description("Refresh the wmill-managed tsconfig.wmill.json (and Deno import map for Deno projects)").option("--yes", "Non-interactive: wire an existing custom tsconfig.json/deno.json to the managed file without prompting (a previously-generated config is always migrated automatically).").action(async (opts) => {
86383
+ await refreshTsconfig({ yes: opts.yes === true });
86384
+ });
86385
+ tsconfig_default = command30;
86386
+ });
86387
+
86187
86388
  // src/main.ts
86188
86389
  init_mod3();
86189
86390
 
@@ -87560,7 +87761,7 @@ await __promiseAll([
87560
87761
  init_context()
87561
87762
  ]);
87562
87763
  var import_yaml39 = __toESM(require_dist(), 1);
87563
- import { existsSync as existsSync10 } from "node:fs";
87764
+ import { existsSync as existsSync9 } from "node:fs";
87564
87765
  import { writeFile as writeFile19 } from "node:fs/promises";
87565
87766
  import { dirname as dirname18, join as join18 } from "node:path";
87566
87767
  var PROTECTION_RULES_FILENAME = "protection-rules.yaml";
@@ -87570,17 +87771,17 @@ function getProtectionRulesPath() {
87570
87771
  return null;
87571
87772
  return join18(dirname18(wmillPath), PROTECTION_RULES_FILENAME);
87572
87773
  }
87573
- async function readProtectionRulesFile(path21) {
87574
- if (!existsSync10(path21))
87774
+ async function readProtectionRulesFile(path20) {
87775
+ if (!existsSync9(path20))
87575
87776
  return {};
87576
- const parsed = await yamlParseFile(path21);
87777
+ const parsed = await yamlParseFile(path20);
87577
87778
  return parsed ?? {};
87578
87779
  }
87579
- async function writeProtectionRulesFile(path21, data3) {
87780
+ async function writeProtectionRulesFile(path20, data3) {
87580
87781
  const sorted = {};
87581
87782
  for (const k of Object.keys(data3).sort())
87582
87783
  sorted[k] = data3[k];
87583
- await writeFile19(path21, import_yaml39.stringify(sorted, yamlOptions), "utf-8");
87784
+ await writeFile19(path20, import_yaml39.stringify(sorted, yamlOptions), "utf-8");
87584
87785
  }
87585
87786
 
87586
87787
  class WorkspaceResolver {
@@ -87625,7 +87826,7 @@ async function configureClientForWorkspace(opts, ws, resolver) {
87625
87826
  // src/commands/protection-rules/utils.ts
87626
87827
  init_colors2();
87627
87828
  init_log();
87628
- import process21 from "node:process";
87829
+ import process20 from "node:process";
87629
87830
  function outputResult2(opts, result) {
87630
87831
  if (opts.jsonOutput) {
87631
87832
  console.log(JSON.stringify(result));
@@ -87637,7 +87838,7 @@ function outputResult2(opts, result) {
87637
87838
  }
87638
87839
  function fail(opts, result) {
87639
87840
  outputResult2(opts, { ...result, success: false });
87640
- process21.exit(1);
87841
+ process20.exit(1);
87641
87842
  }
87642
87843
  function describeEntry(entry) {
87643
87844
  const n = ProtectionRulesConverter.normalizeEntry(entry);
@@ -87781,8 +87982,8 @@ await __promiseAll([
87781
87982
  init_confirm(),
87782
87983
  init_conf()
87783
87984
  ]);
87784
- import process22 from "node:process";
87785
- import { existsSync as existsSync11 } from "node:fs";
87985
+ import process21 from "node:process";
87986
+ import { existsSync as existsSync10 } from "node:fs";
87786
87987
  async function pushProtectionRules(opts, workspaceArg) {
87787
87988
  if (opts.jsonOutput)
87788
87989
  setSilent(true);
@@ -87792,7 +87993,7 @@ async function pushProtectionRules(opts, workspaceArg) {
87792
87993
  error: "No wmill.yaml found. Run 'wmill init' first — protection-rules.yaml lives next to it."
87793
87994
  });
87794
87995
  }
87795
- if (!existsSync11(prPath)) {
87996
+ if (!existsSync10(prPath)) {
87796
87997
  fail(opts, {
87797
87998
  error: "No protection-rules.yaml found. Run 'wmill protection-rules pull' first."
87798
87999
  });
@@ -87862,7 +88063,7 @@ async function pushProtectionRules(opts, workspaceArg) {
87862
88063
  workspaces: Object.fromEntries(wsPlans.map((w) => [w.ws, structuredPlan(w.plan)]))
87863
88064
  }));
87864
88065
  if (hadError)
87865
- process22.exit(1);
88066
+ process21.exit(1);
87866
88067
  return;
87867
88068
  }
87868
88069
  if (!opts.jsonOutput) {
@@ -87876,7 +88077,7 @@ async function pushProtectionRules(opts, workspaceArg) {
87876
88077
  error: "One or more workspaces failed (see errors above); the rest are in sync",
87877
88078
  partialFailure: true
87878
88079
  });
87879
- process22.exit(1);
88080
+ process21.exit(1);
87880
88081
  }
87881
88082
  if (!opts.dryRun) {
87882
88083
  outputResult2(opts, {
@@ -87888,7 +88089,7 @@ async function pushProtectionRules(opts, workspaceArg) {
87888
88089
  }
87889
88090
  if (opts.dryRun) {
87890
88091
  if (hadError)
87891
- process22.exit(1);
88092
+ process21.exit(1);
87892
88093
  return;
87893
88094
  }
87894
88095
  for (const w of wsPlans) {
@@ -87897,7 +88098,7 @@ async function pushProtectionRules(opts, workspaceArg) {
87897
88098
  }
87898
88099
  }
87899
88100
  const totalDeletes = changed.reduce((n, w) => n + w.plan.toDelete.length, 0);
87900
- if (!opts.yes && !!process22.stdin.isTTY) {
88101
+ if (!opts.yes && !!process21.stdin.isTTY) {
87901
88102
  const confirmed = await Confirm.prompt({
87902
88103
  message: totalDeletes > 0 ? `Apply these changes? This DELETES ${totalDeletes} protection rule(s) across ${changed.length} workspace(s).` : `Apply these changes to ${changed.length} workspace(s)?`,
87903
88104
  default: totalDeletes === 0
@@ -87959,7 +88160,7 @@ async function pushProtectionRules(opts, workspaceArg) {
87959
88160
  partialFailure: true,
87960
88161
  ...applied
87961
88162
  });
87962
- process22.exit(1);
88163
+ process21.exit(1);
87963
88164
  }
87964
88165
  outputResult2(opts, {
87965
88166
  success: true,
@@ -88089,7 +88290,7 @@ import * as http3 from "node:http";
88089
88290
  import * as https from "node:https";
88090
88291
  import { access, readdir as readdir10, realpath, stat as stat17, unlink, writeFile as writeFile20 } from "node:fs/promises";
88091
88292
  import { watch as watch2 } from "node:fs";
88092
- import * as path21 from "node:path";
88293
+ import * as path20 from "node:path";
88093
88294
  import * as fs14 from "node:fs";
88094
88295
 
88095
88296
  // src/commands/dev/pathscript-restore.ts
@@ -88185,7 +88386,7 @@ var PORT = 3001;
88185
88386
  var FLOW_SUFFIXES = [".flow", "__flow"];
88186
88387
  var APP_SUFFIXES = [".app", "__app", ".raw_app", "__raw_app"];
88187
88388
  var INLINE_SCRIPT_EXTS = new Set([
88188
- ...exts.map((e) => path21.extname("x" + e)).filter((e) => e !== ".yml"),
88389
+ ...exts.map((e) => path20.extname("x" + e)).filter((e) => e !== ".yml"),
88189
88390
  ".js"
88190
88391
  ]);
88191
88392
  function stripFolderSuffix(rel, suffixes) {
@@ -88226,13 +88427,13 @@ async function listWorkspacePaths() {
88226
88427
  if (entry.name.startsWith(".") || entry.name === "node_modules")
88227
88428
  continue;
88228
88429
  const childRel = rel ? `${rel}/${entry.name}` : entry.name;
88229
- const childAbs = path21.join(dir, entry.name);
88430
+ const childAbs = path20.join(dir, entry.name);
88230
88431
  if (entry.isDirectory()) {
88231
88432
  if (isFlowFolderName(entry.name)) {
88232
88433
  items.push({
88233
88434
  path: stripFolderSuffix(childRel, FLOW_SUFFIXES),
88234
88435
  kind: "flow",
88235
- _metaPath: path21.join(childAbs, "flow.yaml")
88436
+ _metaPath: path20.join(childAbs, "flow.yaml")
88236
88437
  });
88237
88438
  continue;
88238
88439
  }
@@ -88271,25 +88472,25 @@ async function listWorkspacePaths() {
88271
88472
  async function dev2(opts) {
88272
88473
  if (!opts.path) {
88273
88474
  const cwd = process.cwd();
88274
- const cwdBasename = path21.basename(cwd);
88475
+ const cwdBasename = path20.basename(cwd);
88275
88476
  await loadNonDottedPathsSetting();
88276
88477
  if (isFlowFolderName(cwdBasename)) {
88277
88478
  GLOBAL_CONFIG_OPT.noCdToRoot = true;
88278
88479
  let searchDir = cwd;
88279
88480
  let workspaceRoot;
88280
88481
  while (true) {
88281
- const wmillYaml = path21.join(searchDir, "wmill.yaml");
88482
+ const wmillYaml = path20.join(searchDir, "wmill.yaml");
88282
88483
  if (fs14.existsSync(wmillYaml)) {
88283
88484
  workspaceRoot = searchDir;
88284
88485
  break;
88285
88486
  }
88286
- const parentDir = path21.dirname(searchDir);
88487
+ const parentDir = path20.dirname(searchDir);
88287
88488
  if (parentDir === searchDir)
88288
88489
  break;
88289
88490
  searchDir = parentDir;
88290
88491
  }
88291
88492
  if (workspaceRoot) {
88292
- const relPath = path21.relative(workspaceRoot, cwd).replaceAll("\\", "/");
88493
+ const relPath = path20.relative(workspaceRoot, cwd).replaceAll("\\", "/");
88293
88494
  opts.path = stripFolderSuffix(relPath, FLOW_SUFFIXES);
88294
88495
  info(`Detected flow folder, path: ${opts.path}`);
88295
88496
  process.chdir(workspaceRoot);
@@ -88354,7 +88555,7 @@ async function dev2(opts) {
88354
88555
  return;
88355
88556
  const wmFlowPath = stripFolderSuffix(localPath.replace(/\/$/, ""), FLOW_SUFFIXES);
88356
88557
  const localFlow = await yamlParseFile(localPath + "flow.yaml");
88357
- await replaceInlineScripts(localFlow.value.modules, async (path22) => await readTextFile(localPath + path22), exports_log, localPath, SEP21, undefined);
88558
+ await replaceInlineScripts(localFlow.value.modules, async (path21) => await readTextFile(localPath + path21), exports_log, localPath, SEP21, undefined);
88358
88559
  snapshotPathScripts(localFlow.value);
88359
88560
  const localScriptReader = createPreviewLocalScriptReader({
88360
88561
  exts,
@@ -88516,7 +88717,7 @@ async function dev2(opts) {
88516
88717
  for (const file of dirFiles) {
88517
88718
  if (file === "flow.yaml" || file === "flow.json" || file.startsWith("."))
88518
88719
  continue;
88519
- if (!INLINE_SCRIPT_EXTS.has(path21.extname(file)))
88720
+ if (!INLINE_SCRIPT_EXTS.has(path20.extname(file)))
88520
88721
  continue;
88521
88722
  if (!extractedPaths.has(file)) {
88522
88723
  await unlink(flowDir + file);
@@ -89706,7 +89907,8 @@ async function refreshPrompts(opts) {
89706
89907
  const config = await readConfigFile2();
89707
89908
  nonDottedPaths = config.nonDottedPaths ?? false;
89708
89909
  } catch {}
89709
- const interactive = process.stdin.isTTY && !opts.yes;
89910
+ const assumeYes = opts.yes === true;
89911
+ const interactive = process.stdin.isTTY && !assumeYes;
89710
89912
  try {
89711
89913
  const result = await writeAiGuidanceFiles({
89712
89914
  targetDir: ".",
@@ -89715,9 +89917,11 @@ async function refreshPrompts(opts) {
89715
89917
  agentsSourcePath: process.env[WMILL_INIT_AI_AGENTS_SOURCE_ENV],
89716
89918
  claudeSourcePath: process.env[WMILL_INIT_AI_CLAUDE_SOURCE_ENV],
89717
89919
  resolveAgentsMdMigration: async () => {
89718
- if (!interactive)
89920
+ if (assumeYes)
89719
89921
  return "append";
89720
- return await promptMigration();
89922
+ if (interactive)
89923
+ return await promptMigration();
89924
+ return "skip";
89721
89925
  }
89722
89926
  });
89723
89927
  info(colors.green("Refreshed AGENTS.cli.md"));
@@ -89792,10 +89996,11 @@ async function promptMigration() {
89792
89996
  async function promptsAction(opts) {
89793
89997
  await refreshPrompts({ yes: opts.yes === true });
89794
89998
  }
89795
- var command29 = new Command().description("Refresh AGENTS.cli.md and managed skills. User-owned AGENTS.md and CLAUDE.md are never overwritten unless you opt in.").option("--yes", "Non-interactive: skip the migration prompt for existing AGENTS.md / CLAUDE.md without the expected include; defaults to appending the include.").action(promptsAction);
89999
+ var command29 = new Command().description("Refresh AGENTS.cli.md and managed skills. User-owned AGENTS.md and CLAUDE.md are never overwritten unless you opt in.").option("--yes", "Non-interactive: append the @AGENTS.cli.md include to an existing AGENTS.md / CLAUDE.md without prompting. Without it, a non-interactive run leaves an unlinked file untouched.").action(promptsAction);
89796
90000
  var prompts_default = command29;
89797
90001
 
89798
90002
  // src/commands/init/init.ts
90003
+ await init_tsconfig();
89799
90004
  async function initAction(opts) {
89800
90005
  let didBindWorkspace = false;
89801
90006
  let boundProfile;
@@ -89940,6 +90145,11 @@ async function initAction(opts) {
89940
90145
  }
89941
90146
  }
89942
90147
  await refreshPrompts({ yes: opts.useDefault === true });
90148
+ try {
90149
+ await refreshTsconfig({ yes: opts.useDefault === true });
90150
+ } catch (error2) {
90151
+ warn(`Could not generate tsconfig: ${error2 instanceof Error ? error2.message : error2}`);
90152
+ }
89943
90153
  if (didBindWorkspace && boundProfile) {
89944
90154
  try {
89945
90155
  const rtOpts = { ...opts };
@@ -89952,13 +90162,14 @@ async function initAction(opts) {
89952
90162
  info(colors.gray("Skipped resource type namespace generation (no workspace bound). Run 'wmill workspace bind' then 'wmill init' to generate it."));
89953
90163
  }
89954
90164
  }
89955
- var command30 = new Command().description("Bootstrap a windmill project with a wmill.yaml file").option("--use-default", "Use default settings without checking backend").option("--use-backend", "Use backend git-sync settings if available").option("--repository <repo:string>", "Specify repository path (e.g., u/user/repo) when using backend settings").option("--bind-profile", "Automatically bind active workspace profile to current Git branch").option("--no-bind-profile", "Skip workspace profile binding prompt").action(initAction);
89956
- var init_default = command30;
90165
+ var command31 = new Command().description("Bootstrap a windmill project with a wmill.yaml file").option("--use-default", "Use default settings without checking backend").option("--use-backend", "Use backend git-sync settings if available").option("--repository <repo:string>", "Specify repository path (e.g., u/user/repo) when using backend settings").option("--bind-profile", "Automatically bind active workspace profile to current Git branch").option("--no-bind-profile", "Skip workspace profile binding prompt").action(initAction);
90166
+ var init_default = command31;
89957
90167
 
89958
90168
  // src/commands/refresh/refresh.ts
89959
90169
  init_mod3();
89960
- var command31 = new Command().description("Refresh wmill-managed project files (AGENTS.cli.md and skills)").command("prompts", prompts_default);
89961
- var refresh_default = command31;
90170
+ await init_tsconfig();
90171
+ var command32 = new Command().description("Refresh wmill-managed project files (AGENTS.cli.md, skills, tsconfig.wmill.json)").command("prompts", prompts_default).command("tsconfig", tsconfig_default);
90172
+ var refresh_default = command32;
89962
90173
 
89963
90174
  // src/main.ts
89964
90175
  init_freshness_gate();
@@ -90127,8 +90338,8 @@ Warning: Found ${workers.length} active worker(s) on the instance.`));
90127
90338
  }
90128
90339
  var pull3 = new Command().description("Pull completed and queued jobs from workspace").option("-c, --completed-output <file:string>", "Completed jobs output file (default: completed_jobs.json)").option("-q, --queued-output <file:string>", "Queued jobs output file (default: queued_jobs.json)").option("--skip-worker-check", "Skip checking for active workers before export").arguments("[workspace:string]").action(pullJobs);
90129
90340
  var push12 = new Command().description("Push completed and queued jobs to workspace").option("-c, --completed-file <file:string>", "Completed jobs input file (default: completed_jobs.json)").option("-q, --queued-file <file:string>", "Queued jobs input file (default: queued_jobs.json)").option("--skip-worker-check", "Skip checking for active workers before import").arguments("[workspace:string]").action(pushJobs);
90130
- var command32 = new Command().description("Manage jobs (import/export)").command("pull", pull3).command("push", push12);
90131
- var jobs_default = command32;
90341
+ var command33 = new Command().description("Manage jobs (import/export)").command("pull", pull3).command("push", push12);
90342
+ var jobs_default = command33;
90132
90343
 
90133
90344
  // src/commands/job/job.ts
90134
90345
  init_mod3();
@@ -90489,8 +90700,8 @@ async function restart(opts, id) {
90489
90700
  console.log(newId);
90490
90701
  }
90491
90702
  var listOptions = (cmd) => cmd.option("--json", "Output as JSON (for piping to jq)").option("--script-path <scriptPath:string>", "Filter by exact script/flow path").option("--created-by <createdBy:string>", "Filter by creator username").option("--running", "Show only running jobs").option("--failed", "Show only failed jobs").option("--success <success:boolean>", "Filter by success status (true/false)").option("--limit <limit:number>", "Number of jobs to return (default 30, max 100)").option("--job-kinds <jobKinds:string>", "Filter by job kinds (default: script,flow,singlestepflow)").option("--label <label:string>", "Filter by job label").option("--all", "Include sub-jobs (flow steps). By default only top-level jobs are shown").option("--parent <parent:string>", "Filter by parent job ID (show sub-jobs of a specific flow)").option("--is-flow-step", "Show only flow step jobs");
90492
- var command33 = listOptions(new Command().description("Manage jobs (list, inspect, cancel)")).action(list13).command("list", listOptions(new Command().description("List recent jobs"))).action(list13).command("get", "Get job details. For flows: shows step tree with sub-job IDs").arguments("<id:string>").option("--json", "Output as JSON (for piping to jq)").action(get10).command("result", "Get the result of a completed job (machine-friendly)").arguments("<id:string>").action(result).command("logs", "Get job logs. For flows: aggregates all step logs").arguments("<id:string>").action(logs).command("cancel", "Cancel a running or queued job").arguments("<id:string>").option("--reason <reason:string>", "Reason for cancellation").action(cancel).command("rerun", "Re-run a completed job with the same args. Prints the new job UUID on stdout.").arguments("<id:string>").action(rerun).command("restart", "Restart a completed flow at a given top-level step. Prints the new flow job UUID on stdout.").arguments("<id:string>").option("--step <stepId:string>", "Top-level step id to restart the flow from", { required: true }).option("--iteration <n:number>", "For a top-level branchall or for-loop step, the iteration to restart at").action(restart);
90493
- var job_default = command33;
90703
+ var command34 = listOptions(new Command().description("Manage jobs (list, inspect, cancel)")).action(list13).command("list", listOptions(new Command().description("List recent jobs"))).action(list13).command("get", "Get job details. For flows: shows step tree with sub-job IDs").arguments("<id:string>").option("--json", "Output as JSON (for piping to jq)").action(get10).command("result", "Get the result of a completed job (machine-friendly)").arguments("<id:string>").action(result).command("logs", "Get job logs. For flows: aggregates all step logs").arguments("<id:string>").action(logs).command("cancel", "Cancel a running or queued job").arguments("<id:string>").option("--reason <reason:string>", "Reason for cancellation").action(cancel).command("rerun", "Re-run a completed job with the same args. Prints the new job UUID on stdout.").arguments("<id:string>").action(rerun).command("restart", "Restart a completed flow at a given top-level step. Prints the new flow job UUID on stdout.").arguments("<id:string>").option("--step <stepId:string>", "Top-level step id to restart the flow from", { required: true }).option("--iteration <n:number>", "For a top-level branchall or for-loop step, the iteration to restart at").action(restart);
90704
+ var job_default = command34;
90494
90705
 
90495
90706
  // src/commands/group/group.ts
90496
90707
  init_mod3();
@@ -90589,8 +90800,8 @@ async function removeUser(opts, name, username) {
90589
90800
  });
90590
90801
  info(colors.green(`User '${username}' removed from group '${name}'.`));
90591
90802
  }
90592
- var command34 = new Command().description("Manage workspace groups").option("--json", "Output as JSON (for piping to jq)").action(list14).command("list", "List all groups in the workspace").option("--json", "Output as JSON (for piping to jq)").action(list14).command("get", "Get group details and members").arguments("<name:string>").option("--json", "Output as JSON (for piping to jq)").action(get11).command("create", "Create a new group").arguments("<name:string>").option("--summary <summary:string>", "Group summary/description").action(create).command("delete", "Delete a group").arguments("<name:string>").action(deleteGroup2).command("add-user", "Add a user to a group").arguments("<name:string> <username:string>").action(addUser2).command("remove-user", "Remove a user from a group").arguments("<name:string> <username:string>").action(removeUser);
90593
- var group_default = command34;
90803
+ var command35 = new Command().description("Manage workspace groups").option("--json", "Output as JSON (for piping to jq)").action(list14).command("list", "List all groups in the workspace").option("--json", "Output as JSON (for piping to jq)").action(list14).command("get", "Get group details and members").arguments("<name:string>").option("--json", "Output as JSON (for piping to jq)").action(get11).command("create", "Create a new group").arguments("<name:string>").option("--summary <summary:string>", "Group summary/description").action(create).command("delete", "Delete a group").arguments("<name:string>").action(deleteGroup2).command("add-user", "Add a user to a group").arguments("<name:string> <username:string>").action(addUser2).command("remove-user", "Remove a user from a group").arguments("<name:string> <username:string>").action(removeUser);
90804
+ var group_default = command35;
90594
90805
 
90595
90806
  // src/commands/audit/audit.ts
90596
90807
  init_mod3();
@@ -90667,8 +90878,8 @@ async function get12(opts, id) {
90667
90878
  }
90668
90879
  }
90669
90880
  var auditListOptions = (cmd) => cmd.option("--json", "Output as JSON (for piping to jq)").option("--username <username:string>", "Filter by username").option("--operation <operation:string>", "Filter by operation (exact or prefix)").option("--action-kind <actionKind:string>", "Filter by action kind (Create, Update, Delete, Execute)").option("--before <before:string>", "Filter events before this timestamp").option("--after <after:string>", "Filter events after this timestamp").option("--limit <limit:number>", "Number of entries to return (default 30, max 100)");
90670
- var command35 = auditListOptions(new Command().description("View audit logs (requires admin)")).action(list15).command("list", auditListOptions(new Command().description("List audit log entries"))).action(list15).command("get", "Get a specific audit log entry").arguments("<id:string>").option("--json", "Output as JSON (for piping to jq)").action(get12);
90671
- var audit_default = command35;
90881
+ var command36 = auditListOptions(new Command().description("View audit logs (requires admin)")).action(list15).command("list", auditListOptions(new Command().description("List audit log entries"))).action(list15).command("get", "Get a specific audit log entry").arguments("<id:string>").option("--json", "Output as JSON (for piping to jq)").action(get12);
90882
+ var audit_default = command36;
90672
90883
 
90673
90884
  // src/commands/token/token.ts
90674
90885
  init_mod3();
@@ -90722,8 +90933,8 @@ async function deleteToken2(opts, tokenPrefix) {
90722
90933
  await deleteToken({ tokenPrefix });
90723
90934
  info(colors.green(`Token with prefix '${tokenPrefix}' deleted.`));
90724
90935
  }
90725
- var command36 = new Command().description("Manage API tokens").option("--json", "Output as JSON (for piping to jq)").action(list16).command("list", "List API tokens").option("--json", "Output as JSON (for piping to jq)").action(list16).command("create", "Create a new API token").option("--label <label:string>", "Token label").option("--expiration <expiration:string>", "Token expiration (ISO 8601 timestamp)").action(create2).command("delete", "Delete a token by its prefix").arguments("<token_prefix:string>").action(deleteToken2);
90726
- var token_default = command36;
90936
+ var command37 = new Command().description("Manage API tokens").option("--json", "Output as JSON (for piping to jq)").action(list16).command("list", "List API tokens").option("--json", "Output as JSON (for piping to jq)").action(list16).command("create", "Create a new API token").option("--label <label:string>", "Token label").option("--expiration <expiration:string>", "Token expiration (ISO 8601 timestamp)").action(create2).command("delete", "Delete a token by its prefix").arguments("<token_prefix:string>").action(deleteToken2);
90937
+ var token_default = command37;
90727
90938
 
90728
90939
  // src/main.ts
90729
90940
  await init_generate_metadata();
@@ -90803,8 +91014,8 @@ ${await res.text()}`);
90803
91014
  console.log();
90804
91015
  }
90805
91016
  }
90806
- var command37 = new Command().name("docs").description("Search Windmill documentation.").arguments("<query:string>").option("--json", "Output results as JSON.").action(docs);
90807
- var docs_default = command37;
91017
+ var command38 = new Command().name("docs").description("Search Windmill documentation.").arguments("<query:string>").option("--json", "Output results as JSON.").action(docs);
91018
+ var docs_default = command38;
90808
91019
 
90809
91020
  // src/commands/config/config.ts
90810
91021
  init_mod3();
@@ -90874,8 +91085,8 @@ async function migrateAction() {
90874
91085
  info(` Also removed additional legacy keys: ${legacyKeys.slice(1).join(", ")}`);
90875
91086
  }
90876
91087
  }
90877
- var command38 = new Command().name("config").description("Show all available wmill.yaml configuration options").option("--json", "Output as JSON for programmatic consumption").action(configAction).command("migrate").description("Migrate wmill.yaml from gitBranches/environments to workspaces format").action(migrateAction);
90878
- var config_default = command38;
91088
+ var command39 = new Command().name("config").description("Show all available wmill.yaml configuration options").option("--json", "Output as JSON for programmatic consumption").action(configAction).command("migrate").description("Migrate wmill.yaml from gitBranches/environments to workspaces format").action(migrateAction);
91089
+ var config_default = command39;
90879
91090
 
90880
91091
  // src/commands/datatable/datatable.ts
90881
91092
  init_mod3();
@@ -92789,8 +93000,8 @@ async function serve2(opts) {
92789
93000
  async function psql2(opts) {
92790
93001
  await psql(opts);
92791
93002
  }
92792
- var command39 = new Command().description("datatable related commands").command("list", "list all datatables in the workspace").option("--json", "Output as JSON (for piping to jq)").action(list17).command("run", "run a SQL query on a datatable").arguments("<sql:string>").option("-n --name <name:string>", "Datatable name (default: main)").option("-s --silent", "Output only the final result as JSON. Useful for scripting.").action(run4).command("serve", "Serve all datatables as a Postgres-wire endpoint (psql, DBeaver, pgAdmin); the client picks the datatable via the database name in its connection string").option("--port <port:number>", "Port to listen on (default: first free port in 5433-5500)").option("--host <host:string>", "Bind address (default: 127.0.0.1)").option("--password <password:string>", "Password for Postgres clients (default: generate a random password at startup)").action(serve2).command("psql", "Start a serve listener and launch psql connected to it").option("-n --name <name:string>", "Datatable to connect psql to (default: main)").option("--port <port:number>", "Port the proxy listens on (default: first free port in 5433-5500)").option("--host <host:string>", "Bind address for the proxy (default: 127.0.0.1)").option("--password <password:string>", "Password for the temporary Postgres proxy (default: generate a random password at startup)").action(psql2);
92793
- var datatable_default = command39;
93003
+ var command40 = new Command().description("datatable related commands").command("list", "list all datatables in the workspace").option("--json", "Output as JSON (for piping to jq)").action(list17).command("run", "run a SQL query on a datatable").arguments("<sql:string>").option("-n --name <name:string>", "Datatable name (default: main)").option("-s --silent", "Output only the final result as JSON. Useful for scripting.").action(run4).command("serve", "Serve all datatables as a Postgres-wire endpoint (psql, DBeaver, pgAdmin); the client picks the datatable via the database name in its connection string").option("--port <port:number>", "Port to listen on (default: first free port in 5433-5500)").option("--host <host:string>", "Bind address (default: 127.0.0.1)").option("--password <password:string>", "Password for Postgres clients (default: generate a random password at startup)").action(serve2).command("psql", "Start a serve listener and launch psql connected to it").option("-n --name <name:string>", "Datatable to connect psql to (default: main)").option("--port <port:number>", "Port the proxy listens on (default: first free port in 5433-5500)").option("--host <host:string>", "Bind address for the proxy (default: 127.0.0.1)").option("--password <password:string>", "Password for the temporary Postgres proxy (default: generate a random password at startup)").action(psql2);
93004
+ var datatable_default = command40;
92794
93005
 
92795
93006
  // src/commands/ducklake/ducklake.ts
92796
93007
  init_mod3();
@@ -92820,8 +93031,8 @@ async function run5(opts, sql) {
92820
93031
  const name = opts.name ?? DEFAULT_DUCKLAKE_NAME;
92821
93032
  await runCatalogQuery(opts, "ducklake", name, sql);
92822
93033
  }
92823
- var command40 = new Command().description("ducklake related commands").command("list", "list all ducklakes in the workspace").option("--json", "Output as JSON (for piping to jq)").action(list18).command("run", "run a SQL query on a ducklake").arguments("<sql:string>").option("-n --name <name:string>", "Ducklake name (default: main)").option("-s --silent", "Output only the final result as JSON. Useful for scripting.").action(run5);
92824
- var ducklake_default = command40;
93034
+ var command41 = new Command().description("ducklake related commands").command("list", "list all ducklakes in the workspace").option("--json", "Output as JSON (for piping to jq)").action(list18).command("run", "run a SQL query on a ducklake").arguments("<sql:string>").option("-n --name <name:string>", "Ducklake name (default: main)").option("-s --silent", "Output only the final result as JSON. Useful for scripting.").action(run5);
93035
+ var ducklake_default = command41;
92825
93036
 
92826
93037
  // src/commands/object-storage/object-storage.ts
92827
93038
  init_mod3();
@@ -93022,12 +93233,11 @@ async function preview3(opts, fileKey) {
93022
93233
  `);
93023
93234
  }
93024
93235
  }
93025
- var command41 = new Command().alias("s3").description("Object storage (S3) related commands. Operates on the workspace's default object storage; use --storage to target a configured secondary storage.").action(listStorages).command("list", "List configured object storages for the workspace (default + secondary).").option("--json", "Output as JSON (for piping to jq)").action(listStorages).command("files", "List files in an object storage. Optionally filter by prefix.").alias("ls").arguments("[prefix:string]").option("--json", "Output as JSON (for piping to jq)").option("--max-keys <maxKeys:number>", "Page size (default 100)").option("--marker <marker:string>", "Pagination marker from a previous response").option("--storage <storage:string>", "Secondary storage name (omit for the workspace default)").action(listFiles).command("upload", "Upload a local file to object storage at the given file key.").arguments("<local_path:string> <file_key:string>").option("--storage <storage:string>", "Secondary storage name").option("--content-type <contentType:string>", "Content-Type header to set on the object").option("--content-disposition <contentDisposition:string>", "Content-Disposition header to set on the object").action(upload).command("download", "Download an object to a local file (or stdout). Default output path is the basename of the file key in the current directory.").arguments("<file_key:string> [output_path:string]").option("--storage <storage:string>", "Secondary storage name").option("--stdout", "Write file contents to stdout instead of a file").action(download).command("delete", "Delete an object from object storage. Prompts for confirmation unless --yes is set.").arguments("<file_key:string>").option("--storage <storage:string>", "Secondary storage name").option("--yes", "Skip the confirmation prompt").action(del).command("move", "Move an object within the same storage (rename or relocate by key).").arguments("<src_file_key:string> <dest_file_key:string>").option("--storage <storage:string>", "Secondary storage name").action(move).command("info", "Show metadata (size, mime, last-modified) for an object.").arguments("<file_key:string>").option("--json", "Output as JSON (for piping to jq)").option("--storage <storage:string>", "Secondary storage name").action(info2).command("preview", "Preview the contents of an object (text/CSV). Use --bytes-from / --bytes-length to peek at a slice of binary files.").arguments("<file_key:string>").option("--storage <storage:string>", "Secondary storage name").option("--mime <mime:string>", "Override the detected mime type (e.g. text/csv)").option("--bytes-from <bytesFrom:number>", "Start offset in bytes").option("--bytes-length <bytesLength:number>", "Number of bytes to read").option("--csv-separator <csvSeparator:string>", "CSV column separator (default ,)").option("--csv-header", "Treat the first CSV row as a header").action(preview3);
93026
- var object_storage_default = command41;
93236
+ var command42 = new Command().alias("s3").description("Object storage (S3) related commands. Operates on the workspace's default object storage; use --storage to target a configured secondary storage.").action(listStorages).command("list", "List configured object storages for the workspace (default + secondary).").option("--json", "Output as JSON (for piping to jq)").action(listStorages).command("files", "List files in an object storage. Optionally filter by prefix.").alias("ls").arguments("[prefix:string]").option("--json", "Output as JSON (for piping to jq)").option("--max-keys <maxKeys:number>", "Page size (default 100)").option("--marker <marker:string>", "Pagination marker from a previous response").option("--storage <storage:string>", "Secondary storage name (omit for the workspace default)").action(listFiles).command("upload", "Upload a local file to object storage at the given file key.").arguments("<local_path:string> <file_key:string>").option("--storage <storage:string>", "Secondary storage name").option("--content-type <contentType:string>", "Content-Type header to set on the object").option("--content-disposition <contentDisposition:string>", "Content-Disposition header to set on the object").action(upload).command("download", "Download an object to a local file (or stdout). Default output path is the basename of the file key in the current directory.").arguments("<file_key:string> [output_path:string]").option("--storage <storage:string>", "Secondary storage name").option("--stdout", "Write file contents to stdout instead of a file").action(download).command("delete", "Delete an object from object storage. Prompts for confirmation unless --yes is set.").arguments("<file_key:string>").option("--storage <storage:string>", "Secondary storage name").option("--yes", "Skip the confirmation prompt").action(del).command("move", "Move an object within the same storage (rename or relocate by key).").arguments("<src_file_key:string> <dest_file_key:string>").option("--storage <storage:string>", "Secondary storage name").action(move).command("info", "Show metadata (size, mime, last-modified) for an object.").arguments("<file_key:string>").option("--json", "Output as JSON (for piping to jq)").option("--storage <storage:string>", "Secondary storage name").action(info2).command("preview", "Preview the contents of an object (text/CSV). Use --bytes-from / --bytes-length to peek at a slice of binary files.").arguments("<file_key:string>").option("--storage <storage:string>", "Secondary storage name").option("--mime <mime:string>", "Override the detected mime type (e.g. text/csv)").option("--bytes-from <bytesFrom:number>", "Start offset in bytes").option("--bytes-length <bytesLength:number>", "Number of bytes to read").option("--csv-separator <csvSeparator:string>", "CSV column separator (default ,)").option("--csv-header", "Treat the first CSV row as a header").action(preview3);
93237
+ var object_storage_default = command42;
93027
93238
 
93028
93239
  // src/main.ts
93029
93240
  await init_context();
93030
- var VERSION = "1.715.0";
93031
93241
  async function checkVersionSafe(cmd) {
93032
93242
  const mainCommand = cmd.getMainCommand();
93033
93243
  const upgradeCommand = mainCommand.getCommand("upgrade");
@@ -93044,7 +93254,7 @@ async function checkVersionSafe(cmd) {
93044
93254
  }
93045
93255
  mainCommand.version(`${currentVersion} (New version available: ${latestVersion}. Run '${mainCommand.getName()} upgrade' to upgrade to the latest version!)`);
93046
93256
  }
93047
- var command42 = 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).helpOption("-h, --help", "Show this help.", {
93257
+ var command43 = 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).helpOption("-h, --help", "Show this help.", {
93048
93258
  action: async function() {
93049
93259
  const self2 = this;
93050
93260
  const long = self2.getRawArgs().includes(`--${self2.getHelpOption()?.name}`);
@@ -93086,20 +93296,20 @@ var command42 = new Command().name("wmill").action(() => info(`Welcome to Windmi
93086
93296
  error(e2);
93087
93297
  info("Try running with sudo and otherwise check the result of the command: npm uninstall windmill-cli && npm install -g windmill-cli");
93088
93298
  })).command("completions", new Command().description("Generate shell completions.").command("bash", new Command().description("Generate bash completions.").action(() => {
93089
- process.stdout.write(generateShellCompletions(command42, "bash") + `
93299
+ process.stdout.write(generateShellCompletions(command43, "bash") + `
93090
93300
  `);
93091
93301
  })).command("zsh", new Command().description("Generate zsh completions.").action(() => {
93092
- process.stdout.write(generateShellCompletions(command42, "zsh") + `
93302
+ process.stdout.write(generateShellCompletions(command43, "zsh") + `
93093
93303
  `);
93094
93304
  })).command("fish", new Command().description("Generate fish completions.").action(() => {
93095
- process.stdout.write(generateShellCompletions(command42, "fish") + `
93305
+ process.stdout.write(generateShellCompletions(command43, "fish") + `
93096
93306
  `);
93097
93307
  })));
93098
93308
  async function main2() {
93099
93309
  try {
93100
93310
  const args = process.argv.slice(2);
93101
93311
  if (args.length === 0) {
93102
- command42.showHelp();
93312
+ command43.showHelp();
93103
93313
  }
93104
93314
  const LOG_LEVEL = args.includes("--verbose") || args.includes("--debug") ? "DEBUG" : "INFO";
93105
93315
  setShowDiffs(args.includes("--show-diffs"));
@@ -93116,8 +93326,10 @@ async function main2() {
93116
93326
  if (shouldRunFreshnessCheck(process.argv)) {
93117
93327
  const { warnIfPromptsStale: warnIfPromptsStale2 } = await init_freshness().then(() => exports_freshness);
93118
93328
  await warnIfPromptsStale2({ argv: process.argv }).catch(() => {});
93329
+ const { warnIfTsconfigStale: warnIfTsconfigStale2 } = await init_tsconfig().then(() => exports_tsconfig);
93330
+ await warnIfTsconfigStale2().catch(() => {});
93119
93331
  }
93120
- await command42.parse(args);
93332
+ await command43.parse(args);
93121
93333
  } catch (e2) {
93122
93334
  if (e2 && typeof e2 === "object" && "name" in e2 && e2.name === "ApiError") {
93123
93335
  const body = e2.body;
@@ -93153,7 +93365,7 @@ if (isMain()) {
93153
93365
  process.stdin.destroy();
93154
93366
  });
93155
93367
  }
93156
- var main_default = command42;
93368
+ var main_default = command43;
93157
93369
  export {
93158
93370
  add as workspaceAdd,
93159
93371
  workspace_default as workspace,