windmill-cli 1.783.0 → 1.785.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 +720 -253
- package/package.json +2 -2
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.785.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,
|
|
@@ -17512,6 +17515,8 @@ __export(exports_services_gen, {
|
|
|
17512
17515
|
getOfflineLicenseStatus: () => getOfflineLicenseStatus,
|
|
17513
17516
|
getObjectStorageUsage: () => getObjectStorageUsage,
|
|
17514
17517
|
getOauthConnect: () => getOauthConnect,
|
|
17518
|
+
getNpmProxyConfig: () => getNpmProxyConfig,
|
|
17519
|
+
getNpmPackageTarball: () => getNpmPackageTarball,
|
|
17515
17520
|
getNpmPackageMetadata: () => getNpmPackageMetadata,
|
|
17516
17521
|
getNpmPackageFiletree: () => getNpmPackageFiletree,
|
|
17517
17522
|
getNpmPackageFile: () => getNpmPackageFile,
|
|
@@ -17833,6 +17838,7 @@ __export(exports_services_gen, {
|
|
|
17833
17838
|
compareWorkspaces: () => compareWorkspaces,
|
|
17834
17839
|
commitKafkaOffsets: () => commitKafkaOffsets,
|
|
17835
17840
|
closeDeploymentRequestMerged: () => closeDeploymentRequestMerged,
|
|
17841
|
+
clearResourceHistory: () => clearResourceHistory,
|
|
17836
17842
|
clearIndex: () => clearIndex,
|
|
17837
17843
|
checkSchemaContracts: () => checkSchemaContracts,
|
|
17838
17844
|
checkS3FolderExists: () => checkS3FolderExists,
|
|
@@ -20335,6 +20341,42 @@ var backendVersion = () => {
|
|
|
20335
20341
|
body: data3.requestBody,
|
|
20336
20342
|
mediaType: "application/json"
|
|
20337
20343
|
});
|
|
20344
|
+
}, getResourceHistory = (data3) => {
|
|
20345
|
+
return request(OpenAPI, {
|
|
20346
|
+
method: "GET",
|
|
20347
|
+
url: "/w/{workspace}/resources/history/p/{path}",
|
|
20348
|
+
path: {
|
|
20349
|
+
workspace: data3.workspace,
|
|
20350
|
+
path: data3.path
|
|
20351
|
+
}
|
|
20352
|
+
});
|
|
20353
|
+
}, clearResourceHistory = (data3) => {
|
|
20354
|
+
return request(OpenAPI, {
|
|
20355
|
+
method: "DELETE",
|
|
20356
|
+
url: "/w/{workspace}/resources/history/p/{path}",
|
|
20357
|
+
path: {
|
|
20358
|
+
workspace: data3.workspace,
|
|
20359
|
+
path: data3.path
|
|
20360
|
+
}
|
|
20361
|
+
});
|
|
20362
|
+
}, getResourceVersion = (data3) => {
|
|
20363
|
+
return request(OpenAPI, {
|
|
20364
|
+
method: "GET",
|
|
20365
|
+
url: "/w/{workspace}/resources/history/v/{version}",
|
|
20366
|
+
path: {
|
|
20367
|
+
workspace: data3.workspace,
|
|
20368
|
+
version: data3.version
|
|
20369
|
+
}
|
|
20370
|
+
});
|
|
20371
|
+
}, restoreResourceVersion = (data3) => {
|
|
20372
|
+
return request(OpenAPI, {
|
|
20373
|
+
method: "POST",
|
|
20374
|
+
url: "/w/{workspace}/resources/history/restore/v/{version}",
|
|
20375
|
+
path: {
|
|
20376
|
+
workspace: data3.workspace,
|
|
20377
|
+
version: data3.version
|
|
20378
|
+
}
|
|
20379
|
+
});
|
|
20338
20380
|
}, getResource = (data3) => {
|
|
20339
20381
|
return request(OpenAPI, {
|
|
20340
20382
|
method: "GET",
|
|
@@ -20509,6 +20551,14 @@ var backendVersion = () => {
|
|
|
20509
20551
|
workspace: data3.workspace
|
|
20510
20552
|
}
|
|
20511
20553
|
});
|
|
20554
|
+
}, getNpmProxyConfig = (data3) => {
|
|
20555
|
+
return request(OpenAPI, {
|
|
20556
|
+
method: "GET",
|
|
20557
|
+
url: "/w/{workspace}/npm_proxy/config",
|
|
20558
|
+
path: {
|
|
20559
|
+
workspace: data3.workspace
|
|
20560
|
+
}
|
|
20561
|
+
});
|
|
20512
20562
|
}, getNpmPackageMetadata = (data3) => {
|
|
20513
20563
|
return request(OpenAPI, {
|
|
20514
20564
|
method: "GET",
|
|
@@ -20551,6 +20601,16 @@ var backendVersion = () => {
|
|
|
20551
20601
|
filepath: data3.filepath
|
|
20552
20602
|
}
|
|
20553
20603
|
});
|
|
20604
|
+
}, getNpmPackageTarball = (data3) => {
|
|
20605
|
+
return request(OpenAPI, {
|
|
20606
|
+
method: "GET",
|
|
20607
|
+
url: "/w/{workspace}/npm_proxy/tarball/{package}/{version}",
|
|
20608
|
+
path: {
|
|
20609
|
+
workspace: data3.workspace,
|
|
20610
|
+
package: data3._package,
|
|
20611
|
+
version: data3.version
|
|
20612
|
+
}
|
|
20613
|
+
});
|
|
20554
20614
|
}, queryResourceTypes = (data3) => {
|
|
20555
20615
|
return request(OpenAPI, {
|
|
20556
20616
|
method: "GET",
|
|
@@ -26598,6 +26658,7 @@ __export(exports_gen, {
|
|
|
26598
26658
|
resumeSuspendedFlowAsOwner: () => resumeSuspendedFlowAsOwner,
|
|
26599
26659
|
resumeSuspended: () => resumeSuspended,
|
|
26600
26660
|
resultById: () => resultById,
|
|
26661
|
+
restoreResourceVersion: () => restoreResourceVersion,
|
|
26601
26662
|
restartWorkerGroup: () => restartWorkerGroup,
|
|
26602
26663
|
restartFlowAtStep: () => restartFlowAtStep,
|
|
26603
26664
|
resolveNpmPackageVersion: () => resolveNpmPackageVersion,
|
|
@@ -26875,9 +26936,11 @@ __export(exports_gen, {
|
|
|
26875
26936
|
getRuffConfig: () => getRuffConfig,
|
|
26876
26937
|
getRootJobId: () => getRootJobId,
|
|
26877
26938
|
getResumeUrls: () => getResumeUrls,
|
|
26939
|
+
getResourceVersion: () => getResourceVersion,
|
|
26878
26940
|
getResourceValueInterpolated: () => getResourceValueInterpolated,
|
|
26879
26941
|
getResourceValue: () => getResourceValue,
|
|
26880
26942
|
getResourceType: () => getResourceType,
|
|
26943
|
+
getResourceHistory: () => getResourceHistory,
|
|
26881
26944
|
getResource: () => getResource,
|
|
26882
26945
|
getRawAppData: () => getRawAppData,
|
|
26883
26946
|
getQueuePosition: () => getQueuePosition,
|
|
@@ -26900,6 +26963,8 @@ __export(exports_gen, {
|
|
|
26900
26963
|
getOfflineLicenseStatus: () => getOfflineLicenseStatus,
|
|
26901
26964
|
getObjectStorageUsage: () => getObjectStorageUsage,
|
|
26902
26965
|
getOauthConnect: () => getOauthConnect,
|
|
26966
|
+
getNpmProxyConfig: () => getNpmProxyConfig,
|
|
26967
|
+
getNpmPackageTarball: () => getNpmPackageTarball,
|
|
26903
26968
|
getNpmPackageMetadata: () => getNpmPackageMetadata,
|
|
26904
26969
|
getNpmPackageFiletree: () => getNpmPackageFiletree,
|
|
26905
26970
|
getNpmPackageFile: () => getNpmPackageFile,
|
|
@@ -27221,6 +27286,7 @@ __export(exports_gen, {
|
|
|
27221
27286
|
compareWorkspaces: () => compareWorkspaces,
|
|
27222
27287
|
commitKafkaOffsets: () => commitKafkaOffsets,
|
|
27223
27288
|
closeDeploymentRequestMerged: () => closeDeploymentRequestMerged,
|
|
27289
|
+
clearResourceHistory: () => clearResourceHistory,
|
|
27224
27290
|
clearIndex: () => clearIndex,
|
|
27225
27291
|
checkSchemaContracts: () => checkSchemaContracts,
|
|
27226
27292
|
checkS3FolderExists: () => checkS3FolderExists,
|
|
@@ -27383,7 +27449,7 @@ var init_auth = __esm(async () => {
|
|
|
27383
27449
|
});
|
|
27384
27450
|
|
|
27385
27451
|
// src/core/constants.ts
|
|
27386
|
-
var WM_FORK_PREFIX = "wm-fork", VERSION = "1.
|
|
27452
|
+
var WM_FORK_PREFIX = "wm-fork", VERSION = "1.785.0";
|
|
27387
27453
|
|
|
27388
27454
|
// src/utils/git.ts
|
|
27389
27455
|
var exports_git = {};
|
|
@@ -31056,9 +31122,13 @@ __export(exports_context, {
|
|
|
31056
31122
|
validatePath: () => validatePath,
|
|
31057
31123
|
tryResolveVersion: () => tryResolveVersion,
|
|
31058
31124
|
tryResolveBranchWorkspace: () => tryResolveBranchWorkspace,
|
|
31125
|
+
toSyncRootRelativePath: () => toSyncRootRelativePath,
|
|
31059
31126
|
resolveWorkspace: () => resolveWorkspace,
|
|
31060
|
-
fetchVersion: () => fetchVersion
|
|
31127
|
+
fetchVersion: () => fetchVersion,
|
|
31128
|
+
assertRemotePath: () => assertRemotePath
|
|
31061
31129
|
});
|
|
31130
|
+
import { existsSync as existsSync5, realpathSync } from "node:fs";
|
|
31131
|
+
import { basename as basename4, dirname as dirname7, isAbsolute as isAbsolute3, join as join9, relative as relative6, resolve as resolve6 } from "node:path";
|
|
31062
31132
|
async function selectFromMultipleProfiles(profiles, baseUrl2, workspaceId, context, configDir) {
|
|
31063
31133
|
if (profiles.length === 1) {
|
|
31064
31134
|
return profiles[0];
|
|
@@ -31465,6 +31535,34 @@ async function tryResolveVersion(opts) {
|
|
|
31465
31535
|
return;
|
|
31466
31536
|
}
|
|
31467
31537
|
}
|
|
31538
|
+
function syncRoot() {
|
|
31539
|
+
const wmillYaml = getWmillYamlPath();
|
|
31540
|
+
return wmillYaml ? dirname7(wmillYaml) : process.cwd();
|
|
31541
|
+
}
|
|
31542
|
+
function toSyncRootRelativePath(arg, cwdBeforeConfig) {
|
|
31543
|
+
const root = syncRoot();
|
|
31544
|
+
const candidates = isAbsolute3(arg) ? [arg] : [resolve6(cwdBeforeConfig, arg), resolve6(root, arg)];
|
|
31545
|
+
const abs = candidates.find((c) => existsSync5(c)) ?? candidates.find((c) => existsSync5(dirname7(c))) ?? candidates.at(-1);
|
|
31546
|
+
const rel = relative6(root, abs);
|
|
31547
|
+
if (rel === "")
|
|
31548
|
+
return ".";
|
|
31549
|
+
if (!rel.startsWith(".."))
|
|
31550
|
+
return rel;
|
|
31551
|
+
try {
|
|
31552
|
+
const resolved = relative6(realpathSync(root), realpathOfNamed(abs));
|
|
31553
|
+
return resolved === "" ? "." : resolved;
|
|
31554
|
+
} catch {
|
|
31555
|
+
return rel;
|
|
31556
|
+
}
|
|
31557
|
+
}
|
|
31558
|
+
function realpathOfNamed(p) {
|
|
31559
|
+
return existsSync5(p) ? realpathSync(p) : join9(realpathSync(dirname7(p)), basename4(p));
|
|
31560
|
+
}
|
|
31561
|
+
function assertRemotePath(remotePath, arg) {
|
|
31562
|
+
if (REMOTE_PATH_RE.test(remotePath))
|
|
31563
|
+
return;
|
|
31564
|
+
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>.`);
|
|
31565
|
+
}
|
|
31468
31566
|
function validatePath(path5) {
|
|
31469
31567
|
if (!(path5.startsWith("g") || path5.startsWith("u") || path5.startsWith("f"))) {
|
|
31470
31568
|
infoStderr(colors.red("Given remote path looks invalid. Remote paths are typically of the form <u|g|f>/<username|group|folder>/..."));
|
|
@@ -31472,6 +31570,7 @@ function validatePath(path5) {
|
|
|
31472
31570
|
}
|
|
31473
31571
|
return true;
|
|
31474
31572
|
}
|
|
31573
|
+
var REMOTE_PATH_RE;
|
|
31475
31574
|
var init_context = __esm(async () => {
|
|
31476
31575
|
init_colors2();
|
|
31477
31576
|
init_log();
|
|
@@ -31489,6 +31588,7 @@ var init_context = __esm(async () => {
|
|
|
31489
31588
|
init_branch_profiles(),
|
|
31490
31589
|
init_conf()
|
|
31491
31590
|
]);
|
|
31591
|
+
REMOTE_PATH_RE = /^[ufg](\/[^/]+){2,}$/;
|
|
31492
31592
|
});
|
|
31493
31593
|
|
|
31494
31594
|
// src/commands/sync/global.ts
|
|
@@ -31666,6 +31766,12 @@ function isFileResource(path5) {
|
|
|
31666
31766
|
const splitPath = path5.split(".");
|
|
31667
31767
|
return splitPath.length >= 4 && splitPath[splitPath.length - 3] == "resource" && splitPath[splitPath.length - 2] == "file";
|
|
31668
31768
|
}
|
|
31769
|
+
function removeResourceSuffix(path5) {
|
|
31770
|
+
if (isFileResource(path5)) {
|
|
31771
|
+
return path5.split(".").slice(0, -3).join(".");
|
|
31772
|
+
}
|
|
31773
|
+
return path5.replace(/\.resource\.(yaml|json)$/, "");
|
|
31774
|
+
}
|
|
31669
31775
|
function isFilesetResource(path5) {
|
|
31670
31776
|
return path5.includes(".fileset/") || path5.includes(".fileset\\");
|
|
31671
31777
|
}
|
|
@@ -33697,13 +33803,13 @@ return schema
|
|
|
33697
33803
|
import { createServer as createServer2 } from "node:net";
|
|
33698
33804
|
import { execSync as execSync3 } from "node:child_process";
|
|
33699
33805
|
function isPortFree(port, host) {
|
|
33700
|
-
return new Promise((
|
|
33806
|
+
return new Promise((resolve7) => {
|
|
33701
33807
|
const s = createServer2();
|
|
33702
33808
|
s.once("error", (err) => {
|
|
33703
33809
|
const code2 = err.code ?? "";
|
|
33704
|
-
|
|
33810
|
+
resolve7(code2 !== "EADDRINUSE" && code2 !== "EACCES");
|
|
33705
33811
|
});
|
|
33706
|
-
s.once("listening", () => s.close(() =>
|
|
33812
|
+
s.once("listening", () => s.close(() => resolve7(true)));
|
|
33707
33813
|
s.listen(port, host);
|
|
33708
33814
|
});
|
|
33709
33815
|
}
|
|
@@ -37832,8 +37938,8 @@ var require_streamx = __commonJS((exports, module) => {
|
|
|
37832
37938
|
return this;
|
|
37833
37939
|
},
|
|
37834
37940
|
next() {
|
|
37835
|
-
return new Promise(function(
|
|
37836
|
-
promiseResolve =
|
|
37941
|
+
return new Promise(function(resolve7, reject) {
|
|
37942
|
+
promiseResolve = resolve7;
|
|
37837
37943
|
promiseReject = reject;
|
|
37838
37944
|
const data3 = stream.read();
|
|
37839
37945
|
if (data3 !== null)
|
|
@@ -37870,14 +37976,14 @@ var require_streamx = __commonJS((exports, module) => {
|
|
|
37870
37976
|
}
|
|
37871
37977
|
function destroy(err) {
|
|
37872
37978
|
stream.destroy(err);
|
|
37873
|
-
return new Promise((
|
|
37979
|
+
return new Promise((resolve7, reject) => {
|
|
37874
37980
|
if (stream._duplexState & DESTROYED)
|
|
37875
|
-
return
|
|
37981
|
+
return resolve7({ value: undefined, done: true });
|
|
37876
37982
|
stream.once("close", function() {
|
|
37877
37983
|
if (err)
|
|
37878
37984
|
reject(err);
|
|
37879
37985
|
else
|
|
37880
|
-
|
|
37986
|
+
resolve7({ value: undefined, done: true });
|
|
37881
37987
|
});
|
|
37882
37988
|
});
|
|
37883
37989
|
}
|
|
@@ -37929,8 +38035,8 @@ var require_streamx = __commonJS((exports, module) => {
|
|
|
37929
38035
|
return Promise.resolve(true);
|
|
37930
38036
|
if (state.drains === null)
|
|
37931
38037
|
state.drains = [];
|
|
37932
|
-
return new Promise((
|
|
37933
|
-
state.drains.push({ writes, resolve:
|
|
38038
|
+
return new Promise((resolve7) => {
|
|
38039
|
+
state.drains.push({ writes, resolve: resolve7 });
|
|
37934
38040
|
});
|
|
37935
38041
|
}
|
|
37936
38042
|
write(data3) {
|
|
@@ -38044,11 +38150,11 @@ var require_streamx = __commonJS((exports, module) => {
|
|
|
38044
38150
|
cb(null);
|
|
38045
38151
|
}
|
|
38046
38152
|
function pipelinePromise(...streams) {
|
|
38047
|
-
return new Promise((
|
|
38153
|
+
return new Promise((resolve7, reject) => {
|
|
38048
38154
|
return pipeline(...streams, (err) => {
|
|
38049
38155
|
if (err)
|
|
38050
38156
|
return reject(err);
|
|
38051
|
-
|
|
38157
|
+
resolve7();
|
|
38052
38158
|
});
|
|
38053
38159
|
});
|
|
38054
38160
|
}
|
|
@@ -38754,16 +38860,16 @@ var require_extract = __commonJS((exports, module) => {
|
|
|
38754
38860
|
entryCallback = null;
|
|
38755
38861
|
cb(err);
|
|
38756
38862
|
}
|
|
38757
|
-
function onnext(
|
|
38863
|
+
function onnext(resolve7, reject) {
|
|
38758
38864
|
if (error2) {
|
|
38759
38865
|
return reject(error2);
|
|
38760
38866
|
}
|
|
38761
38867
|
if (entryStream) {
|
|
38762
|
-
|
|
38868
|
+
resolve7({ value: entryStream, done: false });
|
|
38763
38869
|
entryStream = null;
|
|
38764
38870
|
return;
|
|
38765
38871
|
}
|
|
38766
|
-
promiseResolve =
|
|
38872
|
+
promiseResolve = resolve7;
|
|
38767
38873
|
promiseReject = reject;
|
|
38768
38874
|
consumeCallback(null);
|
|
38769
38875
|
if (extract._finished && promiseResolve) {
|
|
@@ -38794,14 +38900,14 @@ var require_extract = __commonJS((exports, module) => {
|
|
|
38794
38900
|
function destroy(err) {
|
|
38795
38901
|
extract.destroy(err);
|
|
38796
38902
|
consumeCallback(err);
|
|
38797
|
-
return new Promise((
|
|
38903
|
+
return new Promise((resolve7, reject) => {
|
|
38798
38904
|
if (extract.destroyed)
|
|
38799
|
-
return
|
|
38905
|
+
return resolve7({ value: undefined, done: true });
|
|
38800
38906
|
extract.once("close", function() {
|
|
38801
38907
|
if (err)
|
|
38802
38908
|
reject(err);
|
|
38803
38909
|
else
|
|
38804
|
-
|
|
38910
|
+
resolve7({ value: undefined, done: true });
|
|
38805
38911
|
});
|
|
38806
38912
|
});
|
|
38807
38913
|
}
|
|
@@ -39210,8 +39316,8 @@ async function extractTarball(body, destDir) {
|
|
|
39210
39316
|
ws.on("error", next);
|
|
39211
39317
|
stream.on("error", next);
|
|
39212
39318
|
});
|
|
39213
|
-
await new Promise((
|
|
39214
|
-
extract.on("finish",
|
|
39319
|
+
await new Promise((resolve8, reject) => {
|
|
39320
|
+
extract.on("finish", resolve8);
|
|
39215
39321
|
extract.on("error", reject);
|
|
39216
39322
|
Readable.fromWeb(body).pipe(createGunzip()).on("error", reject).pipe(extract).on("error", reject);
|
|
39217
39323
|
});
|
|
@@ -39264,14 +39370,43 @@ function detectFrameworks(appDir) {
|
|
|
39264
39370
|
return { svelte: false, vue: false };
|
|
39265
39371
|
}
|
|
39266
39372
|
}
|
|
39373
|
+
function esmConditionTarget(subpath) {
|
|
39374
|
+
if (typeof subpath === "string")
|
|
39375
|
+
return subpath;
|
|
39376
|
+
if (!subpath || typeof subpath !== "object" || Array.isArray(subpath)) {
|
|
39377
|
+
return;
|
|
39378
|
+
}
|
|
39379
|
+
for (const [condition, target] of Object.entries(subpath)) {
|
|
39380
|
+
if (!ESM_CONDITIONS.includes(condition))
|
|
39381
|
+
continue;
|
|
39382
|
+
const entry = esmConditionTarget(target);
|
|
39383
|
+
if (entry)
|
|
39384
|
+
return entry;
|
|
39385
|
+
}
|
|
39386
|
+
return;
|
|
39387
|
+
}
|
|
39388
|
+
function resolveAppSvelteCompiler(appDir) {
|
|
39389
|
+
const requireFromApp = createRequire2(path6.join(path6.resolve(appDir), "package.json"));
|
|
39390
|
+
try {
|
|
39391
|
+
const pkgPath = requireFromApp.resolve("svelte/package.json");
|
|
39392
|
+
const exportsMap = JSON.parse(readTextFileSync(pkgPath))?.exports;
|
|
39393
|
+
const target = esmConditionTarget(exportsMap?.["./compiler"]);
|
|
39394
|
+
if (target?.startsWith(".")) {
|
|
39395
|
+
const entry = path6.resolve(path6.dirname(pkgPath), target);
|
|
39396
|
+
if (fs9.existsSync(entry))
|
|
39397
|
+
return entry;
|
|
39398
|
+
}
|
|
39399
|
+
} catch {}
|
|
39400
|
+
return requireFromApp.resolve("svelte/compiler");
|
|
39401
|
+
}
|
|
39267
39402
|
async function loadSvelteCompiler(appDir) {
|
|
39403
|
+
let mod;
|
|
39268
39404
|
try {
|
|
39269
|
-
|
|
39270
|
-
const entry = requireFromApp.resolve("svelte/compiler");
|
|
39271
|
-
return await import(pathToFileURL2(entry).href);
|
|
39405
|
+
mod = await import(pathToFileURL2(resolveAppSvelteCompiler(appDir)).href);
|
|
39272
39406
|
} catch {
|
|
39273
|
-
|
|
39407
|
+
mod = await import("svelte/compiler");
|
|
39274
39408
|
}
|
|
39409
|
+
return typeof mod?.compile === "function" ? mod : mod?.default ?? mod;
|
|
39275
39410
|
}
|
|
39276
39411
|
function createSveltePlugin(appDir) {
|
|
39277
39412
|
let compilerPromise;
|
|
@@ -39349,13 +39484,13 @@ async function ensureNodeModules(appDir) {
|
|
|
39349
39484
|
const nodeModulesPath = path6.join(targetDir, "node_modules");
|
|
39350
39485
|
if (!fs9.existsSync(nodeModulesPath)) {
|
|
39351
39486
|
info(colors.yellow("\uD83D\uDCE6 node_modules not found, running npm install..."));
|
|
39352
|
-
const code2 = await new Promise((
|
|
39487
|
+
const code2 = await new Promise((resolve9, reject) => {
|
|
39353
39488
|
const npmInstall = spawn("npm", ["install"], {
|
|
39354
39489
|
cwd: targetDir,
|
|
39355
39490
|
stdio: "inherit",
|
|
39356
39491
|
shell: true
|
|
39357
39492
|
});
|
|
39358
|
-
npmInstall.on("close", (code3) =>
|
|
39493
|
+
npmInstall.on("close", (code3) => resolve9(code3 ?? 0));
|
|
39359
39494
|
npmInstall.on("error", reject);
|
|
39360
39495
|
});
|
|
39361
39496
|
if (code2 !== 0) {
|
|
@@ -39483,7 +39618,7 @@ function getDevBuildOptions(entryPoint = "index.tsx", svelte = false) {
|
|
|
39483
39618
|
}
|
|
39484
39619
|
};
|
|
39485
39620
|
}
|
|
39486
|
-
var DEFAULT_BUILD_OPTIONS;
|
|
39621
|
+
var DEFAULT_BUILD_OPTIONS, ESM_CONDITIONS;
|
|
39487
39622
|
var init_bundle = __esm(async () => {
|
|
39488
39623
|
init_log();
|
|
39489
39624
|
init_colors2();
|
|
@@ -39503,6 +39638,7 @@ var init_bundle = __esm(async () => {
|
|
|
39503
39638
|
logLevel: "info",
|
|
39504
39639
|
write: true
|
|
39505
39640
|
};
|
|
39641
|
+
ESM_CONDITIONS = ["node", "import", "default"];
|
|
39506
39642
|
});
|
|
39507
39643
|
|
|
39508
39644
|
// src/commands/app/wmillTsDev.ts
|
|
@@ -39750,7 +39886,7 @@ async function pollJobWithQueueLogging(workspace, jobId, options) {
|
|
|
39750
39886
|
info(colors.gray(`${label}${jobId}: still polling, queue status unavailable...`));
|
|
39751
39887
|
}
|
|
39752
39888
|
const delayMs = Date.now() - startedAt < fastPollDurationMs ? fastPollIntervalMs : slowPollIntervalMs;
|
|
39753
|
-
await new Promise((
|
|
39889
|
+
await new Promise((resolve9) => setTimeout(resolve9, delayMs));
|
|
39754
39890
|
}
|
|
39755
39891
|
}
|
|
39756
39892
|
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 +41834,7 @@ var require_BufferList = __commonJS((exports, module) => {
|
|
|
41698
41834
|
this.head = this.tail = null;
|
|
41699
41835
|
this.length = 0;
|
|
41700
41836
|
};
|
|
41701
|
-
BufferList.prototype.join = function
|
|
41837
|
+
BufferList.prototype.join = function join12(s) {
|
|
41702
41838
|
if (this.length === 0)
|
|
41703
41839
|
return "";
|
|
41704
41840
|
var p = this.head;
|
|
@@ -43710,8 +43846,8 @@ var require_lib2 = __commonJS((exports, module) => {
|
|
|
43710
43846
|
return this;
|
|
43711
43847
|
}
|
|
43712
43848
|
var p = this.constructor;
|
|
43713
|
-
return this.then(
|
|
43714
|
-
function
|
|
43849
|
+
return this.then(resolve10, reject2);
|
|
43850
|
+
function resolve10(value) {
|
|
43715
43851
|
function yes() {
|
|
43716
43852
|
return value;
|
|
43717
43853
|
}
|
|
@@ -43864,8 +44000,8 @@ var require_lib2 = __commonJS((exports, module) => {
|
|
|
43864
44000
|
}
|
|
43865
44001
|
return out;
|
|
43866
44002
|
}
|
|
43867
|
-
Promise2.resolve =
|
|
43868
|
-
function
|
|
44003
|
+
Promise2.resolve = resolve9;
|
|
44004
|
+
function resolve9(value) {
|
|
43869
44005
|
if (value instanceof this) {
|
|
43870
44006
|
return value;
|
|
43871
44007
|
}
|
|
@@ -44219,10 +44355,10 @@ var require_utils = __commonJS((exports) => {
|
|
|
44219
44355
|
var promise = external.Promise.resolve(inputData).then(function(data3) {
|
|
44220
44356
|
var isBlob2 = support.blob && (data3 instanceof Blob || ["[object File]", "[object Blob]"].indexOf(Object.prototype.toString.call(data3)) !== -1);
|
|
44221
44357
|
if (isBlob2 && typeof FileReader !== "undefined") {
|
|
44222
|
-
return new external.Promise(function(
|
|
44358
|
+
return new external.Promise(function(resolve9, reject) {
|
|
44223
44359
|
var reader = new FileReader;
|
|
44224
44360
|
reader.onload = function(e) {
|
|
44225
|
-
|
|
44361
|
+
resolve9(e.target.result);
|
|
44226
44362
|
};
|
|
44227
44363
|
reader.onerror = function(e) {
|
|
44228
44364
|
reject(e.target.error);
|
|
@@ -44686,7 +44822,7 @@ var require_StreamHelper = __commonJS((exports, module) => {
|
|
|
44686
44822
|
}
|
|
44687
44823
|
}
|
|
44688
44824
|
function accumulate(helper, updateCallback) {
|
|
44689
|
-
return new external.Promise(function(
|
|
44825
|
+
return new external.Promise(function(resolve9, reject) {
|
|
44690
44826
|
var dataArray = [];
|
|
44691
44827
|
var { _internalType: chunkType, _outputType: resultType, _mimeType: mimeType } = helper;
|
|
44692
44828
|
helper.on("data", function(data3, meta) {
|
|
@@ -44700,7 +44836,7 @@ var require_StreamHelper = __commonJS((exports, module) => {
|
|
|
44700
44836
|
}).on("end", function() {
|
|
44701
44837
|
try {
|
|
44702
44838
|
var result = transformZipOutput(resultType, concat(chunkType, dataArray), mimeType);
|
|
44703
|
-
|
|
44839
|
+
resolve9(result);
|
|
44704
44840
|
} catch (e) {
|
|
44705
44841
|
reject(e);
|
|
44706
44842
|
}
|
|
@@ -50277,7 +50413,7 @@ var require_load = __commonJS((exports, module) => {
|
|
|
50277
50413
|
var Crc32Probe = require_Crc32Probe();
|
|
50278
50414
|
var nodejsUtils = require_nodejsUtils();
|
|
50279
50415
|
function checkEntryCRC32(zipEntry) {
|
|
50280
|
-
return new external.Promise(function(
|
|
50416
|
+
return new external.Promise(function(resolve9, reject) {
|
|
50281
50417
|
var worker = zipEntry.decompressed.getContentWorker().pipe(new Crc32Probe);
|
|
50282
50418
|
worker.on("error", function(e) {
|
|
50283
50419
|
reject(e);
|
|
@@ -50285,7 +50421,7 @@ var require_load = __commonJS((exports, module) => {
|
|
|
50285
50421
|
if (worker.streamInfo.crc32 !== zipEntry.decompressed.crc32) {
|
|
50286
50422
|
reject(new Error("Corrupted zip : CRC32 mismatch"));
|
|
50287
50423
|
} else {
|
|
50288
|
-
|
|
50424
|
+
resolve9();
|
|
50289
50425
|
}
|
|
50290
50426
|
}).resume();
|
|
50291
50427
|
});
|
|
@@ -50400,9 +50536,9 @@ class TarAsZip {
|
|
|
50400
50536
|
const sub = new TarAsZip(new Map);
|
|
50401
50537
|
for (const [name, file] of Object.entries(this.files)) {
|
|
50402
50538
|
if (name.startsWith(normalized)) {
|
|
50403
|
-
const
|
|
50404
|
-
if (
|
|
50405
|
-
sub.files[
|
|
50539
|
+
const relative8 = name.slice(normalized.length);
|
|
50540
|
+
if (relative8) {
|
|
50541
|
+
sub.files[relative8] = { ...file, name: relative8 };
|
|
50406
50542
|
}
|
|
50407
50543
|
}
|
|
50408
50544
|
}
|
|
@@ -50413,7 +50549,7 @@ async function parseTarResponse(response) {
|
|
|
50413
50549
|
const buffer = Buffer.from(await response.arrayBuffer());
|
|
50414
50550
|
const entries = new Map;
|
|
50415
50551
|
const ex = $extract();
|
|
50416
|
-
return new Promise((
|
|
50552
|
+
return new Promise((resolve9, reject) => {
|
|
50417
50553
|
ex.on("entry", (header, stream, next) => {
|
|
50418
50554
|
const chunks = [];
|
|
50419
50555
|
stream.on("data", (chunk) => chunks.push(chunk));
|
|
@@ -50427,7 +50563,7 @@ async function parseTarResponse(response) {
|
|
|
50427
50563
|
stream.on("error", reject);
|
|
50428
50564
|
stream.resume();
|
|
50429
50565
|
});
|
|
50430
|
-
ex.on("finish", () =>
|
|
50566
|
+
ex.on("finish", () => resolve9(new TarAsZip(entries)));
|
|
50431
50567
|
ex.on("error", reject);
|
|
50432
50568
|
Readable2.from(buffer).pipe(ex);
|
|
50433
50569
|
});
|
|
@@ -53379,7 +53515,7 @@ var require_compile = __commonJS((exports) => {
|
|
|
53379
53515
|
const schOrFunc = root.refs[ref];
|
|
53380
53516
|
if (schOrFunc)
|
|
53381
53517
|
return schOrFunc;
|
|
53382
|
-
let _sch =
|
|
53518
|
+
let _sch = resolve9.call(this, root, ref);
|
|
53383
53519
|
if (_sch === undefined) {
|
|
53384
53520
|
const schema = (_a = root.localRefs) === null || _a === undefined ? undefined : _a[ref];
|
|
53385
53521
|
const { schemaId } = this.opts;
|
|
@@ -53406,7 +53542,7 @@ var require_compile = __commonJS((exports) => {
|
|
|
53406
53542
|
function sameSchemaEnv(s1, s2) {
|
|
53407
53543
|
return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;
|
|
53408
53544
|
}
|
|
53409
|
-
function
|
|
53545
|
+
function resolve9(root, ref) {
|
|
53410
53546
|
let sch;
|
|
53411
53547
|
while (typeof (sch = this.refs[ref]) == "string")
|
|
53412
53548
|
ref = sch;
|
|
@@ -53914,54 +54050,54 @@ var require_fast_uri = __commonJS((exports, module) => {
|
|
|
53914
54050
|
}
|
|
53915
54051
|
return uri;
|
|
53916
54052
|
}
|
|
53917
|
-
function
|
|
54053
|
+
function resolve9(baseURI, relativeURI, options) {
|
|
53918
54054
|
const schemelessOptions = Object.assign({ scheme: "null" }, options);
|
|
53919
54055
|
const resolved = resolveComponents(parse7(baseURI, schemelessOptions), parse7(relativeURI, schemelessOptions), schemelessOptions, true);
|
|
53920
54056
|
return serialize(resolved, { ...schemelessOptions, skipEscape: true });
|
|
53921
54057
|
}
|
|
53922
|
-
function resolveComponents(base,
|
|
54058
|
+
function resolveComponents(base, relative8, options, skipNormalization) {
|
|
53923
54059
|
const target = {};
|
|
53924
54060
|
if (!skipNormalization) {
|
|
53925
54061
|
base = parse7(serialize(base, options), options);
|
|
53926
|
-
|
|
54062
|
+
relative8 = parse7(serialize(relative8, options), options);
|
|
53927
54063
|
}
|
|
53928
54064
|
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 =
|
|
54065
|
+
if (!options.tolerant && relative8.scheme) {
|
|
54066
|
+
target.scheme = relative8.scheme;
|
|
54067
|
+
target.userinfo = relative8.userinfo;
|
|
54068
|
+
target.host = relative8.host;
|
|
54069
|
+
target.port = relative8.port;
|
|
54070
|
+
target.path = removeDotSegments(relative8.path || "");
|
|
54071
|
+
target.query = relative8.query;
|
|
53936
54072
|
} else {
|
|
53937
|
-
if (
|
|
53938
|
-
target.userinfo =
|
|
53939
|
-
target.host =
|
|
53940
|
-
target.port =
|
|
53941
|
-
target.path = removeDotSegments(
|
|
53942
|
-
target.query =
|
|
54073
|
+
if (relative8.userinfo !== undefined || relative8.host !== undefined || relative8.port !== undefined) {
|
|
54074
|
+
target.userinfo = relative8.userinfo;
|
|
54075
|
+
target.host = relative8.host;
|
|
54076
|
+
target.port = relative8.port;
|
|
54077
|
+
target.path = removeDotSegments(relative8.path || "");
|
|
54078
|
+
target.query = relative8.query;
|
|
53943
54079
|
} else {
|
|
53944
|
-
if (!
|
|
54080
|
+
if (!relative8.path) {
|
|
53945
54081
|
target.path = base.path;
|
|
53946
|
-
if (
|
|
53947
|
-
target.query =
|
|
54082
|
+
if (relative8.query !== undefined) {
|
|
54083
|
+
target.query = relative8.query;
|
|
53948
54084
|
} else {
|
|
53949
54085
|
target.query = base.query;
|
|
53950
54086
|
}
|
|
53951
54087
|
} else {
|
|
53952
|
-
if (
|
|
53953
|
-
target.path = removeDotSegments(
|
|
54088
|
+
if (relative8.path.charAt(0) === "/") {
|
|
54089
|
+
target.path = removeDotSegments(relative8.path);
|
|
53954
54090
|
} else {
|
|
53955
54091
|
if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) {
|
|
53956
|
-
target.path = "/" +
|
|
54092
|
+
target.path = "/" + relative8.path;
|
|
53957
54093
|
} else if (!base.path) {
|
|
53958
|
-
target.path =
|
|
54094
|
+
target.path = relative8.path;
|
|
53959
54095
|
} else {
|
|
53960
|
-
target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) +
|
|
54096
|
+
target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative8.path;
|
|
53961
54097
|
}
|
|
53962
54098
|
target.path = removeDotSegments(target.path);
|
|
53963
54099
|
}
|
|
53964
|
-
target.query =
|
|
54100
|
+
target.query = relative8.query;
|
|
53965
54101
|
}
|
|
53966
54102
|
target.userinfo = base.userinfo;
|
|
53967
54103
|
target.host = base.host;
|
|
@@ -53969,7 +54105,7 @@ var require_fast_uri = __commonJS((exports, module) => {
|
|
|
53969
54105
|
}
|
|
53970
54106
|
target.scheme = base.scheme;
|
|
53971
54107
|
}
|
|
53972
|
-
target.fragment =
|
|
54108
|
+
target.fragment = relative8.fragment;
|
|
53973
54109
|
return target;
|
|
53974
54110
|
}
|
|
53975
54111
|
function equal2(uriA, uriB, options) {
|
|
@@ -54147,7 +54283,7 @@ var require_fast_uri = __commonJS((exports, module) => {
|
|
|
54147
54283
|
var fastUri = {
|
|
54148
54284
|
SCHEMES,
|
|
54149
54285
|
normalize: normalize5,
|
|
54150
|
-
resolve:
|
|
54286
|
+
resolve: resolve9,
|
|
54151
54287
|
resolveComponents,
|
|
54152
54288
|
equal: equal2,
|
|
54153
54289
|
serialize,
|
|
@@ -56829,11 +56965,11 @@ var require_tslib = __commonJS((exports, module) => {
|
|
|
56829
56965
|
};
|
|
56830
56966
|
__awaiter2 = function(thisArg, _arguments, P, generator) {
|
|
56831
56967
|
function adopt(value) {
|
|
56832
|
-
return value instanceof P ? value : new P(function(
|
|
56833
|
-
|
|
56968
|
+
return value instanceof P ? value : new P(function(resolve9) {
|
|
56969
|
+
resolve9(value);
|
|
56834
56970
|
});
|
|
56835
56971
|
}
|
|
56836
|
-
return new (P || (P = Promise))(function(
|
|
56972
|
+
return new (P || (P = Promise))(function(resolve9, reject) {
|
|
56837
56973
|
function fulfilled(value) {
|
|
56838
56974
|
try {
|
|
56839
56975
|
step(generator.next(value));
|
|
@@ -56849,7 +56985,7 @@ var require_tslib = __commonJS((exports, module) => {
|
|
|
56849
56985
|
}
|
|
56850
56986
|
}
|
|
56851
56987
|
function step(result) {
|
|
56852
|
-
result.done ?
|
|
56988
|
+
result.done ? resolve9(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
56853
56989
|
}
|
|
56854
56990
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
56855
56991
|
});
|
|
@@ -57078,14 +57214,14 @@ var require_tslib = __commonJS((exports, module) => {
|
|
|
57078
57214
|
}, i);
|
|
57079
57215
|
function verb(n) {
|
|
57080
57216
|
i[n] = o[n] && function(v) {
|
|
57081
|
-
return new Promise(function(
|
|
57082
|
-
v = o[n](v), settle(
|
|
57217
|
+
return new Promise(function(resolve9, reject) {
|
|
57218
|
+
v = o[n](v), settle(resolve9, reject, v.done, v.value);
|
|
57083
57219
|
});
|
|
57084
57220
|
};
|
|
57085
57221
|
}
|
|
57086
|
-
function settle(
|
|
57222
|
+
function settle(resolve9, reject, d, v) {
|
|
57087
57223
|
Promise.resolve(v).then(function(v2) {
|
|
57088
|
-
|
|
57224
|
+
resolve9({ value: v2, done: d });
|
|
57089
57225
|
}, reject);
|
|
57090
57226
|
}
|
|
57091
57227
|
};
|
|
@@ -61600,7 +61736,7 @@ var init_openflow = __esm(() => {
|
|
|
61600
61736
|
openflow_default = {
|
|
61601
61737
|
openapi: "3.0.3",
|
|
61602
61738
|
info: {
|
|
61603
|
-
version: "1.
|
|
61739
|
+
version: "1.785.0",
|
|
61604
61740
|
title: "OpenFlow Spec",
|
|
61605
61741
|
contact: {
|
|
61606
61742
|
name: "Ruben Fiszel",
|
|
@@ -64070,17 +64206,73 @@ Frontend appends a \`*\` to the displayed name.
|
|
|
64070
64206
|
},
|
|
64071
64207
|
filters: {
|
|
64072
64208
|
type: "array",
|
|
64209
|
+
description: "Filters to match incoming messages (only matching messages trigger the script). Each entry is either a leaf `{key, value}` (top-level field) or `{path, value}` (dotted path into nested objects), or a group `{any_of: [...]}` / `{all_of: [...]}` / `{none_of: [...]}` nesting more entries. Entries at the top level are combined with `filter_logic`.",
|
|
64073
64210
|
items: {
|
|
64074
|
-
|
|
64075
|
-
|
|
64076
|
-
|
|
64077
|
-
type: "
|
|
64211
|
+
description: "Either a leaf filter, matching a field of the message (parsed as JSON) against a value by equality (or superset, when the value is an object or array) — addressed by `key` for a top-level field or `path` for a dotted path into nested objects — or a group nesting sub-filters under a boolean operator (`none_of` matches when none of its sub-filters do).\n",
|
|
64212
|
+
oneOf: [
|
|
64213
|
+
{
|
|
64214
|
+
type: "object",
|
|
64215
|
+
properties: {
|
|
64216
|
+
key: {
|
|
64217
|
+
type: "string"
|
|
64218
|
+
},
|
|
64219
|
+
value: {}
|
|
64220
|
+
},
|
|
64221
|
+
required: [
|
|
64222
|
+
"key",
|
|
64223
|
+
"value"
|
|
64224
|
+
]
|
|
64078
64225
|
},
|
|
64079
|
-
|
|
64080
|
-
|
|
64081
|
-
|
|
64082
|
-
|
|
64083
|
-
|
|
64226
|
+
{
|
|
64227
|
+
type: "object",
|
|
64228
|
+
properties: {
|
|
64229
|
+
path: {
|
|
64230
|
+
type: "string",
|
|
64231
|
+
description: "Dotted path into nested objects, e.g. `a.b.c`. Does not traverse arrays."
|
|
64232
|
+
},
|
|
64233
|
+
value: {}
|
|
64234
|
+
},
|
|
64235
|
+
required: [
|
|
64236
|
+
"path",
|
|
64237
|
+
"value"
|
|
64238
|
+
]
|
|
64239
|
+
},
|
|
64240
|
+
{
|
|
64241
|
+
type: "object",
|
|
64242
|
+
properties: {
|
|
64243
|
+
any_of: {
|
|
64244
|
+
type: "array",
|
|
64245
|
+
items: {}
|
|
64246
|
+
}
|
|
64247
|
+
},
|
|
64248
|
+
required: [
|
|
64249
|
+
"any_of"
|
|
64250
|
+
]
|
|
64251
|
+
},
|
|
64252
|
+
{
|
|
64253
|
+
type: "object",
|
|
64254
|
+
properties: {
|
|
64255
|
+
all_of: {
|
|
64256
|
+
type: "array",
|
|
64257
|
+
items: {}
|
|
64258
|
+
}
|
|
64259
|
+
},
|
|
64260
|
+
required: [
|
|
64261
|
+
"all_of"
|
|
64262
|
+
]
|
|
64263
|
+
},
|
|
64264
|
+
{
|
|
64265
|
+
type: "object",
|
|
64266
|
+
properties: {
|
|
64267
|
+
none_of: {
|
|
64268
|
+
type: "array",
|
|
64269
|
+
items: {}
|
|
64270
|
+
}
|
|
64271
|
+
},
|
|
64272
|
+
required: [
|
|
64273
|
+
"none_of"
|
|
64274
|
+
]
|
|
64275
|
+
}
|
|
64084
64276
|
]
|
|
64085
64277
|
}
|
|
64086
64278
|
},
|
|
@@ -64091,7 +64283,7 @@ Frontend appends a \`*\` to the displayed name.
|
|
|
64091
64283
|
"or"
|
|
64092
64284
|
],
|
|
64093
64285
|
default: "and",
|
|
64094
|
-
description: "Logic to apply when evaluating filters. 'and' requires all
|
|
64286
|
+
description: "Logic to apply when evaluating the top-level filters. 'and' requires all of them to match, 'or' requires any of them to match. Nested `any_of`/`all_of`/`none_of` groups carry their own logic."
|
|
64095
64287
|
},
|
|
64096
64288
|
auto_offset_reset: {
|
|
64097
64289
|
type: "string",
|
|
@@ -64813,18 +65005,73 @@ Frontend appends a \`*\` to the displayed name.
|
|
|
64813
65005
|
},
|
|
64814
65006
|
filters: {
|
|
64815
65007
|
type: "array",
|
|
64816
|
-
description: "
|
|
65008
|
+
description: "Filters to match incoming messages (only matching messages trigger the script). Each entry is either a leaf `{key, value}` (top-level field) or `{path, value}` (dotted path into nested objects), or a group `{any_of: [...]}` / `{all_of: [...]}` / `{none_of: [...]}` nesting more entries. Entries at the top level are combined with `filter_logic`.",
|
|
64817
65009
|
items: {
|
|
64818
|
-
|
|
64819
|
-
|
|
64820
|
-
|
|
64821
|
-
type: "
|
|
65010
|
+
description: "Either a leaf filter, matching a field of the message (parsed as JSON) against a value by equality (or superset, when the value is an object or array) — addressed by `key` for a top-level field or `path` for a dotted path into nested objects — or a group nesting sub-filters under a boolean operator (`none_of` matches when none of its sub-filters do).\n",
|
|
65011
|
+
oneOf: [
|
|
65012
|
+
{
|
|
65013
|
+
type: "object",
|
|
65014
|
+
properties: {
|
|
65015
|
+
key: {
|
|
65016
|
+
type: "string"
|
|
65017
|
+
},
|
|
65018
|
+
value: {}
|
|
65019
|
+
},
|
|
65020
|
+
required: [
|
|
65021
|
+
"key",
|
|
65022
|
+
"value"
|
|
65023
|
+
]
|
|
64822
65024
|
},
|
|
64823
|
-
|
|
64824
|
-
|
|
64825
|
-
|
|
64826
|
-
|
|
64827
|
-
|
|
65025
|
+
{
|
|
65026
|
+
type: "object",
|
|
65027
|
+
properties: {
|
|
65028
|
+
path: {
|
|
65029
|
+
type: "string",
|
|
65030
|
+
description: "Dotted path into nested objects, e.g. `a.b.c`. Does not traverse arrays."
|
|
65031
|
+
},
|
|
65032
|
+
value: {}
|
|
65033
|
+
},
|
|
65034
|
+
required: [
|
|
65035
|
+
"path",
|
|
65036
|
+
"value"
|
|
65037
|
+
]
|
|
65038
|
+
},
|
|
65039
|
+
{
|
|
65040
|
+
type: "object",
|
|
65041
|
+
properties: {
|
|
65042
|
+
any_of: {
|
|
65043
|
+
type: "array",
|
|
65044
|
+
items: {}
|
|
65045
|
+
}
|
|
65046
|
+
},
|
|
65047
|
+
required: [
|
|
65048
|
+
"any_of"
|
|
65049
|
+
]
|
|
65050
|
+
},
|
|
65051
|
+
{
|
|
65052
|
+
type: "object",
|
|
65053
|
+
properties: {
|
|
65054
|
+
all_of: {
|
|
65055
|
+
type: "array",
|
|
65056
|
+
items: {}
|
|
65057
|
+
}
|
|
65058
|
+
},
|
|
65059
|
+
required: [
|
|
65060
|
+
"all_of"
|
|
65061
|
+
]
|
|
65062
|
+
},
|
|
65063
|
+
{
|
|
65064
|
+
type: "object",
|
|
65065
|
+
properties: {
|
|
65066
|
+
none_of: {
|
|
65067
|
+
type: "array",
|
|
65068
|
+
items: {}
|
|
65069
|
+
}
|
|
65070
|
+
},
|
|
65071
|
+
required: [
|
|
65072
|
+
"none_of"
|
|
65073
|
+
]
|
|
65074
|
+
}
|
|
64828
65075
|
]
|
|
64829
65076
|
}
|
|
64830
65077
|
},
|
|
@@ -64835,7 +65082,7 @@ Frontend appends a \`*\` to the displayed name.
|
|
|
64835
65082
|
"or"
|
|
64836
65083
|
],
|
|
64837
65084
|
default: "and",
|
|
64838
|
-
description: "Logic to apply when evaluating filters. 'and' requires all
|
|
65085
|
+
description: "Logic to apply when evaluating the top-level filters. 'and' requires all of them to match, 'or' requires any of them to match. Nested `any_of`/`all_of`/`none_of` groups carry their own logic."
|
|
64839
65086
|
},
|
|
64840
65087
|
initial_messages: {
|
|
64841
65088
|
type: "array",
|
|
@@ -65588,6 +65835,9 @@ function getWorkspaceSpecificPath(basePath, specificItems, workspaceNameOverride
|
|
|
65588
65835
|
return;
|
|
65589
65836
|
}
|
|
65590
65837
|
function isCurrentWorkspaceFile(path8, workspaceNameOverride) {
|
|
65838
|
+
if (isFilesetResource(path8)) {
|
|
65839
|
+
return false;
|
|
65840
|
+
}
|
|
65591
65841
|
let currentWorkspace = null;
|
|
65592
65842
|
if (workspaceNameOverride) {
|
|
65593
65843
|
currentWorkspace = workspaceNameOverride;
|
|
@@ -65607,6 +65857,9 @@ function isCurrentWorkspaceFile(path8, workspaceNameOverride) {
|
|
|
65607
65857
|
return pattern.test(path8);
|
|
65608
65858
|
}
|
|
65609
65859
|
function isWorkspaceSpecificFile(path8) {
|
|
65860
|
+
if (isFilesetResource(path8)) {
|
|
65861
|
+
return false;
|
|
65862
|
+
}
|
|
65610
65863
|
const typePattern = buildItemTypePattern();
|
|
65611
65864
|
return new RegExp(`\\.[^.]+\\.${typePattern}\\.(yaml|json)$|` + `\\.[^.]+\\.resource\\.file\\..+$|` + `/folder\\.[^.]+\\.meta\\.(yaml|json)$|` + `^settings\\.[^.]+\\.(yaml|json)$`).test(path8);
|
|
65612
65865
|
}
|
|
@@ -65624,11 +65877,11 @@ var init_specific_items = __esm(async () => {
|
|
|
65624
65877
|
|
|
65625
65878
|
// src/utils/tar.ts
|
|
65626
65879
|
function createTarBlob(entries) {
|
|
65627
|
-
return new Promise((
|
|
65880
|
+
return new Promise((resolve9, reject) => {
|
|
65628
65881
|
const p = $pack();
|
|
65629
65882
|
const chunks = [];
|
|
65630
65883
|
p.on("data", (chunk) => chunks.push(new Uint8Array(chunk)));
|
|
65631
|
-
p.on("end", () =>
|
|
65884
|
+
p.on("end", () => resolve9(new Blob(chunks)));
|
|
65632
65885
|
p.on("error", reject);
|
|
65633
65886
|
for (const entry of entries) {
|
|
65634
65887
|
p.entry({ name: entry.name }, Buffer.from(entry.content));
|
|
@@ -66369,7 +66622,7 @@ function collectPathScriptPaths(flowValue) {
|
|
|
66369
66622
|
}
|
|
66370
66623
|
|
|
66371
66624
|
// src/commands/flow/flow_metadata.ts
|
|
66372
|
-
import { existsSync as
|
|
66625
|
+
import { existsSync as existsSync8 } from "node:fs";
|
|
66373
66626
|
import { rm } from "node:fs/promises";
|
|
66374
66627
|
import * as path8 from "node:path";
|
|
66375
66628
|
import { sep as SEP4 } from "node:path";
|
|
@@ -66538,7 +66791,7 @@ async function generateFlowLockInternal(folder, dryRun, workspace, opts, justUpd
|
|
|
66538
66791
|
if (inlineScripts.some((other) => other.path === legacyRelPath))
|
|
66539
66792
|
continue;
|
|
66540
66793
|
const legacyAbsPath = process.cwd() + SEP4 + folder + SEP4 + legacyRelPath;
|
|
66541
|
-
if (
|
|
66794
|
+
if (existsSync8(legacyAbsPath)) {
|
|
66542
66795
|
try {
|
|
66543
66796
|
await rm(legacyAbsPath);
|
|
66544
66797
|
info(colors.gray(`Removed legacy lock file ${legacyRelPath} (renamed to canonical name)`));
|
|
@@ -66661,7 +66914,7 @@ __export(exports_generate_metadata, {
|
|
|
66661
66914
|
});
|
|
66662
66915
|
import { sep as SEP5 } from "node:path";
|
|
66663
66916
|
async function walkLocalScripts(codebases, ignore) {
|
|
66664
|
-
const elems = await elementsToMap(await FSFSElement(process.cwd(), codebases, false), (p, isD) => !isD && !hasScriptExt(p) || ignore(p, isD) || isFolderResourcePathAnyFormat(p) || isDatatableMigrationPath(p) || isScriptModulePath(p) && !isModuleEntryPoint(p), false, {});
|
|
66917
|
+
const elems = await elementsToMap(await FSFSElement(process.cwd(), codebases, false), (p, isD) => !isD && !hasScriptExt(p) || ignore(p, isD) || isFolderResourcePathAnyFormat(p) || isDatatableMigrationPath(p) || isFileResource(p) || isFilesetResource(p) || isScriptModulePath(p) && !isModuleEntryPoint(p), false, {});
|
|
66665
66918
|
return Object.keys(elems);
|
|
66666
66919
|
}
|
|
66667
66920
|
async function walkLocalFlowFolders(ignore) {
|
|
@@ -66720,7 +66973,7 @@ function categorizeLocalFiles(paths) {
|
|
|
66720
66973
|
flowFolderSet.add(p.substring(0, p.lastIndexOf(SEP5)));
|
|
66721
66974
|
} else if (p.endsWith(SEP5 + "raw_app.yaml") || p.endsWith(SEP5 + "app.yaml")) {
|
|
66722
66975
|
appPaths.push(p);
|
|
66723
|
-
} else if (hasScriptExt(p) && !isFolderResourcePathAnyFormat(p) && !isDatatableMigrationPath(p) && !(isScriptModulePath(p) && !isModuleEntryPoint(p))) {
|
|
66976
|
+
} else if (hasScriptExt(p) && !isFolderResourcePathAnyFormat(p) && !isDatatableMigrationPath(p) && !isFileResource(p) && !isFilesetResource(p) && !(isScriptModulePath(p) && !isModuleEntryPoint(p))) {
|
|
66724
66977
|
scripts.push(p);
|
|
66725
66978
|
}
|
|
66726
66979
|
}
|
|
@@ -67112,6 +67365,7 @@ var init_generate_metadata = __esm(async () => {
|
|
|
67112
67365
|
await __promiseAll([
|
|
67113
67366
|
init_confirm(),
|
|
67114
67367
|
init_types(),
|
|
67368
|
+
init_utils(),
|
|
67115
67369
|
init_conf(),
|
|
67116
67370
|
init_context(),
|
|
67117
67371
|
init_auth(),
|
|
@@ -67170,6 +67424,9 @@ async function push2(opts, filePath) {
|
|
|
67170
67424
|
if (filePath.endsWith(".script.json") || filePath.endsWith(".script.yaml")) {
|
|
67171
67425
|
throw Error("Cannot push a script metadata file, point to the script content file instead (.py, .ts, .go|.sh)");
|
|
67172
67426
|
}
|
|
67427
|
+
if (isFileResource(filePath) || isFilesetResource(filePath)) {
|
|
67428
|
+
throw Error("Cannot push a file/fileset resource content file as a script, push its .resource.yaml with 'wmill resource push' instead");
|
|
67429
|
+
}
|
|
67173
67430
|
await requireLogin(opts);
|
|
67174
67431
|
try {
|
|
67175
67432
|
const content = await readScriptContent(filePath);
|
|
@@ -67229,6 +67486,9 @@ async function handleScriptMetadata(path10, workspace, alreadySynced, message, r
|
|
|
67229
67486
|
}
|
|
67230
67487
|
}
|
|
67231
67488
|
async function handleFile(path10, workspace, alreadySynced, message, opts, rawWorkspaceDependencies, codebases, permissionedAsContext) {
|
|
67489
|
+
if (isFileResource(path10) || isFilesetResource(path10)) {
|
|
67490
|
+
return false;
|
|
67491
|
+
}
|
|
67232
67492
|
const moduleEntryPoint = isModuleEntryPoint(path10);
|
|
67233
67493
|
if (!isAppInlineScriptPath2(path10) && !isFlowInlineScriptPath2(path10) && !isRawAppPath(path10) && (!isScriptModulePath(path10) || moduleEntryPoint) && hasScriptExt(path10)) {
|
|
67234
67494
|
if (alreadySynced.includes(path10)) {
|
|
@@ -67700,7 +67960,7 @@ async function list4(opts) {
|
|
|
67700
67960
|
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
67961
|
}
|
|
67702
67962
|
}
|
|
67703
|
-
async function
|
|
67963
|
+
async function resolve9(input) {
|
|
67704
67964
|
if (!input) {
|
|
67705
67965
|
throw new Error("No data given");
|
|
67706
67966
|
}
|
|
@@ -67726,7 +67986,7 @@ async function run2(opts, path10) {
|
|
|
67726
67986
|
}
|
|
67727
67987
|
const workspace = await resolveWorkspace(opts);
|
|
67728
67988
|
await requireLogin(opts);
|
|
67729
|
-
const input = opts.data ? await
|
|
67989
|
+
const input = opts.data ? await resolve9(opts.data) : {};
|
|
67730
67990
|
if (!opts.data) {
|
|
67731
67991
|
try {
|
|
67732
67992
|
const script = await getScriptByPath({
|
|
@@ -67792,7 +68052,7 @@ ${script.lock_error_logs}`);
|
|
|
67792
68052
|
break;
|
|
67793
68053
|
} catch {
|
|
67794
68054
|
retries++;
|
|
67795
|
-
await new Promise((
|
|
68055
|
+
await new Promise((resolve10) => setTimeout(resolve10, 100));
|
|
67796
68056
|
}
|
|
67797
68057
|
}
|
|
67798
68058
|
if (retries >= MAX_RETRIES) {
|
|
@@ -67829,7 +68089,7 @@ async function track_job(workspace, id) {
|
|
|
67829
68089
|
info("failed to get job updated. skipping log streaming.");
|
|
67830
68090
|
break;
|
|
67831
68091
|
}
|
|
67832
|
-
await new Promise((
|
|
68092
|
+
await new Promise((resolve10) => setTimeout(resolve10, 500));
|
|
67833
68093
|
continue;
|
|
67834
68094
|
}
|
|
67835
68095
|
if (!running && updates.running === true) {
|
|
@@ -67849,7 +68109,7 @@ async function track_job(workspace, id) {
|
|
|
67849
68109
|
info(colors.yellow("Job suspended. Waiting for it to continue..."));
|
|
67850
68110
|
}
|
|
67851
68111
|
}
|
|
67852
|
-
await new Promise((
|
|
68112
|
+
await new Promise((resolve10, _) => setTimeout(() => resolve10(undefined), 1000));
|
|
67853
68113
|
try {
|
|
67854
68114
|
const final_job = await getCompletedJob({ workspace, id });
|
|
67855
68115
|
if ((final_job.logs?.length ?? -1) > logOffset) {
|
|
@@ -68018,12 +68278,14 @@ async function preview(opts, filePath) {
|
|
|
68018
68278
|
if (opts.silent) {
|
|
68019
68279
|
setSilent(true);
|
|
68020
68280
|
}
|
|
68281
|
+
const cwdBeforeConfig = process.cwd();
|
|
68021
68282
|
opts = await mergeConfigWithConfigFile(opts);
|
|
68022
68283
|
const workspace = await resolveWorkspace(opts);
|
|
68023
68284
|
await requireLogin(opts);
|
|
68024
|
-
|
|
68025
|
-
|
|
68026
|
-
|
|
68285
|
+
const argPath = filePath;
|
|
68286
|
+
filePath = toSyncRootRelativePath(filePath, cwdBeforeConfig);
|
|
68287
|
+
const remotePath = scriptPathToRemotePath(filePath);
|
|
68288
|
+
assertRemotePath(remotePath, argPath);
|
|
68027
68289
|
const absentDescriptor = await stat4(filePath).then(() => false, (e) => isMissingDbtDescriptor(filePath, e));
|
|
68028
68290
|
if (!absentDescriptor) {
|
|
68029
68291
|
const fstat = await stat4(filePath);
|
|
@@ -68037,7 +68299,7 @@ async function preview(opts, filePath) {
|
|
|
68037
68299
|
const codebases = await listSyncCodebases(opts);
|
|
68038
68300
|
const language = inferContentTypeFromFilePath(filePath, opts?.defaultTs);
|
|
68039
68301
|
const content = await readScriptContent(filePath);
|
|
68040
|
-
const input = opts.data ? await
|
|
68302
|
+
const input = opts.data ? await resolve9(opts.data) : {};
|
|
68041
68303
|
const isFolderLayout = isModuleEntryPoint(filePath);
|
|
68042
68304
|
const isDbt = language === "dbt";
|
|
68043
68305
|
const moduleFolderPath = isFolderLayout ? path9.dirname(filePath) : filePath.substring(0, filePath.indexOf(".")) + getModuleFolderSuffix(language);
|
|
@@ -68045,7 +68307,7 @@ async function preview(opts, filePath) {
|
|
|
68045
68307
|
const codebase = language == "bun" ? findCodebase(filePath, codebases) : undefined;
|
|
68046
68308
|
let tempScriptRefs = undefined;
|
|
68047
68309
|
const { extractRelativeImports: extractRelativeImports2 } = await init_relative_imports().then(() => exports_relative_imports);
|
|
68048
|
-
const relImports = await extractRelativeImports2(content,
|
|
68310
|
+
const relImports = await extractRelativeImports2(content, remotePath, language);
|
|
68049
68311
|
if (relImports.length > 0) {
|
|
68050
68312
|
const { buildPreviewTempScriptRefs: buildPreviewTempScriptRefs2 } = await init_generate_metadata().then(() => exports_generate_metadata);
|
|
68051
68313
|
tempScriptRefs = await buildPreviewTempScriptRefs2(workspace, opts, codebases, { kind: "script", path: filePath });
|
|
@@ -68127,7 +68389,7 @@ async function preview(opts, filePath) {
|
|
|
68127
68389
|
const form = new FormData;
|
|
68128
68390
|
const previewPayload = {
|
|
68129
68391
|
content,
|
|
68130
|
-
path:
|
|
68392
|
+
path: remotePath,
|
|
68131
68393
|
args: input,
|
|
68132
68394
|
language,
|
|
68133
68395
|
tag: opts.tag,
|
|
@@ -68169,7 +68431,7 @@ async function preview(opts, filePath) {
|
|
|
68169
68431
|
}
|
|
68170
68432
|
break;
|
|
68171
68433
|
} catch {
|
|
68172
|
-
await new Promise((
|
|
68434
|
+
await new Promise((resolve10) => setTimeout(resolve10, 100));
|
|
68173
68435
|
}
|
|
68174
68436
|
}
|
|
68175
68437
|
} else {
|
|
@@ -68177,7 +68439,7 @@ async function preview(opts, filePath) {
|
|
|
68177
68439
|
workspace: workspace.workspaceId,
|
|
68178
68440
|
requestBody: {
|
|
68179
68441
|
content,
|
|
68180
|
-
path:
|
|
68442
|
+
path: remotePath,
|
|
68181
68443
|
args: input,
|
|
68182
68444
|
language,
|
|
68183
68445
|
tag: opts.tag,
|
|
@@ -69158,7 +69420,15 @@ async function readFilesetDirectory(dirPath) {
|
|
|
69158
69420
|
await walk(dirPath, "");
|
|
69159
69421
|
return result;
|
|
69160
69422
|
}
|
|
69161
|
-
|
|
69423
|
+
function validateFilesetPointer(dirPath, remotePath) {
|
|
69424
|
+
const normalize6 = (p) => p.replaceAll("\\", "/").replace(/\/+$/, "");
|
|
69425
|
+
const pointer = normalize6(dirPath);
|
|
69426
|
+
const expected = normalize6(remotePath.replaceAll(SEP8, "/")) + ".fileset";
|
|
69427
|
+
if (pointer !== expected) {
|
|
69428
|
+
throw new Error(`Resource ${remotePath.replaceAll(SEP8, "/")} uses '!inline_fileset ${dirPath}', ` + `but a fileset directory must live next to its resource file, at '${expected}'. ` + `Move the directory there (e.g. 'git mv ${pointer} ${expected}') and update the ` + `'!inline_fileset' value to match.`);
|
|
69429
|
+
}
|
|
69430
|
+
}
|
|
69431
|
+
async function pushResource(workspace, remotePath, resource, localResource, originalLocalPath, wsSpecific, enforceCanonicalFileset) {
|
|
69162
69432
|
remotePath = removeType(remotePath, "resource");
|
|
69163
69433
|
try {
|
|
69164
69434
|
resource = await getResource({
|
|
@@ -69169,6 +69439,9 @@ async function pushResource(workspace, remotePath, resource, localResource, orig
|
|
|
69169
69439
|
const resolveInlineContent = async () => {
|
|
69170
69440
|
if (typeof localResource.value === "string" && localResource.value.startsWith("!inline_fileset ")) {
|
|
69171
69441
|
const dirPath = localResource.value.split(" ")[1];
|
|
69442
|
+
if (enforceCanonicalFileset) {
|
|
69443
|
+
validateFilesetPointer(dirPath, remotePath);
|
|
69444
|
+
}
|
|
69172
69445
|
localResource.value = await readFilesetDirectory(dirPath.replaceAll("/", SEP8));
|
|
69173
69446
|
} else if (localResource.value["content"]?.startsWith("!inline ")) {
|
|
69174
69447
|
const basePath = localResource.value["content"].split(" ")[1];
|
|
@@ -69334,6 +69607,7 @@ __export(exports_sync, {
|
|
|
69334
69607
|
gitDeploy: () => gitDeploy,
|
|
69335
69608
|
generateDatatablesDocumentation: () => generateDatatablesDocumentation,
|
|
69336
69609
|
generateAgentsDocumentation: () => generateAgentsDocumentation,
|
|
69610
|
+
findFilesetResourceFile: () => findFilesetResourceFile,
|
|
69337
69611
|
findCodebase: () => findCodebase,
|
|
69338
69612
|
findCaseInsensitiveCollisions: () => findCaseInsensitiveCollisions,
|
|
69339
69613
|
extractInlineScriptsForApps: () => extractInlineScriptsForApps,
|
|
@@ -69354,7 +69628,7 @@ import {
|
|
|
69354
69628
|
copyFile,
|
|
69355
69629
|
mkdir as mkdir5
|
|
69356
69630
|
} from "node:fs/promises";
|
|
69357
|
-
import { existsSync as
|
|
69631
|
+
import { existsSync as existsSync10 } from "node:fs";
|
|
69358
69632
|
import * as path12 from "node:path";
|
|
69359
69633
|
import { sep as SEP9 } from "node:path";
|
|
69360
69634
|
function configKeyForItemKind(kind) {
|
|
@@ -69810,13 +70084,16 @@ function parseFileResourceTypeMap(raw) {
|
|
|
69810
70084
|
}
|
|
69811
70085
|
return { formatExtMap, filesetMap };
|
|
69812
70086
|
}
|
|
69813
|
-
async function findFilesetResourceFile(changePath) {
|
|
70087
|
+
async function findFilesetResourceFile(changePath, wsName) {
|
|
69814
70088
|
const filesetIdx = changePath.indexOf(".fileset" + SEP9);
|
|
69815
70089
|
if (filesetIdx === -1) {
|
|
69816
70090
|
throw new Error(`Not a fileset resource path: ${changePath}`);
|
|
69817
70091
|
}
|
|
69818
70092
|
const basePath = changePath.substring(0, filesetIdx);
|
|
69819
70093
|
const candidates = [basePath + ".resource.json", basePath + ".resource.yaml"];
|
|
70094
|
+
if (wsName) {
|
|
70095
|
+
candidates.unshift(toWorkspaceSpecificPath(basePath + ".resource.json", wsName), toWorkspaceSpecificPath(basePath + ".resource.yaml", wsName));
|
|
70096
|
+
}
|
|
69820
70097
|
for (const candidate of candidates) {
|
|
69821
70098
|
try {
|
|
69822
70099
|
const s = await stat7(candidate);
|
|
@@ -69829,7 +70106,7 @@ async function findFilesetResourceFile(changePath) {
|
|
|
69829
70106
|
async function pushFilesetParentResource(childPath, workspaceId, alreadySynced, cachedWsName, specificItems) {
|
|
69830
70107
|
let resourceFilePath;
|
|
69831
70108
|
try {
|
|
69832
|
-
resourceFilePath = await findFilesetResourceFile(childPath);
|
|
70109
|
+
resourceFilePath = await findFilesetResourceFile(childPath, cachedWsName);
|
|
69833
70110
|
} catch {
|
|
69834
70111
|
return { status: "parent-missing" };
|
|
69835
70112
|
}
|
|
@@ -69846,7 +70123,7 @@ async function pushFilesetParentResource(childPath, workspaceId, alreadySynced,
|
|
|
69846
70123
|
} else if (specificItems && isSpecificItem(childPath, specificItems)) {
|
|
69847
70124
|
wsSpecific = true;
|
|
69848
70125
|
}
|
|
69849
|
-
await pushResource(workspaceId, serverPath, undefined, newObj, resourceFilePath, wsSpecific ? true : undefined);
|
|
70126
|
+
await pushResource(workspaceId, serverPath, undefined, newObj, resourceFilePath, wsSpecific ? true : undefined, true);
|
|
69850
70127
|
return { status: "pushed", resourceFilePath };
|
|
69851
70128
|
}
|
|
69852
70129
|
function ZipFSElement(zip, useYaml, defaultTs, resourceTypeToFormatExtension, resourceTypeToIsFileset, ignoreCodebaseChanges, stripOnBehalfOf) {
|
|
@@ -71136,8 +71413,8 @@ async function pushParentScriptForModule(modulePath, workspace, alreadySynced, m
|
|
|
71136
71413
|
return;
|
|
71137
71414
|
const moduleFolderPath = scriptBasePath + getModuleFolderSuffix(isDbt ? "dbt" : undefined);
|
|
71138
71415
|
if (isDbt) {
|
|
71139
|
-
const hasMetadata =
|
|
71140
|
-
if (!
|
|
71416
|
+
const hasMetadata = existsSync10(scriptBasePath + ".script.yaml") || existsSync10(scriptBasePath + ".script.json");
|
|
71417
|
+
if (!existsSync10(moduleFolderPath + "/dbt_project.yml")) {
|
|
71141
71418
|
if (hasMetadata) {
|
|
71142
71419
|
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
71420
|
}
|
|
@@ -71924,6 +72201,41 @@ Run 'wmill folder add-missing' to create them locally, then push again.`;
|
|
|
71924
72201
|
warn(msg);
|
|
71925
72202
|
}
|
|
71926
72203
|
}
|
|
72204
|
+
{
|
|
72205
|
+
const wsNameForPointerCheck = wsNameForFiles || (isGitRepository() ? getCurrentGitBranch() : null);
|
|
72206
|
+
const pointerErrors = [];
|
|
72207
|
+
for (const change of changes) {
|
|
72208
|
+
if (change.name !== "added" && change.name !== "edited") {
|
|
72209
|
+
continue;
|
|
72210
|
+
}
|
|
72211
|
+
const normalizedPath = change.path.replaceAll(SEP9, "/");
|
|
72212
|
+
if (!normalizedPath.endsWith(".resource.yaml") && !normalizedPath.endsWith(".resource.json")) {
|
|
72213
|
+
continue;
|
|
72214
|
+
}
|
|
72215
|
+
if (isFilesetResource(change.path)) {
|
|
72216
|
+
continue;
|
|
72217
|
+
}
|
|
72218
|
+
const content = change.name === "added" ? change.content : change.after;
|
|
72219
|
+
let parsed;
|
|
72220
|
+
try {
|
|
72221
|
+
parsed = parseFromPath(change.path, content);
|
|
72222
|
+
} catch {
|
|
72223
|
+
continue;
|
|
72224
|
+
}
|
|
72225
|
+
if (typeof parsed?.value === "string" && parsed.value.startsWith("!inline_fileset ")) {
|
|
72226
|
+
const serverPath = wsNameForPointerCheck && isWorkspaceSpecificFile(change.path) ? fromWorkspaceSpecificPath(change.path, wsNameForPointerCheck) : change.path;
|
|
72227
|
+
try {
|
|
72228
|
+
validateFilesetPointer(parsed.value.split(" ")[1], removeType(serverPath, "resource"));
|
|
72229
|
+
} catch (e) {
|
|
72230
|
+
pointerErrors.push(e instanceof Error ? e.message : String(e));
|
|
72231
|
+
}
|
|
72232
|
+
}
|
|
72233
|
+
}
|
|
72234
|
+
if (pointerErrors.length > 0) {
|
|
72235
|
+
throw new Error(pointerErrors.join(`
|
|
72236
|
+
`));
|
|
72237
|
+
}
|
|
72238
|
+
}
|
|
71927
72239
|
if (opts.dryRun && opts.jsonOutput) {
|
|
71928
72240
|
const result = {
|
|
71929
72241
|
success: true,
|
|
@@ -71967,11 +72279,11 @@ Run 'wmill folder add-missing' to create them locally, then push again.`;
|
|
|
71967
72279
|
}
|
|
71968
72280
|
const rules = folderRulesCache.get(folderName2);
|
|
71969
72281
|
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 (!
|
|
72282
|
+
const relative8 = remotePath.slice(`f/${folderName2}/`.length);
|
|
72283
|
+
if (!relative8)
|
|
71972
72284
|
continue;
|
|
71973
72285
|
for (const rule of rules) {
|
|
71974
|
-
if (minimatch(
|
|
72286
|
+
if (minimatch(relative8, rule.path_glob)) {
|
|
71975
72287
|
folderDefaultAnnotations.set(change.path, rule.permissioned_as);
|
|
71976
72288
|
break;
|
|
71977
72289
|
}
|
|
@@ -72108,27 +72420,22 @@ Run 'wmill folder add-missing' to create them locally, then push again.`;
|
|
|
72108
72420
|
}
|
|
72109
72421
|
}
|
|
72110
72422
|
if (change.name === "edited") {
|
|
72111
|
-
if (
|
|
72423
|
+
if (isFileResource(change.path) || isFilesetResource(change.path)) {
|
|
72112
72424
|
if (stateTarget) {
|
|
72113
|
-
await
|
|
72425
|
+
await mkdir5(path12.dirname(stateTarget), { recursive: true });
|
|
72426
|
+
info(`Editing ${getTypeStrFromPath(change.path)} ${change.path}`);
|
|
72114
72427
|
}
|
|
72115
|
-
|
|
72116
|
-
|
|
72117
|
-
|
|
72118
|
-
|
|
72428
|
+
}
|
|
72429
|
+
if (isFilesetResource(change.path)) {
|
|
72430
|
+
const result = await pushFilesetParentResource(change.path, workspace.workspaceId, alreadySynced, cachedWsNameForPush, specificItems);
|
|
72431
|
+
if (result.status === "parent-missing") {
|
|
72432
|
+
throw new Error(`No resource metadata file found for fileset resource: ${change.path}`);
|
|
72119
72433
|
}
|
|
72120
|
-
continue;
|
|
72121
|
-
} else if (isScriptModulePath(change.path)) {
|
|
72122
|
-
await pushParentScriptForModule(change.path, workspace, alreadySynced, opts.message, opts, rawWorkspaceDependencies, codebases);
|
|
72123
72434
|
if (stateTarget) {
|
|
72124
72435
|
await writeFile7(stateTarget, change.after, "utf-8");
|
|
72125
72436
|
}
|
|
72126
72437
|
continue;
|
|
72127
72438
|
}
|
|
72128
|
-
if (stateTarget) {
|
|
72129
|
-
await mkdir5(path12.dirname(stateTarget), { recursive: true });
|
|
72130
|
-
info(`Editing ${getTypeStrFromPath(change.path)} ${change.path}`);
|
|
72131
|
-
}
|
|
72132
72439
|
if (isFileResource(change.path)) {
|
|
72133
72440
|
const resourceFilePath = await findResourceFile(change.path);
|
|
72134
72441
|
if (!alreadySynced.includes(resourceFilePath)) {
|
|
@@ -72143,24 +72450,33 @@ Run 'wmill folder add-missing' to create them locally, then push again.`;
|
|
|
72143
72450
|
} else if (specificItems && isSpecificItem(change.path, specificItems)) {
|
|
72144
72451
|
isFileResWsSpecific = true;
|
|
72145
72452
|
}
|
|
72146
|
-
await pushResource(workspace.workspaceId, serverPath, undefined, newObj2, resourceFilePath, isFileResWsSpecific ? true : undefined);
|
|
72147
|
-
|
|
72148
|
-
|
|
72149
|
-
|
|
72150
|
-
continue;
|
|
72453
|
+
await pushResource(workspace.workspaceId, serverPath, undefined, newObj2, resourceFilePath, isFileResWsSpecific ? true : undefined, true);
|
|
72454
|
+
}
|
|
72455
|
+
if (stateTarget) {
|
|
72456
|
+
await writeFile7(stateTarget, change.after, "utf-8");
|
|
72151
72457
|
}
|
|
72458
|
+
continue;
|
|
72152
72459
|
}
|
|
72153
|
-
if (
|
|
72154
|
-
|
|
72155
|
-
|
|
72156
|
-
throw new Error(`No resource metadata file found for fileset resource: ${change.path}`);
|
|
72460
|
+
if (await handleScriptMetadata(change.path, workspace, alreadySynced, opts.message, rawWorkspaceDependencies, codebases, opts, permissionedAsContext)) {
|
|
72461
|
+
if (stateTarget) {
|
|
72462
|
+
await writeFile7(stateTarget, change.after, "utf-8");
|
|
72157
72463
|
}
|
|
72158
|
-
|
|
72159
|
-
|
|
72160
|
-
|
|
72161
|
-
|
|
72162
|
-
continue;
|
|
72464
|
+
continue;
|
|
72465
|
+
} else if (await handleFile(change.path, workspace, alreadySynced, opts.message, opts, rawWorkspaceDependencies, codebases, permissionedAsContext)) {
|
|
72466
|
+
if (stateTarget) {
|
|
72467
|
+
await writeFile7(stateTarget, change.after, "utf-8");
|
|
72163
72468
|
}
|
|
72469
|
+
continue;
|
|
72470
|
+
} else if (isScriptModulePath(change.path)) {
|
|
72471
|
+
await pushParentScriptForModule(change.path, workspace, alreadySynced, opts.message, opts, rawWorkspaceDependencies, codebases);
|
|
72472
|
+
if (stateTarget) {
|
|
72473
|
+
await writeFile7(stateTarget, change.after, "utf-8");
|
|
72474
|
+
}
|
|
72475
|
+
continue;
|
|
72476
|
+
}
|
|
72477
|
+
if (stateTarget) {
|
|
72478
|
+
await mkdir5(path12.dirname(stateTarget), { recursive: true });
|
|
72479
|
+
info(`Editing ${getTypeStrFromPath(change.path)} ${change.path}`);
|
|
72164
72480
|
}
|
|
72165
72481
|
const oldObj = parseFromPath(change.path, change.before);
|
|
72166
72482
|
const newObj = parseFromPath(change.path, change.after);
|
|
@@ -72277,7 +72593,7 @@ Run 'wmill folder add-missing' to create them locally, then push again.`;
|
|
|
72277
72593
|
});
|
|
72278
72594
|
break;
|
|
72279
72595
|
case "resource": {
|
|
72280
|
-
const resourcePath =
|
|
72596
|
+
const resourcePath = removeResourceSuffix(target);
|
|
72281
72597
|
try {
|
|
72282
72598
|
await deleteResource({
|
|
72283
72599
|
workspace: workspaceId,
|
|
@@ -72912,7 +73228,7 @@ var init_parse_schema = __esm(() => {
|
|
|
72912
73228
|
// src/utils/metadata.ts
|
|
72913
73229
|
import { sep as SEP10 } from "node:path";
|
|
72914
73230
|
import { writeFile as writeFile8, stat as stat8, rm as rm3, readdir as readdir5 } from "node:fs/promises";
|
|
72915
|
-
import { readFileSync as readFileSync3, existsSync as
|
|
73231
|
+
import { readFileSync as readFileSync3, existsSync as existsSync11, readdirSync as readdirSync2, statSync as statSync3, writeFileSync as writeFileSync5 } from "node:fs";
|
|
72916
73232
|
import * as path13 from "node:path";
|
|
72917
73233
|
import { createRequire as createRequire3 } from "node:module";
|
|
72918
73234
|
function loadParser(pkgName) {
|
|
@@ -73016,7 +73332,7 @@ async function generateScriptMetadataInternal(scriptPath, workspace, opts, dryRu
|
|
|
73016
73332
|
const metadataContent = await readTextFile(metadataWithType.path);
|
|
73017
73333
|
const filteredRawWorkspaceDependencies = filterWorkspaceDependencies(rawWorkspaceDependencies, scriptContent, language);
|
|
73018
73334
|
const moduleFolderPath = isFolderLayout ? path13.dirname(scriptPath) : scriptPath.substring(0, scriptPath.indexOf(".")) + getModuleFolderSuffix(language);
|
|
73019
|
-
const hasModules =
|
|
73335
|
+
const hasModules = existsSync11(moduleFolderPath) && statSync3(moduleFolderPath).isDirectory();
|
|
73020
73336
|
const depsForHash = tree ? {} : filteredRawWorkspaceDependencies;
|
|
73021
73337
|
let hash2 = await generateScriptHash(depsForHash, scriptContent, metadataContent);
|
|
73022
73338
|
let moduleHashes = {};
|
|
@@ -73309,7 +73625,7 @@ async function updateScriptLock(workspace, scriptContent, language, remotePath,
|
|
|
73309
73625
|
if (!languageNeedsLock(language)) {
|
|
73310
73626
|
if (language === "dbt") {
|
|
73311
73627
|
const lockPath2 = lockPathOverride ?? remotePath + ".script.lock";
|
|
73312
|
-
if (
|
|
73628
|
+
if (existsSync11(lockPath2)) {
|
|
73313
73629
|
metadataContent.lock = "!inline " + lockPath2.replaceAll(SEP10, "/");
|
|
73314
73630
|
}
|
|
73315
73631
|
}
|
|
@@ -73367,7 +73683,7 @@ async function updateModuleLocks(workspace, dirPath, relPrefix, scriptRemotePath
|
|
|
73367
73683
|
writeFileSync5(lockPath, lock, "utf-8");
|
|
73368
73684
|
} else {
|
|
73369
73685
|
try {
|
|
73370
|
-
if (
|
|
73686
|
+
if (existsSync11(lockPath)) {
|
|
73371
73687
|
const { rm: rmAsync } = await import("node:fs/promises");
|
|
73372
73688
|
await rmAsync(lockPath);
|
|
73373
73689
|
}
|
|
@@ -76045,7 +76361,7 @@ async function waitForJob(workspace, jobId) {
|
|
|
76045
76361
|
}
|
|
76046
76362
|
let syncIteration = 0;
|
|
76047
76363
|
let lastQueueLogAt = Date.now();
|
|
76048
|
-
return new Promise((
|
|
76364
|
+
return new Promise((resolve11, reject) => {
|
|
76049
76365
|
async function checkJob() {
|
|
76050
76366
|
try {
|
|
76051
76367
|
const maybeJob = await getCompletedJobResultMaybe({
|
|
@@ -76057,7 +76373,7 @@ async function waitForJob(workspace, jobId) {
|
|
|
76057
76373
|
if (!maybeJob.success && typeof maybeJob.result === "object" && maybeJob.result !== null && "error" in maybeJob.result) {
|
|
76058
76374
|
reject(maybeJob.result.error);
|
|
76059
76375
|
} else {
|
|
76060
|
-
|
|
76376
|
+
resolve11(maybeJob.result);
|
|
76061
76377
|
}
|
|
76062
76378
|
return;
|
|
76063
76379
|
}
|
|
@@ -77087,8 +77403,8 @@ This folder is for SQL migration files that will be applied to datatables during
|
|
|
77087
77403
|
process.stdout.write(`\r${colors.gray(`${frames[i++ % frames.length]} Creating Claude session...`)}`);
|
|
77088
77404
|
}, 80);
|
|
77089
77405
|
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) :
|
|
77406
|
+
await new Promise((resolve12, reject) => {
|
|
77407
|
+
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
77408
|
});
|
|
77093
77409
|
} finally {
|
|
77094
77410
|
clearInterval(spinner);
|
|
@@ -77283,7 +77599,7 @@ var init_new = __esm(async () => {
|
|
|
77283
77599
|
});
|
|
77284
77600
|
|
|
77285
77601
|
// src/commands/app/app.ts
|
|
77286
|
-
import { sep as SEP14, isAbsolute as
|
|
77602
|
+
import { sep as SEP14, isAbsolute as isAbsolute5, resolve as pathResolve, relative as pathRelative, basename as basename9 } from "node:path";
|
|
77287
77603
|
import { stat as stat10 } from "node:fs/promises";
|
|
77288
77604
|
function respecializeFields(fields) {
|
|
77289
77605
|
Object.entries(fields).forEach(([k, v]) => {
|
|
@@ -77484,9 +77800,9 @@ async function push5(opts, filePath, remotePath) {
|
|
|
77484
77800
|
if (!filePath) {
|
|
77485
77801
|
filePath = originalCwd;
|
|
77486
77802
|
}
|
|
77487
|
-
const absoluteFilePath =
|
|
77803
|
+
const absoluteFilePath = isAbsolute5(filePath) ? filePath : pathResolve(originalCwd, filePath);
|
|
77488
77804
|
const normalizedPath = absoluteFilePath.endsWith(SEP14) ? absoluteFilePath.slice(0, -1) : absoluteFilePath;
|
|
77489
|
-
const dirName =
|
|
77805
|
+
const dirName = basename9(normalizedPath);
|
|
77490
77806
|
const isRawAppByName = dirName.endsWith("__raw_app") || dirName.endsWith(".raw_app");
|
|
77491
77807
|
const isAppByName = dirName.endsWith("__app") || dirName.endsWith(".app");
|
|
77492
77808
|
let hasRawAppYaml = false;
|
|
@@ -77513,7 +77829,7 @@ async function push5(opts, filePath, remotePath) {
|
|
|
77513
77829
|
}
|
|
77514
77830
|
const wmillRoot = process.cwd();
|
|
77515
77831
|
let inferred = pathRelative(wmillRoot, normalizedPath).replaceAll(SEP14, "/");
|
|
77516
|
-
if (inferred.startsWith("..") ||
|
|
77832
|
+
if (inferred.startsWith("..") || isAbsolute5(inferred)) {
|
|
77517
77833
|
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
77834
|
return;
|
|
77519
77835
|
}
|
|
@@ -77809,24 +78125,24 @@ var init_folder = __esm(async () => {
|
|
|
77809
78125
|
error(`Path '${testPath}' is not under folder '${folderName2}' (expected prefix '${prefix}')`);
|
|
77810
78126
|
return;
|
|
77811
78127
|
}
|
|
77812
|
-
const
|
|
78128
|
+
const relative9 = testPath.slice(prefix.length);
|
|
77813
78129
|
const { minimatch: minimatch2 } = await Promise.resolve().then(() => (init_esm2(), exports_esm));
|
|
77814
78130
|
for (let i = 0;i < rules.length; i++) {
|
|
77815
78131
|
const rule = rules[i];
|
|
77816
|
-
if (minimatch2(
|
|
78132
|
+
if (minimatch2(relative9, rule.path_glob)) {
|
|
77817
78133
|
if (opts.json) {
|
|
77818
|
-
console.log(JSON.stringify({ matched: true, rule_index: i, rule, relative_path:
|
|
78134
|
+
console.log(JSON.stringify({ matched: true, rule_index: i, rule, relative_path: relative9 }));
|
|
77819
78135
|
} else {
|
|
77820
78136
|
info(colors.green(`✓ Rule #${i + 1} matches: path_glob='${rule.path_glob}' → permissioned_as='${rule.permissioned_as}'`));
|
|
77821
|
-
info(colors.gray(` (relative path tested: '${
|
|
78137
|
+
info(colors.gray(` (relative path tested: '${relative9}')`));
|
|
77822
78138
|
}
|
|
77823
78139
|
return;
|
|
77824
78140
|
}
|
|
77825
78141
|
}
|
|
77826
78142
|
if (opts.json) {
|
|
77827
|
-
console.log(JSON.stringify({ matched: false, relative_path:
|
|
78143
|
+
console.log(JSON.stringify({ matched: false, relative_path: relative9 }));
|
|
77828
78144
|
} else {
|
|
77829
|
-
info(colors.yellow(`No rule matches path '${testPath}' (relative: '${
|
|
78145
|
+
info(colors.yellow(`No rule matches path '${testPath}' (relative: '${relative9}')`));
|
|
77830
78146
|
}
|
|
77831
78147
|
});
|
|
77832
78148
|
folder_default = command15;
|
|
@@ -77834,7 +78150,7 @@ var init_folder = __esm(async () => {
|
|
|
77834
78150
|
|
|
77835
78151
|
// src/commands/variable/variable.ts
|
|
77836
78152
|
import { mkdir as mkdir9, stat as stat12, writeFile as writeFile12 } from "node:fs/promises";
|
|
77837
|
-
import { dirname as
|
|
78153
|
+
import { dirname as dirname16 } from "node:path";
|
|
77838
78154
|
import { sep as SEP16 } from "node:path";
|
|
77839
78155
|
async function list8(opts) {
|
|
77840
78156
|
if (opts.json)
|
|
@@ -77872,7 +78188,7 @@ async function newVariable(opts, path21) {
|
|
|
77872
78188
|
is_secret: false,
|
|
77873
78189
|
description: ""
|
|
77874
78190
|
};
|
|
77875
|
-
await mkdir9(
|
|
78191
|
+
await mkdir9(dirname16(filePath), { recursive: true });
|
|
77876
78192
|
await writeFile12(filePath, import_yaml26.stringify(template), {
|
|
77877
78193
|
flag: "wx",
|
|
77878
78194
|
encoding: "utf-8"
|
|
@@ -78057,7 +78373,7 @@ var init_variable = __esm(async () => {
|
|
|
78057
78373
|
|
|
78058
78374
|
// src/commands/schedule/schedule.ts
|
|
78059
78375
|
import { mkdir as mkdir10, stat as stat13, writeFile as writeFile13 } from "node:fs/promises";
|
|
78060
|
-
import { dirname as
|
|
78376
|
+
import { dirname as dirname17 } from "node:path";
|
|
78061
78377
|
import { sep as SEP17 } from "node:path";
|
|
78062
78378
|
async function list9(opts) {
|
|
78063
78379
|
if (opts.json)
|
|
@@ -78094,7 +78410,7 @@ async function newSchedule(opts, path21) {
|
|
|
78094
78410
|
is_flow: false,
|
|
78095
78411
|
enabled: false
|
|
78096
78412
|
};
|
|
78097
|
-
await mkdir10(
|
|
78413
|
+
await mkdir10(dirname17(filePath), { recursive: true });
|
|
78098
78414
|
await writeFile13(filePath, import_yaml27.stringify(template), {
|
|
78099
78415
|
flag: "wx",
|
|
78100
78416
|
encoding: "utf-8"
|
|
@@ -79856,7 +80172,7 @@ var init_dependencies = __esm(async () => {
|
|
|
79856
80172
|
|
|
79857
80173
|
// src/commands/trigger/trigger.ts
|
|
79858
80174
|
import { mkdir as mkdir12, stat as stat15, writeFile as writeFile17 } from "node:fs/promises";
|
|
79859
|
-
import { dirname as
|
|
80175
|
+
import { dirname as dirname18 } from "node:path";
|
|
79860
80176
|
import { sep as SEP18 } from "node:path";
|
|
79861
80177
|
async function getTrigger(triggerType, workspace, path22) {
|
|
79862
80178
|
const triggerFunctions = {
|
|
@@ -80057,7 +80373,7 @@ async function newTrigger(opts, path22) {
|
|
|
80057
80373
|
throw e;
|
|
80058
80374
|
}
|
|
80059
80375
|
const template = triggerTemplates[kind];
|
|
80060
|
-
await mkdir12(
|
|
80376
|
+
await mkdir12(dirname18(filePath), { recursive: true });
|
|
80061
80377
|
await writeFile17(filePath, import_yaml34.stringify(template), {
|
|
80062
80378
|
flag: "wx",
|
|
80063
80379
|
encoding: "utf-8"
|
|
@@ -80470,7 +80786,7 @@ async function pushObj(workspace, p, befObj, newObj, plainSecrets, alreadySynced
|
|
|
80470
80786
|
} else if (typeEnding === "resource") {
|
|
80471
80787
|
if (!alreadySynced3.includes(p)) {
|
|
80472
80788
|
alreadySynced3.push(p);
|
|
80473
|
-
await pushResource(workspace, p, befObj, newObj, originalLocalPath || p, wsSpecific);
|
|
80789
|
+
await pushResource(workspace, p, befObj, newObj, originalLocalPath || p, wsSpecific, true);
|
|
80474
80790
|
}
|
|
80475
80791
|
} else if (typeEnding === "resource-type") {
|
|
80476
80792
|
await pushResourceType(workspace, p, befObj, newObj);
|
|
@@ -80789,7 +81105,7 @@ var init_local_path_scripts = __esm(async () => {
|
|
|
80789
81105
|
});
|
|
80790
81106
|
|
|
80791
81107
|
// src/commands/flow/flow.ts
|
|
80792
|
-
import { dirname as
|
|
81108
|
+
import { dirname as dirname19, sep as SEP20 } from "node:path";
|
|
80793
81109
|
import { mkdirSync as mkdirSync8, writeFileSync as writeFileSync8 } from "node:fs";
|
|
80794
81110
|
function normalizeOptionalString(value) {
|
|
80795
81111
|
return typeof value === "string" && value.trim() === "" ? undefined : value ?? undefined;
|
|
@@ -81039,7 +81355,7 @@ async function run3(opts, path23) {
|
|
|
81039
81355
|
}
|
|
81040
81356
|
const workspace = await resolveWorkspace(opts);
|
|
81041
81357
|
await requireLogin(opts);
|
|
81042
|
-
const input = opts.data ? await
|
|
81358
|
+
const input = opts.data ? await resolve9(opts.data) : {};
|
|
81043
81359
|
if (!opts.data) {
|
|
81044
81360
|
try {
|
|
81045
81361
|
const flow = await getFlowByPath({
|
|
@@ -81120,7 +81436,7 @@ async function run3(opts, path23) {
|
|
|
81120
81436
|
forLoopFailed = refreshedModule.type === "Failure";
|
|
81121
81437
|
break;
|
|
81122
81438
|
}
|
|
81123
|
-
await new Promise((
|
|
81439
|
+
await new Promise((resolve12) => setTimeout(resolve12, 200));
|
|
81124
81440
|
}
|
|
81125
81441
|
if (forLoopFailed)
|
|
81126
81442
|
break;
|
|
@@ -81136,7 +81452,7 @@ async function run3(opts, path23) {
|
|
|
81136
81452
|
info(colors.dim(status));
|
|
81137
81453
|
lastStatus = status;
|
|
81138
81454
|
}
|
|
81139
|
-
await new Promise((
|
|
81455
|
+
await new Promise((resolve12, _) => setTimeout(() => resolve12(undefined), 100));
|
|
81140
81456
|
if (isCompleted)
|
|
81141
81457
|
break;
|
|
81142
81458
|
continue;
|
|
@@ -81172,7 +81488,7 @@ async function run3(opts, path23) {
|
|
|
81172
81488
|
break;
|
|
81173
81489
|
} catch {
|
|
81174
81490
|
retries++;
|
|
81175
|
-
await new Promise((
|
|
81491
|
+
await new Promise((resolve12) => setTimeout(resolve12, 100));
|
|
81176
81492
|
}
|
|
81177
81493
|
}
|
|
81178
81494
|
if (retries >= MAX_RETRIES) {
|
|
@@ -81184,16 +81500,19 @@ async function preview2(opts, flowPath) {
|
|
|
81184
81500
|
setSilent(true);
|
|
81185
81501
|
}
|
|
81186
81502
|
const useLocalPathScripts = !opts.remote;
|
|
81503
|
+
const cwdBeforeConfig = process.cwd();
|
|
81187
81504
|
if (useLocalPathScripts) {
|
|
81188
81505
|
opts = await mergeConfigWithConfigFile(opts);
|
|
81189
81506
|
}
|
|
81190
81507
|
const workspace = await resolveWorkspace(opts);
|
|
81191
81508
|
await requireLogin(opts);
|
|
81192
81509
|
const codebases = useLocalPathScripts ? listSyncCodebases(opts) : [];
|
|
81510
|
+
const argPath = flowPath;
|
|
81511
|
+
flowPath = toSyncRootRelativePath(flowPath, cwdBeforeConfig);
|
|
81193
81512
|
const isFlowDir = flowPath.endsWith(".flow") || flowPath.endsWith(".flow" + SEP20) || flowPath.endsWith("__flow") || flowPath.endsWith("__flow" + SEP20);
|
|
81194
81513
|
if (!isFlowDir) {
|
|
81195
81514
|
if (flowPath.endsWith("flow.yaml") || flowPath.endsWith("flow.json")) {
|
|
81196
|
-
flowPath =
|
|
81515
|
+
flowPath = dirname19(flowPath);
|
|
81197
81516
|
} else {
|
|
81198
81517
|
throw new Error("Flow path must be a .flow/__flow directory or a flow.yaml file");
|
|
81199
81518
|
}
|
|
@@ -81201,6 +81520,8 @@ async function preview2(opts, flowPath) {
|
|
|
81201
81520
|
if (!flowPath.endsWith(SEP20)) {
|
|
81202
81521
|
flowPath += SEP20;
|
|
81203
81522
|
}
|
|
81523
|
+
const flowWmPath = stripFlowSuffix(flowPath).replaceAll(SEP20, "/");
|
|
81524
|
+
assertRemotePath(flowWmPath, argPath);
|
|
81204
81525
|
const localFlow = await yamlParseFile(flowPath + "flow.yaml");
|
|
81205
81526
|
const fileReader = async (path23) => await readTextFile(flowPath + path23);
|
|
81206
81527
|
await replaceInlineScripts(localFlow.value.modules, fileReader, exports_log, flowPath, SEP20);
|
|
@@ -81235,9 +81556,8 @@ async function preview2(opts, flowPath) {
|
|
|
81235
81556
|
const resolvedCodebases = await Promise.resolve(codebases);
|
|
81236
81557
|
tempScriptRefs = await buildPreviewTempScriptRefs2(workspace, opts, resolvedCodebases, { kind: "flow", folder: flowPath });
|
|
81237
81558
|
}
|
|
81238
|
-
const input = opts.data ? await
|
|
81559
|
+
const input = opts.data ? await resolve9(opts.data) : {};
|
|
81239
81560
|
debug(`Flow value: ${JSON.stringify(localFlow.value, null, 2)}`);
|
|
81240
|
-
const flowWmPath = stripFlowSuffix(flowPath).replaceAll(SEP20, "/");
|
|
81241
81561
|
if (opts.step) {
|
|
81242
81562
|
await previewStep(opts.step, localFlow, flowWmPath, workspace, input, tempScriptRefs, opts.silent, opts.tag);
|
|
81243
81563
|
return;
|
|
@@ -83391,6 +83711,14 @@ async getResult(jobId: string): Promise<any>
|
|
|
83391
83711
|
*/
|
|
83392
83712
|
async getResultMaybe(jobId: string): Promise<any>
|
|
83393
83713
|
|
|
83714
|
+
/**
|
|
83715
|
+
* Cancel a queued or running job by ID.
|
|
83716
|
+
* @param jobId - UUID of the job to cancel
|
|
83717
|
+
* @param reason - Optional reason for cancellation
|
|
83718
|
+
* @returns Response message from the cancel endpoint
|
|
83719
|
+
*/
|
|
83720
|
+
async cancelJob(jobId: string, reason: string | undefined = undefined): Promise<string>
|
|
83721
|
+
|
|
83394
83722
|
/**
|
|
83395
83723
|
* Run a script asynchronously by its path
|
|
83396
83724
|
* @param path - Script path in Windmill
|
|
@@ -84155,6 +84483,14 @@ async getResult(jobId: string): Promise<any>
|
|
|
84155
84483
|
*/
|
|
84156
84484
|
async getResultMaybe(jobId: string): Promise<any>
|
|
84157
84485
|
|
|
84486
|
+
/**
|
|
84487
|
+
* Cancel a queued or running job by ID.
|
|
84488
|
+
* @param jobId - UUID of the job to cancel
|
|
84489
|
+
* @param reason - Optional reason for cancellation
|
|
84490
|
+
* @returns Response message from the cancel endpoint
|
|
84491
|
+
*/
|
|
84492
|
+
async cancelJob(jobId: string, reason: string | undefined = undefined): Promise<string>
|
|
84493
|
+
|
|
84158
84494
|
/**
|
|
84159
84495
|
* Run a script asynchronously by its path
|
|
84160
84496
|
* @param path - Script path in Windmill
|
|
@@ -85013,6 +85349,14 @@ async getResult(jobId: string): Promise<any>
|
|
|
85013
85349
|
*/
|
|
85014
85350
|
async getResultMaybe(jobId: string): Promise<any>
|
|
85015
85351
|
|
|
85352
|
+
/**
|
|
85353
|
+
* Cancel a queued or running job by ID.
|
|
85354
|
+
* @param jobId - UUID of the job to cancel
|
|
85355
|
+
* @param reason - Optional reason for cancellation
|
|
85356
|
+
* @returns Response message from the cancel endpoint
|
|
85357
|
+
*/
|
|
85358
|
+
async cancelJob(jobId: string, reason: string | undefined = undefined): Promise<string>
|
|
85359
|
+
|
|
85016
85360
|
/**
|
|
85017
85361
|
* Run a script asynchronously by its path
|
|
85018
85362
|
* @param path - Script path in Windmill
|
|
@@ -91006,18 +91350,62 @@ properties:
|
|
|
91006
91350
|
filters:
|
|
91007
91351
|
type: array
|
|
91008
91352
|
items:
|
|
91009
|
-
|
|
91010
|
-
|
|
91011
|
-
|
|
91012
|
-
|
|
91013
|
-
|
|
91353
|
+
oneOf:
|
|
91354
|
+
- type: object
|
|
91355
|
+
properties:
|
|
91356
|
+
key:
|
|
91357
|
+
type: string
|
|
91358
|
+
value: {}
|
|
91359
|
+
required:
|
|
91360
|
+
- key
|
|
91361
|
+
- value
|
|
91362
|
+
- type: object
|
|
91363
|
+
properties:
|
|
91364
|
+
path:
|
|
91365
|
+
type: string
|
|
91366
|
+
description: Dotted path into nested objects, e.g. \`a.b.c\`. Does not traverse
|
|
91367
|
+
arrays.
|
|
91368
|
+
value: {}
|
|
91369
|
+
required:
|
|
91370
|
+
- path
|
|
91371
|
+
- value
|
|
91372
|
+
- type: object
|
|
91373
|
+
properties:
|
|
91374
|
+
any_of:
|
|
91375
|
+
type: array
|
|
91376
|
+
items:
|
|
91377
|
+
type: object
|
|
91378
|
+
required:
|
|
91379
|
+
- any_of
|
|
91380
|
+
- type: object
|
|
91381
|
+
properties:
|
|
91382
|
+
all_of:
|
|
91383
|
+
type: array
|
|
91384
|
+
items:
|
|
91385
|
+
type: object
|
|
91386
|
+
required:
|
|
91387
|
+
- all_of
|
|
91388
|
+
- type: object
|
|
91389
|
+
properties:
|
|
91390
|
+
none_of:
|
|
91391
|
+
type: array
|
|
91392
|
+
items:
|
|
91393
|
+
type: object
|
|
91394
|
+
required:
|
|
91395
|
+
- none_of
|
|
91396
|
+
description: 'Filters to match incoming messages (only matching messages trigger
|
|
91397
|
+
the script). Each entry is either a leaf \`{key, value}\` (top-level field) or
|
|
91398
|
+
\`{path, value}\` (dotted path into nested objects), or a group \`{any_of: [...]}\`
|
|
91399
|
+
/ \`{all_of: [...]}\` / \`{none_of: [...]}\` nesting more entries. Entries at the
|
|
91400
|
+
top level are combined with \`filter_logic\`.'
|
|
91014
91401
|
filter_logic:
|
|
91015
91402
|
type: string
|
|
91016
91403
|
enum:
|
|
91017
91404
|
- and
|
|
91018
91405
|
- or
|
|
91019
|
-
description: Logic to apply when evaluating filters. 'and' requires
|
|
91020
|
-
to match, 'or' requires any
|
|
91406
|
+
description: Logic to apply when evaluating the top-level filters. 'and' requires
|
|
91407
|
+
all of them to match, 'or' requires any of them to match. Nested \`any_of\`/\`all_of\`/\`none_of\`
|
|
91408
|
+
groups carry their own logic.
|
|
91021
91409
|
auto_offset_reset:
|
|
91022
91410
|
type: string
|
|
91023
91411
|
enum:
|
|
@@ -91118,6 +91506,18 @@ properties:
|
|
|
91118
91506
|
type: array
|
|
91119
91507
|
items:
|
|
91120
91508
|
type: object
|
|
91509
|
+
properties:
|
|
91510
|
+
qos:
|
|
91511
|
+
type: string
|
|
91512
|
+
enum:
|
|
91513
|
+
- qos0
|
|
91514
|
+
- qos1
|
|
91515
|
+
- qos2
|
|
91516
|
+
topic:
|
|
91517
|
+
type: string
|
|
91518
|
+
required:
|
|
91519
|
+
- qos
|
|
91520
|
+
- topic
|
|
91121
91521
|
description: Array of MQTT topics to subscribe to, each with topic name and QoS
|
|
91122
91522
|
level
|
|
91123
91523
|
v3_config:
|
|
@@ -91662,24 +92062,91 @@ properties:
|
|
|
91662
92062
|
filters:
|
|
91663
92063
|
type: array
|
|
91664
92064
|
items:
|
|
91665
|
-
|
|
91666
|
-
|
|
91667
|
-
|
|
91668
|
-
|
|
91669
|
-
|
|
91670
|
-
|
|
91671
|
-
|
|
92065
|
+
oneOf:
|
|
92066
|
+
- type: object
|
|
92067
|
+
properties:
|
|
92068
|
+
key:
|
|
92069
|
+
type: string
|
|
92070
|
+
value: {}
|
|
92071
|
+
required:
|
|
92072
|
+
- key
|
|
92073
|
+
- value
|
|
92074
|
+
- type: object
|
|
92075
|
+
properties:
|
|
92076
|
+
path:
|
|
92077
|
+
type: string
|
|
92078
|
+
description: Dotted path into nested objects, e.g. \`a.b.c\`. Does not traverse
|
|
92079
|
+
arrays.
|
|
92080
|
+
value: {}
|
|
92081
|
+
required:
|
|
92082
|
+
- path
|
|
92083
|
+
- value
|
|
92084
|
+
- type: object
|
|
92085
|
+
properties:
|
|
92086
|
+
any_of:
|
|
92087
|
+
type: array
|
|
92088
|
+
items:
|
|
92089
|
+
type: object
|
|
92090
|
+
required:
|
|
92091
|
+
- any_of
|
|
92092
|
+
- type: object
|
|
92093
|
+
properties:
|
|
92094
|
+
all_of:
|
|
92095
|
+
type: array
|
|
92096
|
+
items:
|
|
92097
|
+
type: object
|
|
92098
|
+
required:
|
|
92099
|
+
- all_of
|
|
92100
|
+
- type: object
|
|
92101
|
+
properties:
|
|
92102
|
+
none_of:
|
|
92103
|
+
type: array
|
|
92104
|
+
items:
|
|
92105
|
+
type: object
|
|
92106
|
+
required:
|
|
92107
|
+
- none_of
|
|
92108
|
+
description: 'Filters to match incoming messages (only matching messages trigger
|
|
92109
|
+
the script). Each entry is either a leaf \`{key, value}\` (top-level field) or
|
|
92110
|
+
\`{path, value}\` (dotted path into nested objects), or a group \`{any_of: [...]}\`
|
|
92111
|
+
/ \`{all_of: [...]}\` / \`{none_of: [...]}\` nesting more entries. Entries at the
|
|
92112
|
+
top level are combined with \`filter_logic\`.'
|
|
91672
92113
|
filter_logic:
|
|
91673
92114
|
type: string
|
|
91674
92115
|
enum:
|
|
91675
92116
|
- and
|
|
91676
92117
|
- or
|
|
91677
|
-
description: Logic to apply when evaluating filters. 'and' requires
|
|
91678
|
-
to match, 'or' requires any
|
|
92118
|
+
description: Logic to apply when evaluating the top-level filters. 'and' requires
|
|
92119
|
+
all of them to match, 'or' requires any of them to match. Nested \`any_of\`/\`all_of\`/\`none_of\`
|
|
92120
|
+
groups carry their own logic.
|
|
91679
92121
|
initial_messages:
|
|
91680
92122
|
type: array
|
|
91681
92123
|
items:
|
|
91682
|
-
|
|
92124
|
+
oneOf:
|
|
92125
|
+
- type: object
|
|
92126
|
+
properties:
|
|
92127
|
+
raw_message:
|
|
92128
|
+
type: string
|
|
92129
|
+
required:
|
|
92130
|
+
- raw_message
|
|
92131
|
+
- type: object
|
|
92132
|
+
properties:
|
|
92133
|
+
runnable_result:
|
|
92134
|
+
type: object
|
|
92135
|
+
properties:
|
|
92136
|
+
path:
|
|
92137
|
+
type: string
|
|
92138
|
+
args:
|
|
92139
|
+
type: object
|
|
92140
|
+
description: The arguments to pass to the script or flow
|
|
92141
|
+
additionalProperties: true
|
|
92142
|
+
is_flow:
|
|
92143
|
+
type: boolean
|
|
92144
|
+
required:
|
|
92145
|
+
- path
|
|
92146
|
+
- args
|
|
92147
|
+
- is_flow
|
|
92148
|
+
required:
|
|
92149
|
+
- runnable_result
|
|
91683
92150
|
description: Messages to send immediately after connecting (can be raw strings
|
|
91684
92151
|
or computed by runnables)
|
|
91685
92152
|
url_runnable_args:
|
|
@@ -91935,7 +92402,7 @@ __export(exports_tsconfig, {
|
|
|
91935
92402
|
});
|
|
91936
92403
|
import { execSync as execSync6 } from "node:child_process";
|
|
91937
92404
|
import { createHash as createHash2 } from "node:crypto";
|
|
91938
|
-
import { existsSync as
|
|
92405
|
+
import { existsSync as existsSync19, readFileSync as readFileSync5, writeFileSync as writeFileSync9 } from "node:fs";
|
|
91939
92406
|
import path24 from "node:path";
|
|
91940
92407
|
import process25 from "node:process";
|
|
91941
92408
|
function buildManagedTsconfig() {
|
|
@@ -92062,7 +92529,7 @@ async function refreshManagedDenoImportMap(mode) {
|
|
|
92062
92529
|
});
|
|
92063
92530
|
}
|
|
92064
92531
|
async function ensureUserReferencesManaged(opts) {
|
|
92065
|
-
const existing = [opts.file, ...opts.altFiles ?? []].map((f) => path24.join(process25.cwd(), f)).find((p) =>
|
|
92532
|
+
const existing = [opts.file, ...opts.altFiles ?? []].map((f) => path24.join(process25.cwd(), f)).find((p) => existsSync19(p));
|
|
92066
92533
|
if (!existing) {
|
|
92067
92534
|
const userPath = path24.join(process25.cwd(), opts.file);
|
|
92068
92535
|
writeFileSync9(userPath, JSON.stringify(opts.create, null, 2) + `
|
|
@@ -92114,7 +92581,7 @@ async function ensureUserReferencesManaged(opts) {
|
|
|
92114
92581
|
}
|
|
92115
92582
|
function ensureBunTypesAvailable() {
|
|
92116
92583
|
const cwd = process25.cwd();
|
|
92117
|
-
if (
|
|
92584
|
+
if (existsSync19(path24.join(cwd, "node_modules", "bun-types"))) {
|
|
92118
92585
|
return true;
|
|
92119
92586
|
}
|
|
92120
92587
|
try {
|
|
@@ -92137,7 +92604,7 @@ function ensureBunTypesAvailable() {
|
|
|
92137
92604
|
async function warnIfTsconfigStale(opts) {
|
|
92138
92605
|
const cwd = opts?.cwd ?? process25.cwd();
|
|
92139
92606
|
const managedPath = path24.join(cwd, MANAGED_TSCONFIG);
|
|
92140
|
-
if (!
|
|
92607
|
+
if (!existsSync19(managedPath))
|
|
92141
92608
|
return;
|
|
92142
92609
|
let managedText;
|
|
92143
92610
|
try {
|
|
@@ -93390,7 +93857,7 @@ await __promiseAll([
|
|
|
93390
93857
|
init_user(),
|
|
93391
93858
|
init_variable()
|
|
93392
93859
|
]);
|
|
93393
|
-
import { realpathSync } from "node:fs";
|
|
93860
|
+
import { realpathSync as realpathSync2 } from "node:fs";
|
|
93394
93861
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
93395
93862
|
|
|
93396
93863
|
// src/commands/hub/hub.ts
|
|
@@ -93576,18 +94043,18 @@ await __promiseAll([
|
|
|
93576
94043
|
init_context()
|
|
93577
94044
|
]);
|
|
93578
94045
|
var import_yaml40 = __toESM(require_dist(), 1);
|
|
93579
|
-
import { existsSync as
|
|
94046
|
+
import { existsSync as existsSync16 } from "node:fs";
|
|
93580
94047
|
import { writeFile as writeFile19 } from "node:fs/promises";
|
|
93581
|
-
import { dirname as
|
|
94048
|
+
import { dirname as dirname20, join as join22 } from "node:path";
|
|
93582
94049
|
var PROTECTION_RULES_FILENAME = "protection-rules.yaml";
|
|
93583
94050
|
function getProtectionRulesPath() {
|
|
93584
94051
|
const wmillPath = getWmillYamlPath();
|
|
93585
94052
|
if (!wmillPath)
|
|
93586
94053
|
return null;
|
|
93587
|
-
return
|
|
94054
|
+
return join22(dirname20(wmillPath), PROTECTION_RULES_FILENAME);
|
|
93588
94055
|
}
|
|
93589
94056
|
async function readProtectionRulesFile(path23) {
|
|
93590
|
-
if (!
|
|
94057
|
+
if (!existsSync16(path23))
|
|
93591
94058
|
return {};
|
|
93592
94059
|
const parsed = await yamlParseFile(path23);
|
|
93593
94060
|
return parsed ?? {};
|
|
@@ -93798,7 +94265,7 @@ await __promiseAll([
|
|
|
93798
94265
|
init_conf()
|
|
93799
94266
|
]);
|
|
93800
94267
|
import process24 from "node:process";
|
|
93801
|
-
import { existsSync as
|
|
94268
|
+
import { existsSync as existsSync17 } from "node:fs";
|
|
93802
94269
|
async function pushProtectionRules(opts, workspaceArg) {
|
|
93803
94270
|
if (opts.jsonOutput)
|
|
93804
94271
|
setSilent(true);
|
|
@@ -93808,7 +94275,7 @@ async function pushProtectionRules(opts, workspaceArg) {
|
|
|
93808
94275
|
error: "No wmill.yaml found. Run 'wmill init' first — protection-rules.yaml lives next to it."
|
|
93809
94276
|
});
|
|
93810
94277
|
}
|
|
93811
|
-
if (!
|
|
94278
|
+
if (!existsSync17(prPath)) {
|
|
93812
94279
|
fail(opts, {
|
|
93813
94280
|
error: "No protection-rules.yaml found. Run 'wmill protection-rules pull' first."
|
|
93814
94281
|
});
|
|
@@ -94770,7 +95237,7 @@ async function dev2(opts) {
|
|
|
94770
95237
|
}
|
|
94771
95238
|
socket.destroy();
|
|
94772
95239
|
});
|
|
94773
|
-
return new Promise((
|
|
95240
|
+
return new Promise((resolve12) => {
|
|
94774
95241
|
proxyServer.listen(proxyPort, BIND_HOST, () => {
|
|
94775
95242
|
console.log(`Dev proxy listening on http://localhost:${proxyPort}`);
|
|
94776
95243
|
if (opts.path) {
|
|
@@ -94780,7 +95247,7 @@ async function dev2(opts) {
|
|
|
94780
95247
|
console.log("(pass --path <path> to skip the picker)");
|
|
94781
95248
|
}
|
|
94782
95249
|
maybeOpenBrowser(`http://localhost:${proxyPort}/`);
|
|
94783
|
-
|
|
95250
|
+
resolve12();
|
|
94784
95251
|
});
|
|
94785
95252
|
});
|
|
94786
95253
|
}
|
|
@@ -94886,9 +95353,9 @@ class NpmProvider extends Provider {
|
|
|
94886
95353
|
if (verbose)
|
|
94887
95354
|
process.stderr.write(d);
|
|
94888
95355
|
});
|
|
94889
|
-
const exitCode = await new Promise((
|
|
95356
|
+
const exitCode = await new Promise((resolve12, reject) => {
|
|
94890
95357
|
proc.on("error", reject);
|
|
94891
|
-
proc.on("close",
|
|
95358
|
+
proc.on("close", resolve12);
|
|
94892
95359
|
}).catch((e) => {
|
|
94893
95360
|
throw new Error(`failed to run npm: ${e instanceof Error ? e.message : e}
|
|
94894
95361
|
|
|
@@ -95584,7 +96051,7 @@ await __promiseAll([
|
|
|
95584
96051
|
init_freshness()
|
|
95585
96052
|
]);
|
|
95586
96053
|
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
|
|
96054
|
+
import { join as join24 } from "node:path";
|
|
95588
96055
|
var WMILL_INIT_AI_SKILLS_SOURCE_ENV = "WMILL_INIT_AI_SKILLS_SOURCE";
|
|
95589
96056
|
var WMILL_INIT_AI_AGENTS_SOURCE_ENV = "WMILL_INIT_AI_AGENTS_SOURCE";
|
|
95590
96057
|
var WMILL_INIT_AI_CLAUDE_SOURCE_ENV = "WMILL_INIT_AI_CLAUDE_SOURCE";
|
|
@@ -95597,20 +96064,20 @@ async function writeAiGuidanceFiles(options) {
|
|
|
95597
96064
|
const skillMetadata = options.skillsSourcePath ? await readSkillMetadataFromDirectory(options.skillsSourcePath) : getGeneratedSkillMetadata();
|
|
95598
96065
|
const rawAgentsCliContent = options.agentsSourcePath != null ? await readTextFile(options.agentsSourcePath) : generateAgentsCliMdContent(buildSkillsReference(skillMetadata));
|
|
95599
96066
|
const agentsCliContent = injectPromptsHashMarker(rawAgentsCliContent, currentPromptsHash(nonDottedPaths));
|
|
95600
|
-
const agentsCliPath =
|
|
96067
|
+
const agentsCliPath = join24(options.targetDir, AGENTS_WMILL_FILENAME);
|
|
95601
96068
|
await writeFile21(agentsCliPath, agentsCliContent, "utf8");
|
|
95602
96069
|
const agentsCliWritten = true;
|
|
95603
96070
|
const legacyManagedRemoved = await migrateLegacyManagedFile(options.targetDir);
|
|
95604
96071
|
const resolveMigration = cacheOnce(options.resolveAgentsMdMigration);
|
|
95605
96072
|
const agentsMdResult = await reconcileIncludingFile({
|
|
95606
|
-
path:
|
|
96073
|
+
path: join24(options.targetDir, "AGENTS.md"),
|
|
95607
96074
|
includeLine: AGENTS_WMILL_INCLUDE_LINE,
|
|
95608
96075
|
skeleton: generateAgentsMdSkeleton(),
|
|
95609
96076
|
resolveMigration
|
|
95610
96077
|
});
|
|
95611
96078
|
const claudeSkeleton = options.claudeSourcePath != null ? await readTextFile(options.claudeSourcePath) : CLAUDE_MD_DEFAULT;
|
|
95612
96079
|
const claudeMdResult = await reconcileIncludingFile({
|
|
95613
|
-
path:
|
|
96080
|
+
path: join24(options.targetDir, "CLAUDE.md"),
|
|
95614
96081
|
includeLine: CLAUDE_MD_INCLUDE_LINE,
|
|
95615
96082
|
skeleton: claudeSkeleton,
|
|
95616
96083
|
resolveMigration
|
|
@@ -95632,7 +96099,7 @@ async function writeAiGuidanceFiles(options) {
|
|
|
95632
96099
|
}
|
|
95633
96100
|
async function migrateLegacyManagedFile(targetDir) {
|
|
95634
96101
|
for (const fileName of ["AGENTS.md", "CLAUDE.md"]) {
|
|
95635
|
-
const filePath =
|
|
96102
|
+
const filePath = join24(targetDir, fileName);
|
|
95636
96103
|
const existing = await readTextFile(filePath).catch(() => null);
|
|
95637
96104
|
if (existing == null)
|
|
95638
96105
|
continue;
|
|
@@ -95641,7 +96108,7 @@ async function migrateLegacyManagedFile(targetDir) {
|
|
|
95641
96108
|
await writeFile21(filePath, rewritten, "utf8");
|
|
95642
96109
|
}
|
|
95643
96110
|
}
|
|
95644
|
-
const legacyPath =
|
|
96111
|
+
const legacyPath = join24(targetDir, LEGACY_AGENTS_CLI_FILENAME);
|
|
95645
96112
|
const legacyExists = await stat19(legacyPath).catch(() => null) != null;
|
|
95646
96113
|
if (legacyExists) {
|
|
95647
96114
|
await rm6(legacyPath, { force: true });
|
|
@@ -95718,9 +96185,9 @@ async function copySkillsFromSource(targetDir, skillsSourcePath) {
|
|
|
95718
96185
|
async function writeGeneratedSkills(targetDir, nonDottedPaths) {
|
|
95719
96186
|
const skillsDirs = await ensureSkillsDirectories(targetDir);
|
|
95720
96187
|
await Promise.all(skillsDirs.flatMap((skillsDir) => SKILLS.map(async (skill) => {
|
|
95721
|
-
const skillDir =
|
|
96188
|
+
const skillDir = join24(skillsDir, skill.name);
|
|
95722
96189
|
await mkdir13(skillDir, { recursive: true });
|
|
95723
|
-
await writeFile21(
|
|
96190
|
+
await writeFile21(join24(skillDir, "SKILL.md"), renderGeneratedSkillContent(skill.name, nonDottedPaths), "utf8");
|
|
95724
96191
|
})));
|
|
95725
96192
|
return SKILLS.map((skill) => ({
|
|
95726
96193
|
...skill,
|
|
@@ -95734,14 +96201,14 @@ function getGeneratedSkillMetadata() {
|
|
|
95734
96201
|
}));
|
|
95735
96202
|
}
|
|
95736
96203
|
async function ensureSkillsDirectories(targetDir) {
|
|
95737
|
-
const skillsDirs = SKILL_TARGET_ROOTS.map((root) =>
|
|
96204
|
+
const skillsDirs = SKILL_TARGET_ROOTS.map((root) => join24(targetDir, root, "skills"));
|
|
95738
96205
|
await Promise.all(skillsDirs.map((skillsDir) => mkdir13(skillsDir, { recursive: true })));
|
|
95739
96206
|
return skillsDirs;
|
|
95740
96207
|
}
|
|
95741
96208
|
async function copyDirectoryContents(sourceDir, targetDir) {
|
|
95742
96209
|
const entries = await readdir11(sourceDir, { withFileTypes: true });
|
|
95743
96210
|
await Promise.all(entries.map(async (entry) => {
|
|
95744
|
-
await cp(
|
|
96211
|
+
await cp(join24(sourceDir, entry.name), join24(targetDir, entry.name), {
|
|
95745
96212
|
recursive: true,
|
|
95746
96213
|
force: true
|
|
95747
96214
|
});
|
|
@@ -95784,7 +96251,7 @@ async function readSkillMetadataFromDirectory(skillsDir) {
|
|
|
95784
96251
|
if (!entry.isDirectory()) {
|
|
95785
96252
|
continue;
|
|
95786
96253
|
}
|
|
95787
|
-
const skillPath =
|
|
96254
|
+
const skillPath = join24(skillsDir, entry.name, "SKILL.md");
|
|
95788
96255
|
if (!await stat19(skillPath).catch(() => null)) {
|
|
95789
96256
|
continue;
|
|
95790
96257
|
}
|
|
@@ -98376,16 +98843,16 @@ async function startServe(opts) {
|
|
|
98376
98843
|
error(`server error: ${err.message}`);
|
|
98377
98844
|
process.exitCode = 1;
|
|
98378
98845
|
});
|
|
98379
|
-
await new Promise((
|
|
98846
|
+
await new Promise((resolve12) => server.listen(port, host, () => resolve12()));
|
|
98380
98847
|
return {
|
|
98381
98848
|
host,
|
|
98382
98849
|
port,
|
|
98383
98850
|
user: DEFAULT_USER,
|
|
98384
98851
|
password,
|
|
98385
98852
|
connectionString: (datatableName) => `postgresql://${DEFAULT_USER}:${encodeURIComponent(password)}@${host}:${port}/${encodeURIComponent(datatableName)}`,
|
|
98386
|
-
close: () => new Promise((
|
|
98387
|
-
server.close(() =>
|
|
98388
|
-
setTimeout(
|
|
98853
|
+
close: () => new Promise((resolve12) => {
|
|
98854
|
+
server.close(() => resolve12());
|
|
98855
|
+
setTimeout(resolve12, 1000).unref();
|
|
98389
98856
|
})
|
|
98390
98857
|
};
|
|
98391
98858
|
}
|
|
@@ -98894,13 +99361,13 @@ async function psql(opts) {
|
|
|
98894
99361
|
}
|
|
98895
99362
|
handle.close().finally(() => process.exit(1));
|
|
98896
99363
|
});
|
|
98897
|
-
const exitCode = await new Promise((
|
|
99364
|
+
const exitCode = await new Promise((resolve12) => {
|
|
98898
99365
|
child.on("exit", (code2, signal) => {
|
|
98899
99366
|
if (signal && typeof signal === "string") {
|
|
98900
99367
|
const num = signalToNumber(signal);
|
|
98901
|
-
|
|
99368
|
+
resolve12(num !== undefined ? 128 + num : 1);
|
|
98902
99369
|
} else {
|
|
98903
|
-
|
|
99370
|
+
resolve12(code2 ?? 0);
|
|
98904
99371
|
}
|
|
98905
99372
|
});
|
|
98906
99373
|
});
|
|
@@ -100303,7 +100770,7 @@ await __promiseAll([
|
|
|
100303
100770
|
init_conf()
|
|
100304
100771
|
]);
|
|
100305
100772
|
import { writeFile as writeFile25 } from "node:fs/promises";
|
|
100306
|
-
import { existsSync as
|
|
100773
|
+
import { existsSync as existsSync21, readFileSync as readFileSync8 } from "node:fs";
|
|
100307
100774
|
import * as path27 from "node:path";
|
|
100308
100775
|
var ASSET_KINDS = "s3object,ducklake,datatable,volume,dbt";
|
|
100309
100776
|
function assetUri(kind, p3) {
|
|
@@ -100523,7 +100990,7 @@ async function generatePipelineDocs(opts, folder) {
|
|
|
100523
100990
|
];
|
|
100524
100991
|
for (const [name, content] of pointers) {
|
|
100525
100992
|
const p3 = path27.join(folderDir, name);
|
|
100526
|
-
if (
|
|
100993
|
+
if (existsSync21(p3)) {
|
|
100527
100994
|
let existing;
|
|
100528
100995
|
try {
|
|
100529
100996
|
existing = readFileSync8(p3, "utf-8");
|
|
@@ -100542,7 +101009,7 @@ async function generatePipelineDocs(opts, folder) {
|
|
|
100542
101009
|
}
|
|
100543
101010
|
|
|
100544
101011
|
// src/commands/pipeline/pipelineUpload.ts
|
|
100545
|
-
import { basename as
|
|
101012
|
+
import { basename as basename11 } from "node:path";
|
|
100546
101013
|
function parseUploadBinding(spec) {
|
|
100547
101014
|
const eq = spec.indexOf("=");
|
|
100548
101015
|
const left = eq < 0 ? "" : spec.slice(0, eq).trim();
|
|
@@ -100584,7 +101051,7 @@ function s3ObjectParams(schema) {
|
|
|
100584
101051
|
return Object.keys(props).filter((k2) => isS3Object(props[k2]?.format));
|
|
100585
101052
|
}
|
|
100586
101053
|
function devUploadKey(scriptPath, param, source) {
|
|
100587
|
-
return `wmilldev/pipeline/${scriptPath}/${param}/${
|
|
101054
|
+
return `wmilldev/pipeline/${scriptPath}/${param}/${basename11(source)}`;
|
|
100588
101055
|
}
|
|
100589
101056
|
function parseS3Uri(source) {
|
|
100590
101057
|
const m3 = source.match(/^s3:\/\/([^/]*)\/(.*)$/);
|
|
@@ -101229,7 +101696,7 @@ await __promiseAll([
|
|
|
101229
101696
|
]);
|
|
101230
101697
|
import { Buffer as Buffer6 } from "node:buffer";
|
|
101231
101698
|
import { readFile as readFile4, writeFile as writeFile26 } from "node:fs/promises";
|
|
101232
|
-
import { basename as
|
|
101699
|
+
import { basename as basename12 } from "node:path";
|
|
101233
101700
|
function formatBytes(n2) {
|
|
101234
101701
|
if (n2 == null)
|
|
101235
101702
|
return "-";
|
|
@@ -101330,7 +101797,7 @@ async function download(opts, fileKey, outputPath) {
|
|
|
101330
101797
|
process.stdout.write(buf);
|
|
101331
101798
|
return;
|
|
101332
101799
|
}
|
|
101333
|
-
const dest = outputPath ??
|
|
101800
|
+
const dest = outputPath ?? basename12(fileKey);
|
|
101334
101801
|
await writeFile26(dest, buf);
|
|
101335
101802
|
info(colors.green(`Downloaded ${fileKey} -> ${dest}`));
|
|
101336
101803
|
}
|
|
@@ -101534,7 +102001,7 @@ function isMain() {
|
|
|
101534
102001
|
const scriptPath = process.argv[1];
|
|
101535
102002
|
if (!scriptPath)
|
|
101536
102003
|
return false;
|
|
101537
|
-
const realScriptPath =
|
|
102004
|
+
const realScriptPath = realpathSync2(scriptPath);
|
|
101538
102005
|
const modulePath = fileURLToPath2(import.meta.url);
|
|
101539
102006
|
return realScriptPath === modulePath;
|
|
101540
102007
|
} catch {
|