@workit-dev/pi 2.26.0 → 2.26.2
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/dist/worker.js +101 -108
- package/dist/workit.js +132 -105
- package/package.json +1 -1
package/dist/worker.js
CHANGED
|
@@ -4961,11 +4961,6 @@ if (!globalConfig.localeError)
|
|
|
4961
4961
|
config(en_default());
|
|
4962
4962
|
if (!globalConfig.memoizer)
|
|
4963
4963
|
config({ memoizer: memoizer() });
|
|
4964
|
-
var described = (schema, description) => {
|
|
4965
|
-
const copy = schema.clone();
|
|
4966
|
-
globalRegistry.add(copy, { description });
|
|
4967
|
-
return copy;
|
|
4968
|
-
};
|
|
4969
4964
|
|
|
4970
4965
|
// packages/workit-core/src/core/task-contract.ts
|
|
4971
4966
|
var OPERATION_FAMILIES = [
|
|
@@ -6424,25 +6419,25 @@ var nonBlank = string2().check(refine((value) => value.trim().length > 0, "must
|
|
|
6424
6419
|
var branchPreset = custom((value) => typeof value === "string" && Object.hasOwn(PRESETS, value), "unsupported branch preset");
|
|
6425
6420
|
var commitPreset = custom((value) => typeof value === "string" && COMMIT_PRESETS.includes(value), "unsupported commit preset");
|
|
6426
6421
|
var workspaceBranchPolicySchema = strictObject({
|
|
6427
|
-
preset:
|
|
6428
|
-
developBranch:
|
|
6429
|
-
prefixes:
|
|
6422
|
+
preset: branchPreset,
|
|
6423
|
+
developBranch: optional(nonBlank),
|
|
6424
|
+
prefixes: optional(looseObject({
|
|
6430
6425
|
feature: nonBlank,
|
|
6431
6426
|
bugfix: nonBlank,
|
|
6432
6427
|
release: nonBlank,
|
|
6433
6428
|
hotfix: nonBlank
|
|
6434
|
-
})),
|
|
6435
|
-
allowed:
|
|
6436
|
-
protected:
|
|
6437
|
-
integration:
|
|
6429
|
+
})),
|
|
6430
|
+
allowed: optional(array(nonBlank)),
|
|
6431
|
+
protected: optional(array(nonBlank)),
|
|
6432
|
+
integration: optional(_enum(["pr", "merge"]))
|
|
6438
6433
|
});
|
|
6439
6434
|
var workspaceCommitPolicySchema = strictObject({
|
|
6440
|
-
preset:
|
|
6441
|
-
pattern:
|
|
6435
|
+
preset: commitPreset,
|
|
6436
|
+
pattern: optional(string2())
|
|
6442
6437
|
});
|
|
6443
6438
|
var workspaceProfileSchema = strictObject({
|
|
6444
|
-
branchPolicy:
|
|
6445
|
-
commitPolicy:
|
|
6439
|
+
branchPolicy: optional(workspaceBranchPolicySchema),
|
|
6440
|
+
commitPolicy: optional(workspaceCommitPolicySchema)
|
|
6446
6441
|
}).check(refine((profile) => profile.branchPolicy !== undefined || profile.commitPolicy !== undefined, { message: "a profile must define branchPolicy or commitPolicy" }));
|
|
6447
6442
|
var versionSourceSchema = discriminatedUnion("kind", [
|
|
6448
6443
|
strictObject({
|
|
@@ -6454,22 +6449,22 @@ var versionSourceSchema = discriminatedUnion("kind", [
|
|
|
6454
6449
|
strictObject({ kind: literal("manual") })
|
|
6455
6450
|
]);
|
|
6456
6451
|
var releaseTrackSchema = looseObject({
|
|
6457
|
-
strategy:
|
|
6458
|
-
productionBranch:
|
|
6459
|
-
integrationBranch:
|
|
6460
|
-
naming:
|
|
6452
|
+
strategy: optional(branchPreset),
|
|
6453
|
+
productionBranch: nonBlank,
|
|
6454
|
+
integrationBranch: nonBlank,
|
|
6455
|
+
naming: optional(looseObject({
|
|
6461
6456
|
feature: optional(nonBlank),
|
|
6462
6457
|
release: optional(nonBlank),
|
|
6463
6458
|
hotfix: optional(nonBlank)
|
|
6464
|
-
})),
|
|
6465
|
-
baseBranch:
|
|
6466
|
-
mergeBackBranches:
|
|
6467
|
-
pullRequestTarget:
|
|
6468
|
-
tagNamespace:
|
|
6469
|
-
versionSource:
|
|
6470
|
-
requiredChecks:
|
|
6471
|
-
critical:
|
|
6472
|
-
releaseNotes:
|
|
6459
|
+
})),
|
|
6460
|
+
baseBranch: optional(nonBlank),
|
|
6461
|
+
mergeBackBranches: optional(array(nonBlank)),
|
|
6462
|
+
pullRequestTarget: optional(nonBlank),
|
|
6463
|
+
tagNamespace: optional(string2()),
|
|
6464
|
+
versionSource: optional(versionSourceSchema),
|
|
6465
|
+
requiredChecks: optional(array(nonBlank)),
|
|
6466
|
+
critical: optional(array(nonBlank)),
|
|
6467
|
+
releaseNotes: optional(unknown())
|
|
6473
6468
|
}).check(superRefine((track, context) => {
|
|
6474
6469
|
for (const [field, values] of [
|
|
6475
6470
|
["mergeBackBranches", track.mergeBackBranches ?? []],
|
|
@@ -6491,67 +6486,67 @@ var releaseTrackSchema = looseObject({
|
|
|
6491
6486
|
});
|
|
6492
6487
|
}
|
|
6493
6488
|
}));
|
|
6494
|
-
var modelRoles =
|
|
6489
|
+
var modelRoles = optional(unknown());
|
|
6495
6490
|
var workspaceConfigSchema = looseObject({
|
|
6496
|
-
name:
|
|
6497
|
-
glob:
|
|
6498
|
-
vcs:
|
|
6499
|
-
provider:
|
|
6500
|
-
defaultTargetBranch:
|
|
6501
|
-
tokenFile:
|
|
6502
|
-
account:
|
|
6503
|
-
host:
|
|
6504
|
-
})),
|
|
6505
|
-
autoApprove:
|
|
6506
|
-
defaultEndpoint:
|
|
6507
|
-
verification:
|
|
6508
|
-
delegation:
|
|
6509
|
-
changelog:
|
|
6510
|
-
docs:
|
|
6511
|
-
changelogPath:
|
|
6512
|
-
prTemplate:
|
|
6513
|
-
releaseNotes:
|
|
6514
|
-
trailers:
|
|
6515
|
-
deleteBranch:
|
|
6516
|
-
cleanup:
|
|
6517
|
-
feedback:
|
|
6518
|
-
liveSessionGuard:
|
|
6519
|
-
shared:
|
|
6520
|
-
fanout:
|
|
6521
|
-
tierModels:
|
|
6522
|
-
deps:
|
|
6523
|
-
installTimeout:
|
|
6524
|
-
})),
|
|
6525
|
-
models:
|
|
6526
|
-
resources:
|
|
6527
|
-
remotes:
|
|
6528
|
-
externalRepos:
|
|
6529
|
-
additiveRiskPaths:
|
|
6530
|
-
autonomy:
|
|
6491
|
+
name: nonBlank,
|
|
6492
|
+
glob: nonBlank,
|
|
6493
|
+
vcs: optional(looseObject({
|
|
6494
|
+
provider: _enum(["gitlab", "github"]),
|
|
6495
|
+
defaultTargetBranch: optional(nonBlank),
|
|
6496
|
+
tokenFile: optional(nonBlank),
|
|
6497
|
+
account: optional(nonBlank),
|
|
6498
|
+
host: optional(unknown())
|
|
6499
|
+
})),
|
|
6500
|
+
autoApprove: optional(union([boolean2(), array(nonBlank)])),
|
|
6501
|
+
defaultEndpoint: optional(unknown()),
|
|
6502
|
+
verification: optional(_enum(["proportional", "self", "independent"])),
|
|
6503
|
+
delegation: optional(unknown()),
|
|
6504
|
+
changelog: optional(unknown()),
|
|
6505
|
+
docs: optional(unknown()),
|
|
6506
|
+
changelogPath: optional(unknown()),
|
|
6507
|
+
prTemplate: optional(unknown()),
|
|
6508
|
+
releaseNotes: optional(unknown()),
|
|
6509
|
+
trailers: optional(boolean2()),
|
|
6510
|
+
deleteBranch: optional(boolean2()),
|
|
6511
|
+
cleanup: optional(unknown()),
|
|
6512
|
+
feedback: optional(unknown()),
|
|
6513
|
+
liveSessionGuard: optional(boolean2()),
|
|
6514
|
+
shared: optional(boolean2()),
|
|
6515
|
+
fanout: optional(looseObject({
|
|
6516
|
+
tierModels: optional(unknown()),
|
|
6517
|
+
deps: optional(unknown()),
|
|
6518
|
+
installTimeout: optional(unknown())
|
|
6519
|
+
})),
|
|
6520
|
+
models: optional(looseObject({ roles: modelRoles })),
|
|
6521
|
+
resources: optional(unknown()),
|
|
6522
|
+
remotes: optional(array(nonBlank.check(refine((pattern) => remotePattern(pattern) !== null, "is not a remote URL (https://host/owner/repo, git@host:owner/repo, a path, or owner/*)")))),
|
|
6523
|
+
externalRepos: optional(array(nonBlank.check(_regex(/^[\w-]+(?:\/\w[\w.-]*)*\/(?:\w[\w.-]*|\*)$/u, "is owner/name, group/project or owner/* on the checkout's forge host, without the host")))),
|
|
6524
|
+
additiveRiskPaths: optional(array(nonBlank)),
|
|
6525
|
+
autonomy: optional(looseObject(Object.fromEntries(["push", "pr", "merge", "release", "rerun"].map((kind) => [
|
|
6531
6526
|
kind,
|
|
6532
|
-
|
|
6533
|
-
])))),
|
|
6534
|
-
youtrack:
|
|
6535
|
-
baseUrl:
|
|
6536
|
-
link_issues:
|
|
6537
|
-
writes:
|
|
6538
|
-
autoHosts:
|
|
6539
|
-
})),
|
|
6540
|
-
issues:
|
|
6541
|
-
provider:
|
|
6542
|
-
link:
|
|
6543
|
-
relation:
|
|
6544
|
-
backlink:
|
|
6545
|
-
link_on_pr:
|
|
6546
|
-
repo:
|
|
6547
|
-
host:
|
|
6548
|
-
})),
|
|
6549
|
-
branchPolicy:
|
|
6550
|
-
commitPolicy:
|
|
6551
|
-
defaultProfile:
|
|
6552
|
-
profiles:
|
|
6553
|
-
releaseTracks:
|
|
6554
|
-
releasePackages:
|
|
6527
|
+
optional(union([boolean2(), literal("verified")]))
|
|
6528
|
+
])))),
|
|
6529
|
+
youtrack: optional(looseObject({
|
|
6530
|
+
baseUrl: optional(nonBlank),
|
|
6531
|
+
link_issues: optional(boolean2()),
|
|
6532
|
+
writes: optional(_enum(["ask", "auto"])),
|
|
6533
|
+
autoHosts: optional(array(nonBlank))
|
|
6534
|
+
})),
|
|
6535
|
+
issues: optional(looseObject({
|
|
6536
|
+
provider: optional(_enum(["github", "gitlab", "youtrack"])),
|
|
6537
|
+
link: optional(boolean2()),
|
|
6538
|
+
relation: optional(unknown()),
|
|
6539
|
+
backlink: optional(boolean2()),
|
|
6540
|
+
link_on_pr: optional(boolean2()),
|
|
6541
|
+
repo: optional(unknown()),
|
|
6542
|
+
host: optional(unknown())
|
|
6543
|
+
})),
|
|
6544
|
+
branchPolicy: optional(workspaceBranchPolicySchema),
|
|
6545
|
+
commitPolicy: optional(workspaceCommitPolicySchema),
|
|
6546
|
+
defaultProfile: optional(nonBlank),
|
|
6547
|
+
profiles: optional(record(nonBlank, workspaceProfileSchema)),
|
|
6548
|
+
releaseTracks: optional(record(nonBlank, releaseTrackSchema)),
|
|
6549
|
+
releasePackages: optional(unknown())
|
|
6555
6550
|
}).check(superRefine((workspace, context) => {
|
|
6556
6551
|
if (workspace.defaultProfile !== undefined && !Object.hasOwn(workspace.profiles ?? {}, workspace.defaultProfile)) {
|
|
6557
6552
|
context.addIssue({
|
|
@@ -6562,11 +6557,11 @@ var workspaceConfigSchema = looseObject({
|
|
|
6562
6557
|
}
|
|
6563
6558
|
}));
|
|
6564
6559
|
var workspacesFileSchema = looseObject({
|
|
6565
|
-
workspaces:
|
|
6566
|
-
models:
|
|
6567
|
-
feedback:
|
|
6568
|
-
account:
|
|
6569
|
-
}))
|
|
6560
|
+
workspaces: optional(array(workspaceConfigSchema)),
|
|
6561
|
+
models: optional(looseObject({ roles: modelRoles })),
|
|
6562
|
+
feedback: optional(looseObject({
|
|
6563
|
+
account: optional(nonBlank)
|
|
6564
|
+
}))
|
|
6570
6565
|
}).check(superRefine((file, context) => {
|
|
6571
6566
|
const names = new Set;
|
|
6572
6567
|
for (const [index, workspace] of (file.workspaces ?? []).entries()) {
|
|
@@ -9950,19 +9945,6 @@ var PI_DESCRIPTOR = {
|
|
|
9950
9945
|
]
|
|
9951
9946
|
};
|
|
9952
9947
|
|
|
9953
|
-
// packages/workit-core/src/hooks/write-gate.ts
|
|
9954
|
-
import path14 from "node:path";
|
|
9955
|
-
|
|
9956
|
-
// packages/workit-core/src/core/live-session.ts
|
|
9957
|
-
import { spawnSync as spawnSync8 } from "node:child_process";
|
|
9958
|
-
var LIVE_SESSION_TTL_MS = 15 * 60000;
|
|
9959
|
-
var liveProbe = {
|
|
9960
|
-
platform: process.platform,
|
|
9961
|
-
run: (args) => spawnSync8("ps", args, { encoding: "utf8", timeout: 2000 }).stdout ?? "",
|
|
9962
|
-
start: (pid) => processStartOf(pid)
|
|
9963
|
-
};
|
|
9964
|
-
var PIDS = new Map;
|
|
9965
|
-
|
|
9966
9948
|
// packages/workit-core/src/hooks/windows-reads.ts
|
|
9967
9949
|
var READ_CMDLETS = new Set([
|
|
9968
9950
|
"foreach-object",
|
|
@@ -9989,7 +9971,19 @@ var READ_CMDLETS = new Set([
|
|
|
9989
9971
|
"pop-location",
|
|
9990
9972
|
"help"
|
|
9991
9973
|
]);
|
|
9992
|
-
|
|
9974
|
+
|
|
9975
|
+
// packages/workit-core/src/hooks/write-gate.ts
|
|
9976
|
+
import path14 from "node:path";
|
|
9977
|
+
|
|
9978
|
+
// packages/workit-core/src/core/live-session.ts
|
|
9979
|
+
import { spawnSync as spawnSync8 } from "node:child_process";
|
|
9980
|
+
var LIVE_SESSION_TTL_MS = 15 * 60000;
|
|
9981
|
+
var liveProbe = {
|
|
9982
|
+
platform: process.platform,
|
|
9983
|
+
run: (args) => spawnSync8("ps", args, { encoding: "utf8", timeout: 2000 }).stdout ?? "",
|
|
9984
|
+
start: (pid) => processStartOf(pid)
|
|
9985
|
+
};
|
|
9986
|
+
var PIDS = new Map;
|
|
9993
9987
|
|
|
9994
9988
|
// packages/workit-core/src/hooks/write-gate.ts
|
|
9995
9989
|
var CASE_INSENSITIVE = process.platform === "darwin" || process.platform === "win32";
|
|
@@ -10026,7 +10020,6 @@ var PUSHD2 = new Set(["pushd", "push-location"]);
|
|
|
10026
10020
|
var POPD2 = new Set(["popd", "pop-location"]);
|
|
10027
10021
|
var UNKNOWN_DIR = path14.resolve(path14.parse(process.cwd()).root, ".workit-unknown-dir");
|
|
10028
10022
|
var DECLARERS = new Set(["export", "declare", "typeset", "local", "readonly"]);
|
|
10029
|
-
var POSIX_LOADER = new RegExp(LOADER_ENV.source);
|
|
10030
10023
|
var REBINDS_ANY = new Set([
|
|
10031
10024
|
"source",
|
|
10032
10025
|
".",
|
package/dist/workit.js
CHANGED
|
@@ -5374,11 +5374,6 @@ if (!globalConfig.localeError)
|
|
|
5374
5374
|
config(en_default());
|
|
5375
5375
|
if (!globalConfig.memoizer)
|
|
5376
5376
|
config({ memoizer: memoizer() });
|
|
5377
|
-
var described = (schema, description) => {
|
|
5378
|
-
const copy = schema.clone();
|
|
5379
|
-
globalRegistry.add(copy, { description });
|
|
5380
|
-
return copy;
|
|
5381
|
-
};
|
|
5382
5377
|
|
|
5383
5378
|
// packages/workit-core/src/core/scope-glob.ts
|
|
5384
5379
|
var GLOB = /[*?[\]{}]/u;
|
|
@@ -8378,25 +8373,25 @@ var nonBlank = string2().check(refine((value) => value.trim().length > 0, "must
|
|
|
8378
8373
|
var branchPreset = custom((value) => typeof value === "string" && Object.hasOwn(PRESETS, value), "unsupported branch preset");
|
|
8379
8374
|
var commitPreset = custom((value) => typeof value === "string" && COMMIT_PRESETS.includes(value), "unsupported commit preset");
|
|
8380
8375
|
var workspaceBranchPolicySchema = strictObject({
|
|
8381
|
-
preset:
|
|
8382
|
-
developBranch:
|
|
8383
|
-
prefixes:
|
|
8376
|
+
preset: branchPreset,
|
|
8377
|
+
developBranch: optional(nonBlank),
|
|
8378
|
+
prefixes: optional(looseObject({
|
|
8384
8379
|
feature: nonBlank,
|
|
8385
8380
|
bugfix: nonBlank,
|
|
8386
8381
|
release: nonBlank,
|
|
8387
8382
|
hotfix: nonBlank
|
|
8388
|
-
})),
|
|
8389
|
-
allowed:
|
|
8390
|
-
protected:
|
|
8391
|
-
integration:
|
|
8383
|
+
})),
|
|
8384
|
+
allowed: optional(array(nonBlank)),
|
|
8385
|
+
protected: optional(array(nonBlank)),
|
|
8386
|
+
integration: optional(_enum(["pr", "merge"]))
|
|
8392
8387
|
});
|
|
8393
8388
|
var workspaceCommitPolicySchema = strictObject({
|
|
8394
|
-
preset:
|
|
8395
|
-
pattern:
|
|
8389
|
+
preset: commitPreset,
|
|
8390
|
+
pattern: optional(string2())
|
|
8396
8391
|
});
|
|
8397
8392
|
var workspaceProfileSchema = strictObject({
|
|
8398
|
-
branchPolicy:
|
|
8399
|
-
commitPolicy:
|
|
8393
|
+
branchPolicy: optional(workspaceBranchPolicySchema),
|
|
8394
|
+
commitPolicy: optional(workspaceCommitPolicySchema)
|
|
8400
8395
|
}).check(refine((profile) => profile.branchPolicy !== undefined || profile.commitPolicy !== undefined, { message: "a profile must define branchPolicy or commitPolicy" }));
|
|
8401
8396
|
var versionSourceSchema = discriminatedUnion("kind", [
|
|
8402
8397
|
strictObject({
|
|
@@ -8408,22 +8403,22 @@ var versionSourceSchema = discriminatedUnion("kind", [
|
|
|
8408
8403
|
strictObject({ kind: literal("manual") })
|
|
8409
8404
|
]);
|
|
8410
8405
|
var releaseTrackSchema = looseObject({
|
|
8411
|
-
strategy:
|
|
8412
|
-
productionBranch:
|
|
8413
|
-
integrationBranch:
|
|
8414
|
-
naming:
|
|
8406
|
+
strategy: optional(branchPreset),
|
|
8407
|
+
productionBranch: nonBlank,
|
|
8408
|
+
integrationBranch: nonBlank,
|
|
8409
|
+
naming: optional(looseObject({
|
|
8415
8410
|
feature: optional(nonBlank),
|
|
8416
8411
|
release: optional(nonBlank),
|
|
8417
8412
|
hotfix: optional(nonBlank)
|
|
8418
|
-
})),
|
|
8419
|
-
baseBranch:
|
|
8420
|
-
mergeBackBranches:
|
|
8421
|
-
pullRequestTarget:
|
|
8422
|
-
tagNamespace:
|
|
8423
|
-
versionSource:
|
|
8424
|
-
requiredChecks:
|
|
8425
|
-
critical:
|
|
8426
|
-
releaseNotes:
|
|
8413
|
+
})),
|
|
8414
|
+
baseBranch: optional(nonBlank),
|
|
8415
|
+
mergeBackBranches: optional(array(nonBlank)),
|
|
8416
|
+
pullRequestTarget: optional(nonBlank),
|
|
8417
|
+
tagNamespace: optional(string2()),
|
|
8418
|
+
versionSource: optional(versionSourceSchema),
|
|
8419
|
+
requiredChecks: optional(array(nonBlank)),
|
|
8420
|
+
critical: optional(array(nonBlank)),
|
|
8421
|
+
releaseNotes: optional(unknown())
|
|
8427
8422
|
}).check(superRefine((track, context) => {
|
|
8428
8423
|
for (const [field, values] of [
|
|
8429
8424
|
["mergeBackBranches", track.mergeBackBranches ?? []],
|
|
@@ -8445,67 +8440,67 @@ var releaseTrackSchema = looseObject({
|
|
|
8445
8440
|
});
|
|
8446
8441
|
}
|
|
8447
8442
|
}));
|
|
8448
|
-
var modelRoles =
|
|
8443
|
+
var modelRoles = optional(unknown());
|
|
8449
8444
|
var workspaceConfigSchema = looseObject({
|
|
8450
|
-
name:
|
|
8451
|
-
glob:
|
|
8452
|
-
vcs:
|
|
8453
|
-
provider:
|
|
8454
|
-
defaultTargetBranch:
|
|
8455
|
-
tokenFile:
|
|
8456
|
-
account:
|
|
8457
|
-
host:
|
|
8458
|
-
})),
|
|
8459
|
-
autoApprove:
|
|
8460
|
-
defaultEndpoint:
|
|
8461
|
-
verification:
|
|
8462
|
-
delegation:
|
|
8463
|
-
changelog:
|
|
8464
|
-
docs:
|
|
8465
|
-
changelogPath:
|
|
8466
|
-
prTemplate:
|
|
8467
|
-
releaseNotes:
|
|
8468
|
-
trailers:
|
|
8469
|
-
deleteBranch:
|
|
8470
|
-
cleanup:
|
|
8471
|
-
feedback:
|
|
8472
|
-
liveSessionGuard:
|
|
8473
|
-
shared:
|
|
8474
|
-
fanout:
|
|
8475
|
-
tierModels:
|
|
8476
|
-
deps:
|
|
8477
|
-
installTimeout:
|
|
8478
|
-
})),
|
|
8479
|
-
models:
|
|
8480
|
-
resources:
|
|
8481
|
-
remotes:
|
|
8482
|
-
externalRepos:
|
|
8483
|
-
additiveRiskPaths:
|
|
8484
|
-
autonomy:
|
|
8445
|
+
name: nonBlank,
|
|
8446
|
+
glob: nonBlank,
|
|
8447
|
+
vcs: optional(looseObject({
|
|
8448
|
+
provider: _enum(["gitlab", "github"]),
|
|
8449
|
+
defaultTargetBranch: optional(nonBlank),
|
|
8450
|
+
tokenFile: optional(nonBlank),
|
|
8451
|
+
account: optional(nonBlank),
|
|
8452
|
+
host: optional(unknown())
|
|
8453
|
+
})),
|
|
8454
|
+
autoApprove: optional(union([boolean2(), array(nonBlank)])),
|
|
8455
|
+
defaultEndpoint: optional(unknown()),
|
|
8456
|
+
verification: optional(_enum(["proportional", "self", "independent"])),
|
|
8457
|
+
delegation: optional(unknown()),
|
|
8458
|
+
changelog: optional(unknown()),
|
|
8459
|
+
docs: optional(unknown()),
|
|
8460
|
+
changelogPath: optional(unknown()),
|
|
8461
|
+
prTemplate: optional(unknown()),
|
|
8462
|
+
releaseNotes: optional(unknown()),
|
|
8463
|
+
trailers: optional(boolean2()),
|
|
8464
|
+
deleteBranch: optional(boolean2()),
|
|
8465
|
+
cleanup: optional(unknown()),
|
|
8466
|
+
feedback: optional(unknown()),
|
|
8467
|
+
liveSessionGuard: optional(boolean2()),
|
|
8468
|
+
shared: optional(boolean2()),
|
|
8469
|
+
fanout: optional(looseObject({
|
|
8470
|
+
tierModels: optional(unknown()),
|
|
8471
|
+
deps: optional(unknown()),
|
|
8472
|
+
installTimeout: optional(unknown())
|
|
8473
|
+
})),
|
|
8474
|
+
models: optional(looseObject({ roles: modelRoles })),
|
|
8475
|
+
resources: optional(unknown()),
|
|
8476
|
+
remotes: optional(array(nonBlank.check(refine((pattern) => remotePattern(pattern) !== null, "is not a remote URL (https://host/owner/repo, git@host:owner/repo, a path, or owner/*)")))),
|
|
8477
|
+
externalRepos: optional(array(nonBlank.check(_regex(/^[\w-]+(?:\/\w[\w.-]*)*\/(?:\w[\w.-]*|\*)$/u, "is owner/name, group/project or owner/* on the checkout's forge host, without the host")))),
|
|
8478
|
+
additiveRiskPaths: optional(array(nonBlank)),
|
|
8479
|
+
autonomy: optional(looseObject(Object.fromEntries(["push", "pr", "merge", "release", "rerun"].map((kind) => [
|
|
8485
8480
|
kind,
|
|
8486
|
-
|
|
8487
|
-
])))),
|
|
8488
|
-
youtrack:
|
|
8489
|
-
baseUrl:
|
|
8490
|
-
link_issues:
|
|
8491
|
-
writes:
|
|
8492
|
-
autoHosts:
|
|
8493
|
-
})),
|
|
8494
|
-
issues:
|
|
8495
|
-
provider:
|
|
8496
|
-
link:
|
|
8497
|
-
relation:
|
|
8498
|
-
backlink:
|
|
8499
|
-
link_on_pr:
|
|
8500
|
-
repo:
|
|
8501
|
-
host:
|
|
8502
|
-
})),
|
|
8503
|
-
branchPolicy:
|
|
8504
|
-
commitPolicy:
|
|
8505
|
-
defaultProfile:
|
|
8506
|
-
profiles:
|
|
8507
|
-
releaseTracks:
|
|
8508
|
-
releasePackages:
|
|
8481
|
+
optional(union([boolean2(), literal("verified")]))
|
|
8482
|
+
])))),
|
|
8483
|
+
youtrack: optional(looseObject({
|
|
8484
|
+
baseUrl: optional(nonBlank),
|
|
8485
|
+
link_issues: optional(boolean2()),
|
|
8486
|
+
writes: optional(_enum(["ask", "auto"])),
|
|
8487
|
+
autoHosts: optional(array(nonBlank))
|
|
8488
|
+
})),
|
|
8489
|
+
issues: optional(looseObject({
|
|
8490
|
+
provider: optional(_enum(["github", "gitlab", "youtrack"])),
|
|
8491
|
+
link: optional(boolean2()),
|
|
8492
|
+
relation: optional(unknown()),
|
|
8493
|
+
backlink: optional(boolean2()),
|
|
8494
|
+
link_on_pr: optional(boolean2()),
|
|
8495
|
+
repo: optional(unknown()),
|
|
8496
|
+
host: optional(unknown())
|
|
8497
|
+
})),
|
|
8498
|
+
branchPolicy: optional(workspaceBranchPolicySchema),
|
|
8499
|
+
commitPolicy: optional(workspaceCommitPolicySchema),
|
|
8500
|
+
defaultProfile: optional(nonBlank),
|
|
8501
|
+
profiles: optional(record(nonBlank, workspaceProfileSchema)),
|
|
8502
|
+
releaseTracks: optional(record(nonBlank, releaseTrackSchema)),
|
|
8503
|
+
releasePackages: optional(unknown())
|
|
8509
8504
|
}).check(superRefine((workspace, context) => {
|
|
8510
8505
|
if (workspace.defaultProfile !== undefined && !Object.hasOwn(workspace.profiles ?? {}, workspace.defaultProfile)) {
|
|
8511
8506
|
context.addIssue({
|
|
@@ -8516,11 +8511,11 @@ var workspaceConfigSchema = looseObject({
|
|
|
8516
8511
|
}
|
|
8517
8512
|
}));
|
|
8518
8513
|
var workspacesFileSchema = looseObject({
|
|
8519
|
-
workspaces:
|
|
8520
|
-
models:
|
|
8521
|
-
feedback:
|
|
8522
|
-
account:
|
|
8523
|
-
}))
|
|
8514
|
+
workspaces: optional(array(workspaceConfigSchema)),
|
|
8515
|
+
models: optional(looseObject({ roles: modelRoles })),
|
|
8516
|
+
feedback: optional(looseObject({
|
|
8517
|
+
account: optional(nonBlank)
|
|
8518
|
+
}))
|
|
8524
8519
|
}).check(superRefine((file, context) => {
|
|
8525
8520
|
const names = new Set;
|
|
8526
8521
|
for (const [index, workspace] of (file.workspaces ?? []).entries()) {
|
|
@@ -20389,12 +20384,20 @@ var POWERSHELL_PARAMETERS = [
|
|
|
20389
20384
|
{ name: "workingdirectory", min: 2, aliases: ["wd"], kind: "value" }
|
|
20390
20385
|
];
|
|
20391
20386
|
var powershellRun = (words, stdin) => {
|
|
20387
|
+
const { script, opaque, dir } = powershellParameters(words, stdin);
|
|
20388
|
+
return {
|
|
20389
|
+
script: script !== null && dir !== undefined ? `Set-Location -LiteralPath '${dir.replaceAll("'", "''")}'; ${script}` : script,
|
|
20390
|
+
opaque
|
|
20391
|
+
};
|
|
20392
|
+
};
|
|
20393
|
+
var powershellParameters = (words, stdin) => {
|
|
20392
20394
|
const host = /powershell/i.test(words[0] ?? "") ? "powershell" : "pwsh";
|
|
20393
20395
|
let opaque = false;
|
|
20396
|
+
let dir;
|
|
20394
20397
|
for (let index = 1;index < words.length; index++) {
|
|
20395
20398
|
const word = words[index];
|
|
20396
20399
|
if (!/^[-/]/.test(word))
|
|
20397
|
-
return host === "powershell" ? { script: words.slice(index).join(" "), opaque } : { script: null, opaque: true };
|
|
20400
|
+
return host === "powershell" ? { script: words.slice(index).join(" "), opaque, dir } : { script: null, opaque: true };
|
|
20398
20401
|
const [, key = "", glued] = /^(?:--?|\/)([^:=]*)(?:[:=](.*))?$/s.exec(word) ?? [];
|
|
20399
20402
|
const flag = key.toLowerCase();
|
|
20400
20403
|
const matches = POWERSHELL_PARAMETERS.filter((parameter) => (parameter.host ?? host) === host && flag !== "" && (parameter.aliases?.includes(flag) || flag.length >= parameter.min && parameter.name.startsWith(flag)));
|
|
@@ -20402,13 +20405,19 @@ var powershellRun = (words, stdin) => {
|
|
|
20402
20405
|
opaque = true;
|
|
20403
20406
|
continue;
|
|
20404
20407
|
}
|
|
20405
|
-
const [{ kind }] = matches;
|
|
20408
|
+
const [{ kind, name }] = matches;
|
|
20406
20409
|
const value = glued ?? words[index + 1];
|
|
20410
|
+
if (name === "workingdirectory")
|
|
20411
|
+
dir = value;
|
|
20407
20412
|
if (kind === "info")
|
|
20408
20413
|
return { script: null, opaque: opaque || index < words.length - 1 };
|
|
20409
20414
|
if (kind === "encoded") {
|
|
20410
20415
|
try {
|
|
20411
|
-
return {
|
|
20416
|
+
return {
|
|
20417
|
+
script: Buffer.from(value ?? "", "base64").toString("utf16le"),
|
|
20418
|
+
opaque: true,
|
|
20419
|
+
dir
|
|
20420
|
+
};
|
|
20412
20421
|
} catch {
|
|
20413
20422
|
return { script: null, opaque: true };
|
|
20414
20423
|
}
|
|
@@ -20416,15 +20425,17 @@ var powershellRun = (words, stdin) => {
|
|
|
20416
20425
|
if (kind === "args")
|
|
20417
20426
|
return {
|
|
20418
20427
|
script: value ?? null,
|
|
20419
|
-
opaque: opaque || glued !== undefined || value === undefined
|
|
20428
|
+
opaque: opaque || glued !== undefined || value === undefined,
|
|
20429
|
+
dir
|
|
20420
20430
|
};
|
|
20421
20431
|
if (kind === "script") {
|
|
20422
20432
|
if (value === "-")
|
|
20423
|
-
return { script: stdin ?? null, opaque: true };
|
|
20433
|
+
return { script: stdin ?? null, opaque: true, dir };
|
|
20424
20434
|
const rest = glued === undefined ? words.slice(index + 1) : [glued, ...words.slice(index + 1)];
|
|
20425
20435
|
return {
|
|
20426
20436
|
script: rest.join(" ") || null,
|
|
20427
|
-
opaque: opaque || glued !== undefined || !rest.length
|
|
20437
|
+
opaque: opaque || glued !== undefined || !rest.length,
|
|
20438
|
+
dir
|
|
20428
20439
|
};
|
|
20429
20440
|
}
|
|
20430
20441
|
opaque ||= kind === "opaque";
|
|
@@ -27729,7 +27740,9 @@ var KEYWORDS2 = /^(?:if|elseif|else|switch|while|do|until|for|foreach|try|catch|
|
|
|
27729
27740
|
var WINDOWS_WRITERS = /^(?:xcopy|robocopy|attrib|icacls|cacls|takeown|compact|cipher|expand|extrac32|makecab|fsutil|reg|regedit|setx|schtasks|msiexec|certutil|bitsadmin|replace|subst|mountvol|format|diskpart|wsl|cscript|wscript|mshta|rundll32|regsvr32|call)$/;
|
|
27730
27741
|
var READ_METHODS = /^(?:trim(?:start|end)?|split|contains(?:key|value)?|startswith|endswith|substring|(?:last)?indexof(?:any)?|to(?:lower|upper)(?:invariant)?|tostring|tochararray|pad(?:left|right)|equals|compareto|gettype|gethashcode|normalize|where)$/i;
|
|
27731
27742
|
var READ_MEMBERS = /^(?:name|fullname|basename|extension|length|count|directory|directoryname|parent|root|exists|mode|lastwritetime(?:utc)?|creationtime(?:utc)?|lastaccesstime(?:utc)?|attributes|linktype|target|pspath|pschildname|path|line|linenumber|filename|matches|value|key|keys|values|id|processname|source|definition|version)$/i;
|
|
27732
|
-
var LOADER_ENV = /^(?:GIT_\w*|PAGER|EDITOR|VISUAL|PATH|LD_\w*|DYLD_\w*|NODE_OPTIONS|PYTHON\w*|BASH_ENV|ENV|PERL5(?:OPT|LIB)|RUBY(?:OPT|LIB))$/i;
|
|
27743
|
+
var LOADER_ENV = /^(?:GIT_\w*|SSH_ASKPASS(?:_REQUIRE)?|PAGER|EDITOR|VISUAL|PATH|PATHEXT|PSModulePath|LD_\w*|DYLD_\w*|NODE_OPTIONS|NODE_PATH|BUN_OPTIONS|npm_config_\w*|PYTHON\w*|BASH_ENV|ENV|PROMPT_COMMAND|PERL5(?:OPT|LIB)|RUBY(?:OPT|LIB)|RUSTC_(?:WORKSPACE_)?WRAPPER|CARGO_\w*|JAVA_TOOL_OPTIONS|_JAVA_OPTIONS|JDK_JAVA_OPTIONS|DOTNET_STARTUP_HOOKS|COMPLUS_\w*|CORECLR_\w*)$/i;
|
|
27744
|
+
var GIT_CONFIG_ENV2 = /^(?:HOME|USERPROFILE|HOMEDRIVE|HOMEPATH|XDG_\w+|LESS\w*)$/i;
|
|
27745
|
+
var EXEMPT_LOADER = /^(?:(?:GIT_)?PAGER=cat|GIT_OPTIONAL_LOCKS=0)$/;
|
|
27733
27746
|
var CMD_VAR = /%[^%\s]+%|![^!\s]+!/;
|
|
27734
27747
|
var NULL_SINK = /^(?:\$null|nul|\/dev\/null)$/i;
|
|
27735
27748
|
var pwshCode = (text) => {
|
|
@@ -27782,7 +27795,7 @@ var powershellTextWriter = (text) => {
|
|
|
27782
27795
|
if (statics)
|
|
27783
27796
|
return `${statics[1]}::${statics[2]}`;
|
|
27784
27797
|
for (const [, name] of code.matchAll(/\$\{?env:(\w+)\}?\s*[-+]?=/gi))
|
|
27785
|
-
if (LOADER_ENV.test(name))
|
|
27798
|
+
if (LOADER_ENV.test(name) || GIT_CONFIG_ENV2.test(name))
|
|
27786
27799
|
return `$env:${name} =`;
|
|
27787
27800
|
for (const [, name] of code.matchAll(/\.([A-Za-z_]\w*)\(/g))
|
|
27788
27801
|
if (!READ_METHODS.test(name))
|
|
@@ -28856,14 +28869,13 @@ var commandWords = (words) => {
|
|
|
28856
28869
|
start++;
|
|
28857
28870
|
return words.slice(start);
|
|
28858
28871
|
};
|
|
28859
|
-
var POSIX_LOADER = new RegExp(LOADER_ENV.source);
|
|
28860
28872
|
var loaderAssignment = (words) => {
|
|
28861
28873
|
for (const word of words) {
|
|
28862
28874
|
const name = /^(\w+)\+?=/.exec(word)?.[1];
|
|
28863
|
-
if (
|
|
28875
|
+
if (EXEMPT_LOADER.test(word))
|
|
28864
28876
|
continue;
|
|
28865
28877
|
if (name !== undefined) {
|
|
28866
|
-
if (
|
|
28878
|
+
if (LOADER_ENV.test(name))
|
|
28867
28879
|
return word.split("=")[0];
|
|
28868
28880
|
} else if (!DECLARERS.has(word) && word !== "env" && !word.startsWith("-"))
|
|
28869
28881
|
return;
|
|
@@ -31739,6 +31751,12 @@ var remoteIn = (dir, name, repo) => {
|
|
|
31739
31751
|
const url = configEntries(fs30.readFileSync(path49.join(shared, "config"), "utf8")).find(([key]) => key === `remote.${name}.url`.toLowerCase())?.[1];
|
|
31740
31752
|
return url !== undefined && literalIn(url, repo, true);
|
|
31741
31753
|
};
|
|
31754
|
+
var judgeEnvAllowed = (word) => {
|
|
31755
|
+
if (EXEMPT_LOADER.test(word))
|
|
31756
|
+
return true;
|
|
31757
|
+
const [, name = "", value = ""] = /^(\w+)\+?=([\s\S]*)$/.exec(word) ?? [];
|
|
31758
|
+
return !LOADER_ENV.test(name) && !GIT_CONFIG_ENV2.test(name) && !/[$`]/.test(value);
|
|
31759
|
+
};
|
|
31742
31760
|
var judgeGit = (command, repo, cwd, depth = 0) => {
|
|
31743
31761
|
const runsGit = /\bgit\b/.test(command);
|
|
31744
31762
|
for (const segment of segmentsOf(command)) {
|
|
@@ -31750,6 +31768,15 @@ var judgeGit = (command, repo, cwd, depth = 0) => {
|
|
|
31750
31768
|
const lead = [];
|
|
31751
31769
|
while (/^\w+\+?=/.test(words[at] ?? ""))
|
|
31752
31770
|
lead.push(words[at++]);
|
|
31771
|
+
if (words[at] === "env" && !segment.expands?.includes(at)) {
|
|
31772
|
+
let after = at + 1;
|
|
31773
|
+
while (/^\w+\+?=/.test(words[after] ?? ""))
|
|
31774
|
+
after++;
|
|
31775
|
+
if (!words[after]?.startsWith("-")) {
|
|
31776
|
+
lead.push(...words.slice(at + 1, after));
|
|
31777
|
+
at = after;
|
|
31778
|
+
}
|
|
31779
|
+
}
|
|
31753
31780
|
const name = path49.basename(words[at] ?? "");
|
|
31754
31781
|
let start = words.findIndex((word) => /(?:^|[\\/])git(?:\.exe)?(?:=|$)/.test(word));
|
|
31755
31782
|
if (start > at) {
|
|
@@ -31770,7 +31797,7 @@ var judgeGit = (command, repo, cwd, depth = 0) => {
|
|
|
31770
31797
|
if (/^(?:export|declare|local|readonly|typeset)$/.test(name))
|
|
31771
31798
|
lead.push(...words.slice(at + 1).filter((word) => /^\w+\+?=/.test(word)));
|
|
31772
31799
|
for (const word of runsGit ? lead : lead.filter((set) => /^(?:BASH_)?ENV=/.test(set)))
|
|
31773
|
-
if (
|
|
31800
|
+
if (!judgeEnvAllowed(word))
|
|
31774
31801
|
why ??= `\`${word}\` is not allowed`;
|
|
31775
31802
|
let index = start < 0 ? words.length : start + 1;
|
|
31776
31803
|
let dir = "";
|