windmill-cli 1.783.0 → 1.784.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/main.js +294 -180
- package/package.json +1 -1
package/esm/main.js
CHANGED
|
@@ -16784,7 +16784,7 @@ var init_OpenAPI = __esm(() => {
|
|
|
16784
16784
|
PASSWORD: undefined,
|
|
16785
16785
|
TOKEN: getEnv3("WM_TOKEN"),
|
|
16786
16786
|
USERNAME: undefined,
|
|
16787
|
-
VERSION: "1.
|
|
16787
|
+
VERSION: "1.784.0",
|
|
16788
16788
|
WITH_CREDENTIALS: true,
|
|
16789
16789
|
interceptors: {
|
|
16790
16790
|
request: new Interceptors,
|
|
@@ -17210,6 +17210,7 @@ __export(exports_services_gen, {
|
|
|
17210
17210
|
resumeSuspendedFlowAsOwner: () => resumeSuspendedFlowAsOwner,
|
|
17211
17211
|
resumeSuspended: () => resumeSuspended,
|
|
17212
17212
|
resultById: () => resultById,
|
|
17213
|
+
restoreResourceVersion: () => restoreResourceVersion,
|
|
17213
17214
|
restartWorkerGroup: () => restartWorkerGroup,
|
|
17214
17215
|
restartFlowAtStep: () => restartFlowAtStep,
|
|
17215
17216
|
resolveNpmPackageVersion: () => resolveNpmPackageVersion,
|
|
@@ -17487,9 +17488,11 @@ __export(exports_services_gen, {
|
|
|
17487
17488
|
getRuffConfig: () => getRuffConfig,
|
|
17488
17489
|
getRootJobId: () => getRootJobId,
|
|
17489
17490
|
getResumeUrls: () => getResumeUrls,
|
|
17491
|
+
getResourceVersion: () => getResourceVersion,
|
|
17490
17492
|
getResourceValueInterpolated: () => getResourceValueInterpolated,
|
|
17491
17493
|
getResourceValue: () => getResourceValue,
|
|
17492
17494
|
getResourceType: () => getResourceType,
|
|
17495
|
+
getResourceHistory: () => getResourceHistory,
|
|
17493
17496
|
getResource: () => getResource,
|
|
17494
17497
|
getRawAppData: () => getRawAppData,
|
|
17495
17498
|
getQueuePosition: () => getQueuePosition,
|
|
@@ -17833,6 +17836,7 @@ __export(exports_services_gen, {
|
|
|
17833
17836
|
compareWorkspaces: () => compareWorkspaces,
|
|
17834
17837
|
commitKafkaOffsets: () => commitKafkaOffsets,
|
|
17835
17838
|
closeDeploymentRequestMerged: () => closeDeploymentRequestMerged,
|
|
17839
|
+
clearResourceHistory: () => clearResourceHistory,
|
|
17836
17840
|
clearIndex: () => clearIndex,
|
|
17837
17841
|
checkSchemaContracts: () => checkSchemaContracts,
|
|
17838
17842
|
checkS3FolderExists: () => checkS3FolderExists,
|
|
@@ -20335,6 +20339,42 @@ var backendVersion = () => {
|
|
|
20335
20339
|
body: data3.requestBody,
|
|
20336
20340
|
mediaType: "application/json"
|
|
20337
20341
|
});
|
|
20342
|
+
}, getResourceHistory = (data3) => {
|
|
20343
|
+
return request(OpenAPI, {
|
|
20344
|
+
method: "GET",
|
|
20345
|
+
url: "/w/{workspace}/resources/history/p/{path}",
|
|
20346
|
+
path: {
|
|
20347
|
+
workspace: data3.workspace,
|
|
20348
|
+
path: data3.path
|
|
20349
|
+
}
|
|
20350
|
+
});
|
|
20351
|
+
}, clearResourceHistory = (data3) => {
|
|
20352
|
+
return request(OpenAPI, {
|
|
20353
|
+
method: "DELETE",
|
|
20354
|
+
url: "/w/{workspace}/resources/history/p/{path}",
|
|
20355
|
+
path: {
|
|
20356
|
+
workspace: data3.workspace,
|
|
20357
|
+
path: data3.path
|
|
20358
|
+
}
|
|
20359
|
+
});
|
|
20360
|
+
}, getResourceVersion = (data3) => {
|
|
20361
|
+
return request(OpenAPI, {
|
|
20362
|
+
method: "GET",
|
|
20363
|
+
url: "/w/{workspace}/resources/history/v/{version}",
|
|
20364
|
+
path: {
|
|
20365
|
+
workspace: data3.workspace,
|
|
20366
|
+
version: data3.version
|
|
20367
|
+
}
|
|
20368
|
+
});
|
|
20369
|
+
}, restoreResourceVersion = (data3) => {
|
|
20370
|
+
return request(OpenAPI, {
|
|
20371
|
+
method: "POST",
|
|
20372
|
+
url: "/w/{workspace}/resources/history/restore/v/{version}",
|
|
20373
|
+
path: {
|
|
20374
|
+
workspace: data3.workspace,
|
|
20375
|
+
version: data3.version
|
|
20376
|
+
}
|
|
20377
|
+
});
|
|
20338
20378
|
}, getResource = (data3) => {
|
|
20339
20379
|
return request(OpenAPI, {
|
|
20340
20380
|
method: "GET",
|
|
@@ -26598,6 +26638,7 @@ __export(exports_gen, {
|
|
|
26598
26638
|
resumeSuspendedFlowAsOwner: () => resumeSuspendedFlowAsOwner,
|
|
26599
26639
|
resumeSuspended: () => resumeSuspended,
|
|
26600
26640
|
resultById: () => resultById,
|
|
26641
|
+
restoreResourceVersion: () => restoreResourceVersion,
|
|
26601
26642
|
restartWorkerGroup: () => restartWorkerGroup,
|
|
26602
26643
|
restartFlowAtStep: () => restartFlowAtStep,
|
|
26603
26644
|
resolveNpmPackageVersion: () => resolveNpmPackageVersion,
|
|
@@ -26875,9 +26916,11 @@ __export(exports_gen, {
|
|
|
26875
26916
|
getRuffConfig: () => getRuffConfig,
|
|
26876
26917
|
getRootJobId: () => getRootJobId,
|
|
26877
26918
|
getResumeUrls: () => getResumeUrls,
|
|
26919
|
+
getResourceVersion: () => getResourceVersion,
|
|
26878
26920
|
getResourceValueInterpolated: () => getResourceValueInterpolated,
|
|
26879
26921
|
getResourceValue: () => getResourceValue,
|
|
26880
26922
|
getResourceType: () => getResourceType,
|
|
26923
|
+
getResourceHistory: () => getResourceHistory,
|
|
26881
26924
|
getResource: () => getResource,
|
|
26882
26925
|
getRawAppData: () => getRawAppData,
|
|
26883
26926
|
getQueuePosition: () => getQueuePosition,
|
|
@@ -27221,6 +27264,7 @@ __export(exports_gen, {
|
|
|
27221
27264
|
compareWorkspaces: () => compareWorkspaces,
|
|
27222
27265
|
commitKafkaOffsets: () => commitKafkaOffsets,
|
|
27223
27266
|
closeDeploymentRequestMerged: () => closeDeploymentRequestMerged,
|
|
27267
|
+
clearResourceHistory: () => clearResourceHistory,
|
|
27224
27268
|
clearIndex: () => clearIndex,
|
|
27225
27269
|
checkSchemaContracts: () => checkSchemaContracts,
|
|
27226
27270
|
checkS3FolderExists: () => checkS3FolderExists,
|
|
@@ -27383,7 +27427,7 @@ var init_auth = __esm(async () => {
|
|
|
27383
27427
|
});
|
|
27384
27428
|
|
|
27385
27429
|
// src/core/constants.ts
|
|
27386
|
-
var WM_FORK_PREFIX = "wm-fork", VERSION = "1.
|
|
27430
|
+
var WM_FORK_PREFIX = "wm-fork", VERSION = "1.784.0";
|
|
27387
27431
|
|
|
27388
27432
|
// src/utils/git.ts
|
|
27389
27433
|
var exports_git = {};
|
|
@@ -31056,9 +31100,13 @@ __export(exports_context, {
|
|
|
31056
31100
|
validatePath: () => validatePath,
|
|
31057
31101
|
tryResolveVersion: () => tryResolveVersion,
|
|
31058
31102
|
tryResolveBranchWorkspace: () => tryResolveBranchWorkspace,
|
|
31103
|
+
toSyncRootRelativePath: () => toSyncRootRelativePath,
|
|
31059
31104
|
resolveWorkspace: () => resolveWorkspace,
|
|
31060
|
-
fetchVersion: () => fetchVersion
|
|
31105
|
+
fetchVersion: () => fetchVersion,
|
|
31106
|
+
assertRemotePath: () => assertRemotePath
|
|
31061
31107
|
});
|
|
31108
|
+
import { existsSync as existsSync5, realpathSync } from "node:fs";
|
|
31109
|
+
import { basename as basename4, dirname as dirname7, isAbsolute as isAbsolute3, join as join9, relative as relative6, resolve as resolve6 } from "node:path";
|
|
31062
31110
|
async function selectFromMultipleProfiles(profiles, baseUrl2, workspaceId, context, configDir) {
|
|
31063
31111
|
if (profiles.length === 1) {
|
|
31064
31112
|
return profiles[0];
|
|
@@ -31465,6 +31513,34 @@ async function tryResolveVersion(opts) {
|
|
|
31465
31513
|
return;
|
|
31466
31514
|
}
|
|
31467
31515
|
}
|
|
31516
|
+
function syncRoot() {
|
|
31517
|
+
const wmillYaml = getWmillYamlPath();
|
|
31518
|
+
return wmillYaml ? dirname7(wmillYaml) : process.cwd();
|
|
31519
|
+
}
|
|
31520
|
+
function toSyncRootRelativePath(arg, cwdBeforeConfig) {
|
|
31521
|
+
const root = syncRoot();
|
|
31522
|
+
const candidates = isAbsolute3(arg) ? [arg] : [resolve6(cwdBeforeConfig, arg), resolve6(root, arg)];
|
|
31523
|
+
const abs = candidates.find((c) => existsSync5(c)) ?? candidates.find((c) => existsSync5(dirname7(c))) ?? candidates.at(-1);
|
|
31524
|
+
const rel = relative6(root, abs);
|
|
31525
|
+
if (rel === "")
|
|
31526
|
+
return ".";
|
|
31527
|
+
if (!rel.startsWith(".."))
|
|
31528
|
+
return rel;
|
|
31529
|
+
try {
|
|
31530
|
+
const resolved = relative6(realpathSync(root), realpathOfNamed(abs));
|
|
31531
|
+
return resolved === "" ? "." : resolved;
|
|
31532
|
+
} catch {
|
|
31533
|
+
return rel;
|
|
31534
|
+
}
|
|
31535
|
+
}
|
|
31536
|
+
function realpathOfNamed(p) {
|
|
31537
|
+
return existsSync5(p) ? realpathSync(p) : join9(realpathSync(dirname7(p)), basename4(p));
|
|
31538
|
+
}
|
|
31539
|
+
function assertRemotePath(remotePath, arg) {
|
|
31540
|
+
if (REMOTE_PATH_RE.test(remotePath))
|
|
31541
|
+
return;
|
|
31542
|
+
throw new Error(`Cannot derive a Windmill path from '${arg}'` + (remotePath ? ` (it maps to '${remotePath}')` : "") + `: a preview runs under the path of the file it previews, which must sit inside the wmill.yaml root and be of the form <u|g|f>/<username|group|folder>/<name>.`);
|
|
31543
|
+
}
|
|
31468
31544
|
function validatePath(path5) {
|
|
31469
31545
|
if (!(path5.startsWith("g") || path5.startsWith("u") || path5.startsWith("f"))) {
|
|
31470
31546
|
infoStderr(colors.red("Given remote path looks invalid. Remote paths are typically of the form <u|g|f>/<username|group|folder>/..."));
|
|
@@ -31472,6 +31548,7 @@ function validatePath(path5) {
|
|
|
31472
31548
|
}
|
|
31473
31549
|
return true;
|
|
31474
31550
|
}
|
|
31551
|
+
var REMOTE_PATH_RE;
|
|
31475
31552
|
var init_context = __esm(async () => {
|
|
31476
31553
|
init_colors2();
|
|
31477
31554
|
init_log();
|
|
@@ -31489,6 +31566,7 @@ var init_context = __esm(async () => {
|
|
|
31489
31566
|
init_branch_profiles(),
|
|
31490
31567
|
init_conf()
|
|
31491
31568
|
]);
|
|
31569
|
+
REMOTE_PATH_RE = /^[ufg](\/[^/]+){2,}$/;
|
|
31492
31570
|
});
|
|
31493
31571
|
|
|
31494
31572
|
// src/commands/sync/global.ts
|
|
@@ -33697,13 +33775,13 @@ return schema
|
|
|
33697
33775
|
import { createServer as createServer2 } from "node:net";
|
|
33698
33776
|
import { execSync as execSync3 } from "node:child_process";
|
|
33699
33777
|
function isPortFree(port, host) {
|
|
33700
|
-
return new Promise((
|
|
33778
|
+
return new Promise((resolve7) => {
|
|
33701
33779
|
const s = createServer2();
|
|
33702
33780
|
s.once("error", (err) => {
|
|
33703
33781
|
const code2 = err.code ?? "";
|
|
33704
|
-
|
|
33782
|
+
resolve7(code2 !== "EADDRINUSE" && code2 !== "EACCES");
|
|
33705
33783
|
});
|
|
33706
|
-
s.once("listening", () => s.close(() =>
|
|
33784
|
+
s.once("listening", () => s.close(() => resolve7(true)));
|
|
33707
33785
|
s.listen(port, host);
|
|
33708
33786
|
});
|
|
33709
33787
|
}
|
|
@@ -37832,8 +37910,8 @@ var require_streamx = __commonJS((exports, module) => {
|
|
|
37832
37910
|
return this;
|
|
37833
37911
|
},
|
|
37834
37912
|
next() {
|
|
37835
|
-
return new Promise(function(
|
|
37836
|
-
promiseResolve =
|
|
37913
|
+
return new Promise(function(resolve7, reject) {
|
|
37914
|
+
promiseResolve = resolve7;
|
|
37837
37915
|
promiseReject = reject;
|
|
37838
37916
|
const data3 = stream.read();
|
|
37839
37917
|
if (data3 !== null)
|
|
@@ -37870,14 +37948,14 @@ var require_streamx = __commonJS((exports, module) => {
|
|
|
37870
37948
|
}
|
|
37871
37949
|
function destroy(err) {
|
|
37872
37950
|
stream.destroy(err);
|
|
37873
|
-
return new Promise((
|
|
37951
|
+
return new Promise((resolve7, reject) => {
|
|
37874
37952
|
if (stream._duplexState & DESTROYED)
|
|
37875
|
-
return
|
|
37953
|
+
return resolve7({ value: undefined, done: true });
|
|
37876
37954
|
stream.once("close", function() {
|
|
37877
37955
|
if (err)
|
|
37878
37956
|
reject(err);
|
|
37879
37957
|
else
|
|
37880
|
-
|
|
37958
|
+
resolve7({ value: undefined, done: true });
|
|
37881
37959
|
});
|
|
37882
37960
|
});
|
|
37883
37961
|
}
|
|
@@ -37929,8 +38007,8 @@ var require_streamx = __commonJS((exports, module) => {
|
|
|
37929
38007
|
return Promise.resolve(true);
|
|
37930
38008
|
if (state.drains === null)
|
|
37931
38009
|
state.drains = [];
|
|
37932
|
-
return new Promise((
|
|
37933
|
-
state.drains.push({ writes, resolve:
|
|
38010
|
+
return new Promise((resolve7) => {
|
|
38011
|
+
state.drains.push({ writes, resolve: resolve7 });
|
|
37934
38012
|
});
|
|
37935
38013
|
}
|
|
37936
38014
|
write(data3) {
|
|
@@ -38044,11 +38122,11 @@ var require_streamx = __commonJS((exports, module) => {
|
|
|
38044
38122
|
cb(null);
|
|
38045
38123
|
}
|
|
38046
38124
|
function pipelinePromise(...streams) {
|
|
38047
|
-
return new Promise((
|
|
38125
|
+
return new Promise((resolve7, reject) => {
|
|
38048
38126
|
return pipeline(...streams, (err) => {
|
|
38049
38127
|
if (err)
|
|
38050
38128
|
return reject(err);
|
|
38051
|
-
|
|
38129
|
+
resolve7();
|
|
38052
38130
|
});
|
|
38053
38131
|
});
|
|
38054
38132
|
}
|
|
@@ -38754,16 +38832,16 @@ var require_extract = __commonJS((exports, module) => {
|
|
|
38754
38832
|
entryCallback = null;
|
|
38755
38833
|
cb(err);
|
|
38756
38834
|
}
|
|
38757
|
-
function onnext(
|
|
38835
|
+
function onnext(resolve7, reject) {
|
|
38758
38836
|
if (error2) {
|
|
38759
38837
|
return reject(error2);
|
|
38760
38838
|
}
|
|
38761
38839
|
if (entryStream) {
|
|
38762
|
-
|
|
38840
|
+
resolve7({ value: entryStream, done: false });
|
|
38763
38841
|
entryStream = null;
|
|
38764
38842
|
return;
|
|
38765
38843
|
}
|
|
38766
|
-
promiseResolve =
|
|
38844
|
+
promiseResolve = resolve7;
|
|
38767
38845
|
promiseReject = reject;
|
|
38768
38846
|
consumeCallback(null);
|
|
38769
38847
|
if (extract._finished && promiseResolve) {
|
|
@@ -38794,14 +38872,14 @@ var require_extract = __commonJS((exports, module) => {
|
|
|
38794
38872
|
function destroy(err) {
|
|
38795
38873
|
extract.destroy(err);
|
|
38796
38874
|
consumeCallback(err);
|
|
38797
|
-
return new Promise((
|
|
38875
|
+
return new Promise((resolve7, reject) => {
|
|
38798
38876
|
if (extract.destroyed)
|
|
38799
|
-
return
|
|
38877
|
+
return resolve7({ value: undefined, done: true });
|
|
38800
38878
|
extract.once("close", function() {
|
|
38801
38879
|
if (err)
|
|
38802
38880
|
reject(err);
|
|
38803
38881
|
else
|
|
38804
|
-
|
|
38882
|
+
resolve7({ value: undefined, done: true });
|
|
38805
38883
|
});
|
|
38806
38884
|
});
|
|
38807
38885
|
}
|
|
@@ -39210,8 +39288,8 @@ async function extractTarball(body, destDir) {
|
|
|
39210
39288
|
ws.on("error", next);
|
|
39211
39289
|
stream.on("error", next);
|
|
39212
39290
|
});
|
|
39213
|
-
await new Promise((
|
|
39214
|
-
extract.on("finish",
|
|
39291
|
+
await new Promise((resolve8, reject) => {
|
|
39292
|
+
extract.on("finish", resolve8);
|
|
39215
39293
|
extract.on("error", reject);
|
|
39216
39294
|
Readable.fromWeb(body).pipe(createGunzip()).on("error", reject).pipe(extract).on("error", reject);
|
|
39217
39295
|
});
|
|
@@ -39264,14 +39342,43 @@ function detectFrameworks(appDir) {
|
|
|
39264
39342
|
return { svelte: false, vue: false };
|
|
39265
39343
|
}
|
|
39266
39344
|
}
|
|
39345
|
+
function esmConditionTarget(subpath) {
|
|
39346
|
+
if (typeof subpath === "string")
|
|
39347
|
+
return subpath;
|
|
39348
|
+
if (!subpath || typeof subpath !== "object" || Array.isArray(subpath)) {
|
|
39349
|
+
return;
|
|
39350
|
+
}
|
|
39351
|
+
for (const [condition, target] of Object.entries(subpath)) {
|
|
39352
|
+
if (!ESM_CONDITIONS.includes(condition))
|
|
39353
|
+
continue;
|
|
39354
|
+
const entry = esmConditionTarget(target);
|
|
39355
|
+
if (entry)
|
|
39356
|
+
return entry;
|
|
39357
|
+
}
|
|
39358
|
+
return;
|
|
39359
|
+
}
|
|
39360
|
+
function resolveAppSvelteCompiler(appDir) {
|
|
39361
|
+
const requireFromApp = createRequire2(path6.join(path6.resolve(appDir), "package.json"));
|
|
39362
|
+
try {
|
|
39363
|
+
const pkgPath = requireFromApp.resolve("svelte/package.json");
|
|
39364
|
+
const exportsMap = JSON.parse(readTextFileSync(pkgPath))?.exports;
|
|
39365
|
+
const target = esmConditionTarget(exportsMap?.["./compiler"]);
|
|
39366
|
+
if (target?.startsWith(".")) {
|
|
39367
|
+
const entry = path6.resolve(path6.dirname(pkgPath), target);
|
|
39368
|
+
if (fs9.existsSync(entry))
|
|
39369
|
+
return entry;
|
|
39370
|
+
}
|
|
39371
|
+
} catch {}
|
|
39372
|
+
return requireFromApp.resolve("svelte/compiler");
|
|
39373
|
+
}
|
|
39267
39374
|
async function loadSvelteCompiler(appDir) {
|
|
39375
|
+
let mod;
|
|
39268
39376
|
try {
|
|
39269
|
-
|
|
39270
|
-
const entry = requireFromApp.resolve("svelte/compiler");
|
|
39271
|
-
return await import(pathToFileURL2(entry).href);
|
|
39377
|
+
mod = await import(pathToFileURL2(resolveAppSvelteCompiler(appDir)).href);
|
|
39272
39378
|
} catch {
|
|
39273
|
-
|
|
39379
|
+
mod = await import("svelte/compiler");
|
|
39274
39380
|
}
|
|
39381
|
+
return typeof mod?.compile === "function" ? mod : mod?.default ?? mod;
|
|
39275
39382
|
}
|
|
39276
39383
|
function createSveltePlugin(appDir) {
|
|
39277
39384
|
let compilerPromise;
|
|
@@ -39349,13 +39456,13 @@ async function ensureNodeModules(appDir) {
|
|
|
39349
39456
|
const nodeModulesPath = path6.join(targetDir, "node_modules");
|
|
39350
39457
|
if (!fs9.existsSync(nodeModulesPath)) {
|
|
39351
39458
|
info(colors.yellow("\uD83D\uDCE6 node_modules not found, running npm install..."));
|
|
39352
|
-
const code2 = await new Promise((
|
|
39459
|
+
const code2 = await new Promise((resolve9, reject) => {
|
|
39353
39460
|
const npmInstall = spawn("npm", ["install"], {
|
|
39354
39461
|
cwd: targetDir,
|
|
39355
39462
|
stdio: "inherit",
|
|
39356
39463
|
shell: true
|
|
39357
39464
|
});
|
|
39358
|
-
npmInstall.on("close", (code3) =>
|
|
39465
|
+
npmInstall.on("close", (code3) => resolve9(code3 ?? 0));
|
|
39359
39466
|
npmInstall.on("error", reject);
|
|
39360
39467
|
});
|
|
39361
39468
|
if (code2 !== 0) {
|
|
@@ -39483,7 +39590,7 @@ function getDevBuildOptions(entryPoint = "index.tsx", svelte = false) {
|
|
|
39483
39590
|
}
|
|
39484
39591
|
};
|
|
39485
39592
|
}
|
|
39486
|
-
var DEFAULT_BUILD_OPTIONS;
|
|
39593
|
+
var DEFAULT_BUILD_OPTIONS, ESM_CONDITIONS;
|
|
39487
39594
|
var init_bundle = __esm(async () => {
|
|
39488
39595
|
init_log();
|
|
39489
39596
|
init_colors2();
|
|
@@ -39503,6 +39610,7 @@ var init_bundle = __esm(async () => {
|
|
|
39503
39610
|
logLevel: "info",
|
|
39504
39611
|
write: true
|
|
39505
39612
|
};
|
|
39613
|
+
ESM_CONDITIONS = ["node", "import", "default"];
|
|
39506
39614
|
});
|
|
39507
39615
|
|
|
39508
39616
|
// src/commands/app/wmillTsDev.ts
|
|
@@ -39750,7 +39858,7 @@ async function pollJobWithQueueLogging(workspace, jobId, options) {
|
|
|
39750
39858
|
info(colors.gray(`${label}${jobId}: still polling, queue status unavailable...`));
|
|
39751
39859
|
}
|
|
39752
39860
|
const delayMs = Date.now() - startedAt < fastPollDurationMs ? fastPollIntervalMs : slowPollIntervalMs;
|
|
39753
|
-
await new Promise((
|
|
39861
|
+
await new Promise((resolve9) => setTimeout(resolve9, delayMs));
|
|
39754
39862
|
}
|
|
39755
39863
|
}
|
|
39756
39864
|
var DEFAULT_FAST_POLL_INTERVAL_MS = 100, DEFAULT_FAST_POLL_DURATION_MS = 2000, DEFAULT_SLOW_POLL_INTERVAL_MS = 2000, QUEUE_LOG_INTERVAL_MS = 5000, HEARTBEAT_INTERVAL_MS = 60000, MAX_CONSECUTIVE_POLL_ERRORS = 10;
|
|
@@ -41698,7 +41806,7 @@ var require_BufferList = __commonJS((exports, module) => {
|
|
|
41698
41806
|
this.head = this.tail = null;
|
|
41699
41807
|
this.length = 0;
|
|
41700
41808
|
};
|
|
41701
|
-
BufferList.prototype.join = function
|
|
41809
|
+
BufferList.prototype.join = function join12(s) {
|
|
41702
41810
|
if (this.length === 0)
|
|
41703
41811
|
return "";
|
|
41704
41812
|
var p = this.head;
|
|
@@ -43710,8 +43818,8 @@ var require_lib2 = __commonJS((exports, module) => {
|
|
|
43710
43818
|
return this;
|
|
43711
43819
|
}
|
|
43712
43820
|
var p = this.constructor;
|
|
43713
|
-
return this.then(
|
|
43714
|
-
function
|
|
43821
|
+
return this.then(resolve10, reject2);
|
|
43822
|
+
function resolve10(value) {
|
|
43715
43823
|
function yes() {
|
|
43716
43824
|
return value;
|
|
43717
43825
|
}
|
|
@@ -43864,8 +43972,8 @@ var require_lib2 = __commonJS((exports, module) => {
|
|
|
43864
43972
|
}
|
|
43865
43973
|
return out;
|
|
43866
43974
|
}
|
|
43867
|
-
Promise2.resolve =
|
|
43868
|
-
function
|
|
43975
|
+
Promise2.resolve = resolve9;
|
|
43976
|
+
function resolve9(value) {
|
|
43869
43977
|
if (value instanceof this) {
|
|
43870
43978
|
return value;
|
|
43871
43979
|
}
|
|
@@ -44219,10 +44327,10 @@ var require_utils = __commonJS((exports) => {
|
|
|
44219
44327
|
var promise = external.Promise.resolve(inputData).then(function(data3) {
|
|
44220
44328
|
var isBlob2 = support.blob && (data3 instanceof Blob || ["[object File]", "[object Blob]"].indexOf(Object.prototype.toString.call(data3)) !== -1);
|
|
44221
44329
|
if (isBlob2 && typeof FileReader !== "undefined") {
|
|
44222
|
-
return new external.Promise(function(
|
|
44330
|
+
return new external.Promise(function(resolve9, reject) {
|
|
44223
44331
|
var reader = new FileReader;
|
|
44224
44332
|
reader.onload = function(e) {
|
|
44225
|
-
|
|
44333
|
+
resolve9(e.target.result);
|
|
44226
44334
|
};
|
|
44227
44335
|
reader.onerror = function(e) {
|
|
44228
44336
|
reject(e.target.error);
|
|
@@ -44686,7 +44794,7 @@ var require_StreamHelper = __commonJS((exports, module) => {
|
|
|
44686
44794
|
}
|
|
44687
44795
|
}
|
|
44688
44796
|
function accumulate(helper, updateCallback) {
|
|
44689
|
-
return new external.Promise(function(
|
|
44797
|
+
return new external.Promise(function(resolve9, reject) {
|
|
44690
44798
|
var dataArray = [];
|
|
44691
44799
|
var { _internalType: chunkType, _outputType: resultType, _mimeType: mimeType } = helper;
|
|
44692
44800
|
helper.on("data", function(data3, meta) {
|
|
@@ -44700,7 +44808,7 @@ var require_StreamHelper = __commonJS((exports, module) => {
|
|
|
44700
44808
|
}).on("end", function() {
|
|
44701
44809
|
try {
|
|
44702
44810
|
var result = transformZipOutput(resultType, concat(chunkType, dataArray), mimeType);
|
|
44703
|
-
|
|
44811
|
+
resolve9(result);
|
|
44704
44812
|
} catch (e) {
|
|
44705
44813
|
reject(e);
|
|
44706
44814
|
}
|
|
@@ -50277,7 +50385,7 @@ var require_load = __commonJS((exports, module) => {
|
|
|
50277
50385
|
var Crc32Probe = require_Crc32Probe();
|
|
50278
50386
|
var nodejsUtils = require_nodejsUtils();
|
|
50279
50387
|
function checkEntryCRC32(zipEntry) {
|
|
50280
|
-
return new external.Promise(function(
|
|
50388
|
+
return new external.Promise(function(resolve9, reject) {
|
|
50281
50389
|
var worker = zipEntry.decompressed.getContentWorker().pipe(new Crc32Probe);
|
|
50282
50390
|
worker.on("error", function(e) {
|
|
50283
50391
|
reject(e);
|
|
@@ -50285,7 +50393,7 @@ var require_load = __commonJS((exports, module) => {
|
|
|
50285
50393
|
if (worker.streamInfo.crc32 !== zipEntry.decompressed.crc32) {
|
|
50286
50394
|
reject(new Error("Corrupted zip : CRC32 mismatch"));
|
|
50287
50395
|
} else {
|
|
50288
|
-
|
|
50396
|
+
resolve9();
|
|
50289
50397
|
}
|
|
50290
50398
|
}).resume();
|
|
50291
50399
|
});
|
|
@@ -50400,9 +50508,9 @@ class TarAsZip {
|
|
|
50400
50508
|
const sub = new TarAsZip(new Map);
|
|
50401
50509
|
for (const [name, file] of Object.entries(this.files)) {
|
|
50402
50510
|
if (name.startsWith(normalized)) {
|
|
50403
|
-
const
|
|
50404
|
-
if (
|
|
50405
|
-
sub.files[
|
|
50511
|
+
const relative8 = name.slice(normalized.length);
|
|
50512
|
+
if (relative8) {
|
|
50513
|
+
sub.files[relative8] = { ...file, name: relative8 };
|
|
50406
50514
|
}
|
|
50407
50515
|
}
|
|
50408
50516
|
}
|
|
@@ -50413,7 +50521,7 @@ async function parseTarResponse(response) {
|
|
|
50413
50521
|
const buffer = Buffer.from(await response.arrayBuffer());
|
|
50414
50522
|
const entries = new Map;
|
|
50415
50523
|
const ex = $extract();
|
|
50416
|
-
return new Promise((
|
|
50524
|
+
return new Promise((resolve9, reject) => {
|
|
50417
50525
|
ex.on("entry", (header, stream, next) => {
|
|
50418
50526
|
const chunks = [];
|
|
50419
50527
|
stream.on("data", (chunk) => chunks.push(chunk));
|
|
@@ -50427,7 +50535,7 @@ async function parseTarResponse(response) {
|
|
|
50427
50535
|
stream.on("error", reject);
|
|
50428
50536
|
stream.resume();
|
|
50429
50537
|
});
|
|
50430
|
-
ex.on("finish", () =>
|
|
50538
|
+
ex.on("finish", () => resolve9(new TarAsZip(entries)));
|
|
50431
50539
|
ex.on("error", reject);
|
|
50432
50540
|
Readable2.from(buffer).pipe(ex);
|
|
50433
50541
|
});
|
|
@@ -53379,7 +53487,7 @@ var require_compile = __commonJS((exports) => {
|
|
|
53379
53487
|
const schOrFunc = root.refs[ref];
|
|
53380
53488
|
if (schOrFunc)
|
|
53381
53489
|
return schOrFunc;
|
|
53382
|
-
let _sch =
|
|
53490
|
+
let _sch = resolve9.call(this, root, ref);
|
|
53383
53491
|
if (_sch === undefined) {
|
|
53384
53492
|
const schema = (_a = root.localRefs) === null || _a === undefined ? undefined : _a[ref];
|
|
53385
53493
|
const { schemaId } = this.opts;
|
|
@@ -53406,7 +53514,7 @@ var require_compile = __commonJS((exports) => {
|
|
|
53406
53514
|
function sameSchemaEnv(s1, s2) {
|
|
53407
53515
|
return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;
|
|
53408
53516
|
}
|
|
53409
|
-
function
|
|
53517
|
+
function resolve9(root, ref) {
|
|
53410
53518
|
let sch;
|
|
53411
53519
|
while (typeof (sch = this.refs[ref]) == "string")
|
|
53412
53520
|
ref = sch;
|
|
@@ -53914,54 +54022,54 @@ var require_fast_uri = __commonJS((exports, module) => {
|
|
|
53914
54022
|
}
|
|
53915
54023
|
return uri;
|
|
53916
54024
|
}
|
|
53917
|
-
function
|
|
54025
|
+
function resolve9(baseURI, relativeURI, options) {
|
|
53918
54026
|
const schemelessOptions = Object.assign({ scheme: "null" }, options);
|
|
53919
54027
|
const resolved = resolveComponents(parse7(baseURI, schemelessOptions), parse7(relativeURI, schemelessOptions), schemelessOptions, true);
|
|
53920
54028
|
return serialize(resolved, { ...schemelessOptions, skipEscape: true });
|
|
53921
54029
|
}
|
|
53922
|
-
function resolveComponents(base,
|
|
54030
|
+
function resolveComponents(base, relative8, options, skipNormalization) {
|
|
53923
54031
|
const target = {};
|
|
53924
54032
|
if (!skipNormalization) {
|
|
53925
54033
|
base = parse7(serialize(base, options), options);
|
|
53926
|
-
|
|
54034
|
+
relative8 = parse7(serialize(relative8, options), options);
|
|
53927
54035
|
}
|
|
53928
54036
|
options = options || {};
|
|
53929
|
-
if (!options.tolerant &&
|
|
53930
|
-
target.scheme =
|
|
53931
|
-
target.userinfo =
|
|
53932
|
-
target.host =
|
|
53933
|
-
target.port =
|
|
53934
|
-
target.path = removeDotSegments(
|
|
53935
|
-
target.query =
|
|
54037
|
+
if (!options.tolerant && relative8.scheme) {
|
|
54038
|
+
target.scheme = relative8.scheme;
|
|
54039
|
+
target.userinfo = relative8.userinfo;
|
|
54040
|
+
target.host = relative8.host;
|
|
54041
|
+
target.port = relative8.port;
|
|
54042
|
+
target.path = removeDotSegments(relative8.path || "");
|
|
54043
|
+
target.query = relative8.query;
|
|
53936
54044
|
} else {
|
|
53937
|
-
if (
|
|
53938
|
-
target.userinfo =
|
|
53939
|
-
target.host =
|
|
53940
|
-
target.port =
|
|
53941
|
-
target.path = removeDotSegments(
|
|
53942
|
-
target.query =
|
|
54045
|
+
if (relative8.userinfo !== undefined || relative8.host !== undefined || relative8.port !== undefined) {
|
|
54046
|
+
target.userinfo = relative8.userinfo;
|
|
54047
|
+
target.host = relative8.host;
|
|
54048
|
+
target.port = relative8.port;
|
|
54049
|
+
target.path = removeDotSegments(relative8.path || "");
|
|
54050
|
+
target.query = relative8.query;
|
|
53943
54051
|
} else {
|
|
53944
|
-
if (!
|
|
54052
|
+
if (!relative8.path) {
|
|
53945
54053
|
target.path = base.path;
|
|
53946
|
-
if (
|
|
53947
|
-
target.query =
|
|
54054
|
+
if (relative8.query !== undefined) {
|
|
54055
|
+
target.query = relative8.query;
|
|
53948
54056
|
} else {
|
|
53949
54057
|
target.query = base.query;
|
|
53950
54058
|
}
|
|
53951
54059
|
} else {
|
|
53952
|
-
if (
|
|
53953
|
-
target.path = removeDotSegments(
|
|
54060
|
+
if (relative8.path.charAt(0) === "/") {
|
|
54061
|
+
target.path = removeDotSegments(relative8.path);
|
|
53954
54062
|
} else {
|
|
53955
54063
|
if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) {
|
|
53956
|
-
target.path = "/" +
|
|
54064
|
+
target.path = "/" + relative8.path;
|
|
53957
54065
|
} else if (!base.path) {
|
|
53958
|
-
target.path =
|
|
54066
|
+
target.path = relative8.path;
|
|
53959
54067
|
} else {
|
|
53960
|
-
target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) +
|
|
54068
|
+
target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative8.path;
|
|
53961
54069
|
}
|
|
53962
54070
|
target.path = removeDotSegments(target.path);
|
|
53963
54071
|
}
|
|
53964
|
-
target.query =
|
|
54072
|
+
target.query = relative8.query;
|
|
53965
54073
|
}
|
|
53966
54074
|
target.userinfo = base.userinfo;
|
|
53967
54075
|
target.host = base.host;
|
|
@@ -53969,7 +54077,7 @@ var require_fast_uri = __commonJS((exports, module) => {
|
|
|
53969
54077
|
}
|
|
53970
54078
|
target.scheme = base.scheme;
|
|
53971
54079
|
}
|
|
53972
|
-
target.fragment =
|
|
54080
|
+
target.fragment = relative8.fragment;
|
|
53973
54081
|
return target;
|
|
53974
54082
|
}
|
|
53975
54083
|
function equal2(uriA, uriB, options) {
|
|
@@ -54147,7 +54255,7 @@ var require_fast_uri = __commonJS((exports, module) => {
|
|
|
54147
54255
|
var fastUri = {
|
|
54148
54256
|
SCHEMES,
|
|
54149
54257
|
normalize: normalize5,
|
|
54150
|
-
resolve:
|
|
54258
|
+
resolve: resolve9,
|
|
54151
54259
|
resolveComponents,
|
|
54152
54260
|
equal: equal2,
|
|
54153
54261
|
serialize,
|
|
@@ -56829,11 +56937,11 @@ var require_tslib = __commonJS((exports, module) => {
|
|
|
56829
56937
|
};
|
|
56830
56938
|
__awaiter2 = function(thisArg, _arguments, P, generator) {
|
|
56831
56939
|
function adopt(value) {
|
|
56832
|
-
return value instanceof P ? value : new P(function(
|
|
56833
|
-
|
|
56940
|
+
return value instanceof P ? value : new P(function(resolve9) {
|
|
56941
|
+
resolve9(value);
|
|
56834
56942
|
});
|
|
56835
56943
|
}
|
|
56836
|
-
return new (P || (P = Promise))(function(
|
|
56944
|
+
return new (P || (P = Promise))(function(resolve9, reject) {
|
|
56837
56945
|
function fulfilled(value) {
|
|
56838
56946
|
try {
|
|
56839
56947
|
step(generator.next(value));
|
|
@@ -56849,7 +56957,7 @@ var require_tslib = __commonJS((exports, module) => {
|
|
|
56849
56957
|
}
|
|
56850
56958
|
}
|
|
56851
56959
|
function step(result) {
|
|
56852
|
-
result.done ?
|
|
56960
|
+
result.done ? resolve9(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
56853
56961
|
}
|
|
56854
56962
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
56855
56963
|
});
|
|
@@ -57078,14 +57186,14 @@ var require_tslib = __commonJS((exports, module) => {
|
|
|
57078
57186
|
}, i);
|
|
57079
57187
|
function verb(n) {
|
|
57080
57188
|
i[n] = o[n] && function(v) {
|
|
57081
|
-
return new Promise(function(
|
|
57082
|
-
v = o[n](v), settle(
|
|
57189
|
+
return new Promise(function(resolve9, reject) {
|
|
57190
|
+
v = o[n](v), settle(resolve9, reject, v.done, v.value);
|
|
57083
57191
|
});
|
|
57084
57192
|
};
|
|
57085
57193
|
}
|
|
57086
|
-
function settle(
|
|
57194
|
+
function settle(resolve9, reject, d, v) {
|
|
57087
57195
|
Promise.resolve(v).then(function(v2) {
|
|
57088
|
-
|
|
57196
|
+
resolve9({ value: v2, done: d });
|
|
57089
57197
|
}, reject);
|
|
57090
57198
|
}
|
|
57091
57199
|
};
|
|
@@ -61600,7 +61708,7 @@ var init_openflow = __esm(() => {
|
|
|
61600
61708
|
openflow_default = {
|
|
61601
61709
|
openapi: "3.0.3",
|
|
61602
61710
|
info: {
|
|
61603
|
-
version: "1.
|
|
61711
|
+
version: "1.784.0",
|
|
61604
61712
|
title: "OpenFlow Spec",
|
|
61605
61713
|
contact: {
|
|
61606
61714
|
name: "Ruben Fiszel",
|
|
@@ -65624,11 +65732,11 @@ var init_specific_items = __esm(async () => {
|
|
|
65624
65732
|
|
|
65625
65733
|
// src/utils/tar.ts
|
|
65626
65734
|
function createTarBlob(entries) {
|
|
65627
|
-
return new Promise((
|
|
65735
|
+
return new Promise((resolve9, reject) => {
|
|
65628
65736
|
const p = $pack();
|
|
65629
65737
|
const chunks = [];
|
|
65630
65738
|
p.on("data", (chunk) => chunks.push(new Uint8Array(chunk)));
|
|
65631
|
-
p.on("end", () =>
|
|
65739
|
+
p.on("end", () => resolve9(new Blob(chunks)));
|
|
65632
65740
|
p.on("error", reject);
|
|
65633
65741
|
for (const entry of entries) {
|
|
65634
65742
|
p.entry({ name: entry.name }, Buffer.from(entry.content));
|
|
@@ -66369,7 +66477,7 @@ function collectPathScriptPaths(flowValue) {
|
|
|
66369
66477
|
}
|
|
66370
66478
|
|
|
66371
66479
|
// src/commands/flow/flow_metadata.ts
|
|
66372
|
-
import { existsSync as
|
|
66480
|
+
import { existsSync as existsSync8 } from "node:fs";
|
|
66373
66481
|
import { rm } from "node:fs/promises";
|
|
66374
66482
|
import * as path8 from "node:path";
|
|
66375
66483
|
import { sep as SEP4 } from "node:path";
|
|
@@ -66538,7 +66646,7 @@ async function generateFlowLockInternal(folder, dryRun, workspace, opts, justUpd
|
|
|
66538
66646
|
if (inlineScripts.some((other) => other.path === legacyRelPath))
|
|
66539
66647
|
continue;
|
|
66540
66648
|
const legacyAbsPath = process.cwd() + SEP4 + folder + SEP4 + legacyRelPath;
|
|
66541
|
-
if (
|
|
66649
|
+
if (existsSync8(legacyAbsPath)) {
|
|
66542
66650
|
try {
|
|
66543
66651
|
await rm(legacyAbsPath);
|
|
66544
66652
|
info(colors.gray(`Removed legacy lock file ${legacyRelPath} (renamed to canonical name)`));
|
|
@@ -67700,7 +67808,7 @@ async function list4(opts) {
|
|
|
67700
67808
|
new Table2().header(["path", "summary", "language", "created by"]).padding(2).border(true).body(total.map((x) => [x.path, x.summary, x.language, x.created_by])).render();
|
|
67701
67809
|
}
|
|
67702
67810
|
}
|
|
67703
|
-
async function
|
|
67811
|
+
async function resolve9(input) {
|
|
67704
67812
|
if (!input) {
|
|
67705
67813
|
throw new Error("No data given");
|
|
67706
67814
|
}
|
|
@@ -67726,7 +67834,7 @@ async function run2(opts, path10) {
|
|
|
67726
67834
|
}
|
|
67727
67835
|
const workspace = await resolveWorkspace(opts);
|
|
67728
67836
|
await requireLogin(opts);
|
|
67729
|
-
const input = opts.data ? await
|
|
67837
|
+
const input = opts.data ? await resolve9(opts.data) : {};
|
|
67730
67838
|
if (!opts.data) {
|
|
67731
67839
|
try {
|
|
67732
67840
|
const script = await getScriptByPath({
|
|
@@ -67792,7 +67900,7 @@ ${script.lock_error_logs}`);
|
|
|
67792
67900
|
break;
|
|
67793
67901
|
} catch {
|
|
67794
67902
|
retries++;
|
|
67795
|
-
await new Promise((
|
|
67903
|
+
await new Promise((resolve10) => setTimeout(resolve10, 100));
|
|
67796
67904
|
}
|
|
67797
67905
|
}
|
|
67798
67906
|
if (retries >= MAX_RETRIES) {
|
|
@@ -67829,7 +67937,7 @@ async function track_job(workspace, id) {
|
|
|
67829
67937
|
info("failed to get job updated. skipping log streaming.");
|
|
67830
67938
|
break;
|
|
67831
67939
|
}
|
|
67832
|
-
await new Promise((
|
|
67940
|
+
await new Promise((resolve10) => setTimeout(resolve10, 500));
|
|
67833
67941
|
continue;
|
|
67834
67942
|
}
|
|
67835
67943
|
if (!running && updates.running === true) {
|
|
@@ -67849,7 +67957,7 @@ async function track_job(workspace, id) {
|
|
|
67849
67957
|
info(colors.yellow("Job suspended. Waiting for it to continue..."));
|
|
67850
67958
|
}
|
|
67851
67959
|
}
|
|
67852
|
-
await new Promise((
|
|
67960
|
+
await new Promise((resolve10, _) => setTimeout(() => resolve10(undefined), 1000));
|
|
67853
67961
|
try {
|
|
67854
67962
|
const final_job = await getCompletedJob({ workspace, id });
|
|
67855
67963
|
if ((final_job.logs?.length ?? -1) > logOffset) {
|
|
@@ -68018,12 +68126,14 @@ async function preview(opts, filePath) {
|
|
|
68018
68126
|
if (opts.silent) {
|
|
68019
68127
|
setSilent(true);
|
|
68020
68128
|
}
|
|
68129
|
+
const cwdBeforeConfig = process.cwd();
|
|
68021
68130
|
opts = await mergeConfigWithConfigFile(opts);
|
|
68022
68131
|
const workspace = await resolveWorkspace(opts);
|
|
68023
68132
|
await requireLogin(opts);
|
|
68024
|
-
|
|
68025
|
-
|
|
68026
|
-
|
|
68133
|
+
const argPath = filePath;
|
|
68134
|
+
filePath = toSyncRootRelativePath(filePath, cwdBeforeConfig);
|
|
68135
|
+
const remotePath = scriptPathToRemotePath(filePath);
|
|
68136
|
+
assertRemotePath(remotePath, argPath);
|
|
68027
68137
|
const absentDescriptor = await stat4(filePath).then(() => false, (e) => isMissingDbtDescriptor(filePath, e));
|
|
68028
68138
|
if (!absentDescriptor) {
|
|
68029
68139
|
const fstat = await stat4(filePath);
|
|
@@ -68037,7 +68147,7 @@ async function preview(opts, filePath) {
|
|
|
68037
68147
|
const codebases = await listSyncCodebases(opts);
|
|
68038
68148
|
const language = inferContentTypeFromFilePath(filePath, opts?.defaultTs);
|
|
68039
68149
|
const content = await readScriptContent(filePath);
|
|
68040
|
-
const input = opts.data ? await
|
|
68150
|
+
const input = opts.data ? await resolve9(opts.data) : {};
|
|
68041
68151
|
const isFolderLayout = isModuleEntryPoint(filePath);
|
|
68042
68152
|
const isDbt = language === "dbt";
|
|
68043
68153
|
const moduleFolderPath = isFolderLayout ? path9.dirname(filePath) : filePath.substring(0, filePath.indexOf(".")) + getModuleFolderSuffix(language);
|
|
@@ -68045,7 +68155,7 @@ async function preview(opts, filePath) {
|
|
|
68045
68155
|
const codebase = language == "bun" ? findCodebase(filePath, codebases) : undefined;
|
|
68046
68156
|
let tempScriptRefs = undefined;
|
|
68047
68157
|
const { extractRelativeImports: extractRelativeImports2 } = await init_relative_imports().then(() => exports_relative_imports);
|
|
68048
|
-
const relImports = await extractRelativeImports2(content,
|
|
68158
|
+
const relImports = await extractRelativeImports2(content, remotePath, language);
|
|
68049
68159
|
if (relImports.length > 0) {
|
|
68050
68160
|
const { buildPreviewTempScriptRefs: buildPreviewTempScriptRefs2 } = await init_generate_metadata().then(() => exports_generate_metadata);
|
|
68051
68161
|
tempScriptRefs = await buildPreviewTempScriptRefs2(workspace, opts, codebases, { kind: "script", path: filePath });
|
|
@@ -68127,7 +68237,7 @@ async function preview(opts, filePath) {
|
|
|
68127
68237
|
const form = new FormData;
|
|
68128
68238
|
const previewPayload = {
|
|
68129
68239
|
content,
|
|
68130
|
-
path:
|
|
68240
|
+
path: remotePath,
|
|
68131
68241
|
args: input,
|
|
68132
68242
|
language,
|
|
68133
68243
|
tag: opts.tag,
|
|
@@ -68169,7 +68279,7 @@ async function preview(opts, filePath) {
|
|
|
68169
68279
|
}
|
|
68170
68280
|
break;
|
|
68171
68281
|
} catch {
|
|
68172
|
-
await new Promise((
|
|
68282
|
+
await new Promise((resolve10) => setTimeout(resolve10, 100));
|
|
68173
68283
|
}
|
|
68174
68284
|
}
|
|
68175
68285
|
} else {
|
|
@@ -68177,7 +68287,7 @@ async function preview(opts, filePath) {
|
|
|
68177
68287
|
workspace: workspace.workspaceId,
|
|
68178
68288
|
requestBody: {
|
|
68179
68289
|
content,
|
|
68180
|
-
path:
|
|
68290
|
+
path: remotePath,
|
|
68181
68291
|
args: input,
|
|
68182
68292
|
language,
|
|
68183
68293
|
tag: opts.tag,
|
|
@@ -69354,7 +69464,7 @@ import {
|
|
|
69354
69464
|
copyFile,
|
|
69355
69465
|
mkdir as mkdir5
|
|
69356
69466
|
} from "node:fs/promises";
|
|
69357
|
-
import { existsSync as
|
|
69467
|
+
import { existsSync as existsSync10 } from "node:fs";
|
|
69358
69468
|
import * as path12 from "node:path";
|
|
69359
69469
|
import { sep as SEP9 } from "node:path";
|
|
69360
69470
|
function configKeyForItemKind(kind) {
|
|
@@ -71136,8 +71246,8 @@ async function pushParentScriptForModule(modulePath, workspace, alreadySynced, m
|
|
|
71136
71246
|
return;
|
|
71137
71247
|
const moduleFolderPath = scriptBasePath + getModuleFolderSuffix(isDbt ? "dbt" : undefined);
|
|
71138
71248
|
if (isDbt) {
|
|
71139
|
-
const hasMetadata =
|
|
71140
|
-
if (!
|
|
71249
|
+
const hasMetadata = existsSync10(scriptBasePath + ".script.yaml") || existsSync10(scriptBasePath + ".script.json");
|
|
71250
|
+
if (!existsSync10(moduleFolderPath + "/dbt_project.yml")) {
|
|
71141
71251
|
if (hasMetadata) {
|
|
71142
71252
|
throw new Error(`${moduleFolderPath} has no dbt_project.yml but ${scriptBasePath}.script.yaml ` + `remains, so there is no dbt project left to push. Delete the metadata too to ` + `archive the script, or restore the project.`);
|
|
71143
71253
|
}
|
|
@@ -71967,11 +72077,11 @@ Run 'wmill folder add-missing' to create them locally, then push again.`;
|
|
|
71967
72077
|
}
|
|
71968
72078
|
const rules = folderRulesCache.get(folderName2);
|
|
71969
72079
|
const remotePath = change.path.replace(/\.(script|schedule|http_trigger|websocket_trigger|kafka_trigger|nats_trigger|postgres_trigger|mqtt_trigger|amqp_trigger|sqs_trigger|gcp_trigger|azure_trigger|email_trigger)\.(yaml|json)$/, "").replace(/(\.flow|__flow)\/flow\.(yaml|json)$/, "").replace(/\.(app|raw_app)(\/app\.(yaml|json))?$/, "");
|
|
71970
|
-
const
|
|
71971
|
-
if (!
|
|
72080
|
+
const relative8 = remotePath.slice(`f/${folderName2}/`.length);
|
|
72081
|
+
if (!relative8)
|
|
71972
72082
|
continue;
|
|
71973
72083
|
for (const rule of rules) {
|
|
71974
|
-
if (minimatch(
|
|
72084
|
+
if (minimatch(relative8, rule.path_glob)) {
|
|
71975
72085
|
folderDefaultAnnotations.set(change.path, rule.permissioned_as);
|
|
71976
72086
|
break;
|
|
71977
72087
|
}
|
|
@@ -72912,7 +73022,7 @@ var init_parse_schema = __esm(() => {
|
|
|
72912
73022
|
// src/utils/metadata.ts
|
|
72913
73023
|
import { sep as SEP10 } from "node:path";
|
|
72914
73024
|
import { writeFile as writeFile8, stat as stat8, rm as rm3, readdir as readdir5 } from "node:fs/promises";
|
|
72915
|
-
import { readFileSync as readFileSync3, existsSync as
|
|
73025
|
+
import { readFileSync as readFileSync3, existsSync as existsSync11, readdirSync as readdirSync2, statSync as statSync3, writeFileSync as writeFileSync5 } from "node:fs";
|
|
72916
73026
|
import * as path13 from "node:path";
|
|
72917
73027
|
import { createRequire as createRequire3 } from "node:module";
|
|
72918
73028
|
function loadParser(pkgName) {
|
|
@@ -73016,7 +73126,7 @@ async function generateScriptMetadataInternal(scriptPath, workspace, opts, dryRu
|
|
|
73016
73126
|
const metadataContent = await readTextFile(metadataWithType.path);
|
|
73017
73127
|
const filteredRawWorkspaceDependencies = filterWorkspaceDependencies(rawWorkspaceDependencies, scriptContent, language);
|
|
73018
73128
|
const moduleFolderPath = isFolderLayout ? path13.dirname(scriptPath) : scriptPath.substring(0, scriptPath.indexOf(".")) + getModuleFolderSuffix(language);
|
|
73019
|
-
const hasModules =
|
|
73129
|
+
const hasModules = existsSync11(moduleFolderPath) && statSync3(moduleFolderPath).isDirectory();
|
|
73020
73130
|
const depsForHash = tree ? {} : filteredRawWorkspaceDependencies;
|
|
73021
73131
|
let hash2 = await generateScriptHash(depsForHash, scriptContent, metadataContent);
|
|
73022
73132
|
let moduleHashes = {};
|
|
@@ -73309,7 +73419,7 @@ async function updateScriptLock(workspace, scriptContent, language, remotePath,
|
|
|
73309
73419
|
if (!languageNeedsLock(language)) {
|
|
73310
73420
|
if (language === "dbt") {
|
|
73311
73421
|
const lockPath2 = lockPathOverride ?? remotePath + ".script.lock";
|
|
73312
|
-
if (
|
|
73422
|
+
if (existsSync11(lockPath2)) {
|
|
73313
73423
|
metadataContent.lock = "!inline " + lockPath2.replaceAll(SEP10, "/");
|
|
73314
73424
|
}
|
|
73315
73425
|
}
|
|
@@ -73367,7 +73477,7 @@ async function updateModuleLocks(workspace, dirPath, relPrefix, scriptRemotePath
|
|
|
73367
73477
|
writeFileSync5(lockPath, lock, "utf-8");
|
|
73368
73478
|
} else {
|
|
73369
73479
|
try {
|
|
73370
|
-
if (
|
|
73480
|
+
if (existsSync11(lockPath)) {
|
|
73371
73481
|
const { rm: rmAsync } = await import("node:fs/promises");
|
|
73372
73482
|
await rmAsync(lockPath);
|
|
73373
73483
|
}
|
|
@@ -76045,7 +76155,7 @@ async function waitForJob(workspace, jobId) {
|
|
|
76045
76155
|
}
|
|
76046
76156
|
let syncIteration = 0;
|
|
76047
76157
|
let lastQueueLogAt = Date.now();
|
|
76048
|
-
return new Promise((
|
|
76158
|
+
return new Promise((resolve11, reject) => {
|
|
76049
76159
|
async function checkJob() {
|
|
76050
76160
|
try {
|
|
76051
76161
|
const maybeJob = await getCompletedJobResultMaybe({
|
|
@@ -76057,7 +76167,7 @@ async function waitForJob(workspace, jobId) {
|
|
|
76057
76167
|
if (!maybeJob.success && typeof maybeJob.result === "object" && maybeJob.result !== null && "error" in maybeJob.result) {
|
|
76058
76168
|
reject(maybeJob.result.error);
|
|
76059
76169
|
} else {
|
|
76060
|
-
|
|
76170
|
+
resolve11(maybeJob.result);
|
|
76061
76171
|
}
|
|
76062
76172
|
return;
|
|
76063
76173
|
}
|
|
@@ -77087,8 +77197,8 @@ This folder is for SQL migration files that will be applied to datatables during
|
|
|
77087
77197
|
process.stdout.write(`\r${colors.gray(`${frames[i++ % frames.length]} Creating Claude session...`)}`);
|
|
77088
77198
|
}, 80);
|
|
77089
77199
|
try {
|
|
77090
|
-
await new Promise((
|
|
77091
|
-
exec(`claude --session-id "${sessionId}" -p "Say: Your app is ready, click on preview to test it!"`, { cwd: absAppDir }, (error2) => error2 ? reject(error2) :
|
|
77200
|
+
await new Promise((resolve12, reject) => {
|
|
77201
|
+
exec(`claude --session-id "${sessionId}" -p "Say: Your app is ready, click on preview to test it!"`, { cwd: absAppDir }, (error2) => error2 ? reject(error2) : resolve12());
|
|
77092
77202
|
});
|
|
77093
77203
|
} finally {
|
|
77094
77204
|
clearInterval(spinner);
|
|
@@ -77283,7 +77393,7 @@ var init_new = __esm(async () => {
|
|
|
77283
77393
|
});
|
|
77284
77394
|
|
|
77285
77395
|
// src/commands/app/app.ts
|
|
77286
|
-
import { sep as SEP14, isAbsolute as
|
|
77396
|
+
import { sep as SEP14, isAbsolute as isAbsolute5, resolve as pathResolve, relative as pathRelative, basename as basename9 } from "node:path";
|
|
77287
77397
|
import { stat as stat10 } from "node:fs/promises";
|
|
77288
77398
|
function respecializeFields(fields) {
|
|
77289
77399
|
Object.entries(fields).forEach(([k, v]) => {
|
|
@@ -77484,9 +77594,9 @@ async function push5(opts, filePath, remotePath) {
|
|
|
77484
77594
|
if (!filePath) {
|
|
77485
77595
|
filePath = originalCwd;
|
|
77486
77596
|
}
|
|
77487
|
-
const absoluteFilePath =
|
|
77597
|
+
const absoluteFilePath = isAbsolute5(filePath) ? filePath : pathResolve(originalCwd, filePath);
|
|
77488
77598
|
const normalizedPath = absoluteFilePath.endsWith(SEP14) ? absoluteFilePath.slice(0, -1) : absoluteFilePath;
|
|
77489
|
-
const dirName =
|
|
77599
|
+
const dirName = basename9(normalizedPath);
|
|
77490
77600
|
const isRawAppByName = dirName.endsWith("__raw_app") || dirName.endsWith(".raw_app");
|
|
77491
77601
|
const isAppByName = dirName.endsWith("__app") || dirName.endsWith(".app");
|
|
77492
77602
|
let hasRawAppYaml = false;
|
|
@@ -77513,7 +77623,7 @@ async function push5(opts, filePath, remotePath) {
|
|
|
77513
77623
|
}
|
|
77514
77624
|
const wmillRoot = process.cwd();
|
|
77515
77625
|
let inferred = pathRelative(wmillRoot, normalizedPath).replaceAll(SEP14, "/");
|
|
77516
|
-
if (inferred.startsWith("..") ||
|
|
77626
|
+
if (inferred.startsWith("..") || isAbsolute5(inferred)) {
|
|
77517
77627
|
error(colors.red(`Could not infer remote path: '${filePath}' is outside the wmill.yaml root (${wmillRoot}). Move the folder under the root or pass <remote_path> explicitly.`));
|
|
77518
77628
|
return;
|
|
77519
77629
|
}
|
|
@@ -77809,24 +77919,24 @@ var init_folder = __esm(async () => {
|
|
|
77809
77919
|
error(`Path '${testPath}' is not under folder '${folderName2}' (expected prefix '${prefix}')`);
|
|
77810
77920
|
return;
|
|
77811
77921
|
}
|
|
77812
|
-
const
|
|
77922
|
+
const relative9 = testPath.slice(prefix.length);
|
|
77813
77923
|
const { minimatch: minimatch2 } = await Promise.resolve().then(() => (init_esm2(), exports_esm));
|
|
77814
77924
|
for (let i = 0;i < rules.length; i++) {
|
|
77815
77925
|
const rule = rules[i];
|
|
77816
|
-
if (minimatch2(
|
|
77926
|
+
if (minimatch2(relative9, rule.path_glob)) {
|
|
77817
77927
|
if (opts.json) {
|
|
77818
|
-
console.log(JSON.stringify({ matched: true, rule_index: i, rule, relative_path:
|
|
77928
|
+
console.log(JSON.stringify({ matched: true, rule_index: i, rule, relative_path: relative9 }));
|
|
77819
77929
|
} else {
|
|
77820
77930
|
info(colors.green(`✓ Rule #${i + 1} matches: path_glob='${rule.path_glob}' → permissioned_as='${rule.permissioned_as}'`));
|
|
77821
|
-
info(colors.gray(` (relative path tested: '${
|
|
77931
|
+
info(colors.gray(` (relative path tested: '${relative9}')`));
|
|
77822
77932
|
}
|
|
77823
77933
|
return;
|
|
77824
77934
|
}
|
|
77825
77935
|
}
|
|
77826
77936
|
if (opts.json) {
|
|
77827
|
-
console.log(JSON.stringify({ matched: false, relative_path:
|
|
77937
|
+
console.log(JSON.stringify({ matched: false, relative_path: relative9 }));
|
|
77828
77938
|
} else {
|
|
77829
|
-
info(colors.yellow(`No rule matches path '${testPath}' (relative: '${
|
|
77939
|
+
info(colors.yellow(`No rule matches path '${testPath}' (relative: '${relative9}')`));
|
|
77830
77940
|
}
|
|
77831
77941
|
});
|
|
77832
77942
|
folder_default = command15;
|
|
@@ -77834,7 +77944,7 @@ var init_folder = __esm(async () => {
|
|
|
77834
77944
|
|
|
77835
77945
|
// src/commands/variable/variable.ts
|
|
77836
77946
|
import { mkdir as mkdir9, stat as stat12, writeFile as writeFile12 } from "node:fs/promises";
|
|
77837
|
-
import { dirname as
|
|
77947
|
+
import { dirname as dirname16 } from "node:path";
|
|
77838
77948
|
import { sep as SEP16 } from "node:path";
|
|
77839
77949
|
async function list8(opts) {
|
|
77840
77950
|
if (opts.json)
|
|
@@ -77872,7 +77982,7 @@ async function newVariable(opts, path21) {
|
|
|
77872
77982
|
is_secret: false,
|
|
77873
77983
|
description: ""
|
|
77874
77984
|
};
|
|
77875
|
-
await mkdir9(
|
|
77985
|
+
await mkdir9(dirname16(filePath), { recursive: true });
|
|
77876
77986
|
await writeFile12(filePath, import_yaml26.stringify(template), {
|
|
77877
77987
|
flag: "wx",
|
|
77878
77988
|
encoding: "utf-8"
|
|
@@ -78057,7 +78167,7 @@ var init_variable = __esm(async () => {
|
|
|
78057
78167
|
|
|
78058
78168
|
// src/commands/schedule/schedule.ts
|
|
78059
78169
|
import { mkdir as mkdir10, stat as stat13, writeFile as writeFile13 } from "node:fs/promises";
|
|
78060
|
-
import { dirname as
|
|
78170
|
+
import { dirname as dirname17 } from "node:path";
|
|
78061
78171
|
import { sep as SEP17 } from "node:path";
|
|
78062
78172
|
async function list9(opts) {
|
|
78063
78173
|
if (opts.json)
|
|
@@ -78094,7 +78204,7 @@ async function newSchedule(opts, path21) {
|
|
|
78094
78204
|
is_flow: false,
|
|
78095
78205
|
enabled: false
|
|
78096
78206
|
};
|
|
78097
|
-
await mkdir10(
|
|
78207
|
+
await mkdir10(dirname17(filePath), { recursive: true });
|
|
78098
78208
|
await writeFile13(filePath, import_yaml27.stringify(template), {
|
|
78099
78209
|
flag: "wx",
|
|
78100
78210
|
encoding: "utf-8"
|
|
@@ -79856,7 +79966,7 @@ var init_dependencies = __esm(async () => {
|
|
|
79856
79966
|
|
|
79857
79967
|
// src/commands/trigger/trigger.ts
|
|
79858
79968
|
import { mkdir as mkdir12, stat as stat15, writeFile as writeFile17 } from "node:fs/promises";
|
|
79859
|
-
import { dirname as
|
|
79969
|
+
import { dirname as dirname18 } from "node:path";
|
|
79860
79970
|
import { sep as SEP18 } from "node:path";
|
|
79861
79971
|
async function getTrigger(triggerType, workspace, path22) {
|
|
79862
79972
|
const triggerFunctions = {
|
|
@@ -80057,7 +80167,7 @@ async function newTrigger(opts, path22) {
|
|
|
80057
80167
|
throw e;
|
|
80058
80168
|
}
|
|
80059
80169
|
const template = triggerTemplates[kind];
|
|
80060
|
-
await mkdir12(
|
|
80170
|
+
await mkdir12(dirname18(filePath), { recursive: true });
|
|
80061
80171
|
await writeFile17(filePath, import_yaml34.stringify(template), {
|
|
80062
80172
|
flag: "wx",
|
|
80063
80173
|
encoding: "utf-8"
|
|
@@ -80789,7 +80899,7 @@ var init_local_path_scripts = __esm(async () => {
|
|
|
80789
80899
|
});
|
|
80790
80900
|
|
|
80791
80901
|
// src/commands/flow/flow.ts
|
|
80792
|
-
import { dirname as
|
|
80902
|
+
import { dirname as dirname19, sep as SEP20 } from "node:path";
|
|
80793
80903
|
import { mkdirSync as mkdirSync8, writeFileSync as writeFileSync8 } from "node:fs";
|
|
80794
80904
|
function normalizeOptionalString(value) {
|
|
80795
80905
|
return typeof value === "string" && value.trim() === "" ? undefined : value ?? undefined;
|
|
@@ -81039,7 +81149,7 @@ async function run3(opts, path23) {
|
|
|
81039
81149
|
}
|
|
81040
81150
|
const workspace = await resolveWorkspace(opts);
|
|
81041
81151
|
await requireLogin(opts);
|
|
81042
|
-
const input = opts.data ? await
|
|
81152
|
+
const input = opts.data ? await resolve9(opts.data) : {};
|
|
81043
81153
|
if (!opts.data) {
|
|
81044
81154
|
try {
|
|
81045
81155
|
const flow = await getFlowByPath({
|
|
@@ -81120,7 +81230,7 @@ async function run3(opts, path23) {
|
|
|
81120
81230
|
forLoopFailed = refreshedModule.type === "Failure";
|
|
81121
81231
|
break;
|
|
81122
81232
|
}
|
|
81123
|
-
await new Promise((
|
|
81233
|
+
await new Promise((resolve12) => setTimeout(resolve12, 200));
|
|
81124
81234
|
}
|
|
81125
81235
|
if (forLoopFailed)
|
|
81126
81236
|
break;
|
|
@@ -81136,7 +81246,7 @@ async function run3(opts, path23) {
|
|
|
81136
81246
|
info(colors.dim(status));
|
|
81137
81247
|
lastStatus = status;
|
|
81138
81248
|
}
|
|
81139
|
-
await new Promise((
|
|
81249
|
+
await new Promise((resolve12, _) => setTimeout(() => resolve12(undefined), 100));
|
|
81140
81250
|
if (isCompleted)
|
|
81141
81251
|
break;
|
|
81142
81252
|
continue;
|
|
@@ -81172,7 +81282,7 @@ async function run3(opts, path23) {
|
|
|
81172
81282
|
break;
|
|
81173
81283
|
} catch {
|
|
81174
81284
|
retries++;
|
|
81175
|
-
await new Promise((
|
|
81285
|
+
await new Promise((resolve12) => setTimeout(resolve12, 100));
|
|
81176
81286
|
}
|
|
81177
81287
|
}
|
|
81178
81288
|
if (retries >= MAX_RETRIES) {
|
|
@@ -81184,16 +81294,19 @@ async function preview2(opts, flowPath) {
|
|
|
81184
81294
|
setSilent(true);
|
|
81185
81295
|
}
|
|
81186
81296
|
const useLocalPathScripts = !opts.remote;
|
|
81297
|
+
const cwdBeforeConfig = process.cwd();
|
|
81187
81298
|
if (useLocalPathScripts) {
|
|
81188
81299
|
opts = await mergeConfigWithConfigFile(opts);
|
|
81189
81300
|
}
|
|
81190
81301
|
const workspace = await resolveWorkspace(opts);
|
|
81191
81302
|
await requireLogin(opts);
|
|
81192
81303
|
const codebases = useLocalPathScripts ? listSyncCodebases(opts) : [];
|
|
81304
|
+
const argPath = flowPath;
|
|
81305
|
+
flowPath = toSyncRootRelativePath(flowPath, cwdBeforeConfig);
|
|
81193
81306
|
const isFlowDir = flowPath.endsWith(".flow") || flowPath.endsWith(".flow" + SEP20) || flowPath.endsWith("__flow") || flowPath.endsWith("__flow" + SEP20);
|
|
81194
81307
|
if (!isFlowDir) {
|
|
81195
81308
|
if (flowPath.endsWith("flow.yaml") || flowPath.endsWith("flow.json")) {
|
|
81196
|
-
flowPath =
|
|
81309
|
+
flowPath = dirname19(flowPath);
|
|
81197
81310
|
} else {
|
|
81198
81311
|
throw new Error("Flow path must be a .flow/__flow directory or a flow.yaml file");
|
|
81199
81312
|
}
|
|
@@ -81201,6 +81314,8 @@ async function preview2(opts, flowPath) {
|
|
|
81201
81314
|
if (!flowPath.endsWith(SEP20)) {
|
|
81202
81315
|
flowPath += SEP20;
|
|
81203
81316
|
}
|
|
81317
|
+
const flowWmPath = stripFlowSuffix(flowPath).replaceAll(SEP20, "/");
|
|
81318
|
+
assertRemotePath(flowWmPath, argPath);
|
|
81204
81319
|
const localFlow = await yamlParseFile(flowPath + "flow.yaml");
|
|
81205
81320
|
const fileReader = async (path23) => await readTextFile(flowPath + path23);
|
|
81206
81321
|
await replaceInlineScripts(localFlow.value.modules, fileReader, exports_log, flowPath, SEP20);
|
|
@@ -81235,9 +81350,8 @@ async function preview2(opts, flowPath) {
|
|
|
81235
81350
|
const resolvedCodebases = await Promise.resolve(codebases);
|
|
81236
81351
|
tempScriptRefs = await buildPreviewTempScriptRefs2(workspace, opts, resolvedCodebases, { kind: "flow", folder: flowPath });
|
|
81237
81352
|
}
|
|
81238
|
-
const input = opts.data ? await
|
|
81353
|
+
const input = opts.data ? await resolve9(opts.data) : {};
|
|
81239
81354
|
debug(`Flow value: ${JSON.stringify(localFlow.value, null, 2)}`);
|
|
81240
|
-
const flowWmPath = stripFlowSuffix(flowPath).replaceAll(SEP20, "/");
|
|
81241
81355
|
if (opts.step) {
|
|
81242
81356
|
await previewStep(opts.step, localFlow, flowWmPath, workspace, input, tempScriptRefs, opts.silent, opts.tag);
|
|
81243
81357
|
return;
|
|
@@ -91935,7 +92049,7 @@ __export(exports_tsconfig, {
|
|
|
91935
92049
|
});
|
|
91936
92050
|
import { execSync as execSync6 } from "node:child_process";
|
|
91937
92051
|
import { createHash as createHash2 } from "node:crypto";
|
|
91938
|
-
import { existsSync as
|
|
92052
|
+
import { existsSync as existsSync19, readFileSync as readFileSync5, writeFileSync as writeFileSync9 } from "node:fs";
|
|
91939
92053
|
import path24 from "node:path";
|
|
91940
92054
|
import process25 from "node:process";
|
|
91941
92055
|
function buildManagedTsconfig() {
|
|
@@ -92062,7 +92176,7 @@ async function refreshManagedDenoImportMap(mode) {
|
|
|
92062
92176
|
});
|
|
92063
92177
|
}
|
|
92064
92178
|
async function ensureUserReferencesManaged(opts) {
|
|
92065
|
-
const existing = [opts.file, ...opts.altFiles ?? []].map((f) => path24.join(process25.cwd(), f)).find((p) =>
|
|
92179
|
+
const existing = [opts.file, ...opts.altFiles ?? []].map((f) => path24.join(process25.cwd(), f)).find((p) => existsSync19(p));
|
|
92066
92180
|
if (!existing) {
|
|
92067
92181
|
const userPath = path24.join(process25.cwd(), opts.file);
|
|
92068
92182
|
writeFileSync9(userPath, JSON.stringify(opts.create, null, 2) + `
|
|
@@ -92114,7 +92228,7 @@ async function ensureUserReferencesManaged(opts) {
|
|
|
92114
92228
|
}
|
|
92115
92229
|
function ensureBunTypesAvailable() {
|
|
92116
92230
|
const cwd = process25.cwd();
|
|
92117
|
-
if (
|
|
92231
|
+
if (existsSync19(path24.join(cwd, "node_modules", "bun-types"))) {
|
|
92118
92232
|
return true;
|
|
92119
92233
|
}
|
|
92120
92234
|
try {
|
|
@@ -92137,7 +92251,7 @@ function ensureBunTypesAvailable() {
|
|
|
92137
92251
|
async function warnIfTsconfigStale(opts) {
|
|
92138
92252
|
const cwd = opts?.cwd ?? process25.cwd();
|
|
92139
92253
|
const managedPath = path24.join(cwd, MANAGED_TSCONFIG);
|
|
92140
|
-
if (!
|
|
92254
|
+
if (!existsSync19(managedPath))
|
|
92141
92255
|
return;
|
|
92142
92256
|
let managedText;
|
|
92143
92257
|
try {
|
|
@@ -93390,7 +93504,7 @@ await __promiseAll([
|
|
|
93390
93504
|
init_user(),
|
|
93391
93505
|
init_variable()
|
|
93392
93506
|
]);
|
|
93393
|
-
import { realpathSync } from "node:fs";
|
|
93507
|
+
import { realpathSync as realpathSync2 } from "node:fs";
|
|
93394
93508
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
93395
93509
|
|
|
93396
93510
|
// src/commands/hub/hub.ts
|
|
@@ -93576,18 +93690,18 @@ await __promiseAll([
|
|
|
93576
93690
|
init_context()
|
|
93577
93691
|
]);
|
|
93578
93692
|
var import_yaml40 = __toESM(require_dist(), 1);
|
|
93579
|
-
import { existsSync as
|
|
93693
|
+
import { existsSync as existsSync16 } from "node:fs";
|
|
93580
93694
|
import { writeFile as writeFile19 } from "node:fs/promises";
|
|
93581
|
-
import { dirname as
|
|
93695
|
+
import { dirname as dirname20, join as join22 } from "node:path";
|
|
93582
93696
|
var PROTECTION_RULES_FILENAME = "protection-rules.yaml";
|
|
93583
93697
|
function getProtectionRulesPath() {
|
|
93584
93698
|
const wmillPath = getWmillYamlPath();
|
|
93585
93699
|
if (!wmillPath)
|
|
93586
93700
|
return null;
|
|
93587
|
-
return
|
|
93701
|
+
return join22(dirname20(wmillPath), PROTECTION_RULES_FILENAME);
|
|
93588
93702
|
}
|
|
93589
93703
|
async function readProtectionRulesFile(path23) {
|
|
93590
|
-
if (!
|
|
93704
|
+
if (!existsSync16(path23))
|
|
93591
93705
|
return {};
|
|
93592
93706
|
const parsed = await yamlParseFile(path23);
|
|
93593
93707
|
return parsed ?? {};
|
|
@@ -93798,7 +93912,7 @@ await __promiseAll([
|
|
|
93798
93912
|
init_conf()
|
|
93799
93913
|
]);
|
|
93800
93914
|
import process24 from "node:process";
|
|
93801
|
-
import { existsSync as
|
|
93915
|
+
import { existsSync as existsSync17 } from "node:fs";
|
|
93802
93916
|
async function pushProtectionRules(opts, workspaceArg) {
|
|
93803
93917
|
if (opts.jsonOutput)
|
|
93804
93918
|
setSilent(true);
|
|
@@ -93808,7 +93922,7 @@ async function pushProtectionRules(opts, workspaceArg) {
|
|
|
93808
93922
|
error: "No wmill.yaml found. Run 'wmill init' first — protection-rules.yaml lives next to it."
|
|
93809
93923
|
});
|
|
93810
93924
|
}
|
|
93811
|
-
if (!
|
|
93925
|
+
if (!existsSync17(prPath)) {
|
|
93812
93926
|
fail(opts, {
|
|
93813
93927
|
error: "No protection-rules.yaml found. Run 'wmill protection-rules pull' first."
|
|
93814
93928
|
});
|
|
@@ -94770,7 +94884,7 @@ async function dev2(opts) {
|
|
|
94770
94884
|
}
|
|
94771
94885
|
socket.destroy();
|
|
94772
94886
|
});
|
|
94773
|
-
return new Promise((
|
|
94887
|
+
return new Promise((resolve12) => {
|
|
94774
94888
|
proxyServer.listen(proxyPort, BIND_HOST, () => {
|
|
94775
94889
|
console.log(`Dev proxy listening on http://localhost:${proxyPort}`);
|
|
94776
94890
|
if (opts.path) {
|
|
@@ -94780,7 +94894,7 @@ async function dev2(opts) {
|
|
|
94780
94894
|
console.log("(pass --path <path> to skip the picker)");
|
|
94781
94895
|
}
|
|
94782
94896
|
maybeOpenBrowser(`http://localhost:${proxyPort}/`);
|
|
94783
|
-
|
|
94897
|
+
resolve12();
|
|
94784
94898
|
});
|
|
94785
94899
|
});
|
|
94786
94900
|
}
|
|
@@ -94886,9 +95000,9 @@ class NpmProvider extends Provider {
|
|
|
94886
95000
|
if (verbose)
|
|
94887
95001
|
process.stderr.write(d);
|
|
94888
95002
|
});
|
|
94889
|
-
const exitCode = await new Promise((
|
|
95003
|
+
const exitCode = await new Promise((resolve12, reject) => {
|
|
94890
95004
|
proc.on("error", reject);
|
|
94891
|
-
proc.on("close",
|
|
95005
|
+
proc.on("close", resolve12);
|
|
94892
95006
|
}).catch((e) => {
|
|
94893
95007
|
throw new Error(`failed to run npm: ${e instanceof Error ? e.message : e}
|
|
94894
95008
|
|
|
@@ -95584,7 +95698,7 @@ await __promiseAll([
|
|
|
95584
95698
|
init_freshness()
|
|
95585
95699
|
]);
|
|
95586
95700
|
import { cp, mkdir as mkdir13, readdir as readdir11, rm as rm6, stat as stat19, writeFile as writeFile21 } from "node:fs/promises";
|
|
95587
|
-
import { join as
|
|
95701
|
+
import { join as join24 } from "node:path";
|
|
95588
95702
|
var WMILL_INIT_AI_SKILLS_SOURCE_ENV = "WMILL_INIT_AI_SKILLS_SOURCE";
|
|
95589
95703
|
var WMILL_INIT_AI_AGENTS_SOURCE_ENV = "WMILL_INIT_AI_AGENTS_SOURCE";
|
|
95590
95704
|
var WMILL_INIT_AI_CLAUDE_SOURCE_ENV = "WMILL_INIT_AI_CLAUDE_SOURCE";
|
|
@@ -95597,20 +95711,20 @@ async function writeAiGuidanceFiles(options) {
|
|
|
95597
95711
|
const skillMetadata = options.skillsSourcePath ? await readSkillMetadataFromDirectory(options.skillsSourcePath) : getGeneratedSkillMetadata();
|
|
95598
95712
|
const rawAgentsCliContent = options.agentsSourcePath != null ? await readTextFile(options.agentsSourcePath) : generateAgentsCliMdContent(buildSkillsReference(skillMetadata));
|
|
95599
95713
|
const agentsCliContent = injectPromptsHashMarker(rawAgentsCliContent, currentPromptsHash(nonDottedPaths));
|
|
95600
|
-
const agentsCliPath =
|
|
95714
|
+
const agentsCliPath = join24(options.targetDir, AGENTS_WMILL_FILENAME);
|
|
95601
95715
|
await writeFile21(agentsCliPath, agentsCliContent, "utf8");
|
|
95602
95716
|
const agentsCliWritten = true;
|
|
95603
95717
|
const legacyManagedRemoved = await migrateLegacyManagedFile(options.targetDir);
|
|
95604
95718
|
const resolveMigration = cacheOnce(options.resolveAgentsMdMigration);
|
|
95605
95719
|
const agentsMdResult = await reconcileIncludingFile({
|
|
95606
|
-
path:
|
|
95720
|
+
path: join24(options.targetDir, "AGENTS.md"),
|
|
95607
95721
|
includeLine: AGENTS_WMILL_INCLUDE_LINE,
|
|
95608
95722
|
skeleton: generateAgentsMdSkeleton(),
|
|
95609
95723
|
resolveMigration
|
|
95610
95724
|
});
|
|
95611
95725
|
const claudeSkeleton = options.claudeSourcePath != null ? await readTextFile(options.claudeSourcePath) : CLAUDE_MD_DEFAULT;
|
|
95612
95726
|
const claudeMdResult = await reconcileIncludingFile({
|
|
95613
|
-
path:
|
|
95727
|
+
path: join24(options.targetDir, "CLAUDE.md"),
|
|
95614
95728
|
includeLine: CLAUDE_MD_INCLUDE_LINE,
|
|
95615
95729
|
skeleton: claudeSkeleton,
|
|
95616
95730
|
resolveMigration
|
|
@@ -95632,7 +95746,7 @@ async function writeAiGuidanceFiles(options) {
|
|
|
95632
95746
|
}
|
|
95633
95747
|
async function migrateLegacyManagedFile(targetDir) {
|
|
95634
95748
|
for (const fileName of ["AGENTS.md", "CLAUDE.md"]) {
|
|
95635
|
-
const filePath =
|
|
95749
|
+
const filePath = join24(targetDir, fileName);
|
|
95636
95750
|
const existing = await readTextFile(filePath).catch(() => null);
|
|
95637
95751
|
if (existing == null)
|
|
95638
95752
|
continue;
|
|
@@ -95641,7 +95755,7 @@ async function migrateLegacyManagedFile(targetDir) {
|
|
|
95641
95755
|
await writeFile21(filePath, rewritten, "utf8");
|
|
95642
95756
|
}
|
|
95643
95757
|
}
|
|
95644
|
-
const legacyPath =
|
|
95758
|
+
const legacyPath = join24(targetDir, LEGACY_AGENTS_CLI_FILENAME);
|
|
95645
95759
|
const legacyExists = await stat19(legacyPath).catch(() => null) != null;
|
|
95646
95760
|
if (legacyExists) {
|
|
95647
95761
|
await rm6(legacyPath, { force: true });
|
|
@@ -95718,9 +95832,9 @@ async function copySkillsFromSource(targetDir, skillsSourcePath) {
|
|
|
95718
95832
|
async function writeGeneratedSkills(targetDir, nonDottedPaths) {
|
|
95719
95833
|
const skillsDirs = await ensureSkillsDirectories(targetDir);
|
|
95720
95834
|
await Promise.all(skillsDirs.flatMap((skillsDir) => SKILLS.map(async (skill) => {
|
|
95721
|
-
const skillDir =
|
|
95835
|
+
const skillDir = join24(skillsDir, skill.name);
|
|
95722
95836
|
await mkdir13(skillDir, { recursive: true });
|
|
95723
|
-
await writeFile21(
|
|
95837
|
+
await writeFile21(join24(skillDir, "SKILL.md"), renderGeneratedSkillContent(skill.name, nonDottedPaths), "utf8");
|
|
95724
95838
|
})));
|
|
95725
95839
|
return SKILLS.map((skill) => ({
|
|
95726
95840
|
...skill,
|
|
@@ -95734,14 +95848,14 @@ function getGeneratedSkillMetadata() {
|
|
|
95734
95848
|
}));
|
|
95735
95849
|
}
|
|
95736
95850
|
async function ensureSkillsDirectories(targetDir) {
|
|
95737
|
-
const skillsDirs = SKILL_TARGET_ROOTS.map((root) =>
|
|
95851
|
+
const skillsDirs = SKILL_TARGET_ROOTS.map((root) => join24(targetDir, root, "skills"));
|
|
95738
95852
|
await Promise.all(skillsDirs.map((skillsDir) => mkdir13(skillsDir, { recursive: true })));
|
|
95739
95853
|
return skillsDirs;
|
|
95740
95854
|
}
|
|
95741
95855
|
async function copyDirectoryContents(sourceDir, targetDir) {
|
|
95742
95856
|
const entries = await readdir11(sourceDir, { withFileTypes: true });
|
|
95743
95857
|
await Promise.all(entries.map(async (entry) => {
|
|
95744
|
-
await cp(
|
|
95858
|
+
await cp(join24(sourceDir, entry.name), join24(targetDir, entry.name), {
|
|
95745
95859
|
recursive: true,
|
|
95746
95860
|
force: true
|
|
95747
95861
|
});
|
|
@@ -95784,7 +95898,7 @@ async function readSkillMetadataFromDirectory(skillsDir) {
|
|
|
95784
95898
|
if (!entry.isDirectory()) {
|
|
95785
95899
|
continue;
|
|
95786
95900
|
}
|
|
95787
|
-
const skillPath =
|
|
95901
|
+
const skillPath = join24(skillsDir, entry.name, "SKILL.md");
|
|
95788
95902
|
if (!await stat19(skillPath).catch(() => null)) {
|
|
95789
95903
|
continue;
|
|
95790
95904
|
}
|
|
@@ -98376,16 +98490,16 @@ async function startServe(opts) {
|
|
|
98376
98490
|
error(`server error: ${err.message}`);
|
|
98377
98491
|
process.exitCode = 1;
|
|
98378
98492
|
});
|
|
98379
|
-
await new Promise((
|
|
98493
|
+
await new Promise((resolve12) => server.listen(port, host, () => resolve12()));
|
|
98380
98494
|
return {
|
|
98381
98495
|
host,
|
|
98382
98496
|
port,
|
|
98383
98497
|
user: DEFAULT_USER,
|
|
98384
98498
|
password,
|
|
98385
98499
|
connectionString: (datatableName) => `postgresql://${DEFAULT_USER}:${encodeURIComponent(password)}@${host}:${port}/${encodeURIComponent(datatableName)}`,
|
|
98386
|
-
close: () => new Promise((
|
|
98387
|
-
server.close(() =>
|
|
98388
|
-
setTimeout(
|
|
98500
|
+
close: () => new Promise((resolve12) => {
|
|
98501
|
+
server.close(() => resolve12());
|
|
98502
|
+
setTimeout(resolve12, 1000).unref();
|
|
98389
98503
|
})
|
|
98390
98504
|
};
|
|
98391
98505
|
}
|
|
@@ -98894,13 +99008,13 @@ async function psql(opts) {
|
|
|
98894
99008
|
}
|
|
98895
99009
|
handle.close().finally(() => process.exit(1));
|
|
98896
99010
|
});
|
|
98897
|
-
const exitCode = await new Promise((
|
|
99011
|
+
const exitCode = await new Promise((resolve12) => {
|
|
98898
99012
|
child.on("exit", (code2, signal) => {
|
|
98899
99013
|
if (signal && typeof signal === "string") {
|
|
98900
99014
|
const num = signalToNumber(signal);
|
|
98901
|
-
|
|
99015
|
+
resolve12(num !== undefined ? 128 + num : 1);
|
|
98902
99016
|
} else {
|
|
98903
|
-
|
|
99017
|
+
resolve12(code2 ?? 0);
|
|
98904
99018
|
}
|
|
98905
99019
|
});
|
|
98906
99020
|
});
|
|
@@ -100303,7 +100417,7 @@ await __promiseAll([
|
|
|
100303
100417
|
init_conf()
|
|
100304
100418
|
]);
|
|
100305
100419
|
import { writeFile as writeFile25 } from "node:fs/promises";
|
|
100306
|
-
import { existsSync as
|
|
100420
|
+
import { existsSync as existsSync21, readFileSync as readFileSync8 } from "node:fs";
|
|
100307
100421
|
import * as path27 from "node:path";
|
|
100308
100422
|
var ASSET_KINDS = "s3object,ducklake,datatable,volume,dbt";
|
|
100309
100423
|
function assetUri(kind, p3) {
|
|
@@ -100523,7 +100637,7 @@ async function generatePipelineDocs(opts, folder) {
|
|
|
100523
100637
|
];
|
|
100524
100638
|
for (const [name, content] of pointers) {
|
|
100525
100639
|
const p3 = path27.join(folderDir, name);
|
|
100526
|
-
if (
|
|
100640
|
+
if (existsSync21(p3)) {
|
|
100527
100641
|
let existing;
|
|
100528
100642
|
try {
|
|
100529
100643
|
existing = readFileSync8(p3, "utf-8");
|
|
@@ -100542,7 +100656,7 @@ async function generatePipelineDocs(opts, folder) {
|
|
|
100542
100656
|
}
|
|
100543
100657
|
|
|
100544
100658
|
// src/commands/pipeline/pipelineUpload.ts
|
|
100545
|
-
import { basename as
|
|
100659
|
+
import { basename as basename11 } from "node:path";
|
|
100546
100660
|
function parseUploadBinding(spec) {
|
|
100547
100661
|
const eq = spec.indexOf("=");
|
|
100548
100662
|
const left = eq < 0 ? "" : spec.slice(0, eq).trim();
|
|
@@ -100584,7 +100698,7 @@ function s3ObjectParams(schema) {
|
|
|
100584
100698
|
return Object.keys(props).filter((k2) => isS3Object(props[k2]?.format));
|
|
100585
100699
|
}
|
|
100586
100700
|
function devUploadKey(scriptPath, param, source) {
|
|
100587
|
-
return `wmilldev/pipeline/${scriptPath}/${param}/${
|
|
100701
|
+
return `wmilldev/pipeline/${scriptPath}/${param}/${basename11(source)}`;
|
|
100588
100702
|
}
|
|
100589
100703
|
function parseS3Uri(source) {
|
|
100590
100704
|
const m3 = source.match(/^s3:\/\/([^/]*)\/(.*)$/);
|
|
@@ -101229,7 +101343,7 @@ await __promiseAll([
|
|
|
101229
101343
|
]);
|
|
101230
101344
|
import { Buffer as Buffer6 } from "node:buffer";
|
|
101231
101345
|
import { readFile as readFile4, writeFile as writeFile26 } from "node:fs/promises";
|
|
101232
|
-
import { basename as
|
|
101346
|
+
import { basename as basename12 } from "node:path";
|
|
101233
101347
|
function formatBytes(n2) {
|
|
101234
101348
|
if (n2 == null)
|
|
101235
101349
|
return "-";
|
|
@@ -101330,7 +101444,7 @@ async function download(opts, fileKey, outputPath) {
|
|
|
101330
101444
|
process.stdout.write(buf);
|
|
101331
101445
|
return;
|
|
101332
101446
|
}
|
|
101333
|
-
const dest = outputPath ??
|
|
101447
|
+
const dest = outputPath ?? basename12(fileKey);
|
|
101334
101448
|
await writeFile26(dest, buf);
|
|
101335
101449
|
info(colors.green(`Downloaded ${fileKey} -> ${dest}`));
|
|
101336
101450
|
}
|
|
@@ -101534,7 +101648,7 @@ function isMain() {
|
|
|
101534
101648
|
const scriptPath = process.argv[1];
|
|
101535
101649
|
if (!scriptPath)
|
|
101536
101650
|
return false;
|
|
101537
|
-
const realScriptPath =
|
|
101651
|
+
const realScriptPath = realpathSync2(scriptPath);
|
|
101538
101652
|
const modulePath = fileURLToPath2(import.meta.url);
|
|
101539
101653
|
return realScriptPath === modulePath;
|
|
101540
101654
|
} catch {
|