@ricsam/r5d-worker 0.0.78 → 0.0.79
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/README.md +6 -0
- package/dist/cjs/main.cjs +1550 -335
- package/dist/cjs/managed-paths.cjs +101 -1
- package/dist/cjs/package.json +1 -1
- package/dist/cjs/project-workspace-state.cjs +184 -5
- package/dist/cjs/project-worktrees.cjs +641 -56
- package/dist/cjs/registry-auth.cjs +310 -0
- package/dist/cjs/repository-transition-policy.cjs +49 -0
- package/dist/cjs/supervisor.cjs +62 -11
- package/dist/cjs/working-tree-mirror.cjs +191 -34
- package/dist/cjs/workspace-automatic-sync-policy.cjs +69 -0
- package/dist/cjs/workspace-branch-incarnation-policy.cjs +37 -0
- package/dist/cjs/workspace-command-sync-policy.cjs +18 -0
- package/dist/cjs/workspace-git-sync.cjs +1028 -54
- package/dist/cjs/workspace-mount-boundary.cjs +71 -0
- package/dist/cjs/workspace-path-move.cjs +195 -0
- package/dist/cjs/workspace-preserve-only-policy.cjs +36 -0
- package/dist/cjs/workspace-project-config-policy.cjs +46 -0
- package/dist/cjs/workspace-publication-evidence.cjs +46 -0
- package/dist/mjs/main.mjs +1584 -341
- package/dist/mjs/managed-paths.mjs +100 -1
- package/dist/mjs/package.json +1 -1
- package/dist/mjs/project-workspace-state.mjs +181 -5
- package/dist/mjs/project-worktrees.mjs +632 -55
- package/dist/mjs/registry-auth.mjs +269 -0
- package/dist/mjs/repository-transition-policy.mjs +22 -0
- package/dist/mjs/supervisor.mjs +61 -11
- package/dist/mjs/working-tree-mirror.mjs +190 -34
- package/dist/mjs/workspace-automatic-sync-policy.mjs +40 -0
- package/dist/mjs/workspace-branch-incarnation-policy.mjs +13 -0
- package/dist/mjs/workspace-command-sync-policy.mjs +17 -0
- package/dist/mjs/workspace-git-sync.mjs +1023 -54
- package/dist/mjs/workspace-mount-boundary.mjs +37 -0
- package/dist/mjs/workspace-path-move.mjs +160 -0
- package/dist/mjs/workspace-preserve-only-policy.mjs +11 -0
- package/dist/mjs/workspace-project-config-policy.mjs +21 -0
- package/dist/mjs/workspace-publication-evidence.mjs +21 -0
- package/dist/types/credential-authority-lock-fixture.d.ts +1 -0
- package/dist/types/main.d.ts +175 -1
- package/dist/types/managed-paths.d.ts +11 -0
- package/dist/types/project-workspace-state.d.ts +45 -1
- package/dist/types/project-worktrees.d.ts +119 -2
- package/dist/types/registry-auth.d.ts +47 -0
- package/dist/types/repository-transition-policy.d.ts +26 -0
- package/dist/types/supervisor-daemonized-fixture.d.ts +1 -0
- package/dist/types/supervisor-signal-fixture.d.ts +1 -0
- package/dist/types/supervisor.d.ts +6 -4
- package/dist/types/working-tree-mirror.d.ts +7 -0
- package/dist/types/workspace-automatic-sync-policy.d.ts +37 -0
- package/dist/types/workspace-branch-incarnation-policy.d.ts +14 -0
- package/dist/types/workspace-command-sync-policy.d.ts +9 -0
- package/dist/types/workspace-git-sync.d.ts +33 -3
- package/dist/types/workspace-mount-boundary.d.ts +10 -0
- package/dist/types/workspace-path-move.d.ts +21 -0
- package/dist/types/workspace-preserve-only-policy.d.ts +15 -0
- package/dist/types/workspace-project-config-policy.d.ts +34 -0
- package/dist/types/workspace-publication-evidence.d.ts +17 -0
- package/package.json +1 -1
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var workspace_mount_boundary_exports = {};
|
|
30
|
+
__export(workspace_mount_boundary_exports, {
|
|
31
|
+
assertManagedDirectoryPath: () => assertManagedDirectoryPath
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(workspace_mount_boundary_exports);
|
|
34
|
+
var import_node_fs = __toESM(require("node:fs"), 1);
|
|
35
|
+
var import_node_path = __toESM(require("node:path"), 1);
|
|
36
|
+
function containedRelative(root, candidate) {
|
|
37
|
+
const relative = import_node_path.default.relative(root, candidate);
|
|
38
|
+
if (!relative || relative === ".." || relative.startsWith(`..${import_node_path.default.sep}`) || import_node_path.default.isAbsolute(relative)) {
|
|
39
|
+
throw new Error(`Managed directory path escapes its trusted root: ${candidate}`);
|
|
40
|
+
}
|
|
41
|
+
return relative;
|
|
42
|
+
}
|
|
43
|
+
function assertManagedDirectoryPath(input) {
|
|
44
|
+
const trustedRoot = import_node_path.default.resolve(input.trustedRoot);
|
|
45
|
+
const candidate = import_node_path.default.resolve(input.candidate);
|
|
46
|
+
const relative = containedRelative(trustedRoot, candidate);
|
|
47
|
+
const rootStatus = import_node_fs.default.lstatSync(trustedRoot);
|
|
48
|
+
if (!rootStatus.isDirectory() || rootStatus.isSymbolicLink()) {
|
|
49
|
+
throw new Error(`${input.label} trusted root is not a regular directory: ${trustedRoot}`);
|
|
50
|
+
}
|
|
51
|
+
const realRoot = import_node_fs.default.realpathSync(trustedRoot);
|
|
52
|
+
let current = trustedRoot;
|
|
53
|
+
for (const segment of relative.split(import_node_path.default.sep)) {
|
|
54
|
+
current = import_node_path.default.join(current, segment);
|
|
55
|
+
let status;
|
|
56
|
+
try {
|
|
57
|
+
status = import_node_fs.default.lstatSync(current);
|
|
58
|
+
} catch (error) {
|
|
59
|
+
if (error.code === "ENOENT") return;
|
|
60
|
+
throw error;
|
|
61
|
+
}
|
|
62
|
+
if (!status.isDirectory() || status.isSymbolicLink()) {
|
|
63
|
+
throw new Error(`${input.label} contains a symlink or non-directory component: ${current}`);
|
|
64
|
+
}
|
|
65
|
+
containedRelative(realRoot, import_node_fs.default.realpathSync(current));
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
69
|
+
0 && (module.exports = {
|
|
70
|
+
assertManagedDirectoryPath
|
|
71
|
+
});
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var workspace_path_move_exports = {};
|
|
30
|
+
__export(workspace_path_move_exports, {
|
|
31
|
+
checkoutPathMovePublicationComplete: () => checkoutPathMovePublicationComplete,
|
|
32
|
+
preserveProjectCheckoutPathMove: () => preserveProjectCheckoutPathMove
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(workspace_path_move_exports);
|
|
35
|
+
var import_node_fs = __toESM(require("node:fs"), 1);
|
|
36
|
+
var import_node_path = __toESM(require("node:path"), 1);
|
|
37
|
+
var import_node_crypto = require("node:crypto");
|
|
38
|
+
var import_project_worktrees = require("./project-worktrees.cjs");
|
|
39
|
+
var import_managed_paths = require("./managed-paths.cjs");
|
|
40
|
+
var import_working_tree_mirror = require("./working-tree-mirror.cjs");
|
|
41
|
+
var import_workspace_mount_boundary = require("./workspace-mount-boundary.cjs");
|
|
42
|
+
function checkoutPathMovePublicationComplete(requiredMountIds, activeMountIds) {
|
|
43
|
+
return requiredMountIds.length > 0 && requiredMountIds.every((mountId) => activeMountIds.has(mountId));
|
|
44
|
+
}
|
|
45
|
+
function pathIsInside(root, candidate) {
|
|
46
|
+
const relative = import_node_path.default.relative(import_node_path.default.resolve(root), import_node_path.default.resolve(candidate));
|
|
47
|
+
return relative !== "" && relative !== ".." && !relative.startsWith(`..${import_node_path.default.sep}`) && !import_node_path.default.isAbsolute(relative);
|
|
48
|
+
}
|
|
49
|
+
function fsyncTree(targetPath) {
|
|
50
|
+
const stat = import_node_fs.default.lstatSync(targetPath);
|
|
51
|
+
if (stat.isSymbolicLink()) return;
|
|
52
|
+
if (stat.isDirectory()) {
|
|
53
|
+
for (const entry of import_node_fs.default.readdirSync(targetPath).sort()) fsyncTree(import_node_path.default.join(targetPath, entry));
|
|
54
|
+
}
|
|
55
|
+
if (!stat.isDirectory() && !stat.isFile()) return;
|
|
56
|
+
const descriptor = import_node_fs.default.openSync(targetPath, "r");
|
|
57
|
+
try {
|
|
58
|
+
import_node_fs.default.fsyncSync(descriptor);
|
|
59
|
+
} finally {
|
|
60
|
+
import_node_fs.default.closeSync(descriptor);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
function fsyncDirectory(directoryPath) {
|
|
64
|
+
const descriptor = import_node_fs.default.openSync(directoryPath, "r");
|
|
65
|
+
try {
|
|
66
|
+
import_node_fs.default.fsyncSync(descriptor);
|
|
67
|
+
} finally {
|
|
68
|
+
import_node_fs.default.closeSync(descriptor);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
function fsyncAncestorsToRoot(targetPath, durabilityRoot) {
|
|
72
|
+
const root = import_node_path.default.resolve(durabilityRoot);
|
|
73
|
+
let current = import_node_path.default.dirname(import_node_path.default.resolve(targetPath));
|
|
74
|
+
while (true) {
|
|
75
|
+
if (import_node_fs.default.existsSync(current)) {
|
|
76
|
+
const status = import_node_fs.default.lstatSync(current);
|
|
77
|
+
if (!status.isDirectory() || status.isSymbolicLink()) {
|
|
78
|
+
throw new Error(`Project checkout path move durability boundary is not a regular directory: ${current}`);
|
|
79
|
+
}
|
|
80
|
+
fsyncDirectory(current);
|
|
81
|
+
}
|
|
82
|
+
if (current === root) return;
|
|
83
|
+
const parent = import_node_path.default.dirname(current);
|
|
84
|
+
if (parent === current) throw new Error(`Project checkout path move escapes durability root ${root}`);
|
|
85
|
+
current = parent;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
function stableTree(targetPath, durabilityRoot) {
|
|
89
|
+
fsyncTree(targetPath);
|
|
90
|
+
fsyncAncestorsToRoot(targetPath, durabilityRoot);
|
|
91
|
+
}
|
|
92
|
+
function directoryEntryExists(targetPath) {
|
|
93
|
+
try {
|
|
94
|
+
import_node_fs.default.lstatSync(targetPath);
|
|
95
|
+
return true;
|
|
96
|
+
} catch (error) {
|
|
97
|
+
if (error.code === "ENOENT") return false;
|
|
98
|
+
throw error;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
function retiredCheckoutPath(projectsDurabilityRoot, oldProjectRoot) {
|
|
102
|
+
const storageRoot = import_node_path.default.join(projectsDurabilityRoot, ".r5d-retired-checkouts");
|
|
103
|
+
const digest = (0, import_node_crypto.createHash)("sha256").update(oldProjectRoot).digest("hex");
|
|
104
|
+
return { storageRoot, retiredRoot: import_node_path.default.join(storageRoot, digest) };
|
|
105
|
+
}
|
|
106
|
+
function removeRetiredCheckout(retiredRoot, storageRoot) {
|
|
107
|
+
if (!directoryEntryExists(retiredRoot)) return;
|
|
108
|
+
import_node_fs.default.rmSync(retiredRoot, { recursive: true, force: true });
|
|
109
|
+
fsyncDirectory(storageRoot);
|
|
110
|
+
}
|
|
111
|
+
function preserveProjectCheckoutPathMove(input) {
|
|
112
|
+
const oldProjectRoot = import_node_path.default.resolve(input.oldProjectRoot);
|
|
113
|
+
const newProjectRoot = import_node_path.default.resolve(input.newProjectRoot);
|
|
114
|
+
const projectsDurabilityRoot = import_node_path.default.resolve(input.projectsDurabilityRoot);
|
|
115
|
+
const outerWorkspaceRoot = import_node_path.default.resolve(input.outerWorkspaceRoot);
|
|
116
|
+
if (oldProjectRoot === newProjectRoot || pathIsInside(oldProjectRoot, newProjectRoot) || pathIsInside(newProjectRoot, oldProjectRoot)) {
|
|
117
|
+
throw new Error("Project checkout path move roots overlap");
|
|
118
|
+
}
|
|
119
|
+
const branchNames = input.branches.map(({ branchName }) => branchName);
|
|
120
|
+
if (branchNames.length === 0 || new Set(branchNames).size !== branchNames.length) {
|
|
121
|
+
throw new Error("Project checkout path move requires unique branches");
|
|
122
|
+
}
|
|
123
|
+
(0, import_workspace_mount_boundary.assertManagedDirectoryPath)({
|
|
124
|
+
trustedRoot: projectsDurabilityRoot,
|
|
125
|
+
candidate: oldProjectRoot,
|
|
126
|
+
label: "Old project checkout root"
|
|
127
|
+
});
|
|
128
|
+
(0, import_workspace_mount_boundary.assertManagedDirectoryPath)({
|
|
129
|
+
trustedRoot: projectsDurabilityRoot,
|
|
130
|
+
candidate: newProjectRoot,
|
|
131
|
+
label: "New project checkout root"
|
|
132
|
+
});
|
|
133
|
+
for (const branchName of branchNames) (0, import_managed_paths.validateManagedBranchName)(branchName);
|
|
134
|
+
if (directoryEntryExists(oldProjectRoot)) {
|
|
135
|
+
(0, import_working_tree_mirror.assertWorkingTreeHasNoPortableGitMetadataAliases)(oldProjectRoot);
|
|
136
|
+
}
|
|
137
|
+
const { storageRoot: retirementStorageRoot, retiredRoot } = retiredCheckoutPath(projectsDurabilityRoot, oldProjectRoot);
|
|
138
|
+
(0, import_workspace_mount_boundary.assertManagedDirectoryPath)({
|
|
139
|
+
trustedRoot: projectsDurabilityRoot,
|
|
140
|
+
candidate: retirementStorageRoot,
|
|
141
|
+
label: "Retired project checkout storage"
|
|
142
|
+
});
|
|
143
|
+
import_node_fs.default.mkdirSync(retirementStorageRoot, { recursive: true, mode: 448 });
|
|
144
|
+
(0, import_workspace_mount_boundary.assertManagedDirectoryPath)({
|
|
145
|
+
trustedRoot: projectsDurabilityRoot,
|
|
146
|
+
candidate: retirementStorageRoot,
|
|
147
|
+
label: "Retired project checkout storage"
|
|
148
|
+
});
|
|
149
|
+
fsyncDirectory(retirementStorageRoot);
|
|
150
|
+
fsyncDirectory(projectsDurabilityRoot);
|
|
151
|
+
(0, import_workspace_mount_boundary.assertManagedDirectoryPath)({
|
|
152
|
+
trustedRoot: projectsDurabilityRoot,
|
|
153
|
+
candidate: retiredRoot,
|
|
154
|
+
label: "Retired project checkout"
|
|
155
|
+
});
|
|
156
|
+
removeRetiredCheckout(retiredRoot, retirementStorageRoot);
|
|
157
|
+
if (!directoryEntryExists(oldProjectRoot)) return { preservedBranchNames: [] };
|
|
158
|
+
const preservedBranchNames = [];
|
|
159
|
+
for (const branch of input.branches) {
|
|
160
|
+
(0, import_managed_paths.validateManagedBranchName)(branch.branchName);
|
|
161
|
+
const oldBranchPath = import_node_path.default.join(oldProjectRoot, ...branch.branchName.split("/"));
|
|
162
|
+
if (!import_node_fs.default.existsSync(oldBranchPath)) continue;
|
|
163
|
+
const newBranchPath = import_node_path.default.join(newProjectRoot, ...branch.branchName.split("/"));
|
|
164
|
+
const outerBranchPath = import_node_path.default.resolve(outerWorkspaceRoot, ...branch.outerWorkspaceRelativePath.replace(/\\/g, "/").split("/"));
|
|
165
|
+
if (!pathIsInside(outerWorkspaceRoot, outerBranchPath)) {
|
|
166
|
+
throw new Error(`Project checkout path move escapes the outer workspace: ${branch.outerWorkspaceRelativePath}`);
|
|
167
|
+
}
|
|
168
|
+
(0, import_workspace_mount_boundary.assertManagedDirectoryPath)({ trustedRoot: projectsDurabilityRoot, candidate: oldBranchPath, label: "Old project checkout branch" });
|
|
169
|
+
(0, import_workspace_mount_boundary.assertManagedDirectoryPath)({ trustedRoot: projectsDurabilityRoot, candidate: newBranchPath, label: "New project checkout branch" });
|
|
170
|
+
(0, import_workspace_mount_boundary.assertManagedDirectoryPath)({ trustedRoot: outerWorkspaceRoot, candidate: outerBranchPath, label: "Outer workspace branch" });
|
|
171
|
+
(0, import_working_tree_mirror.mirrorWorkingTree)({ sourceRoot: oldBranchPath, targetRoot: outerBranchPath, sourceMode: "git", deletionMode: "all" });
|
|
172
|
+
(0, import_working_tree_mirror.mirrorWorkingTree)({ sourceRoot: oldBranchPath, targetRoot: newBranchPath, sourceMode: "all", deletionMode: "all" });
|
|
173
|
+
(0, import_workspace_mount_boundary.assertManagedDirectoryPath)({ trustedRoot: projectsDurabilityRoot, candidate: newBranchPath, label: "New project checkout branch" });
|
|
174
|
+
(0, import_workspace_mount_boundary.assertManagedDirectoryPath)({ trustedRoot: outerWorkspaceRoot, candidate: outerBranchPath, label: "Outer workspace branch" });
|
|
175
|
+
stableTree(outerBranchPath, outerWorkspaceRoot);
|
|
176
|
+
stableTree(newBranchPath, projectsDurabilityRoot);
|
|
177
|
+
preservedBranchNames.push(branch.branchName);
|
|
178
|
+
}
|
|
179
|
+
for (const branchName of branchNames) {
|
|
180
|
+
const checkoutPath = import_node_path.default.join(oldProjectRoot, ...branchName.split("/"));
|
|
181
|
+
if (import_node_fs.default.existsSync(checkoutPath) && (0, import_project_worktrees.projectWorktreeOperationInProgress)(checkoutPath)) {
|
|
182
|
+
throw new Error(`Project branch ${branchName} has an in-progress Git operation`);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
import_node_fs.default.renameSync(oldProjectRoot, retiredRoot);
|
|
186
|
+
fsyncAncestorsToRoot(oldProjectRoot, projectsDurabilityRoot);
|
|
187
|
+
fsyncDirectory(retirementStorageRoot);
|
|
188
|
+
removeRetiredCheckout(retiredRoot, retirementStorageRoot);
|
|
189
|
+
return { preservedBranchNames: preservedBranchNames.sort() };
|
|
190
|
+
}
|
|
191
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
192
|
+
0 && (module.exports = {
|
|
193
|
+
checkoutPathMovePublicationComplete,
|
|
194
|
+
preserveProjectCheckoutPathMove
|
|
195
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var workspace_preserve_only_policy_exports = {};
|
|
20
|
+
__export(workspace_preserve_only_policy_exports, {
|
|
21
|
+
creatorLocalProjectBranchIsAuthorized: () => creatorLocalProjectBranchIsAuthorized,
|
|
22
|
+
workerProjectBranchDisposition: () => workerProjectBranchDisposition
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(workspace_preserve_only_policy_exports);
|
|
25
|
+
function creatorLocalProjectBranchIsAuthorized(input) {
|
|
26
|
+
return Boolean(input.pendingBranchId && (!input.preserveOnlyBranchId || input.pendingBranchId === input.preserveOnlyBranchId));
|
|
27
|
+
}
|
|
28
|
+
function workerProjectBranchDisposition(input) {
|
|
29
|
+
if (input.activeConfigured) return "active";
|
|
30
|
+
return input.locallyPendingCreated ? "creator_local" : "preserve_only";
|
|
31
|
+
}
|
|
32
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
33
|
+
0 && (module.exports = {
|
|
34
|
+
creatorLocalProjectBranchIsAuthorized,
|
|
35
|
+
workerProjectBranchDisposition
|
|
36
|
+
});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var workspace_project_config_policy_exports = {};
|
|
20
|
+
__export(workspace_project_config_policy_exports, {
|
|
21
|
+
busyProjectConfigurationChangeIds: () => busyProjectConfigurationChangeIds,
|
|
22
|
+
deferredProjectConfigurationPendingBranches: () => deferredProjectConfigurationPendingBranches
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(workspace_project_config_policy_exports);
|
|
25
|
+
function deferredProjectConfigurationPendingBranches(projects) {
|
|
26
|
+
return projects.flatMap((project) => project.branches.map(({ branchName }) => ({ projectId: project.projectId, branchName }))).sort((left, right) => left.projectId.localeCompare(right.projectId) || left.branchName.localeCompare(right.branchName));
|
|
27
|
+
}
|
|
28
|
+
function busyProjectConfigurationChangeIds(input) {
|
|
29
|
+
const currentById = new Map(input.currentProjects.map((project) => [project.projectId, project]));
|
|
30
|
+
const incomingById = new Map(input.incomingProjects.map((project) => [project.projectId, project]));
|
|
31
|
+
const targets = [...input.activeTargets];
|
|
32
|
+
const busyProjectIds = targets.some((target) => target.type === "workspace" && target.rootProfile === "visible_projects") ? /* @__PURE__ */ new Set([...currentById.keys(), ...incomingById.keys()]) : new Set(targets.flatMap((target) => target.type === "project" ? [target.projectId] : []));
|
|
33
|
+
return [...busyProjectIds].filter((projectId) => {
|
|
34
|
+
const current = currentById.get(projectId);
|
|
35
|
+
const incoming = incomingById.get(projectId);
|
|
36
|
+
if (!current && !incoming) return false;
|
|
37
|
+
if (!current || !incoming) return true;
|
|
38
|
+
if (!input.currentProjectReady(current)) return true;
|
|
39
|
+
return input.currentFingerprint(current) !== input.incomingFingerprint(incoming);
|
|
40
|
+
}).sort();
|
|
41
|
+
}
|
|
42
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
43
|
+
0 && (module.exports = {
|
|
44
|
+
busyProjectConfigurationChangeIds,
|
|
45
|
+
deferredProjectConfigurationPendingBranches
|
|
46
|
+
});
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var workspace_publication_evidence_exports = {};
|
|
20
|
+
__export(workspace_publication_evidence_exports, {
|
|
21
|
+
activeProjectBranchNames: () => activeProjectBranchNames,
|
|
22
|
+
activeProjectBranchPublicationEvidence: () => activeProjectBranchPublicationEvidence
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(workspace_publication_evidence_exports);
|
|
25
|
+
function projectBranchMountId(projectId, branchName) {
|
|
26
|
+
return `project:${projectId}:${encodeURIComponent(branchName)}`;
|
|
27
|
+
}
|
|
28
|
+
function activeProjectBranchNames(projectId, branchNames, activeMountIds) {
|
|
29
|
+
const active = new Set(activeMountIds);
|
|
30
|
+
return [...branchNames].filter((branchName) => active.has(projectBranchMountId(projectId, branchName))).sort((left, right) => left.localeCompare(right));
|
|
31
|
+
}
|
|
32
|
+
function activeProjectBranchPublicationEvidence(projects, activeMountIds) {
|
|
33
|
+
const active = new Set(activeMountIds);
|
|
34
|
+
return projects.flatMap(
|
|
35
|
+
(project) => project.executionDisabled || project.mirrorWritesDisabled ? [] : project.branches.flatMap(
|
|
36
|
+
(branch) => active.has(projectBranchMountId(project.projectId, branch.branchName)) ? [{ branchId: branch.branchId, projectId: project.projectId, branchName: branch.branchName }] : []
|
|
37
|
+
)
|
|
38
|
+
).sort(
|
|
39
|
+
(left, right) => left.projectId.localeCompare(right.projectId) || left.branchName.localeCompare(right.branchName) || left.branchId.localeCompare(right.branchId)
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
43
|
+
0 && (module.exports = {
|
|
44
|
+
activeProjectBranchNames,
|
|
45
|
+
activeProjectBranchPublicationEvidence
|
|
46
|
+
});
|