canopycms-cdk 0.6.0 → 0.7.1
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 +1 -1
- package/dist/constructs/cms-distribution.d.ts +1 -1
- package/dist/constructs/cms-service.d.ts +14 -7
- package/dist/constructs/cms-service.js +51 -5
- package/dist/constructs/editor-routing.d.ts +13 -4
- package/dist/constructs/editor-routing.js +22 -11
- package/dist/constructs/worker-lifecycle.d.ts +6 -0
- package/dist/constructs/worker-lifecycle.js +6 -0
- package/package.json +4 -4
- package/worker/dist/index.js +950 -493
- package/worker/dist/index.js.sha256 +1 -1
package/worker/dist/index.js
CHANGED
|
@@ -67,54 +67,54 @@ var require_polyfills = __commonJS({
|
|
|
67
67
|
}
|
|
68
68
|
var chdir;
|
|
69
69
|
module.exports = patch;
|
|
70
|
-
function patch(
|
|
70
|
+
function patch(fs32) {
|
|
71
71
|
if (constants2.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
|
|
72
|
-
patchLchmod(
|
|
73
|
-
}
|
|
74
|
-
if (!
|
|
75
|
-
patchLutimes(
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
if (
|
|
96
|
-
|
|
72
|
+
patchLchmod(fs32);
|
|
73
|
+
}
|
|
74
|
+
if (!fs32.lutimes) {
|
|
75
|
+
patchLutimes(fs32);
|
|
76
|
+
}
|
|
77
|
+
fs32.chown = chownFix(fs32.chown);
|
|
78
|
+
fs32.fchown = chownFix(fs32.fchown);
|
|
79
|
+
fs32.lchown = chownFix(fs32.lchown);
|
|
80
|
+
fs32.chmod = chmodFix(fs32.chmod);
|
|
81
|
+
fs32.fchmod = chmodFix(fs32.fchmod);
|
|
82
|
+
fs32.lchmod = chmodFix(fs32.lchmod);
|
|
83
|
+
fs32.chownSync = chownFixSync(fs32.chownSync);
|
|
84
|
+
fs32.fchownSync = chownFixSync(fs32.fchownSync);
|
|
85
|
+
fs32.lchownSync = chownFixSync(fs32.lchownSync);
|
|
86
|
+
fs32.chmodSync = chmodFixSync(fs32.chmodSync);
|
|
87
|
+
fs32.fchmodSync = chmodFixSync(fs32.fchmodSync);
|
|
88
|
+
fs32.lchmodSync = chmodFixSync(fs32.lchmodSync);
|
|
89
|
+
fs32.stat = statFix(fs32.stat);
|
|
90
|
+
fs32.fstat = statFix(fs32.fstat);
|
|
91
|
+
fs32.lstat = statFix(fs32.lstat);
|
|
92
|
+
fs32.statSync = statFixSync(fs32.statSync);
|
|
93
|
+
fs32.fstatSync = statFixSync(fs32.fstatSync);
|
|
94
|
+
fs32.lstatSync = statFixSync(fs32.lstatSync);
|
|
95
|
+
if (fs32.chmod && !fs32.lchmod) {
|
|
96
|
+
fs32.lchmod = function(path35, mode, cb) {
|
|
97
97
|
if (cb) process.nextTick(cb);
|
|
98
98
|
};
|
|
99
|
-
|
|
99
|
+
fs32.lchmodSync = function() {
|
|
100
100
|
};
|
|
101
101
|
}
|
|
102
|
-
if (
|
|
103
|
-
|
|
102
|
+
if (fs32.chown && !fs32.lchown) {
|
|
103
|
+
fs32.lchown = function(path35, uid, gid, cb) {
|
|
104
104
|
if (cb) process.nextTick(cb);
|
|
105
105
|
};
|
|
106
|
-
|
|
106
|
+
fs32.lchownSync = function() {
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
109
|
if (platform2 === "win32") {
|
|
110
|
-
|
|
110
|
+
fs32.rename = typeof fs32.rename !== "function" ? fs32.rename : (function(fs$rename) {
|
|
111
111
|
function rename(from, to, cb) {
|
|
112
112
|
var start = Date.now();
|
|
113
113
|
var backoff = 0;
|
|
114
114
|
fs$rename(from, to, function CB(er) {
|
|
115
115
|
if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) {
|
|
116
116
|
setTimeout(function() {
|
|
117
|
-
|
|
117
|
+
fs32.stat(to, function(stater, st) {
|
|
118
118
|
if (stater && stater.code === "ENOENT")
|
|
119
119
|
fs$rename(from, to, CB);
|
|
120
120
|
else
|
|
@@ -130,9 +130,9 @@ var require_polyfills = __commonJS({
|
|
|
130
130
|
}
|
|
131
131
|
if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename);
|
|
132
132
|
return rename;
|
|
133
|
-
})(
|
|
133
|
+
})(fs32.rename);
|
|
134
134
|
}
|
|
135
|
-
|
|
135
|
+
fs32.read = typeof fs32.read !== "function" ? fs32.read : (function(fs$read) {
|
|
136
136
|
function read(fd, buffer, offset, length, position, callback_) {
|
|
137
137
|
var callback;
|
|
138
138
|
if (callback_ && typeof callback_ === "function") {
|
|
@@ -140,22 +140,22 @@ var require_polyfills = __commonJS({
|
|
|
140
140
|
callback = function(er, _3, __) {
|
|
141
141
|
if (er && er.code === "EAGAIN" && eagCounter < 10) {
|
|
142
142
|
eagCounter++;
|
|
143
|
-
return fs$read.call(
|
|
143
|
+
return fs$read.call(fs32, fd, buffer, offset, length, position, callback);
|
|
144
144
|
}
|
|
145
145
|
callback_.apply(this, arguments);
|
|
146
146
|
};
|
|
147
147
|
}
|
|
148
|
-
return fs$read.call(
|
|
148
|
+
return fs$read.call(fs32, fd, buffer, offset, length, position, callback);
|
|
149
149
|
}
|
|
150
150
|
if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read);
|
|
151
151
|
return read;
|
|
152
|
-
})(
|
|
153
|
-
|
|
152
|
+
})(fs32.read);
|
|
153
|
+
fs32.readSync = typeof fs32.readSync !== "function" ? fs32.readSync : /* @__PURE__ */ (function(fs$readSync) {
|
|
154
154
|
return function(fd, buffer, offset, length, position) {
|
|
155
155
|
var eagCounter = 0;
|
|
156
156
|
while (true) {
|
|
157
157
|
try {
|
|
158
|
-
return fs$readSync.call(
|
|
158
|
+
return fs$readSync.call(fs32, fd, buffer, offset, length, position);
|
|
159
159
|
} catch (er) {
|
|
160
160
|
if (er.code === "EAGAIN" && eagCounter < 10) {
|
|
161
161
|
eagCounter++;
|
|
@@ -165,11 +165,11 @@ var require_polyfills = __commonJS({
|
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
};
|
|
168
|
-
})(
|
|
169
|
-
function patchLchmod(
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
168
|
+
})(fs32.readSync);
|
|
169
|
+
function patchLchmod(fs33) {
|
|
170
|
+
fs33.lchmod = function(path35, mode, callback) {
|
|
171
|
+
fs33.open(
|
|
172
|
+
path35,
|
|
173
173
|
constants2.O_WRONLY | constants2.O_SYMLINK,
|
|
174
174
|
mode,
|
|
175
175
|
function(err, fd) {
|
|
@@ -177,80 +177,80 @@ var require_polyfills = __commonJS({
|
|
|
177
177
|
if (callback) callback(err);
|
|
178
178
|
return;
|
|
179
179
|
}
|
|
180
|
-
|
|
181
|
-
|
|
180
|
+
fs33.fchmod(fd, mode, function(err2) {
|
|
181
|
+
fs33.close(fd, function(err22) {
|
|
182
182
|
if (callback) callback(err2 || err22);
|
|
183
183
|
});
|
|
184
184
|
});
|
|
185
185
|
}
|
|
186
186
|
);
|
|
187
187
|
};
|
|
188
|
-
|
|
189
|
-
var fd =
|
|
188
|
+
fs33.lchmodSync = function(path35, mode) {
|
|
189
|
+
var fd = fs33.openSync(path35, constants2.O_WRONLY | constants2.O_SYMLINK, mode);
|
|
190
190
|
var threw = true;
|
|
191
191
|
var ret;
|
|
192
192
|
try {
|
|
193
|
-
ret =
|
|
193
|
+
ret = fs33.fchmodSync(fd, mode);
|
|
194
194
|
threw = false;
|
|
195
195
|
} finally {
|
|
196
196
|
if (threw) {
|
|
197
197
|
try {
|
|
198
|
-
|
|
198
|
+
fs33.closeSync(fd);
|
|
199
199
|
} catch (er) {
|
|
200
200
|
}
|
|
201
201
|
} else {
|
|
202
|
-
|
|
202
|
+
fs33.closeSync(fd);
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
return ret;
|
|
206
206
|
};
|
|
207
207
|
}
|
|
208
|
-
function patchLutimes(
|
|
209
|
-
if (constants2.hasOwnProperty("O_SYMLINK") &&
|
|
210
|
-
|
|
211
|
-
|
|
208
|
+
function patchLutimes(fs33) {
|
|
209
|
+
if (constants2.hasOwnProperty("O_SYMLINK") && fs33.futimes) {
|
|
210
|
+
fs33.lutimes = function(path35, at, mt, cb) {
|
|
211
|
+
fs33.open(path35, constants2.O_SYMLINK, function(er, fd) {
|
|
212
212
|
if (er) {
|
|
213
213
|
if (cb) cb(er);
|
|
214
214
|
return;
|
|
215
215
|
}
|
|
216
|
-
|
|
217
|
-
|
|
216
|
+
fs33.futimes(fd, at, mt, function(er2) {
|
|
217
|
+
fs33.close(fd, function(er22) {
|
|
218
218
|
if (cb) cb(er2 || er22);
|
|
219
219
|
});
|
|
220
220
|
});
|
|
221
221
|
});
|
|
222
222
|
};
|
|
223
|
-
|
|
224
|
-
var fd =
|
|
223
|
+
fs33.lutimesSync = function(path35, at, mt) {
|
|
224
|
+
var fd = fs33.openSync(path35, constants2.O_SYMLINK);
|
|
225
225
|
var ret;
|
|
226
226
|
var threw = true;
|
|
227
227
|
try {
|
|
228
|
-
ret =
|
|
228
|
+
ret = fs33.futimesSync(fd, at, mt);
|
|
229
229
|
threw = false;
|
|
230
230
|
} finally {
|
|
231
231
|
if (threw) {
|
|
232
232
|
try {
|
|
233
|
-
|
|
233
|
+
fs33.closeSync(fd);
|
|
234
234
|
} catch (er) {
|
|
235
235
|
}
|
|
236
236
|
} else {
|
|
237
|
-
|
|
237
|
+
fs33.closeSync(fd);
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
240
|
return ret;
|
|
241
241
|
};
|
|
242
|
-
} else if (
|
|
243
|
-
|
|
242
|
+
} else if (fs33.futimes) {
|
|
243
|
+
fs33.lutimes = function(_a4, _b, _c9, cb) {
|
|
244
244
|
if (cb) process.nextTick(cb);
|
|
245
245
|
};
|
|
246
|
-
|
|
246
|
+
fs33.lutimesSync = function() {
|
|
247
247
|
};
|
|
248
248
|
}
|
|
249
249
|
}
|
|
250
250
|
function chmodFix(orig) {
|
|
251
251
|
if (!orig) return orig;
|
|
252
252
|
return function(target, mode, cb) {
|
|
253
|
-
return orig.call(
|
|
253
|
+
return orig.call(fs32, target, mode, function(er) {
|
|
254
254
|
if (chownErOk(er)) er = null;
|
|
255
255
|
if (cb) cb.apply(this, arguments);
|
|
256
256
|
});
|
|
@@ -260,7 +260,7 @@ var require_polyfills = __commonJS({
|
|
|
260
260
|
if (!orig) return orig;
|
|
261
261
|
return function(target, mode) {
|
|
262
262
|
try {
|
|
263
|
-
return orig.call(
|
|
263
|
+
return orig.call(fs32, target, mode);
|
|
264
264
|
} catch (er) {
|
|
265
265
|
if (!chownErOk(er)) throw er;
|
|
266
266
|
}
|
|
@@ -269,7 +269,7 @@ var require_polyfills = __commonJS({
|
|
|
269
269
|
function chownFix(orig) {
|
|
270
270
|
if (!orig) return orig;
|
|
271
271
|
return function(target, uid, gid, cb) {
|
|
272
|
-
return orig.call(
|
|
272
|
+
return orig.call(fs32, target, uid, gid, function(er) {
|
|
273
273
|
if (chownErOk(er)) er = null;
|
|
274
274
|
if (cb) cb.apply(this, arguments);
|
|
275
275
|
});
|
|
@@ -279,7 +279,7 @@ var require_polyfills = __commonJS({
|
|
|
279
279
|
if (!orig) return orig;
|
|
280
280
|
return function(target, uid, gid) {
|
|
281
281
|
try {
|
|
282
|
-
return orig.call(
|
|
282
|
+
return orig.call(fs32, target, uid, gid);
|
|
283
283
|
} catch (er) {
|
|
284
284
|
if (!chownErOk(er)) throw er;
|
|
285
285
|
}
|
|
@@ -299,13 +299,13 @@ var require_polyfills = __commonJS({
|
|
|
299
299
|
}
|
|
300
300
|
if (cb) cb.apply(this, arguments);
|
|
301
301
|
}
|
|
302
|
-
return options ? orig.call(
|
|
302
|
+
return options ? orig.call(fs32, target, options, callback) : orig.call(fs32, target, callback);
|
|
303
303
|
};
|
|
304
304
|
}
|
|
305
305
|
function statFixSync(orig) {
|
|
306
306
|
if (!orig) return orig;
|
|
307
307
|
return function(target, options) {
|
|
308
|
-
var stats = options ? orig.call(
|
|
308
|
+
var stats = options ? orig.call(fs32, target, options) : orig.call(fs32, target);
|
|
309
309
|
if (stats) {
|
|
310
310
|
if (stats.uid < 0) stats.uid += 4294967296;
|
|
311
311
|
if (stats.gid < 0) stats.gid += 4294967296;
|
|
@@ -334,16 +334,16 @@ var require_legacy_streams = __commonJS({
|
|
|
334
334
|
"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/legacy-streams.js"(exports, module) {
|
|
335
335
|
var Stream = __require("stream").Stream;
|
|
336
336
|
module.exports = legacy;
|
|
337
|
-
function legacy(
|
|
337
|
+
function legacy(fs32) {
|
|
338
338
|
return {
|
|
339
339
|
ReadStream: ReadStream2,
|
|
340
340
|
WriteStream
|
|
341
341
|
};
|
|
342
|
-
function ReadStream2(
|
|
343
|
-
if (!(this instanceof ReadStream2)) return new ReadStream2(
|
|
342
|
+
function ReadStream2(path35, options) {
|
|
343
|
+
if (!(this instanceof ReadStream2)) return new ReadStream2(path35, options);
|
|
344
344
|
Stream.call(this);
|
|
345
345
|
var self2 = this;
|
|
346
|
-
this.path =
|
|
346
|
+
this.path = path35;
|
|
347
347
|
this.fd = null;
|
|
348
348
|
this.readable = true;
|
|
349
349
|
this.paused = false;
|
|
@@ -377,7 +377,7 @@ var require_legacy_streams = __commonJS({
|
|
|
377
377
|
});
|
|
378
378
|
return;
|
|
379
379
|
}
|
|
380
|
-
|
|
380
|
+
fs32.open(this.path, this.flags, this.mode, function(err, fd) {
|
|
381
381
|
if (err) {
|
|
382
382
|
self2.emit("error", err);
|
|
383
383
|
self2.readable = false;
|
|
@@ -388,10 +388,10 @@ var require_legacy_streams = __commonJS({
|
|
|
388
388
|
self2._read();
|
|
389
389
|
});
|
|
390
390
|
}
|
|
391
|
-
function WriteStream(
|
|
392
|
-
if (!(this instanceof WriteStream)) return new WriteStream(
|
|
391
|
+
function WriteStream(path35, options) {
|
|
392
|
+
if (!(this instanceof WriteStream)) return new WriteStream(path35, options);
|
|
393
393
|
Stream.call(this);
|
|
394
|
-
this.path =
|
|
394
|
+
this.path = path35;
|
|
395
395
|
this.fd = null;
|
|
396
396
|
this.writable = true;
|
|
397
397
|
this.flags = "w";
|
|
@@ -416,7 +416,7 @@ var require_legacy_streams = __commonJS({
|
|
|
416
416
|
this.busy = false;
|
|
417
417
|
this._queue = [];
|
|
418
418
|
if (this.fd === null) {
|
|
419
|
-
this._open =
|
|
419
|
+
this._open = fs32.open;
|
|
420
420
|
this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);
|
|
421
421
|
this.flush();
|
|
422
422
|
}
|
|
@@ -451,7 +451,7 @@ var require_clone = __commonJS({
|
|
|
451
451
|
// ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js
|
|
452
452
|
var require_graceful_fs = __commonJS({
|
|
453
453
|
"../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js"(exports, module) {
|
|
454
|
-
var
|
|
454
|
+
var fs32 = __require("fs");
|
|
455
455
|
var polyfills = require_polyfills();
|
|
456
456
|
var legacy = require_legacy_streams();
|
|
457
457
|
var clone = require_clone();
|
|
@@ -483,12 +483,12 @@ var require_graceful_fs = __commonJS({
|
|
|
483
483
|
m7 = "GFS4: " + m7.split(/\n/).join("\nGFS4: ");
|
|
484
484
|
console.error(m7);
|
|
485
485
|
};
|
|
486
|
-
if (!
|
|
486
|
+
if (!fs32[gracefulQueue]) {
|
|
487
487
|
queue = global[gracefulQueue] || [];
|
|
488
|
-
publishQueue(
|
|
489
|
-
|
|
488
|
+
publishQueue(fs32, queue);
|
|
489
|
+
fs32.close = (function(fs$close) {
|
|
490
490
|
function close(fd, cb) {
|
|
491
|
-
return fs$close.call(
|
|
491
|
+
return fs$close.call(fs32, fd, function(err) {
|
|
492
492
|
if (!err) {
|
|
493
493
|
resetQueue();
|
|
494
494
|
}
|
|
@@ -500,48 +500,48 @@ var require_graceful_fs = __commonJS({
|
|
|
500
500
|
value: fs$close
|
|
501
501
|
});
|
|
502
502
|
return close;
|
|
503
|
-
})(
|
|
504
|
-
|
|
503
|
+
})(fs32.close);
|
|
504
|
+
fs32.closeSync = (function(fs$closeSync) {
|
|
505
505
|
function closeSync(fd) {
|
|
506
|
-
fs$closeSync.apply(
|
|
506
|
+
fs$closeSync.apply(fs32, arguments);
|
|
507
507
|
resetQueue();
|
|
508
508
|
}
|
|
509
509
|
Object.defineProperty(closeSync, previousSymbol, {
|
|
510
510
|
value: fs$closeSync
|
|
511
511
|
});
|
|
512
512
|
return closeSync;
|
|
513
|
-
})(
|
|
513
|
+
})(fs32.closeSync);
|
|
514
514
|
if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
|
|
515
515
|
process.on("exit", function() {
|
|
516
|
-
debug2(
|
|
517
|
-
__require("assert").equal(
|
|
516
|
+
debug2(fs32[gracefulQueue]);
|
|
517
|
+
__require("assert").equal(fs32[gracefulQueue].length, 0);
|
|
518
518
|
});
|
|
519
519
|
}
|
|
520
520
|
}
|
|
521
521
|
var queue;
|
|
522
522
|
if (!global[gracefulQueue]) {
|
|
523
|
-
publishQueue(global,
|
|
524
|
-
}
|
|
525
|
-
module.exports = patch(clone(
|
|
526
|
-
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !
|
|
527
|
-
module.exports = patch(
|
|
528
|
-
|
|
529
|
-
}
|
|
530
|
-
function patch(
|
|
531
|
-
polyfills(
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
var fs$readFile =
|
|
536
|
-
|
|
537
|
-
function readFile3(
|
|
523
|
+
publishQueue(global, fs32[gracefulQueue]);
|
|
524
|
+
}
|
|
525
|
+
module.exports = patch(clone(fs32));
|
|
526
|
+
if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs32.__patched) {
|
|
527
|
+
module.exports = patch(fs32);
|
|
528
|
+
fs32.__patched = true;
|
|
529
|
+
}
|
|
530
|
+
function patch(fs33) {
|
|
531
|
+
polyfills(fs33);
|
|
532
|
+
fs33.gracefulify = patch;
|
|
533
|
+
fs33.createReadStream = createReadStream;
|
|
534
|
+
fs33.createWriteStream = createWriteStream;
|
|
535
|
+
var fs$readFile = fs33.readFile;
|
|
536
|
+
fs33.readFile = readFile3;
|
|
537
|
+
function readFile3(path35, options, cb) {
|
|
538
538
|
if (typeof options === "function")
|
|
539
539
|
cb = options, options = null;
|
|
540
|
-
return go$readFile(
|
|
541
|
-
function go$readFile(
|
|
542
|
-
return fs$readFile(
|
|
540
|
+
return go$readFile(path35, options, cb);
|
|
541
|
+
function go$readFile(path36, options2, cb2, startTime) {
|
|
542
|
+
return fs$readFile(path36, options2, function(err) {
|
|
543
543
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
544
|
-
enqueue([go$readFile, [
|
|
544
|
+
enqueue([go$readFile, [path36, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
545
545
|
else {
|
|
546
546
|
if (typeof cb2 === "function")
|
|
547
547
|
cb2.apply(this, arguments);
|
|
@@ -549,16 +549,16 @@ var require_graceful_fs = __commonJS({
|
|
|
549
549
|
});
|
|
550
550
|
}
|
|
551
551
|
}
|
|
552
|
-
var fs$writeFile =
|
|
553
|
-
|
|
554
|
-
function writeFile(
|
|
552
|
+
var fs$writeFile = fs33.writeFile;
|
|
553
|
+
fs33.writeFile = writeFile;
|
|
554
|
+
function writeFile(path35, data3, options, cb) {
|
|
555
555
|
if (typeof options === "function")
|
|
556
556
|
cb = options, options = null;
|
|
557
|
-
return go$writeFile(
|
|
558
|
-
function go$writeFile(
|
|
559
|
-
return fs$writeFile(
|
|
557
|
+
return go$writeFile(path35, data3, options, cb);
|
|
558
|
+
function go$writeFile(path36, data4, options2, cb2, startTime) {
|
|
559
|
+
return fs$writeFile(path36, data4, options2, function(err) {
|
|
560
560
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
561
|
-
enqueue([go$writeFile, [
|
|
561
|
+
enqueue([go$writeFile, [path36, data4, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
562
562
|
else {
|
|
563
563
|
if (typeof cb2 === "function")
|
|
564
564
|
cb2.apply(this, arguments);
|
|
@@ -566,17 +566,17 @@ var require_graceful_fs = __commonJS({
|
|
|
566
566
|
});
|
|
567
567
|
}
|
|
568
568
|
}
|
|
569
|
-
var fs$appendFile =
|
|
569
|
+
var fs$appendFile = fs33.appendFile;
|
|
570
570
|
if (fs$appendFile)
|
|
571
|
-
|
|
572
|
-
function appendFile(
|
|
571
|
+
fs33.appendFile = appendFile;
|
|
572
|
+
function appendFile(path35, data3, options, cb) {
|
|
573
573
|
if (typeof options === "function")
|
|
574
574
|
cb = options, options = null;
|
|
575
|
-
return go$appendFile(
|
|
576
|
-
function go$appendFile(
|
|
577
|
-
return fs$appendFile(
|
|
575
|
+
return go$appendFile(path35, data3, options, cb);
|
|
576
|
+
function go$appendFile(path36, data4, options2, cb2, startTime) {
|
|
577
|
+
return fs$appendFile(path36, data4, options2, function(err) {
|
|
578
578
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
579
|
-
enqueue([go$appendFile, [
|
|
579
|
+
enqueue([go$appendFile, [path36, data4, options2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
580
580
|
else {
|
|
581
581
|
if (typeof cb2 === "function")
|
|
582
582
|
cb2.apply(this, arguments);
|
|
@@ -584,9 +584,9 @@ var require_graceful_fs = __commonJS({
|
|
|
584
584
|
});
|
|
585
585
|
}
|
|
586
586
|
}
|
|
587
|
-
var fs$copyFile =
|
|
587
|
+
var fs$copyFile = fs33.copyFile;
|
|
588
588
|
if (fs$copyFile)
|
|
589
|
-
|
|
589
|
+
fs33.copyFile = copyFile;
|
|
590
590
|
function copyFile(src, dest, flags, cb) {
|
|
591
591
|
if (typeof flags === "function") {
|
|
592
592
|
cb = flags;
|
|
@@ -604,34 +604,34 @@ var require_graceful_fs = __commonJS({
|
|
|
604
604
|
});
|
|
605
605
|
}
|
|
606
606
|
}
|
|
607
|
-
var fs$readdir =
|
|
608
|
-
|
|
607
|
+
var fs$readdir = fs33.readdir;
|
|
608
|
+
fs33.readdir = readdir;
|
|
609
609
|
var noReaddirOptionVersions = /^v[0-5]\./;
|
|
610
|
-
function readdir(
|
|
610
|
+
function readdir(path35, options, cb) {
|
|
611
611
|
if (typeof options === "function")
|
|
612
612
|
cb = options, options = null;
|
|
613
|
-
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(
|
|
614
|
-
return fs$readdir(
|
|
615
|
-
|
|
613
|
+
var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path36, options2, cb2, startTime) {
|
|
614
|
+
return fs$readdir(path36, fs$readdirCallback(
|
|
615
|
+
path36,
|
|
616
616
|
options2,
|
|
617
617
|
cb2,
|
|
618
618
|
startTime
|
|
619
619
|
));
|
|
620
|
-
} : function go$readdir2(
|
|
621
|
-
return fs$readdir(
|
|
622
|
-
|
|
620
|
+
} : function go$readdir2(path36, options2, cb2, startTime) {
|
|
621
|
+
return fs$readdir(path36, options2, fs$readdirCallback(
|
|
622
|
+
path36,
|
|
623
623
|
options2,
|
|
624
624
|
cb2,
|
|
625
625
|
startTime
|
|
626
626
|
));
|
|
627
627
|
};
|
|
628
|
-
return go$readdir(
|
|
629
|
-
function fs$readdirCallback(
|
|
628
|
+
return go$readdir(path35, options, cb);
|
|
629
|
+
function fs$readdirCallback(path36, options2, cb2, startTime) {
|
|
630
630
|
return function(err, files) {
|
|
631
631
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
632
632
|
enqueue([
|
|
633
633
|
go$readdir,
|
|
634
|
-
[
|
|
634
|
+
[path36, options2, cb2],
|
|
635
635
|
err,
|
|
636
636
|
startTime || Date.now(),
|
|
637
637
|
Date.now()
|
|
@@ -646,21 +646,21 @@ var require_graceful_fs = __commonJS({
|
|
|
646
646
|
}
|
|
647
647
|
}
|
|
648
648
|
if (process.version.substr(0, 4) === "v0.8") {
|
|
649
|
-
var legStreams = legacy(
|
|
649
|
+
var legStreams = legacy(fs33);
|
|
650
650
|
ReadStream2 = legStreams.ReadStream;
|
|
651
651
|
WriteStream = legStreams.WriteStream;
|
|
652
652
|
}
|
|
653
|
-
var fs$ReadStream =
|
|
653
|
+
var fs$ReadStream = fs33.ReadStream;
|
|
654
654
|
if (fs$ReadStream) {
|
|
655
655
|
ReadStream2.prototype = Object.create(fs$ReadStream.prototype);
|
|
656
656
|
ReadStream2.prototype.open = ReadStream$open;
|
|
657
657
|
}
|
|
658
|
-
var fs$WriteStream =
|
|
658
|
+
var fs$WriteStream = fs33.WriteStream;
|
|
659
659
|
if (fs$WriteStream) {
|
|
660
660
|
WriteStream.prototype = Object.create(fs$WriteStream.prototype);
|
|
661
661
|
WriteStream.prototype.open = WriteStream$open;
|
|
662
662
|
}
|
|
663
|
-
Object.defineProperty(
|
|
663
|
+
Object.defineProperty(fs33, "ReadStream", {
|
|
664
664
|
get: function() {
|
|
665
665
|
return ReadStream2;
|
|
666
666
|
},
|
|
@@ -670,7 +670,7 @@ var require_graceful_fs = __commonJS({
|
|
|
670
670
|
enumerable: true,
|
|
671
671
|
configurable: true
|
|
672
672
|
});
|
|
673
|
-
Object.defineProperty(
|
|
673
|
+
Object.defineProperty(fs33, "WriteStream", {
|
|
674
674
|
get: function() {
|
|
675
675
|
return WriteStream;
|
|
676
676
|
},
|
|
@@ -681,7 +681,7 @@ var require_graceful_fs = __commonJS({
|
|
|
681
681
|
configurable: true
|
|
682
682
|
});
|
|
683
683
|
var FileReadStream = ReadStream2;
|
|
684
|
-
Object.defineProperty(
|
|
684
|
+
Object.defineProperty(fs33, "FileReadStream", {
|
|
685
685
|
get: function() {
|
|
686
686
|
return FileReadStream;
|
|
687
687
|
},
|
|
@@ -692,7 +692,7 @@ var require_graceful_fs = __commonJS({
|
|
|
692
692
|
configurable: true
|
|
693
693
|
});
|
|
694
694
|
var FileWriteStream = WriteStream;
|
|
695
|
-
Object.defineProperty(
|
|
695
|
+
Object.defineProperty(fs33, "FileWriteStream", {
|
|
696
696
|
get: function() {
|
|
697
697
|
return FileWriteStream;
|
|
698
698
|
},
|
|
@@ -702,7 +702,7 @@ var require_graceful_fs = __commonJS({
|
|
|
702
702
|
enumerable: true,
|
|
703
703
|
configurable: true
|
|
704
704
|
});
|
|
705
|
-
function ReadStream2(
|
|
705
|
+
function ReadStream2(path35, options) {
|
|
706
706
|
if (this instanceof ReadStream2)
|
|
707
707
|
return fs$ReadStream.apply(this, arguments), this;
|
|
708
708
|
else
|
|
@@ -722,7 +722,7 @@ var require_graceful_fs = __commonJS({
|
|
|
722
722
|
}
|
|
723
723
|
});
|
|
724
724
|
}
|
|
725
|
-
function WriteStream(
|
|
725
|
+
function WriteStream(path35, options) {
|
|
726
726
|
if (this instanceof WriteStream)
|
|
727
727
|
return fs$WriteStream.apply(this, arguments), this;
|
|
728
728
|
else
|
|
@@ -740,22 +740,22 @@ var require_graceful_fs = __commonJS({
|
|
|
740
740
|
}
|
|
741
741
|
});
|
|
742
742
|
}
|
|
743
|
-
function createReadStream(
|
|
744
|
-
return new
|
|
743
|
+
function createReadStream(path35, options) {
|
|
744
|
+
return new fs33.ReadStream(path35, options);
|
|
745
745
|
}
|
|
746
|
-
function createWriteStream(
|
|
747
|
-
return new
|
|
746
|
+
function createWriteStream(path35, options) {
|
|
747
|
+
return new fs33.WriteStream(path35, options);
|
|
748
748
|
}
|
|
749
|
-
var fs$open =
|
|
750
|
-
|
|
751
|
-
function open(
|
|
749
|
+
var fs$open = fs33.open;
|
|
750
|
+
fs33.open = open;
|
|
751
|
+
function open(path35, flags, mode, cb) {
|
|
752
752
|
if (typeof mode === "function")
|
|
753
753
|
cb = mode, mode = null;
|
|
754
|
-
return go$open(
|
|
755
|
-
function go$open(
|
|
756
|
-
return fs$open(
|
|
754
|
+
return go$open(path35, flags, mode, cb);
|
|
755
|
+
function go$open(path36, flags2, mode2, cb2, startTime) {
|
|
756
|
+
return fs$open(path36, flags2, mode2, function(err, fd) {
|
|
757
757
|
if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
|
|
758
|
-
enqueue([go$open, [
|
|
758
|
+
enqueue([go$open, [path36, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
|
|
759
759
|
else {
|
|
760
760
|
if (typeof cb2 === "function")
|
|
761
761
|
cb2.apply(this, arguments);
|
|
@@ -763,20 +763,20 @@ var require_graceful_fs = __commonJS({
|
|
|
763
763
|
});
|
|
764
764
|
}
|
|
765
765
|
}
|
|
766
|
-
return
|
|
766
|
+
return fs33;
|
|
767
767
|
}
|
|
768
768
|
function enqueue(elem) {
|
|
769
769
|
debug2("ENQUEUE", elem[0].name, elem[1]);
|
|
770
|
-
|
|
770
|
+
fs32[gracefulQueue].push(elem);
|
|
771
771
|
retry2();
|
|
772
772
|
}
|
|
773
773
|
var retryTimer;
|
|
774
774
|
function resetQueue() {
|
|
775
775
|
var now = Date.now();
|
|
776
|
-
for (var i10 = 0; i10 <
|
|
777
|
-
if (
|
|
778
|
-
|
|
779
|
-
|
|
776
|
+
for (var i10 = 0; i10 < fs32[gracefulQueue].length; ++i10) {
|
|
777
|
+
if (fs32[gracefulQueue][i10].length > 2) {
|
|
778
|
+
fs32[gracefulQueue][i10][3] = now;
|
|
779
|
+
fs32[gracefulQueue][i10][4] = now;
|
|
780
780
|
}
|
|
781
781
|
}
|
|
782
782
|
retry2();
|
|
@@ -784,9 +784,9 @@ var require_graceful_fs = __commonJS({
|
|
|
784
784
|
function retry2() {
|
|
785
785
|
clearTimeout(retryTimer);
|
|
786
786
|
retryTimer = void 0;
|
|
787
|
-
if (
|
|
787
|
+
if (fs32[gracefulQueue].length === 0)
|
|
788
788
|
return;
|
|
789
|
-
var elem =
|
|
789
|
+
var elem = fs32[gracefulQueue].shift();
|
|
790
790
|
var fn = elem[0];
|
|
791
791
|
var args = elem[1];
|
|
792
792
|
var err = elem[2];
|
|
@@ -808,7 +808,7 @@ var require_graceful_fs = __commonJS({
|
|
|
808
808
|
debug2("RETRY", fn.name, args);
|
|
809
809
|
fn.apply(null, args.concat([startTime]));
|
|
810
810
|
} else {
|
|
811
|
-
|
|
811
|
+
fs32[gracefulQueue].push(elem);
|
|
812
812
|
}
|
|
813
813
|
}
|
|
814
814
|
if (retryTimer === void 0) {
|
|
@@ -1243,10 +1243,10 @@ var require_mtime_precision = __commonJS({
|
|
|
1243
1243
|
"../../node_modules/.pnpm/proper-lockfile@4.1.2/node_modules/proper-lockfile/lib/mtime-precision.js"(exports, module) {
|
|
1244
1244
|
"use strict";
|
|
1245
1245
|
var cacheSymbol = Symbol();
|
|
1246
|
-
function probe(file,
|
|
1247
|
-
const cachedPrecision =
|
|
1246
|
+
function probe(file, fs32, callback) {
|
|
1247
|
+
const cachedPrecision = fs32[cacheSymbol];
|
|
1248
1248
|
if (cachedPrecision) {
|
|
1249
|
-
return
|
|
1249
|
+
return fs32.stat(file, (err, stat) => {
|
|
1250
1250
|
if (err) {
|
|
1251
1251
|
return callback(err);
|
|
1252
1252
|
}
|
|
@@ -1254,16 +1254,16 @@ var require_mtime_precision = __commonJS({
|
|
|
1254
1254
|
});
|
|
1255
1255
|
}
|
|
1256
1256
|
const mtime = new Date(Math.ceil(Date.now() / 1e3) * 1e3 + 5);
|
|
1257
|
-
|
|
1257
|
+
fs32.utimes(file, mtime, mtime, (err) => {
|
|
1258
1258
|
if (err) {
|
|
1259
1259
|
return callback(err);
|
|
1260
1260
|
}
|
|
1261
|
-
|
|
1261
|
+
fs32.stat(file, (err2, stat) => {
|
|
1262
1262
|
if (err2) {
|
|
1263
1263
|
return callback(err2);
|
|
1264
1264
|
}
|
|
1265
1265
|
const precision = stat.mtime.getTime() % 1e3 === 0 ? "s" : "ms";
|
|
1266
|
-
Object.defineProperty(
|
|
1266
|
+
Object.defineProperty(fs32, cacheSymbol, { value: precision });
|
|
1267
1267
|
callback(null, stat.mtime, precision);
|
|
1268
1268
|
});
|
|
1269
1269
|
});
|
|
@@ -1284,8 +1284,8 @@ var require_mtime_precision = __commonJS({
|
|
|
1284
1284
|
var require_lockfile = __commonJS({
|
|
1285
1285
|
"../../node_modules/.pnpm/proper-lockfile@4.1.2/node_modules/proper-lockfile/lib/lockfile.js"(exports, module) {
|
|
1286
1286
|
"use strict";
|
|
1287
|
-
var
|
|
1288
|
-
var
|
|
1287
|
+
var path35 = __require("path");
|
|
1288
|
+
var fs32 = require_graceful_fs();
|
|
1289
1289
|
var retry2 = require_retry2();
|
|
1290
1290
|
var onExit = require_signal_exit();
|
|
1291
1291
|
var mtimePrecision = require_mtime_precision();
|
|
@@ -1295,7 +1295,7 @@ var require_lockfile = __commonJS({
|
|
|
1295
1295
|
}
|
|
1296
1296
|
function resolveCanonicalPath(file, options, callback) {
|
|
1297
1297
|
if (!options.realpath) {
|
|
1298
|
-
return callback(null,
|
|
1298
|
+
return callback(null, path35.resolve(file));
|
|
1299
1299
|
}
|
|
1300
1300
|
options.fs.realpath(file, callback);
|
|
1301
1301
|
}
|
|
@@ -1416,7 +1416,7 @@ var require_lockfile = __commonJS({
|
|
|
1416
1416
|
update: null,
|
|
1417
1417
|
realpath: true,
|
|
1418
1418
|
retries: 0,
|
|
1419
|
-
fs:
|
|
1419
|
+
fs: fs32,
|
|
1420
1420
|
onCompromised: (err) => {
|
|
1421
1421
|
throw err;
|
|
1422
1422
|
},
|
|
@@ -1460,7 +1460,7 @@ var require_lockfile = __commonJS({
|
|
|
1460
1460
|
}
|
|
1461
1461
|
function unlock(file, options, callback) {
|
|
1462
1462
|
options = {
|
|
1463
|
-
fs:
|
|
1463
|
+
fs: fs32,
|
|
1464
1464
|
realpath: true,
|
|
1465
1465
|
...options
|
|
1466
1466
|
};
|
|
@@ -1482,7 +1482,7 @@ var require_lockfile = __commonJS({
|
|
|
1482
1482
|
options = {
|
|
1483
1483
|
stale: 1e4,
|
|
1484
1484
|
realpath: true,
|
|
1485
|
-
fs:
|
|
1485
|
+
fs: fs32,
|
|
1486
1486
|
...options
|
|
1487
1487
|
};
|
|
1488
1488
|
options.stale = Math.max(options.stale || 0, 2e3);
|
|
@@ -1521,16 +1521,16 @@ var require_lockfile = __commonJS({
|
|
|
1521
1521
|
var require_adapter = __commonJS({
|
|
1522
1522
|
"../../node_modules/.pnpm/proper-lockfile@4.1.2/node_modules/proper-lockfile/lib/adapter.js"(exports, module) {
|
|
1523
1523
|
"use strict";
|
|
1524
|
-
var
|
|
1525
|
-
function createSyncFs(
|
|
1524
|
+
var fs32 = require_graceful_fs();
|
|
1525
|
+
function createSyncFs(fs33) {
|
|
1526
1526
|
const methods = ["mkdir", "realpath", "stat", "rmdir", "utimes"];
|
|
1527
|
-
const newFs = { ...
|
|
1527
|
+
const newFs = { ...fs33 };
|
|
1528
1528
|
methods.forEach((method) => {
|
|
1529
1529
|
newFs[method] = (...args) => {
|
|
1530
1530
|
const callback = args.pop();
|
|
1531
1531
|
let ret;
|
|
1532
1532
|
try {
|
|
1533
|
-
ret =
|
|
1533
|
+
ret = fs33[`${method}Sync`](...args);
|
|
1534
1534
|
} catch (err) {
|
|
1535
1535
|
return callback(err);
|
|
1536
1536
|
}
|
|
@@ -1568,7 +1568,7 @@ var require_adapter = __commonJS({
|
|
|
1568
1568
|
}
|
|
1569
1569
|
function toSyncOptions(options) {
|
|
1570
1570
|
options = { ...options };
|
|
1571
|
-
options.fs = createSyncFs(options.fs ||
|
|
1571
|
+
options.fs = createSyncFs(options.fs || fs32);
|
|
1572
1572
|
if (typeof options.retries === "number" && options.retries > 0 || options.retries && typeof options.retries.retries === "number" && options.retries.retries > 0) {
|
|
1573
1573
|
throw Object.assign(new Error("Cannot use retries with the sync api"), { code: "ESYNC" });
|
|
1574
1574
|
}
|
|
@@ -2530,10 +2530,10 @@ var require_src2 = __commonJS({
|
|
|
2530
2530
|
var fs_1 = __require("fs");
|
|
2531
2531
|
var debug_1 = __importDefault2(require_src());
|
|
2532
2532
|
var log6 = debug_1.default("@kwsites/file-exists");
|
|
2533
|
-
function check(
|
|
2534
|
-
log6(`checking %s`,
|
|
2533
|
+
function check(path35, isFile, isDirectory) {
|
|
2534
|
+
log6(`checking %s`, path35);
|
|
2535
2535
|
try {
|
|
2536
|
-
const stat = fs_1.statSync(
|
|
2536
|
+
const stat = fs_1.statSync(path35);
|
|
2537
2537
|
if (stat.isFile() && isFile) {
|
|
2538
2538
|
log6(`[OK] path represents a file`);
|
|
2539
2539
|
return true;
|
|
@@ -2553,8 +2553,8 @@ var require_src2 = __commonJS({
|
|
|
2553
2553
|
throw e9;
|
|
2554
2554
|
}
|
|
2555
2555
|
}
|
|
2556
|
-
function exists3(
|
|
2557
|
-
return check(
|
|
2556
|
+
function exists3(path35, type = exports.READABLE) {
|
|
2557
|
+
return check(path35, (type & exports.FILE) > 0, (type & exports.FOLDER) > 0);
|
|
2558
2558
|
}
|
|
2559
2559
|
exports.exists = exists3;
|
|
2560
2560
|
exports.FILE = 1;
|
|
@@ -3029,8 +3029,8 @@ var init_parseUtil = __esm({
|
|
|
3029
3029
|
init_errors();
|
|
3030
3030
|
init_en();
|
|
3031
3031
|
makeIssue = (params) => {
|
|
3032
|
-
const { data: data3, path:
|
|
3033
|
-
const fullPath = [...
|
|
3032
|
+
const { data: data3, path: path35, errorMaps, issueData } = params;
|
|
3033
|
+
const fullPath = [...path35, ...issueData.path || []];
|
|
3034
3034
|
const fullIssue = {
|
|
3035
3035
|
...issueData,
|
|
3036
3036
|
path: fullPath
|
|
@@ -3338,11 +3338,11 @@ var init_types = __esm({
|
|
|
3338
3338
|
init_parseUtil();
|
|
3339
3339
|
init_util2();
|
|
3340
3340
|
ParseInputLazyPath = class {
|
|
3341
|
-
constructor(parent, value,
|
|
3341
|
+
constructor(parent, value, path35, key) {
|
|
3342
3342
|
this._cachedPath = [];
|
|
3343
3343
|
this.parent = parent;
|
|
3344
3344
|
this.data = value;
|
|
3345
|
-
this._path =
|
|
3345
|
+
this._path = path35;
|
|
3346
3346
|
this._key = key;
|
|
3347
3347
|
}
|
|
3348
3348
|
get path() {
|
|
@@ -7004,8 +7004,8 @@ var require_dist3 = __commonJS({
|
|
|
7004
7004
|
});
|
|
7005
7005
|
|
|
7006
7006
|
// ../canopycms/src/paths/normalize.ts
|
|
7007
|
-
function normalizeFilesystemPath(
|
|
7008
|
-
return
|
|
7007
|
+
function normalizeFilesystemPath(path35) {
|
|
7008
|
+
return path35.split(/[\\/]+/).filter(Boolean).join("/");
|
|
7009
7009
|
}
|
|
7010
7010
|
var init_normalize = __esm({
|
|
7011
7011
|
"../canopycms/src/paths/normalize.ts"() {
|
|
@@ -8258,15 +8258,15 @@ var require_dist_node9 = __commonJS({
|
|
|
8258
8258
|
octokit.log.debug("request", options);
|
|
8259
8259
|
const start = Date.now();
|
|
8260
8260
|
const requestOptions = octokit.request.endpoint.parse(options);
|
|
8261
|
-
const
|
|
8261
|
+
const path35 = requestOptions.url.replace(options.baseUrl, "");
|
|
8262
8262
|
return request(options).then((response) => {
|
|
8263
8263
|
octokit.log.info(
|
|
8264
|
-
`${requestOptions.method} ${
|
|
8264
|
+
`${requestOptions.method} ${path35} - ${response.status} in ${Date.now() - start}ms`
|
|
8265
8265
|
);
|
|
8266
8266
|
return response;
|
|
8267
8267
|
}).catch((error3) => {
|
|
8268
8268
|
octokit.log.info(
|
|
8269
|
-
`${requestOptions.method} ${
|
|
8269
|
+
`${requestOptions.method} ${path35} - ${error3.status} in ${Date.now() - start}ms`
|
|
8270
8270
|
);
|
|
8271
8271
|
throw error3;
|
|
8272
8272
|
});
|
|
@@ -12360,7 +12360,7 @@ var require_dist_node13 = __commonJS({
|
|
|
12360
12360
|
];
|
|
12361
12361
|
function routeMatcher(paths) {
|
|
12362
12362
|
const regexes = paths.map(
|
|
12363
|
-
(
|
|
12363
|
+
(path35) => path35.split("/").map((c11) => c11.startsWith("{") ? "(?:.+?)" : c11).join("/")
|
|
12364
12364
|
);
|
|
12365
12365
|
const regex2 = `^(?:${regexes.map((r10) => `(?:${r10})`).join("|")})[^/]*$`;
|
|
12366
12366
|
return new RegExp(regex2, "i");
|
|
@@ -13375,9 +13375,9 @@ var init_createPaginator = __esm({
|
|
|
13375
13375
|
command5 = withCommand(command5) ?? command5;
|
|
13376
13376
|
return await client.send(command5, ...args);
|
|
13377
13377
|
};
|
|
13378
|
-
get = (fromObject,
|
|
13378
|
+
get = (fromObject, path35) => {
|
|
13379
13379
|
let cursor3 = fromObject;
|
|
13380
|
-
const pathComponents =
|
|
13380
|
+
const pathComponents = path35.split(".");
|
|
13381
13381
|
for (const step of pathComponents) {
|
|
13382
13382
|
if (!cursor3 || typeof cursor3 !== "object") {
|
|
13383
13383
|
return void 0;
|
|
@@ -14395,12 +14395,12 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
|
|
|
14395
14395
|
const password = request.password ?? "";
|
|
14396
14396
|
auth = `${username}:${password}`;
|
|
14397
14397
|
}
|
|
14398
|
-
let
|
|
14398
|
+
let path35 = request.path;
|
|
14399
14399
|
if (queryString) {
|
|
14400
|
-
|
|
14400
|
+
path35 += `?${queryString}`;
|
|
14401
14401
|
}
|
|
14402
14402
|
if (request.fragment) {
|
|
14403
|
-
|
|
14403
|
+
path35 += `#${request.fragment}`;
|
|
14404
14404
|
}
|
|
14405
14405
|
let hostname = request.hostname ?? "";
|
|
14406
14406
|
if (hostname[0] === "[" && hostname.endsWith("]")) {
|
|
@@ -14412,7 +14412,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
|
|
|
14412
14412
|
headers: request.headers,
|
|
14413
14413
|
host: hostname,
|
|
14414
14414
|
method: request.method,
|
|
14415
|
-
path:
|
|
14415
|
+
path: path35,
|
|
14416
14416
|
port: request.port,
|
|
14417
14417
|
agent,
|
|
14418
14418
|
auth
|
|
@@ -14695,16 +14695,16 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
|
|
|
14695
14695
|
reject(err);
|
|
14696
14696
|
};
|
|
14697
14697
|
const queryString = querystringBuilder.buildQueryString(query || {});
|
|
14698
|
-
let
|
|
14698
|
+
let path35 = request.path;
|
|
14699
14699
|
if (queryString) {
|
|
14700
|
-
|
|
14700
|
+
path35 += `?${queryString}`;
|
|
14701
14701
|
}
|
|
14702
14702
|
if (request.fragment) {
|
|
14703
|
-
|
|
14703
|
+
path35 += `#${request.fragment}`;
|
|
14704
14704
|
}
|
|
14705
14705
|
const req = session.request({
|
|
14706
14706
|
...request.headers,
|
|
14707
|
-
[http2.constants.HTTP2_HEADER_PATH]:
|
|
14707
|
+
[http2.constants.HTTP2_HEADER_PATH]: path35,
|
|
14708
14708
|
[http2.constants.HTTP2_HEADER_METHOD]: method
|
|
14709
14709
|
});
|
|
14710
14710
|
session.ref();
|
|
@@ -14891,13 +14891,13 @@ var require_dist_cjs14 = __commonJS({
|
|
|
14891
14891
|
const abortError = buildAbortError(abortSignal);
|
|
14892
14892
|
return Promise.reject(abortError);
|
|
14893
14893
|
}
|
|
14894
|
-
let
|
|
14894
|
+
let path35 = request.path;
|
|
14895
14895
|
const queryString = querystringBuilder.buildQueryString(request.query || {});
|
|
14896
14896
|
if (queryString) {
|
|
14897
|
-
|
|
14897
|
+
path35 += `?${queryString}`;
|
|
14898
14898
|
}
|
|
14899
14899
|
if (request.fragment) {
|
|
14900
|
-
|
|
14900
|
+
path35 += `#${request.fragment}`;
|
|
14901
14901
|
}
|
|
14902
14902
|
let auth = "";
|
|
14903
14903
|
if (request.username != null || request.password != null) {
|
|
@@ -14906,7 +14906,7 @@ var require_dist_cjs14 = __commonJS({
|
|
|
14906
14906
|
auth = `${username}:${password}@`;
|
|
14907
14907
|
}
|
|
14908
14908
|
const { port, method } = request;
|
|
14909
|
-
const url = `${request.protocol}//${auth}${request.hostname}${port ? `:${port}` : ""}${
|
|
14909
|
+
const url = `${request.protocol}//${auth}${request.hostname}${port ? `:${port}` : ""}${path35}`;
|
|
14910
14910
|
const body = method === "GET" || method === "HEAD" ? void 0 : request.body;
|
|
14911
14911
|
const requestOptions = {
|
|
14912
14912
|
body,
|
|
@@ -17138,13 +17138,13 @@ function __disposeResources(env2) {
|
|
|
17138
17138
|
}
|
|
17139
17139
|
return next();
|
|
17140
17140
|
}
|
|
17141
|
-
function __rewriteRelativeImportExtension(
|
|
17142
|
-
if (typeof
|
|
17143
|
-
return
|
|
17141
|
+
function __rewriteRelativeImportExtension(path35, preserveJsx) {
|
|
17142
|
+
if (typeof path35 === "string" && /^\.\.?\//.test(path35)) {
|
|
17143
|
+
return path35.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m7, tsx, d9, ext, cm) {
|
|
17144
17144
|
return tsx ? preserveJsx ? ".jsx" : ".js" : d9 && (!ext || !cm) ? m7 : d9 + ext + "." + cm.toLowerCase() + "js";
|
|
17145
17145
|
});
|
|
17146
17146
|
}
|
|
17147
|
-
return
|
|
17147
|
+
return path35;
|
|
17148
17148
|
}
|
|
17149
17149
|
var extendStatics, __assign, __createBinding, __setModuleDefault, ownKeys, _SuppressedError, tslib_es6_default;
|
|
17150
17150
|
var init_tslib_es6 = __esm({
|
|
@@ -17250,11 +17250,11 @@ var require_randomUUID = __commonJS({
|
|
|
17250
17250
|
var require_dist_cjs19 = __commonJS({
|
|
17251
17251
|
"../../node_modules/.pnpm/@smithy+uuid@1.1.2/node_modules/@smithy/uuid/dist-cjs/index.js"(exports) {
|
|
17252
17252
|
"use strict";
|
|
17253
|
-
var
|
|
17253
|
+
var randomUUID4 = require_randomUUID();
|
|
17254
17254
|
var decimalToHex2 = Array.from({ length: 256 }, (_3, i10) => i10.toString(16).padStart(2, "0"));
|
|
17255
17255
|
var v43 = () => {
|
|
17256
|
-
if (
|
|
17257
|
-
return
|
|
17256
|
+
if (randomUUID4.randomUUID) {
|
|
17257
|
+
return randomUUID4.randomUUID();
|
|
17258
17258
|
}
|
|
17259
17259
|
const rnds = new Uint8Array(16);
|
|
17260
17260
|
crypto.getRandomValues(rnds);
|
|
@@ -18042,11 +18042,11 @@ var init_HttpBindingProtocol = __esm({
|
|
|
18042
18042
|
const opTraits = translateTraits(operationSchema.traits);
|
|
18043
18043
|
if (opTraits.http) {
|
|
18044
18044
|
request.method = opTraits.http[0];
|
|
18045
|
-
const [
|
|
18045
|
+
const [path35, search] = opTraits.http[1].split("?");
|
|
18046
18046
|
if (request.path == "/") {
|
|
18047
|
-
request.path =
|
|
18047
|
+
request.path = path35;
|
|
18048
18048
|
} else {
|
|
18049
|
-
request.path +=
|
|
18049
|
+
request.path += path35;
|
|
18050
18050
|
}
|
|
18051
18051
|
const traitSearchParams = new URLSearchParams(search ?? "");
|
|
18052
18052
|
Object.assign(query, Object.fromEntries(traitSearchParams));
|
|
@@ -18449,8 +18449,8 @@ var init_requestBuilder = __esm({
|
|
|
18449
18449
|
return this;
|
|
18450
18450
|
}
|
|
18451
18451
|
p(memberName, labelValueProvider, uriLabel, isGreedyLabel) {
|
|
18452
|
-
this.resolvePathStack.push((
|
|
18453
|
-
this.path = resolvedPath(
|
|
18452
|
+
this.resolvePathStack.push((path35) => {
|
|
18453
|
+
this.path = resolvedPath(path35, this.input, memberName, labelValueProvider, uriLabel, isGreedyLabel);
|
|
18454
18454
|
});
|
|
18455
18455
|
return this;
|
|
18456
18456
|
}
|
|
@@ -19100,18 +19100,18 @@ var require_dist_cjs20 = __commonJS({
|
|
|
19100
19100
|
}
|
|
19101
19101
|
};
|
|
19102
19102
|
var booleanEquals2 = (value1, value2) => value1 === value2;
|
|
19103
|
-
var getAttrPathList2 = (
|
|
19104
|
-
const parts =
|
|
19103
|
+
var getAttrPathList2 = (path35) => {
|
|
19104
|
+
const parts = path35.split(".");
|
|
19105
19105
|
const pathList = [];
|
|
19106
19106
|
for (const part of parts) {
|
|
19107
19107
|
const squareBracketIndex = part.indexOf("[");
|
|
19108
19108
|
if (squareBracketIndex !== -1) {
|
|
19109
19109
|
if (part.indexOf("]") !== part.length - 1) {
|
|
19110
|
-
throw new EndpointError2(`Path: '${
|
|
19110
|
+
throw new EndpointError2(`Path: '${path35}' does not end with ']'`);
|
|
19111
19111
|
}
|
|
19112
19112
|
const arrayIndex = part.slice(squareBracketIndex + 1, -1);
|
|
19113
19113
|
if (Number.isNaN(parseInt(arrayIndex))) {
|
|
19114
|
-
throw new EndpointError2(`Invalid array index: '${arrayIndex}' in path: '${
|
|
19114
|
+
throw new EndpointError2(`Invalid array index: '${arrayIndex}' in path: '${path35}'`);
|
|
19115
19115
|
}
|
|
19116
19116
|
if (squareBracketIndex !== 0) {
|
|
19117
19117
|
pathList.push(part.slice(0, squareBracketIndex));
|
|
@@ -19123,9 +19123,9 @@ var require_dist_cjs20 = __commonJS({
|
|
|
19123
19123
|
}
|
|
19124
19124
|
return pathList;
|
|
19125
19125
|
};
|
|
19126
|
-
var getAttr2 = (value,
|
|
19126
|
+
var getAttr2 = (value, path35) => getAttrPathList2(path35).reduce((acc, index) => {
|
|
19127
19127
|
if (typeof acc !== "object") {
|
|
19128
|
-
throw new EndpointError2(`Index '${index}' in '${
|
|
19128
|
+
throw new EndpointError2(`Index '${index}' in '${path35}' not found in '${JSON.stringify(value)}'`);
|
|
19129
19129
|
} else if (Array.isArray(acc)) {
|
|
19130
19130
|
return acc[parseInt(index)];
|
|
19131
19131
|
}
|
|
@@ -19144,8 +19144,8 @@ var require_dist_cjs20 = __commonJS({
|
|
|
19144
19144
|
return value;
|
|
19145
19145
|
}
|
|
19146
19146
|
if (typeof value === "object" && "hostname" in value) {
|
|
19147
|
-
const { hostname: hostname2, port, protocol: protocol2 = "", path:
|
|
19148
|
-
const url = new URL(`${protocol2}//${hostname2}${port ? `:${port}` : ""}${
|
|
19147
|
+
const { hostname: hostname2, port, protocol: protocol2 = "", path: path35 = "", query = {} } = value;
|
|
19148
|
+
const url = new URL(`${protocol2}//${hostname2}${port ? `:${port}` : ""}${path35}`);
|
|
19149
19149
|
url.search = Object.entries(query).map(([k10, v5]) => `${k10}=${v5}`).join("&");
|
|
19150
19150
|
return url;
|
|
19151
19151
|
}
|
|
@@ -20590,10 +20590,10 @@ ${longDate}
|
|
|
20590
20590
|
${credentialScope}
|
|
20591
20591
|
${utilHexEncoding.toHex(hashedRequest)}`;
|
|
20592
20592
|
}
|
|
20593
|
-
getCanonicalPath({ path:
|
|
20593
|
+
getCanonicalPath({ path: path35 }) {
|
|
20594
20594
|
if (this.uriEscapePath) {
|
|
20595
20595
|
const normalizedPathSegments = [];
|
|
20596
|
-
for (const pathSegment of
|
|
20596
|
+
for (const pathSegment of path35.split("/")) {
|
|
20597
20597
|
if (pathSegment?.length === 0)
|
|
20598
20598
|
continue;
|
|
20599
20599
|
if (pathSegment === ".")
|
|
@@ -20604,11 +20604,11 @@ ${utilHexEncoding.toHex(hashedRequest)}`;
|
|
|
20604
20604
|
normalizedPathSegments.push(pathSegment);
|
|
20605
20605
|
}
|
|
20606
20606
|
}
|
|
20607
|
-
const normalizedPath = `${
|
|
20607
|
+
const normalizedPath = `${path35?.startsWith("/") ? "/" : ""}${normalizedPathSegments.join("/")}${normalizedPathSegments.length > 0 && path35?.endsWith("/") ? "/" : ""}`;
|
|
20608
20608
|
const doubleEncoded = utilUriEscape.escapeUri(normalizedPath);
|
|
20609
20609
|
return doubleEncoded.replace(/%2F/g, "/");
|
|
20610
20610
|
}
|
|
20611
|
-
return
|
|
20611
|
+
return path35;
|
|
20612
20612
|
}
|
|
20613
20613
|
validateResolvedCredentials(credentials) {
|
|
20614
20614
|
if (typeof credentials !== "object" || typeof credentials.accessKeyId !== "string" || typeof credentials.secretAccessKey !== "string") {
|
|
@@ -21912,11 +21912,11 @@ var init_SmithyRpcV2CborProtocol = __esm({
|
|
|
21912
21912
|
}
|
|
21913
21913
|
}
|
|
21914
21914
|
const { service, operation: operation3 } = (0, import_util_middleware5.getSmithyContext)(context);
|
|
21915
|
-
const
|
|
21915
|
+
const path35 = `/service/${service}/operation/${operation3}`;
|
|
21916
21916
|
if (request.path.endsWith("/")) {
|
|
21917
|
-
request.path +=
|
|
21917
|
+
request.path += path35.slice(1);
|
|
21918
21918
|
} else {
|
|
21919
|
-
request.path +=
|
|
21919
|
+
request.path += path35;
|
|
21920
21920
|
}
|
|
21921
21921
|
return request;
|
|
21922
21922
|
}
|
|
@@ -27561,14 +27561,14 @@ var require_readFile = __commonJS({
|
|
|
27561
27561
|
var promises_1 = __require("node:fs/promises");
|
|
27562
27562
|
exports.filePromises = {};
|
|
27563
27563
|
exports.fileIntercept = {};
|
|
27564
|
-
var readFile3 = (
|
|
27565
|
-
if (exports.fileIntercept[
|
|
27566
|
-
return exports.fileIntercept[
|
|
27564
|
+
var readFile3 = (path35, options) => {
|
|
27565
|
+
if (exports.fileIntercept[path35] !== void 0) {
|
|
27566
|
+
return exports.fileIntercept[path35];
|
|
27567
27567
|
}
|
|
27568
|
-
if (!exports.filePromises[
|
|
27569
|
-
exports.filePromises[
|
|
27568
|
+
if (!exports.filePromises[path35] || options?.ignoreCache) {
|
|
27569
|
+
exports.filePromises[path35] = (0, promises_1.readFile)(path35, "utf8");
|
|
27570
27570
|
}
|
|
27571
|
-
return exports.filePromises[
|
|
27571
|
+
return exports.filePromises[path35];
|
|
27572
27572
|
};
|
|
27573
27573
|
exports.readFile = readFile3;
|
|
27574
27574
|
}
|
|
@@ -27581,7 +27581,7 @@ var require_dist_cjs33 = __commonJS({
|
|
|
27581
27581
|
var getHomeDir2 = require_getHomeDir();
|
|
27582
27582
|
var getSSOTokenFilepath2 = require_getSSOTokenFilepath();
|
|
27583
27583
|
var getSSOTokenFromFile2 = require_getSSOTokenFromFile();
|
|
27584
|
-
var
|
|
27584
|
+
var path35 = __require("path");
|
|
27585
27585
|
var types = require_dist_cjs();
|
|
27586
27586
|
var readFile3 = require_readFile();
|
|
27587
27587
|
var ENV_PROFILE2 = "AWS_PROFILE";
|
|
@@ -27603,9 +27603,9 @@ var require_dist_cjs33 = __commonJS({
|
|
|
27603
27603
|
...data3.default && { default: data3.default }
|
|
27604
27604
|
});
|
|
27605
27605
|
var ENV_CONFIG_PATH2 = "AWS_CONFIG_FILE";
|
|
27606
|
-
var getConfigFilepath2 = () => process.env[ENV_CONFIG_PATH2] ||
|
|
27606
|
+
var getConfigFilepath2 = () => process.env[ENV_CONFIG_PATH2] || path35.join(getHomeDir2.getHomeDir(), ".aws", "config");
|
|
27607
27607
|
var ENV_CREDENTIALS_PATH2 = "AWS_SHARED_CREDENTIALS_FILE";
|
|
27608
|
-
var getCredentialsFilepath2 = () => process.env[ENV_CREDENTIALS_PATH2] ||
|
|
27608
|
+
var getCredentialsFilepath2 = () => process.env[ENV_CREDENTIALS_PATH2] || path35.join(getHomeDir2.getHomeDir(), ".aws", "credentials");
|
|
27609
27609
|
var prefixKeyRegex2 = /^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/;
|
|
27610
27610
|
var profileNameBlockList2 = ["__proto__", "profile __proto__"];
|
|
27611
27611
|
var parseIni2 = (iniData) => {
|
|
@@ -27660,11 +27660,11 @@ var require_dist_cjs33 = __commonJS({
|
|
|
27660
27660
|
const relativeHomeDirPrefix = "~/";
|
|
27661
27661
|
let resolvedFilepath = filepath;
|
|
27662
27662
|
if (filepath.startsWith(relativeHomeDirPrefix)) {
|
|
27663
|
-
resolvedFilepath =
|
|
27663
|
+
resolvedFilepath = path35.join(homeDir, filepath.slice(2));
|
|
27664
27664
|
}
|
|
27665
27665
|
let resolvedConfigFilepath = configFilepath;
|
|
27666
27666
|
if (configFilepath.startsWith(relativeHomeDirPrefix)) {
|
|
27667
|
-
resolvedConfigFilepath =
|
|
27667
|
+
resolvedConfigFilepath = path35.join(homeDir, configFilepath.slice(2));
|
|
27668
27668
|
}
|
|
27669
27669
|
const parsedFiles = await Promise.all([
|
|
27670
27670
|
readFile3.readFile(resolvedConfigFilepath, {
|
|
@@ -27703,8 +27703,8 @@ var require_dist_cjs33 = __commonJS({
|
|
|
27703
27703
|
getFileRecord() {
|
|
27704
27704
|
return readFile3.fileIntercept;
|
|
27705
27705
|
},
|
|
27706
|
-
interceptFile(
|
|
27707
|
-
readFile3.fileIntercept[
|
|
27706
|
+
interceptFile(path36, contents) {
|
|
27707
|
+
readFile3.fileIntercept[path36] = Promise.resolve(contents);
|
|
27708
27708
|
},
|
|
27709
27709
|
getTokenRecord() {
|
|
27710
27710
|
return getSSOTokenFromFile2.tokenIntercept;
|
|
@@ -28029,8 +28029,8 @@ var require_dist_cjs36 = __commonJS({
|
|
|
28029
28029
|
return endpoint.url.href;
|
|
28030
28030
|
}
|
|
28031
28031
|
if ("hostname" in endpoint) {
|
|
28032
|
-
const { protocol, hostname, port, path:
|
|
28033
|
-
return `${protocol}//${hostname}${port ? ":" + port : ""}${
|
|
28032
|
+
const { protocol, hostname, port, path: path35 } = endpoint;
|
|
28033
|
+
return `${protocol}//${hostname}${port ? ":" + port : ""}${path35}`;
|
|
28034
28034
|
}
|
|
28035
28035
|
}
|
|
28036
28036
|
return endpoint;
|
|
@@ -38064,14 +38064,14 @@ var init_readFile = __esm({
|
|
|
38064
38064
|
"../../node_modules/.pnpm/@smithy+core@3.29.7/node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/readFile.js"() {
|
|
38065
38065
|
filePromises = {};
|
|
38066
38066
|
fileIntercept = {};
|
|
38067
|
-
readFile2 = (
|
|
38068
|
-
if (fileIntercept[
|
|
38069
|
-
return fileIntercept[
|
|
38067
|
+
readFile2 = (path35, options) => {
|
|
38068
|
+
if (fileIntercept[path35] !== void 0) {
|
|
38069
|
+
return fileIntercept[path35];
|
|
38070
38070
|
}
|
|
38071
|
-
if (!filePromises[
|
|
38072
|
-
filePromises[
|
|
38071
|
+
if (!filePromises[path35] || options?.ignoreCache) {
|
|
38072
|
+
filePromises[path35] = fsReadFile(path35, "utf8");
|
|
38073
38073
|
}
|
|
38074
|
-
return filePromises[
|
|
38074
|
+
return filePromises[path35];
|
|
38075
38075
|
};
|
|
38076
38076
|
}
|
|
38077
38077
|
});
|
|
@@ -38183,8 +38183,8 @@ var init_externalDataInterceptor = __esm({
|
|
|
38183
38183
|
getFileRecord() {
|
|
38184
38184
|
return fileIntercept;
|
|
38185
38185
|
},
|
|
38186
|
-
interceptFile(
|
|
38187
|
-
fileIntercept[
|
|
38186
|
+
interceptFile(path35, contents) {
|
|
38187
|
+
fileIntercept[path35] = Promise.resolve(contents);
|
|
38188
38188
|
},
|
|
38189
38189
|
getTokenRecord() {
|
|
38190
38190
|
return tokenIntercept;
|
|
@@ -41118,8 +41118,8 @@ var init_createConfigValueProvider = __esm({
|
|
|
41118
41118
|
return endpoint.url.href;
|
|
41119
41119
|
}
|
|
41120
41120
|
if ("hostname" in endpoint) {
|
|
41121
|
-
const { protocol, hostname, port, path:
|
|
41122
|
-
return `${protocol}//${hostname}${port ? ":" + port : ""}${
|
|
41121
|
+
const { protocol, hostname, port, path: path35 } = endpoint;
|
|
41122
|
+
return `${protocol}//${hostname}${port ? ":" + port : ""}${path35}`;
|
|
41123
41123
|
}
|
|
41124
41124
|
}
|
|
41125
41125
|
return endpoint;
|
|
@@ -41494,18 +41494,18 @@ var getAttrPathList;
|
|
|
41494
41494
|
var init_getAttrPathList = __esm({
|
|
41495
41495
|
"../../node_modules/.pnpm/@smithy+core@3.29.7/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/getAttrPathList.js"() {
|
|
41496
41496
|
init_types4();
|
|
41497
|
-
getAttrPathList = (
|
|
41498
|
-
const parts =
|
|
41497
|
+
getAttrPathList = (path35) => {
|
|
41498
|
+
const parts = path35.split(".");
|
|
41499
41499
|
const pathList = [];
|
|
41500
41500
|
for (const part of parts) {
|
|
41501
41501
|
const squareBracketIndex = part.indexOf("[");
|
|
41502
41502
|
if (squareBracketIndex !== -1) {
|
|
41503
41503
|
if (part.indexOf("]") !== part.length - 1) {
|
|
41504
|
-
throw new EndpointError(`Path: '${
|
|
41504
|
+
throw new EndpointError(`Path: '${path35}' does not end with ']'`);
|
|
41505
41505
|
}
|
|
41506
41506
|
const arrayIndex = part.slice(squareBracketIndex + 1, -1);
|
|
41507
41507
|
if (Number.isNaN(parseInt(arrayIndex))) {
|
|
41508
|
-
throw new EndpointError(`Invalid array index: '${arrayIndex}' in path: '${
|
|
41508
|
+
throw new EndpointError(`Invalid array index: '${arrayIndex}' in path: '${path35}'`);
|
|
41509
41509
|
}
|
|
41510
41510
|
if (squareBracketIndex !== 0) {
|
|
41511
41511
|
pathList.push(part.slice(0, squareBracketIndex));
|
|
@@ -41526,9 +41526,9 @@ var init_getAttr = __esm({
|
|
|
41526
41526
|
"../../node_modules/.pnpm/@smithy+core@3.29.7/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/getAttr.js"() {
|
|
41527
41527
|
init_types4();
|
|
41528
41528
|
init_getAttrPathList();
|
|
41529
|
-
getAttr = (value,
|
|
41529
|
+
getAttr = (value, path35) => getAttrPathList(path35).reduce((acc, index) => {
|
|
41530
41530
|
if (typeof acc !== "object") {
|
|
41531
|
-
throw new EndpointError(`Index '${index}' in '${
|
|
41531
|
+
throw new EndpointError(`Index '${index}' in '${path35}' not found in '${JSON.stringify(value)}'`);
|
|
41532
41532
|
} else if (Array.isArray(acc)) {
|
|
41533
41533
|
const i10 = parseInt(index);
|
|
41534
41534
|
return acc[i10 < 0 ? acc.length + i10 : i10];
|
|
@@ -41589,8 +41589,8 @@ var init_parseURL = __esm({
|
|
|
41589
41589
|
return value;
|
|
41590
41590
|
}
|
|
41591
41591
|
if (typeof value === "object" && "hostname" in value) {
|
|
41592
|
-
const { hostname: hostname2, port, protocol: protocol2 = "", path:
|
|
41593
|
-
const url = new URL(`${protocol2}//${hostname2}${port ? `:${port}` : ""}${
|
|
41592
|
+
const { hostname: hostname2, port, protocol: protocol2 = "", path: path35 = "", query = {} } = value;
|
|
41593
|
+
const url = new URL(`${protocol2}//${hostname2}${port ? `:${port}` : ""}${path35}`);
|
|
41594
41594
|
url.search = Object.entries(query).map(([k10, v5]) => `${k10}=${v5}`).join("&");
|
|
41595
41595
|
return url;
|
|
41596
41596
|
}
|
|
@@ -44827,11 +44827,11 @@ var init_HttpBindingProtocol2 = __esm({
|
|
|
44827
44827
|
const opTraits = translateTraits2(operationSchema.traits);
|
|
44828
44828
|
if (opTraits.http) {
|
|
44829
44829
|
request.method = opTraits.http[0];
|
|
44830
|
-
const [
|
|
44830
|
+
const [path35, search] = opTraits.http[1].split("?");
|
|
44831
44831
|
if (request.path == "/") {
|
|
44832
|
-
request.path =
|
|
44832
|
+
request.path = path35;
|
|
44833
44833
|
} else {
|
|
44834
|
-
request.path +=
|
|
44834
|
+
request.path += path35;
|
|
44835
44835
|
}
|
|
44836
44836
|
const traitSearchParams = new URLSearchParams(search ?? "");
|
|
44837
44837
|
for (const [key, value] of traitSearchParams) {
|
|
@@ -45232,8 +45232,8 @@ var init_requestBuilder3 = __esm({
|
|
|
45232
45232
|
return this;
|
|
45233
45233
|
}
|
|
45234
45234
|
p(memberName, labelValueProvider, uriLabel, isGreedyLabel) {
|
|
45235
|
-
this.resolvePathStack.push((
|
|
45236
|
-
this.path = resolvedPath2(
|
|
45235
|
+
this.resolvePathStack.push((path35) => {
|
|
45236
|
+
this.path = resolvedPath2(path35, this.input, memberName, labelValueProvider, uriLabel, isGreedyLabel);
|
|
45237
45237
|
});
|
|
45238
45238
|
return this;
|
|
45239
45239
|
}
|
|
@@ -45872,9 +45872,9 @@ var init_createPaginator2 = __esm({
|
|
|
45872
45872
|
command5 = withCommand(command5) ?? command5;
|
|
45873
45873
|
return await client.send(command5, ...args);
|
|
45874
45874
|
};
|
|
45875
|
-
get2 = (fromObject,
|
|
45875
|
+
get2 = (fromObject, path35) => {
|
|
45876
45876
|
let cursor3 = fromObject;
|
|
45877
|
-
const pathComponents =
|
|
45877
|
+
const pathComponents = path35.split(".");
|
|
45878
45878
|
for (const step of pathComponents) {
|
|
45879
45879
|
if (!cursor3 || typeof cursor3 !== "object") {
|
|
45880
45880
|
return void 0;
|
|
@@ -49445,10 +49445,10 @@ ${longDate}
|
|
|
49445
49445
|
${credentialScope}
|
|
49446
49446
|
${toHex2(hashedRequest)}`;
|
|
49447
49447
|
}
|
|
49448
|
-
getCanonicalPath({ path:
|
|
49448
|
+
getCanonicalPath({ path: path35 }) {
|
|
49449
49449
|
if (this.uriEscapePath) {
|
|
49450
49450
|
const normalizedPathSegments = [];
|
|
49451
|
-
for (const pathSegment of
|
|
49451
|
+
for (const pathSegment of path35.split("/")) {
|
|
49452
49452
|
if (pathSegment?.length === 0)
|
|
49453
49453
|
continue;
|
|
49454
49454
|
if (pathSegment === ".")
|
|
@@ -49459,11 +49459,11 @@ ${toHex2(hashedRequest)}`;
|
|
|
49459
49459
|
normalizedPathSegments.push(pathSegment);
|
|
49460
49460
|
}
|
|
49461
49461
|
}
|
|
49462
|
-
const normalizedPath = `${
|
|
49462
|
+
const normalizedPath = `${path35?.startsWith("/") ? "/" : ""}${normalizedPathSegments.join("/")}${normalizedPathSegments.length > 0 && path35?.endsWith("/") ? "/" : ""}`;
|
|
49463
49463
|
const doubleEncoded = escapeUri2(normalizedPath);
|
|
49464
49464
|
return doubleEncoded.replace(/%2F/g, "/");
|
|
49465
49465
|
}
|
|
49466
|
-
return
|
|
49466
|
+
return path35;
|
|
49467
49467
|
}
|
|
49468
49468
|
validateResolvedCredentials(credentials) {
|
|
49469
49469
|
if (typeof credentials !== "object" || typeof credentials.accessKeyId !== "string" || typeof credentials.secretAccessKey !== "string") {
|
|
@@ -51032,11 +51032,11 @@ var init_SmithyRpcV2CborProtocol2 = __esm({
|
|
|
51032
51032
|
}
|
|
51033
51033
|
}
|
|
51034
51034
|
const { service, operation: operation3 } = getSmithyContext11(context);
|
|
51035
|
-
const
|
|
51035
|
+
const path35 = `/service/${service}/operation/${operation3}`;
|
|
51036
51036
|
if (request.path.endsWith("/")) {
|
|
51037
|
-
request.path +=
|
|
51037
|
+
request.path += path35.slice(1);
|
|
51038
51038
|
} else {
|
|
51039
|
-
request.path +=
|
|
51039
|
+
request.path += path35;
|
|
51040
51040
|
}
|
|
51041
51041
|
return request;
|
|
51042
51042
|
}
|
|
@@ -54440,12 +54440,12 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
|
|
|
54440
54440
|
const password = request.password ?? "";
|
|
54441
54441
|
auth = `${username}:${password}`;
|
|
54442
54442
|
}
|
|
54443
|
-
let
|
|
54443
|
+
let path35 = request.path;
|
|
54444
54444
|
if (queryString) {
|
|
54445
|
-
|
|
54445
|
+
path35 += `?${queryString}`;
|
|
54446
54446
|
}
|
|
54447
54447
|
if (request.fragment) {
|
|
54448
|
-
|
|
54448
|
+
path35 += `#${request.fragment}`;
|
|
54449
54449
|
}
|
|
54450
54450
|
let hostname = request.hostname ?? "";
|
|
54451
54451
|
if (hostname[0] === "[" && hostname.endsWith("]")) {
|
|
@@ -54457,7 +54457,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
|
|
|
54457
54457
|
headers: request.headers,
|
|
54458
54458
|
host: hostname,
|
|
54459
54459
|
method: request.method,
|
|
54460
|
-
path:
|
|
54460
|
+
path: path35,
|
|
54461
54461
|
port: request.port,
|
|
54462
54462
|
agent,
|
|
54463
54463
|
auth
|
|
@@ -54860,16 +54860,16 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
|
|
|
54860
54860
|
reject(err);
|
|
54861
54861
|
};
|
|
54862
54862
|
const queryString = query ? buildQueryString2(query) : "";
|
|
54863
|
-
let
|
|
54863
|
+
let path35 = request.path;
|
|
54864
54864
|
if (queryString) {
|
|
54865
|
-
|
|
54865
|
+
path35 += `?${queryString}`;
|
|
54866
54866
|
}
|
|
54867
54867
|
if (request.fragment) {
|
|
54868
|
-
|
|
54868
|
+
path35 += `#${request.fragment}`;
|
|
54869
54869
|
}
|
|
54870
54870
|
const clientHttp2Stream = session.request({
|
|
54871
54871
|
...request.headers,
|
|
54872
|
-
[constants2.HTTP2_HEADER_PATH]:
|
|
54872
|
+
[constants2.HTTP2_HEADER_PATH]: path35,
|
|
54873
54873
|
[constants2.HTTP2_HEADER_METHOD]: method
|
|
54874
54874
|
});
|
|
54875
54875
|
if (effectiveRequestTimeout) {
|
|
@@ -54951,7 +54951,7 @@ var require_dist_cjs60 = __commonJS({
|
|
|
54951
54951
|
var { setCredentialFeature: setCredentialFeature3 } = (init_client4(), __toCommonJS(client_exports3));
|
|
54952
54952
|
var { CredentialsProviderError: CredentialsProviderError2 } = (init_config3(), __toCommonJS(config_exports));
|
|
54953
54953
|
var { NodeHttpHandler } = require_dist_cjs59();
|
|
54954
|
-
var
|
|
54954
|
+
var fs32 = __require("node:fs/promises");
|
|
54955
54955
|
var { HttpRequest: HttpRequest11 } = (init_protocols3(), __toCommonJS(protocols_exports3));
|
|
54956
54956
|
var { sdkStreamMixin: sdkStreamMixin4, parseRfc3339DateTime: parseRfc3339DateTime3 } = (init_serde2(), __toCommonJS(serde_exports2));
|
|
54957
54957
|
var ECS_CONTAINER_HOST = "169.254.170.2";
|
|
@@ -55075,7 +55075,7 @@ Set AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI
|
|
|
55075
55075
|
const provider = retryWrapper(async () => {
|
|
55076
55076
|
const request = createGetRequest(url);
|
|
55077
55077
|
if (tokenFile) {
|
|
55078
|
-
request.headers.Authorization = validateToken((await
|
|
55078
|
+
request.headers.Authorization = validateToken((await fs32.readFile(tokenFile)).toString());
|
|
55079
55079
|
} else if (token) {
|
|
55080
55080
|
request.headers.Authorization = validateToken(token);
|
|
55081
55081
|
}
|
|
@@ -69174,7 +69174,7 @@ var require_truncate = __commonJS({
|
|
|
69174
69174
|
var parse2 = require_parse();
|
|
69175
69175
|
var constants2 = require_constants2();
|
|
69176
69176
|
var SemVer = require_semver();
|
|
69177
|
-
var
|
|
69177
|
+
var truncate2 = (version, truncation, options) => {
|
|
69178
69178
|
if (!constants2.RELEASE_TYPES.includes(truncation)) {
|
|
69179
69179
|
return null;
|
|
69180
69180
|
}
|
|
@@ -69204,7 +69204,7 @@ var require_truncate = __commonJS({
|
|
|
69204
69204
|
var isPrerelease = (type) => {
|
|
69205
69205
|
return type.startsWith("pre");
|
|
69206
69206
|
};
|
|
69207
|
-
module.exports =
|
|
69207
|
+
module.exports = truncate2;
|
|
69208
69208
|
}
|
|
69209
69209
|
});
|
|
69210
69210
|
|
|
@@ -70250,7 +70250,7 @@ var require_semver2 = __commonJS({
|
|
|
70250
70250
|
var lte = require_lte();
|
|
70251
70251
|
var cmp = require_cmp();
|
|
70252
70252
|
var coerce2 = require_coerce();
|
|
70253
|
-
var
|
|
70253
|
+
var truncate2 = require_truncate();
|
|
70254
70254
|
var Comparator = require_comparator();
|
|
70255
70255
|
var Range = require_range();
|
|
70256
70256
|
var satisfies = require_satisfies();
|
|
@@ -70289,7 +70289,7 @@ var require_semver2 = __commonJS({
|
|
|
70289
70289
|
lte,
|
|
70290
70290
|
cmp,
|
|
70291
70291
|
coerce: coerce2,
|
|
70292
|
-
truncate,
|
|
70292
|
+
truncate: truncate2,
|
|
70293
70293
|
Comparator,
|
|
70294
70294
|
Range,
|
|
70295
70295
|
satisfies,
|
|
@@ -73157,9 +73157,9 @@ var require_dist_node20 = __commonJS({
|
|
|
73157
73157
|
// ../canopycms/src/worker/cms-worker.ts
|
|
73158
73158
|
var import_proper_lockfile3 = __toESM(require_proper_lockfile(), 1);
|
|
73159
73159
|
import { createHash as createHash2 } from "node:crypto";
|
|
73160
|
-
import
|
|
73160
|
+
import fs30 from "node:fs/promises";
|
|
73161
73161
|
import os from "node:os";
|
|
73162
|
-
import
|
|
73162
|
+
import path32 from "node:path";
|
|
73163
73163
|
|
|
73164
73164
|
// ../canopycms/src/utils/debug.ts
|
|
73165
73165
|
var envFlag = (name2) => typeof process !== "undefined" && process.env[name2] === "true";
|
|
@@ -74344,8 +74344,8 @@ function toLinesWithContent(input = "", trimmed2 = true, separator = "\n") {
|
|
|
74344
74344
|
function forEachLineWithContent(input, callback) {
|
|
74345
74345
|
return toLinesWithContent(input, true).map((line) => callback(line));
|
|
74346
74346
|
}
|
|
74347
|
-
function folderExists(
|
|
74348
|
-
return (0, import_file_exists.exists)(
|
|
74347
|
+
function folderExists(path35) {
|
|
74348
|
+
return (0, import_file_exists.exists)(path35, import_file_exists.FOLDER);
|
|
74349
74349
|
}
|
|
74350
74350
|
function append(target, item) {
|
|
74351
74351
|
if (Array.isArray(target)) {
|
|
@@ -74747,8 +74747,8 @@ function checkIsRepoRootTask() {
|
|
|
74747
74747
|
commands: commands9,
|
|
74748
74748
|
format: "utf-8",
|
|
74749
74749
|
onError,
|
|
74750
|
-
parser(
|
|
74751
|
-
return /^\.(git)?$/.test(
|
|
74750
|
+
parser(path35) {
|
|
74751
|
+
return /^\.(git)?$/.test(path35.trim());
|
|
74752
74752
|
}
|
|
74753
74753
|
};
|
|
74754
74754
|
}
|
|
@@ -75182,11 +75182,11 @@ function parseGrep(grep) {
|
|
|
75182
75182
|
const paths = /* @__PURE__ */ new Set();
|
|
75183
75183
|
const results = {};
|
|
75184
75184
|
forEachLineWithContent(grep, (input) => {
|
|
75185
|
-
const [
|
|
75186
|
-
paths.add(
|
|
75187
|
-
(results[
|
|
75185
|
+
const [path35, line, preview] = input.split(NULL);
|
|
75186
|
+
paths.add(path35);
|
|
75187
|
+
(results[path35] = results[path35] || []).push({
|
|
75188
75188
|
line: asNumber(line),
|
|
75189
|
-
path:
|
|
75189
|
+
path: path35,
|
|
75190
75190
|
preview
|
|
75191
75191
|
});
|
|
75192
75192
|
});
|
|
@@ -75950,14 +75950,14 @@ var init_hash_object = __esm2({
|
|
|
75950
75950
|
init_task();
|
|
75951
75951
|
}
|
|
75952
75952
|
});
|
|
75953
|
-
function parseInit(bare,
|
|
75953
|
+
function parseInit(bare, path35, text) {
|
|
75954
75954
|
const response = String(text).trim();
|
|
75955
75955
|
let result;
|
|
75956
75956
|
if (result = initResponseRegex.exec(response)) {
|
|
75957
|
-
return new InitSummary(bare,
|
|
75957
|
+
return new InitSummary(bare, path35, false, result[1]);
|
|
75958
75958
|
}
|
|
75959
75959
|
if (result = reInitResponseRegex.exec(response)) {
|
|
75960
|
-
return new InitSummary(bare,
|
|
75960
|
+
return new InitSummary(bare, path35, true, result[1]);
|
|
75961
75961
|
}
|
|
75962
75962
|
let gitDir = "";
|
|
75963
75963
|
const tokens = response.split(" ");
|
|
@@ -75968,7 +75968,7 @@ function parseInit(bare, path34, text) {
|
|
|
75968
75968
|
break;
|
|
75969
75969
|
}
|
|
75970
75970
|
}
|
|
75971
|
-
return new InitSummary(bare,
|
|
75971
|
+
return new InitSummary(bare, path35, /^re/i.test(response), gitDir);
|
|
75972
75972
|
}
|
|
75973
75973
|
var InitSummary;
|
|
75974
75974
|
var initResponseRegex;
|
|
@@ -75977,9 +75977,9 @@ var init_InitSummary = __esm2({
|
|
|
75977
75977
|
"src/lib/responses/InitSummary.ts"() {
|
|
75978
75978
|
"use strict";
|
|
75979
75979
|
InitSummary = class {
|
|
75980
|
-
constructor(bare,
|
|
75980
|
+
constructor(bare, path35, existing, gitDir) {
|
|
75981
75981
|
this.bare = bare;
|
|
75982
|
-
this.path =
|
|
75982
|
+
this.path = path35;
|
|
75983
75983
|
this.existing = existing;
|
|
75984
75984
|
this.gitDir = gitDir;
|
|
75985
75985
|
}
|
|
@@ -75991,7 +75991,7 @@ var init_InitSummary = __esm2({
|
|
|
75991
75991
|
function hasBareCommand(command5) {
|
|
75992
75992
|
return command5.includes(bareCommand);
|
|
75993
75993
|
}
|
|
75994
|
-
function initTask(bare = false,
|
|
75994
|
+
function initTask(bare = false, path35, customArgs) {
|
|
75995
75995
|
const commands9 = ["init", ...customArgs];
|
|
75996
75996
|
if (bare && !hasBareCommand(commands9)) {
|
|
75997
75997
|
commands9.splice(1, 0, bareCommand);
|
|
@@ -76000,7 +76000,7 @@ function initTask(bare = false, path34, customArgs) {
|
|
|
76000
76000
|
commands: commands9,
|
|
76001
76001
|
format: "utf-8",
|
|
76002
76002
|
parser(text) {
|
|
76003
|
-
return parseInit(commands9.includes("--bare"),
|
|
76003
|
+
return parseInit(commands9.includes("--bare"), path35, text);
|
|
76004
76004
|
}
|
|
76005
76005
|
};
|
|
76006
76006
|
}
|
|
@@ -76815,12 +76815,12 @@ var init_FileStatusSummary = __esm2({
|
|
|
76815
76815
|
"use strict";
|
|
76816
76816
|
fromPathRegex = /^(.+)\0(.+)$/;
|
|
76817
76817
|
FileStatusSummary = class {
|
|
76818
|
-
constructor(
|
|
76819
|
-
this.path =
|
|
76818
|
+
constructor(path35, index, working_dir) {
|
|
76819
|
+
this.path = path35;
|
|
76820
76820
|
this.index = index;
|
|
76821
76821
|
this.working_dir = working_dir;
|
|
76822
76822
|
if (index === "R" || working_dir === "R") {
|
|
76823
|
-
const detail = fromPathRegex.exec(
|
|
76823
|
+
const detail = fromPathRegex.exec(path35) || [null, path35, path35];
|
|
76824
76824
|
this.from = detail[2] || "";
|
|
76825
76825
|
this.path = detail[1] || "";
|
|
76826
76826
|
}
|
|
@@ -76851,14 +76851,14 @@ function splitLine(result, lineStr) {
|
|
|
76851
76851
|
default:
|
|
76852
76852
|
return;
|
|
76853
76853
|
}
|
|
76854
|
-
function data3(index, workingDir,
|
|
76854
|
+
function data3(index, workingDir, path35) {
|
|
76855
76855
|
const raw = `${index}${workingDir}`;
|
|
76856
76856
|
const handler = parsers6.get(raw);
|
|
76857
76857
|
if (handler) {
|
|
76858
|
-
handler(result,
|
|
76858
|
+
handler(result, path35);
|
|
76859
76859
|
}
|
|
76860
76860
|
if (raw !== "##" && raw !== "!!") {
|
|
76861
|
-
result.files.push(new FileStatusSummary(
|
|
76861
|
+
result.files.push(new FileStatusSummary(path35, index, workingDir));
|
|
76862
76862
|
}
|
|
76863
76863
|
}
|
|
76864
76864
|
}
|
|
@@ -77209,9 +77209,9 @@ var init_simple_git_api = __esm2({
|
|
|
77209
77209
|
next
|
|
77210
77210
|
);
|
|
77211
77211
|
}
|
|
77212
|
-
hashObject(
|
|
77212
|
+
hashObject(path35, write) {
|
|
77213
77213
|
return this._runTask(
|
|
77214
|
-
hashObjectTask(
|
|
77214
|
+
hashObjectTask(path35, write === true),
|
|
77215
77215
|
trailingFunctionArgument(arguments)
|
|
77216
77216
|
);
|
|
77217
77217
|
}
|
|
@@ -77565,8 +77565,8 @@ var init_branch = __esm2({
|
|
|
77565
77565
|
}
|
|
77566
77566
|
});
|
|
77567
77567
|
function toPath(input) {
|
|
77568
|
-
const
|
|
77569
|
-
return
|
|
77568
|
+
const path35 = input.trim().replace(/^["']|["']$/g, "");
|
|
77569
|
+
return path35 && normalize(path35);
|
|
77570
77570
|
}
|
|
77571
77571
|
var parseCheckIgnore;
|
|
77572
77572
|
var init_CheckIgnore = __esm2({
|
|
@@ -77851,8 +77851,8 @@ __export2(sub_module_exports, {
|
|
|
77851
77851
|
subModuleTask: () => subModuleTask,
|
|
77852
77852
|
updateSubModuleTask: () => updateSubModuleTask
|
|
77853
77853
|
});
|
|
77854
|
-
function addSubModuleTask(repo,
|
|
77855
|
-
return subModuleTask(["add", repo,
|
|
77854
|
+
function addSubModuleTask(repo, path35) {
|
|
77855
|
+
return subModuleTask(["add", repo, path35]);
|
|
77856
77856
|
}
|
|
77857
77857
|
function initSubModuleTask(customArgs) {
|
|
77858
77858
|
return subModuleTask(["init", ...customArgs]);
|
|
@@ -78166,8 +78166,8 @@ var require_git = __commonJS2({
|
|
|
78166
78166
|
}
|
|
78167
78167
|
return this._runTask(straightThroughStringTask2(command5, this._trimmed), next);
|
|
78168
78168
|
};
|
|
78169
|
-
Git2.prototype.submoduleAdd = function(repo,
|
|
78170
|
-
return this._runTask(addSubModuleTask2(repo,
|
|
78169
|
+
Git2.prototype.submoduleAdd = function(repo, path35, then) {
|
|
78170
|
+
return this._runTask(addSubModuleTask2(repo, path35), trailingFunctionArgument2(arguments));
|
|
78171
78171
|
};
|
|
78172
78172
|
Git2.prototype.submoduleUpdate = function(args, then) {
|
|
78173
78173
|
return this._runTask(
|
|
@@ -78796,7 +78796,18 @@ function isValidContentId(id) {
|
|
|
78796
78796
|
// ../canopycms/src/id.ts
|
|
78797
78797
|
var isValidId = isValidContentId;
|
|
78798
78798
|
|
|
78799
|
+
// ../canopycms/src/utils/format.ts
|
|
78800
|
+
var getFormatExtension = (format3) => {
|
|
78801
|
+
if (format3 === "md") return ".md";
|
|
78802
|
+
if (format3 === "mdx") return ".mdx";
|
|
78803
|
+
if (format3 === "yaml") return ".yaml";
|
|
78804
|
+
return ".json";
|
|
78805
|
+
};
|
|
78806
|
+
|
|
78799
78807
|
// ../canopycms/src/content-id-index.ts
|
|
78808
|
+
var ENTRY_EXTENSIONS = new Set(
|
|
78809
|
+
Object.keys({ md: true, mdx: true, json: true, yaml: true }).map((format3) => getFormatExtension(format3))
|
|
78810
|
+
);
|
|
78800
78811
|
function extractIdFromFilename(filename) {
|
|
78801
78812
|
if (filename.startsWith(".")) {
|
|
78802
78813
|
return null;
|
|
@@ -79115,8 +79126,9 @@ var SPACE = 32;
|
|
|
79115
79126
|
var DASH = 45;
|
|
79116
79127
|
var PREREQUISITE_PREFIX_BYTES = 42;
|
|
79117
79128
|
var BundleHeaderReader = class {
|
|
79118
|
-
constructor(comments) {
|
|
79129
|
+
constructor(comments, maxBytes = BUNDLE_HEADER_MAX_BYTES) {
|
|
79119
79130
|
this.comments = comments;
|
|
79131
|
+
this.maxBytes = maxBytes;
|
|
79120
79132
|
this.section = "signature";
|
|
79121
79133
|
this.sawCapability = false;
|
|
79122
79134
|
this.prerequisites = [];
|
|
@@ -79206,9 +79218,10 @@ var BundleHeaderReader = class {
|
|
|
79206
79218
|
this.checkBound();
|
|
79207
79219
|
}
|
|
79208
79220
|
checkBound() {
|
|
79209
|
-
if (this.counted >=
|
|
79210
|
-
throw new BundleHeaderError(`its header does not end within ${
|
|
79221
|
+
if (this.counted >= this.maxBytes) {
|
|
79222
|
+
throw new BundleHeaderError(`its header does not end within ${this.maxBytes} bytes`);
|
|
79211
79223
|
}
|
|
79224
|
+
if (this.comments === "skip") return;
|
|
79212
79225
|
const total = this.comments === "refuse" ? this.consumed : this.counted + this.keptBytes;
|
|
79213
79226
|
if (total >= BUNDLE_HEADER_TOTAL_MAX_BYTES) {
|
|
79214
79227
|
throw new BundleHeaderError(
|
|
@@ -79477,23 +79490,127 @@ var import_plugin_throttling = __toESM(require_dist_node13(), 1);
|
|
|
79477
79490
|
init_error();
|
|
79478
79491
|
init_logger();
|
|
79479
79492
|
|
|
79493
|
+
// ../canopycms/src/editor-url.ts
|
|
79494
|
+
function editorDeepLink(editorUrl, branch, entryPath) {
|
|
79495
|
+
const url = new URL(editorUrl);
|
|
79496
|
+
url.searchParams.set("branch", branch);
|
|
79497
|
+
if (entryPath !== void 0) url.searchParams.set("entry", entryPath);
|
|
79498
|
+
return url.href;
|
|
79499
|
+
}
|
|
79500
|
+
|
|
79480
79501
|
// ../canopycms/src/submission-attribution.ts
|
|
79502
|
+
var MAX_NAME_LENGTH = 80;
|
|
79481
79503
|
var PR_SECTION_START = "<!-- canopycms:submission:start -->";
|
|
79482
79504
|
var PR_SECTION_END = "<!-- canopycms:submission:end -->";
|
|
79505
|
+
var PR_COMMENTS_START = "<!-- canopycms:comments:start -->";
|
|
79506
|
+
var PR_COMMENTS_END = "<!-- canopycms:comments:end -->";
|
|
79507
|
+
var INVISIBLE_OR_CONTROL = /[\p{Cc}\p{Cf}\p{Cs}\p{Zl}\p{Zp}]/gu;
|
|
79508
|
+
var STRUCTURAL = /[<>()`\\]/g;
|
|
79509
|
+
function truncate(value, max) {
|
|
79510
|
+
const chars2 = Array.from(value);
|
|
79511
|
+
return chars2.length > max ? `${chars2.slice(0, max - 1).join("")}\u2026` : value;
|
|
79512
|
+
}
|
|
79513
|
+
function cleanPath(raw) {
|
|
79514
|
+
const cleaned = raw.replace(INVISIBLE_OR_CONTROL, " ").replace(/[<>`]/g, "").trim();
|
|
79515
|
+
return cleaned ? truncate(cleaned, 300) : void 0;
|
|
79516
|
+
}
|
|
79517
|
+
function cleanText(raw, max) {
|
|
79518
|
+
if (raw === void 0) return void 0;
|
|
79519
|
+
const cleaned = raw.normalize("NFKC").replace(INVISIBLE_OR_CONTROL, " ").replace(STRUCTURAL, "").replace(/\s+/g, " ").trim();
|
|
79520
|
+
return cleaned ? truncate(cleaned, max) : void 0;
|
|
79521
|
+
}
|
|
79522
|
+
function codeSpan(value) {
|
|
79523
|
+
return `\`${value}\``;
|
|
79524
|
+
}
|
|
79525
|
+
function markdownHref(href) {
|
|
79526
|
+
return href.replace(
|
|
79527
|
+
/[()<>\\\s'"`]/g,
|
|
79528
|
+
(c11) => `%${c11.charCodeAt(0).toString(16).toUpperCase().padStart(2, "0")}`
|
|
79529
|
+
);
|
|
79530
|
+
}
|
|
79531
|
+
function editorLinker(branch, editorUrl) {
|
|
79532
|
+
return (entryPath) => branch && editorUrl ? markdownHref(editorDeepLink(editorUrl, branch, entryPath)) : void 0;
|
|
79533
|
+
}
|
|
79534
|
+
var MAX_LISTED_THREADS = 50;
|
|
79535
|
+
var MAX_EXCERPT_LENGTH = 80;
|
|
79536
|
+
var MAX_COMMENTS_LENGTH = 15e3;
|
|
79537
|
+
var LINE_BREAK = /\r\n?|\n|\u2028|\u2029/;
|
|
79538
|
+
function threadEntryPath(raw) {
|
|
79539
|
+
if (typeof raw !== "string" || cleanPath(raw) !== raw) return void 0;
|
|
79540
|
+
return raw.split("/").every((s7) => s7 !== "" && s7 !== "." && s7 !== "..") ? raw : void 0;
|
|
79541
|
+
}
|
|
79542
|
+
function threadLine(thread, link) {
|
|
79543
|
+
const entryPath = threadEntryPath(thread.entryPath);
|
|
79544
|
+
const field = thread.type === "field" && typeof thread.canopyPath === "string" ? cleanText(thread.canopyPath, MAX_NAME_LENGTH) : void 0;
|
|
79545
|
+
const where = entryPath ? `${codeSpan(entryPath)}${field ? ` \u203A ${codeSpan(field)}` : ""}` : thread.type === "branch" ? "Branch" : "An entry";
|
|
79546
|
+
const [first2] = Array.isArray(thread.comments) ? thread.comments : [];
|
|
79547
|
+
const text = typeof first2?.text === "string" ? first2.text.split(LINE_BREAK)[0] : void 0;
|
|
79548
|
+
const excerpt = cleanText(text, MAX_EXCERPT_LENGTH);
|
|
79549
|
+
const href = entryPath ? link(entryPath) : thread.type === "branch" ? link() : void 0;
|
|
79550
|
+
return [
|
|
79551
|
+
`- ${where}`,
|
|
79552
|
+
excerpt ? ` \u2014 ${codeSpan(excerpt)}` : "",
|
|
79553
|
+
href ? ` ([open in editor](${href}))` : ""
|
|
79554
|
+
].join("");
|
|
79555
|
+
}
|
|
79556
|
+
function buildCommentsBlock(threads, branch, editorUrl) {
|
|
79557
|
+
if (threads === null) {
|
|
79558
|
+
return `${PR_COMMENTS_START}
|
|
79559
|
+
The editor comments could not be read.
|
|
79560
|
+
${PR_COMMENTS_END}`;
|
|
79561
|
+
}
|
|
79562
|
+
const open = threads.filter((t6) => typeof t6 === "object" && t6 !== null && !t6.resolved).sort((a9, b10) => String(a9.createdAt).localeCompare(String(b10.createdAt)));
|
|
79563
|
+
let body;
|
|
79564
|
+
if (open.length > 0) {
|
|
79565
|
+
const listed = open.slice(0, MAX_LISTED_THREADS);
|
|
79566
|
+
const linker = editorLinker(branch, editorUrl);
|
|
79567
|
+
let lines = listed.map((t6) => threadLine(t6, linker));
|
|
79568
|
+
if (lines.join("\n").length > MAX_COMMENTS_LENGTH) {
|
|
79569
|
+
lines = listed.map((t6) => threadLine(t6, () => void 0));
|
|
79570
|
+
}
|
|
79571
|
+
let shown = lines.length;
|
|
79572
|
+
while (shown > 0 && lines.slice(0, shown).join("\n").length > MAX_COMMENTS_LENGTH) shown--;
|
|
79573
|
+
lines = lines.slice(0, shown);
|
|
79574
|
+
if (open.length > shown) lines.push(`- \u2026and ${open.length - shown} more`);
|
|
79575
|
+
const noun = open.length === 1 ? "comment thread" : "comment threads";
|
|
79576
|
+
body = `**${open.length} unresolved editor ${noun}**
|
|
79577
|
+
|
|
79578
|
+
${lines.join("\n")}`;
|
|
79579
|
+
} else {
|
|
79580
|
+
body = threads.length > 0 ? "All editor comments resolved." : "No editor comments.";
|
|
79581
|
+
}
|
|
79582
|
+
return `${PR_COMMENTS_START}
|
|
79583
|
+
${body}
|
|
79584
|
+
${PR_COMMENTS_END}`;
|
|
79585
|
+
}
|
|
79483
79586
|
function mergePrSection(existing, section) {
|
|
79484
79587
|
const body = existing ?? "";
|
|
79485
|
-
|
|
79486
|
-
|
|
79487
|
-
|
|
79488
|
-
return body.slice(0, start) + section + body.slice(end + PR_SECTION_END.length);
|
|
79489
|
-
}
|
|
79490
|
-
end = body.indexOf(PR_SECTION_END, end + PR_SECTION_END.length);
|
|
79588
|
+
const found = findPrSection(body);
|
|
79589
|
+
if (found) {
|
|
79590
|
+
return body.slice(0, found.start) + section + body.slice(found.end + PR_SECTION_END.length);
|
|
79491
79591
|
}
|
|
79492
79592
|
const human = body.split(PR_SECTION_START).join("").split(PR_SECTION_END).join("").trimEnd();
|
|
79493
79593
|
return human ? `${human}
|
|
79494
79594
|
|
|
79495
79595
|
${section}` : section;
|
|
79496
79596
|
}
|
|
79597
|
+
function findPrSection(body) {
|
|
79598
|
+
for (let end = body.indexOf(PR_SECTION_END); end >= 0; ) {
|
|
79599
|
+
const start = body.lastIndexOf(PR_SECTION_START, end - PR_SECTION_START.length);
|
|
79600
|
+
if (start >= 0) return { start, end };
|
|
79601
|
+
end = body.indexOf(PR_SECTION_END, end + PR_SECTION_END.length);
|
|
79602
|
+
}
|
|
79603
|
+
return void 0;
|
|
79604
|
+
}
|
|
79605
|
+
function mergeCommentsBlock(existing, block) {
|
|
79606
|
+
const body = existing ?? "";
|
|
79607
|
+
const section = findPrSection(body);
|
|
79608
|
+
if (!section) return void 0;
|
|
79609
|
+
const start = body.indexOf(PR_COMMENTS_START, section.start);
|
|
79610
|
+
const end = start < 0 ? -1 : body.indexOf(PR_COMMENTS_END, start);
|
|
79611
|
+
if (start < 0 || end < 0 || end > section.end) return void 0;
|
|
79612
|
+
return body.slice(0, start) + block + body.slice(end + PR_COMMENTS_END.length);
|
|
79613
|
+
}
|
|
79497
79614
|
|
|
79498
79615
|
// ../canopycms/src/github-service.ts
|
|
79499
79616
|
var ThrottledOctokit = import_rest.Octokit.plugin(import_plugin_throttling.throttling);
|
|
@@ -82351,12 +82468,30 @@ async function causeOf(proc, err, reason) {
|
|
|
82351
82468
|
);
|
|
82352
82469
|
return own !== null && getErrorMessage(own) !== reason ? own : err;
|
|
82353
82470
|
}
|
|
82471
|
+
var FETCH_BUNDLE_HEADER_MAX_BYTES = 16 * 1024 * 1024;
|
|
82354
82472
|
async function unbundle(ctx, gitDir, bundleId, signal) {
|
|
82355
82473
|
const stream = await ctx.github().openBundle(bundleId);
|
|
82356
82474
|
try {
|
|
82357
|
-
|
|
82475
|
+
const chunks = stream[Symbol.asyncIterator]();
|
|
82476
|
+
const read = await readHeader(stream, chunks, ctx.taskTimeoutMs, signal);
|
|
82477
|
+
const missing = await missingCommits(ctx, gitDir, read.header.prerequisites, signal);
|
|
82478
|
+
if (missing.length > 0) {
|
|
82479
|
+
throw new Error(`Refusing the bundle: its prerequisite ${missing[0]} is not a commit here`);
|
|
82480
|
+
}
|
|
82481
|
+
const { rest: first2 } = read;
|
|
82482
|
+
const pack = Readable2.from(
|
|
82483
|
+
(async function* () {
|
|
82484
|
+
if (first2.length > 0) yield first2;
|
|
82485
|
+
for (; ; ) {
|
|
82486
|
+
const rest = await chunks.next();
|
|
82487
|
+
if (rest.done) return;
|
|
82488
|
+
yield rest.value;
|
|
82489
|
+
}
|
|
82490
|
+
})()
|
|
82491
|
+
);
|
|
82492
|
+
await runGit(["index-pack", "-v", "--fix-thin", "--stdin"], {
|
|
82358
82493
|
...sharedRepoProcessOptions(gitDir, "bare"),
|
|
82359
|
-
stdin:
|
|
82494
|
+
stdin: pack,
|
|
82360
82495
|
inactivityTimeoutMs: ctx.taskTimeoutMs,
|
|
82361
82496
|
signal
|
|
82362
82497
|
});
|
|
@@ -82364,6 +82499,40 @@ async function unbundle(ctx, gitDir, bundleId, signal) {
|
|
|
82364
82499
|
stream.destroy();
|
|
82365
82500
|
}
|
|
82366
82501
|
}
|
|
82502
|
+
async function readHeader(stream, chunks, inactivityTimeoutMs, signal) {
|
|
82503
|
+
signal?.throwIfAborted();
|
|
82504
|
+
let timer;
|
|
82505
|
+
const onAbort = () => stream.destroy(new Error("Reading the bundle was aborted"));
|
|
82506
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
82507
|
+
try {
|
|
82508
|
+
const reader = new BundleHeaderReader("skip", FETCH_BUNDLE_HEADER_MAX_BYTES);
|
|
82509
|
+
for (; ; ) {
|
|
82510
|
+
clearTimeout(timer);
|
|
82511
|
+
timer = setTimeout(
|
|
82512
|
+
() => stream.destroy(new Error(`The bundle sent nothing for ${inactivityTimeoutMs}ms`)),
|
|
82513
|
+
inactivityTimeoutMs
|
|
82514
|
+
);
|
|
82515
|
+
const next = await chunks.next();
|
|
82516
|
+
if (next.done) throw new Error("The bundle ended before its header did");
|
|
82517
|
+
const read = reader.push(next.value);
|
|
82518
|
+
if (read !== null) return read;
|
|
82519
|
+
}
|
|
82520
|
+
} finally {
|
|
82521
|
+
clearTimeout(timer);
|
|
82522
|
+
signal?.removeEventListener("abort", onAbort);
|
|
82523
|
+
}
|
|
82524
|
+
}
|
|
82525
|
+
async function missingCommits(ctx, gitDir, ids, signal) {
|
|
82526
|
+
if (ids.length === 0) return [];
|
|
82527
|
+
const lines = (await runGit(["cat-file", "--batch-check=%(objectname) %(objecttype)", "--end-of-options"], {
|
|
82528
|
+
...sharedRepoProcessOptions(gitDir, "bare"),
|
|
82529
|
+
stdin: ids.map((id) => `${id}
|
|
82530
|
+
`).join(""),
|
|
82531
|
+
inactivityTimeoutMs: ctx.taskTimeoutMs,
|
|
82532
|
+
signal
|
|
82533
|
+
})).split("\n");
|
|
82534
|
+
return ids.filter((id, i10) => lines[i10] !== `${id} commit`);
|
|
82535
|
+
}
|
|
82367
82536
|
async function moveTrackingRefs(ctx, gitDir, refs, signal) {
|
|
82368
82537
|
let needsOperator = null;
|
|
82369
82538
|
const current = /* @__PURE__ */ new Map();
|
|
@@ -82491,7 +82660,7 @@ init_error();
|
|
|
82491
82660
|
init_worker_status();
|
|
82492
82661
|
|
|
82493
82662
|
// ../canopycms/src/version.ts
|
|
82494
|
-
var CANOPYCMS_VERSION = "0.
|
|
82663
|
+
var CANOPYCMS_VERSION = "0.7.1";
|
|
82495
82664
|
|
|
82496
82665
|
// ../canopycms/src/worker/schema-gate.ts
|
|
82497
82666
|
import fs14 from "node:fs/promises";
|
|
@@ -82741,7 +82910,7 @@ async function decideBaseAdvance(input) {
|
|
|
82741
82910
|
}
|
|
82742
82911
|
|
|
82743
82912
|
// ../canopycms/src/worker/task-runner.ts
|
|
82744
|
-
import
|
|
82913
|
+
import fs20 from "node:fs/promises";
|
|
82745
82914
|
|
|
82746
82915
|
// ../canopycms/src/branch-metadata.ts
|
|
82747
82916
|
import fs18 from "node:fs/promises";
|
|
@@ -82797,6 +82966,7 @@ var branchMetadataShape = {
|
|
|
82797
82966
|
pullRequestNumber: external_exports.number().int().optional(),
|
|
82798
82967
|
submittedAt: external_exports.string().optional(),
|
|
82799
82968
|
pushedToGitHubAt: external_exports.string().optional(),
|
|
82969
|
+
editorUrl: external_exports.string().optional(),
|
|
82800
82970
|
syncStatus: enumOf({
|
|
82801
82971
|
synced: "synced",
|
|
82802
82972
|
"pending-sync": "pending-sync",
|
|
@@ -83532,7 +83702,8 @@ var answers = {
|
|
|
83532
83702
|
merged: external_exports.boolean(),
|
|
83533
83703
|
merged_at: external_exports.string().max(64).nullable(),
|
|
83534
83704
|
state: external_exports.enum(["open", "closed"]),
|
|
83535
|
-
node_id: external_exports.string().max(256)
|
|
83705
|
+
node_id: external_exports.string().max(256),
|
|
83706
|
+
body: pullRequestText.body.nullable()
|
|
83536
83707
|
}).strict(),
|
|
83537
83708
|
createOrUpdatePullRequest: pullRequestRef.extend({ created: external_exports.boolean() }).strict(),
|
|
83538
83709
|
convertPullRequestToDraft: empty,
|
|
@@ -83928,6 +84099,249 @@ async function hasPendingHistoryRewrite(ctx, branchName) {
|
|
|
83928
84099
|
|
|
83929
84100
|
// ../canopycms/src/worker/task-runner.ts
|
|
83930
84101
|
init_worker_status();
|
|
84102
|
+
|
|
84103
|
+
// ../canopycms/src/comment-store.ts
|
|
84104
|
+
import fs19 from "node:fs/promises";
|
|
84105
|
+
import path21 from "node:path";
|
|
84106
|
+
import { randomUUID as randomUUID3 } from "node:crypto";
|
|
84107
|
+
init_error();
|
|
84108
|
+
var CommentStoreConflictError = class extends Error {
|
|
84109
|
+
constructor() {
|
|
84110
|
+
super("Concurrent modification detected");
|
|
84111
|
+
this.name = "CommentStoreConflictError";
|
|
84112
|
+
}
|
|
84113
|
+
};
|
|
84114
|
+
function ownThread(data3, threadId) {
|
|
84115
|
+
return Object.prototype.hasOwnProperty.call(data3.threads, threadId) ? data3.threads[threadId] : void 0;
|
|
84116
|
+
}
|
|
84117
|
+
var CommentStore = class {
|
|
84118
|
+
constructor(branchRoot, options) {
|
|
84119
|
+
this.filePath = path21.join(path21.resolve(branchRoot), ".canopy-meta", "comments.json");
|
|
84120
|
+
this.settleMs = options?.settleMs;
|
|
84121
|
+
}
|
|
84122
|
+
/**
|
|
84123
|
+
* Every thread, for a summary that must not mistake a failed read for no comments: only a
|
|
84124
|
+
* missing file reads as none, and an unreadable or malformed one throws, unlike load().
|
|
84125
|
+
*/
|
|
84126
|
+
async listThreadsStrict() {
|
|
84127
|
+
let content;
|
|
84128
|
+
try {
|
|
84129
|
+
content = await fs19.readFile(this.filePath, "utf-8");
|
|
84130
|
+
} catch (err) {
|
|
84131
|
+
if (isNotFoundError2(err)) return [];
|
|
84132
|
+
throw err;
|
|
84133
|
+
}
|
|
84134
|
+
const parsed = JSON.parse(content);
|
|
84135
|
+
const threads = typeof parsed === "object" && parsed !== null ? parsed.threads : void 0;
|
|
84136
|
+
if (typeof threads !== "object" || threads === null) {
|
|
84137
|
+
throw new Error("comments.json has no threads object");
|
|
84138
|
+
}
|
|
84139
|
+
return Object.values(threads);
|
|
84140
|
+
}
|
|
84141
|
+
/** Read-only load. */
|
|
84142
|
+
async load() {
|
|
84143
|
+
const { data: data3 } = await this.loadWithVersion();
|
|
84144
|
+
return data3;
|
|
84145
|
+
}
|
|
84146
|
+
/**
|
|
84147
|
+
* Load, with the version observed at load time. Mutators thread that version
|
|
84148
|
+
* through their load-modify-write cycle as a LOCAL value, never as instance
|
|
84149
|
+
* state, so concurrent cycles cannot clobber each other's expected version.
|
|
84150
|
+
*/
|
|
84151
|
+
async loadWithVersion() {
|
|
84152
|
+
try {
|
|
84153
|
+
const content = await fs19.readFile(this.filePath, "utf-8");
|
|
84154
|
+
const parsed = JSON.parse(content);
|
|
84155
|
+
const version = parsed.version ?? 0;
|
|
84156
|
+
return { data: { ...parsed, version }, version };
|
|
84157
|
+
} catch {
|
|
84158
|
+
return {
|
|
84159
|
+
data: {
|
|
84160
|
+
schemaVersion: 1,
|
|
84161
|
+
version: 0,
|
|
84162
|
+
threads: {}
|
|
84163
|
+
},
|
|
84164
|
+
version: null
|
|
84165
|
+
};
|
|
84166
|
+
}
|
|
84167
|
+
}
|
|
84168
|
+
/**
|
|
84169
|
+
* Write comments.json via the shared OCC helper.
|
|
84170
|
+
*
|
|
84171
|
+
* Throws the helper's raw {@link OccWriteConflictError}, which is what the
|
|
84172
|
+
* surrounding {@link withOccRetry} in withMutation() recognizes and retries;
|
|
84173
|
+
* translation to the public `CommentStoreConflictError` happens at the
|
|
84174
|
+
* withMutation() boundary, once retries are exhausted.
|
|
84175
|
+
*
|
|
84176
|
+
* comments.json is written without a trailing newline (`writeOccJsonFile`'s
|
|
84177
|
+
* default), unlike branch.json.
|
|
84178
|
+
*/
|
|
84179
|
+
async writeData(data3, expectedVersion) {
|
|
84180
|
+
await writeOccJsonFile(
|
|
84181
|
+
this.filePath,
|
|
84182
|
+
{ ...data3 },
|
|
84183
|
+
{
|
|
84184
|
+
expectedVersion,
|
|
84185
|
+
settleMs: this.settleMs
|
|
84186
|
+
}
|
|
84187
|
+
);
|
|
84188
|
+
}
|
|
84189
|
+
/**
|
|
84190
|
+
* Run a mutate cycle (load -> modify -> write) under the full lock +
|
|
84191
|
+
* OCC-retry stack (class doc). A conflict surviving every retry surfaces as
|
|
84192
|
+
* `CommentStoreConflictError`.
|
|
84193
|
+
*/
|
|
84194
|
+
async withMutation(operation3) {
|
|
84195
|
+
try {
|
|
84196
|
+
return await withLock(
|
|
84197
|
+
this.filePath,
|
|
84198
|
+
() => withOccFileLock(
|
|
84199
|
+
this.filePath,
|
|
84200
|
+
() => withOccRetry(async () => {
|
|
84201
|
+
const { data: data3, version } = await this.loadWithVersion();
|
|
84202
|
+
return operation3(data3, version);
|
|
84203
|
+
})
|
|
84204
|
+
)
|
|
84205
|
+
);
|
|
84206
|
+
} catch (err) {
|
|
84207
|
+
if (err instanceof OccWriteConflictError) {
|
|
84208
|
+
throw new CommentStoreConflictError();
|
|
84209
|
+
}
|
|
84210
|
+
throw err;
|
|
84211
|
+
}
|
|
84212
|
+
}
|
|
84213
|
+
async addComment(options) {
|
|
84214
|
+
const threadId = options.threadId || randomUUID3();
|
|
84215
|
+
const commentId = randomUUID3();
|
|
84216
|
+
return this.withMutation(async (data3, version) => {
|
|
84217
|
+
const timestamp2 = (/* @__PURE__ */ new Date()).toISOString();
|
|
84218
|
+
const comment = {
|
|
84219
|
+
id: commentId,
|
|
84220
|
+
threadId,
|
|
84221
|
+
userId: options.userId,
|
|
84222
|
+
timestamp: timestamp2,
|
|
84223
|
+
text: options.text
|
|
84224
|
+
};
|
|
84225
|
+
const existing = ownThread(data3, threadId);
|
|
84226
|
+
if (!existing) {
|
|
84227
|
+
data3.threads[threadId] = {
|
|
84228
|
+
id: threadId,
|
|
84229
|
+
comments: [comment],
|
|
84230
|
+
resolved: false,
|
|
84231
|
+
createdAt: timestamp2,
|
|
84232
|
+
type: options.type,
|
|
84233
|
+
authorId: options.userId,
|
|
84234
|
+
entryPath: options.entryPath,
|
|
84235
|
+
canopyPath: options.canopyPath,
|
|
84236
|
+
...options.itemKeys?.length ? { itemKeys: options.itemKeys } : {}
|
|
84237
|
+
};
|
|
84238
|
+
} else {
|
|
84239
|
+
existing.comments.push(comment);
|
|
84240
|
+
}
|
|
84241
|
+
await this.writeData(data3, version);
|
|
84242
|
+
return { threadId, commentId };
|
|
84243
|
+
});
|
|
84244
|
+
}
|
|
84245
|
+
/**
|
|
84246
|
+
* Append a comment to an existing thread, or return null when `threadId` names none at write
|
|
84247
|
+
* time. Unlike {@link addComment}, a missing thread is never created, so a reply cannot plant
|
|
84248
|
+
* a thread under an id or entry path nobody checked.
|
|
84249
|
+
*/
|
|
84250
|
+
async addReply(options) {
|
|
84251
|
+
const commentId = randomUUID3();
|
|
84252
|
+
return this.withMutation(async (data3, version) => {
|
|
84253
|
+
const thread = ownThread(data3, options.threadId);
|
|
84254
|
+
if (!thread) {
|
|
84255
|
+
return null;
|
|
84256
|
+
}
|
|
84257
|
+
thread.comments.push({
|
|
84258
|
+
id: commentId,
|
|
84259
|
+
threadId: options.threadId,
|
|
84260
|
+
userId: options.userId,
|
|
84261
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
84262
|
+
text: options.text
|
|
84263
|
+
});
|
|
84264
|
+
await this.writeData(data3, version);
|
|
84265
|
+
return { threadId: options.threadId, commentId };
|
|
84266
|
+
});
|
|
84267
|
+
}
|
|
84268
|
+
async resolveThread(threadId, userId) {
|
|
84269
|
+
return this.withMutation(async (data3, version) => {
|
|
84270
|
+
const thread = ownThread(data3, threadId);
|
|
84271
|
+
if (!thread) {
|
|
84272
|
+
return false;
|
|
84273
|
+
}
|
|
84274
|
+
thread.resolved = true;
|
|
84275
|
+
thread.resolvedBy = userId;
|
|
84276
|
+
thread.resolvedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
84277
|
+
await this.writeData(data3, version);
|
|
84278
|
+
return true;
|
|
84279
|
+
});
|
|
84280
|
+
}
|
|
84281
|
+
async listThreads(options) {
|
|
84282
|
+
const data3 = await this.load();
|
|
84283
|
+
const threads = Object.values(data3.threads);
|
|
84284
|
+
if (options?.includeResolved === false) {
|
|
84285
|
+
return threads.filter((t6) => !t6.resolved);
|
|
84286
|
+
}
|
|
84287
|
+
return threads;
|
|
84288
|
+
}
|
|
84289
|
+
async getThread(threadId) {
|
|
84290
|
+
const data3 = await this.load();
|
|
84291
|
+
return ownThread(data3, threadId) ?? null;
|
|
84292
|
+
}
|
|
84293
|
+
async deleteThread(threadId) {
|
|
84294
|
+
return this.withMutation(async (data3, version) => {
|
|
84295
|
+
if (!ownThread(data3, threadId)) {
|
|
84296
|
+
return false;
|
|
84297
|
+
}
|
|
84298
|
+
delete data3.threads[threadId];
|
|
84299
|
+
await this.writeData(data3, version);
|
|
84300
|
+
return true;
|
|
84301
|
+
});
|
|
84302
|
+
}
|
|
84303
|
+
/** Threads on one field. */
|
|
84304
|
+
async getThreadsForField(entryPath, canopyPath) {
|
|
84305
|
+
const data3 = await this.load();
|
|
84306
|
+
return Object.values(data3.threads).filter((t6) => t6.type === "field" && t6.entryPath === entryPath && t6.canopyPath === canopyPath).sort((a9, b10) => a9.createdAt.localeCompare(b10.createdAt));
|
|
84307
|
+
}
|
|
84308
|
+
/** Threads on one entry, excluding its field threads. */
|
|
84309
|
+
async getThreadsForEntry(entryPath) {
|
|
84310
|
+
const data3 = await this.load();
|
|
84311
|
+
return Object.values(data3.threads).filter((t6) => t6.type === "entry" && t6.entryPath === entryPath).sort((a9, b10) => a9.createdAt.localeCompare(b10.createdAt));
|
|
84312
|
+
}
|
|
84313
|
+
/** Branch-level threads. */
|
|
84314
|
+
async getBranchThreads() {
|
|
84315
|
+
const data3 = await this.load();
|
|
84316
|
+
return Object.values(data3.threads).filter((t6) => t6.type === "branch").sort((a9, b10) => a9.createdAt.localeCompare(b10.createdAt));
|
|
84317
|
+
}
|
|
84318
|
+
};
|
|
84319
|
+
|
|
84320
|
+
// ../canopycms/src/pr-comments.ts
|
|
84321
|
+
init_error();
|
|
84322
|
+
var SYNC_PR_COMMENTS_ACTION = "sync-pr-comments";
|
|
84323
|
+
async function renderPrCommentsBody(options) {
|
|
84324
|
+
const threads = await new CommentStore(options.branchRoot).listThreadsStrict();
|
|
84325
|
+
const next = mergeCommentsBlock(
|
|
84326
|
+
options.body,
|
|
84327
|
+
buildCommentsBlock(threads, options.branch, options.editorUrl)
|
|
84328
|
+
);
|
|
84329
|
+
return next === void 0 || next === options.body ? void 0 : next;
|
|
84330
|
+
}
|
|
84331
|
+
async function refreshCommentsBlock(options) {
|
|
84332
|
+
try {
|
|
84333
|
+
const threads = await new CommentStore(options.branchRoot).listThreadsStrict();
|
|
84334
|
+
const block = buildCommentsBlock(threads, options.branch, options.editorUrl);
|
|
84335
|
+
return mergeCommentsBlock(options.section, block) ?? options.section;
|
|
84336
|
+
} catch (err) {
|
|
84337
|
+
options.warn(
|
|
84338
|
+
`Could not re-read the editor comments of ${options.branch}; the PR gets the summary from submit time: ${getErrorMessage(err)}`
|
|
84339
|
+
);
|
|
84340
|
+
return options.section;
|
|
84341
|
+
}
|
|
84342
|
+
}
|
|
84343
|
+
|
|
84344
|
+
// ../canopycms/src/worker/task-runner.ts
|
|
83931
84345
|
var PermanentTaskError = class extends Error {
|
|
83932
84346
|
};
|
|
83933
84347
|
var TaskAbortedForShutdownError = class extends Error {
|
|
@@ -84115,6 +84529,15 @@ async function executeTask(ctx, task, signal) {
|
|
|
84115
84529
|
return { pushed: true };
|
|
84116
84530
|
}
|
|
84117
84531
|
await ctx.pushBranchToGitHub(branch, signal);
|
|
84532
|
+
const mergeSectionIntoBody = payload3.mergeSectionIntoBody === true;
|
|
84533
|
+
const queuedBody = optionalString(payload3, "body", "");
|
|
84534
|
+
const body = mergeSectionIntoBody ? await refreshCommentsBlock({
|
|
84535
|
+
branchRoot: ctx.branchWorkspacePath(branch),
|
|
84536
|
+
branch,
|
|
84537
|
+
editorUrl: typeof payload3.editorUrl === "string" ? payload3.editorUrl : void 0,
|
|
84538
|
+
section: queuedBody,
|
|
84539
|
+
warn: workerLogWarn
|
|
84540
|
+
}) : queuedBody;
|
|
84118
84541
|
let result;
|
|
84119
84542
|
try {
|
|
84120
84543
|
result = await ctx.github().createOrUpdatePullRequest(
|
|
@@ -84122,10 +84545,10 @@ async function executeTask(ctx, task, signal) {
|
|
|
84122
84545
|
head: branch,
|
|
84123
84546
|
base,
|
|
84124
84547
|
title: optionalString(payload3, "title", `Submit ${branch}`),
|
|
84125
|
-
body
|
|
84548
|
+
body,
|
|
84126
84549
|
// Content submits (api/github-sync.ts) set both.
|
|
84127
84550
|
markReadyIfDraft: payload3.markReadyIfDraft === true,
|
|
84128
|
-
mergeSectionIntoBody
|
|
84551
|
+
mergeSectionIntoBody
|
|
84129
84552
|
},
|
|
84130
84553
|
signal
|
|
84131
84554
|
);
|
|
@@ -84194,12 +84617,42 @@ async function executeTask(ctx, task, signal) {
|
|
|
84194
84617
|
workerLog(`Deleted GitHub branch ${branch}`);
|
|
84195
84618
|
return { deleted: true };
|
|
84196
84619
|
}
|
|
84620
|
+
case "sync-pr-comments": {
|
|
84621
|
+
const branch = requireString(payload3, "branch");
|
|
84622
|
+
const prNumber2 = requireNumber(payload3, "pullRequestNumber");
|
|
84623
|
+
const editorUrl = typeof payload3.editorUrl === "string" ? payload3.editorUrl : void 0;
|
|
84624
|
+
const branchPath = ctx.branchWorkspacePath(branch);
|
|
84625
|
+
let live = null;
|
|
84626
|
+
try {
|
|
84627
|
+
live = await BranchMetadataFileManager.loadOnly(branchPath);
|
|
84628
|
+
} catch (err) {
|
|
84629
|
+
if (!(err instanceof BranchMetadataCorruptError)) throw err;
|
|
84630
|
+
}
|
|
84631
|
+
if (live?.branch.pullRequestNumber !== prNumber2) {
|
|
84632
|
+
return { updated: false, skipped: "not-this-pr" };
|
|
84633
|
+
}
|
|
84634
|
+
const pr = await ctx.github().getPullRequest(prNumber2, signal);
|
|
84635
|
+
if (pr.state !== "open") return { updated: false, skipped: "not-open" };
|
|
84636
|
+
const body = await renderPrCommentsBody({
|
|
84637
|
+
branchRoot: branchPath,
|
|
84638
|
+
branch,
|
|
84639
|
+
editorUrl,
|
|
84640
|
+
body: pr.body
|
|
84641
|
+
}).catch((err) => {
|
|
84642
|
+
if (err instanceof SyntaxError) throw new PermanentTaskError(getErrorMessage(err));
|
|
84643
|
+
throw err;
|
|
84644
|
+
});
|
|
84645
|
+
if (body === void 0) return { updated: false, skipped: "unchanged" };
|
|
84646
|
+
await ctx.github().updatePullRequest(prNumber2, { body }, signal);
|
|
84647
|
+
workerLog(`Updated the editor comments on PR #${prNumber2} for ${branch}`);
|
|
84648
|
+
return { updated: true };
|
|
84649
|
+
}
|
|
84197
84650
|
default:
|
|
84198
84651
|
throw new PermanentTaskError(`Unknown task action: ${action}`);
|
|
84199
84652
|
}
|
|
84200
84653
|
}
|
|
84201
84654
|
function metadataBranchOf(task) {
|
|
84202
|
-
if (task.action === "delete-remote-branch") return null;
|
|
84655
|
+
if (task.action === "delete-remote-branch" || task.action === SYNC_PR_COMMENTS_ACTION) return null;
|
|
84203
84656
|
return typeof task.payload.branch === "string" ? task.payload.branch : null;
|
|
84204
84657
|
}
|
|
84205
84658
|
async function updateBranchMetadata(ctx, task, result) {
|
|
@@ -84207,7 +84660,7 @@ async function updateBranchMetadata(ctx, task, result) {
|
|
|
84207
84660
|
if (!branch) return;
|
|
84208
84661
|
const branchPath = ctx.branchWorkspacePath(branch);
|
|
84209
84662
|
try {
|
|
84210
|
-
await
|
|
84663
|
+
await fs20.stat(branchPath);
|
|
84211
84664
|
} catch {
|
|
84212
84665
|
return;
|
|
84213
84666
|
}
|
|
@@ -84243,7 +84696,7 @@ async function updateBranchMetadataOnFailure(ctx, task, error3, options) {
|
|
|
84243
84696
|
if (!branch) return;
|
|
84244
84697
|
const branchPath = ctx.branchWorkspacePath(branch);
|
|
84245
84698
|
try {
|
|
84246
|
-
await
|
|
84699
|
+
await fs20.stat(branchPath);
|
|
84247
84700
|
} catch {
|
|
84248
84701
|
return;
|
|
84249
84702
|
}
|
|
@@ -84355,7 +84808,7 @@ function logPushOutcome(ctx, branch, outcome, note) {
|
|
|
84355
84808
|
async function recordPushedToGitHub(ctx, branchPath, branch) {
|
|
84356
84809
|
if (isSettingsBranch(branch)) return;
|
|
84357
84810
|
try {
|
|
84358
|
-
await
|
|
84811
|
+
await fs20.stat(branchPath);
|
|
84359
84812
|
} catch {
|
|
84360
84813
|
return;
|
|
84361
84814
|
}
|
|
@@ -84369,18 +84822,18 @@ async function recordPushedToGitHub(ctx, branchPath, branch) {
|
|
|
84369
84822
|
}
|
|
84370
84823
|
|
|
84371
84824
|
// ../canopycms/src/worker/rebase.ts
|
|
84372
|
-
import
|
|
84373
|
-
import
|
|
84825
|
+
import fs22 from "node:fs/promises";
|
|
84826
|
+
import path24 from "node:path";
|
|
84374
84827
|
init_normalize();
|
|
84375
84828
|
init_types2();
|
|
84376
84829
|
|
|
84377
84830
|
// ../canopycms/src/utils/content-write-lock.ts
|
|
84378
84831
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
84379
|
-
import
|
|
84832
|
+
import path22 from "node:path";
|
|
84380
84833
|
var META_DIR2 = ".canopy-meta";
|
|
84381
84834
|
var CONTENT_WRITE_LOCK_NAME = "content-write.lock";
|
|
84382
84835
|
function lockTargetDir(branchRoot) {
|
|
84383
|
-
return
|
|
84836
|
+
return path22.join(path22.resolve(branchRoot), META_DIR2);
|
|
84384
84837
|
}
|
|
84385
84838
|
var CONTENT_WRITE_LOCK_STALE_MS = 3e4;
|
|
84386
84839
|
function tryAcquireContentWriteLock(branchRoot, onCompromised) {
|
|
@@ -84395,8 +84848,8 @@ function tryAcquireContentWriteLock(branchRoot, onCompromised) {
|
|
|
84395
84848
|
var heldRoots = new AsyncLocalStorage();
|
|
84396
84849
|
|
|
84397
84850
|
// ../canopycms/src/worker/provisioned-workspace.ts
|
|
84398
|
-
import
|
|
84399
|
-
import
|
|
84851
|
+
import fs21 from "node:fs/promises";
|
|
84852
|
+
import path23 from "node:path";
|
|
84400
84853
|
init_error();
|
|
84401
84854
|
async function holdProvisionedWorkspace(contentBranchesPath, dirName) {
|
|
84402
84855
|
let release2;
|
|
@@ -84416,13 +84869,13 @@ async function holdProvisionedWorkspace(contentBranchesPath, dirName) {
|
|
|
84416
84869
|
if (isNodeError(err) && err.code === "ELOCKED") return { kind: "locked" };
|
|
84417
84870
|
throw err;
|
|
84418
84871
|
}
|
|
84419
|
-
const root5 =
|
|
84872
|
+
const root5 = path23.join(contentBranchesPath, dirName);
|
|
84420
84873
|
const [gitIsDir, hasMetadata] = await Promise.all([
|
|
84421
|
-
|
|
84874
|
+
fs21.stat(path23.join(root5, ".git")).then(
|
|
84422
84875
|
(stat) => stat.isDirectory(),
|
|
84423
84876
|
() => false
|
|
84424
84877
|
),
|
|
84425
|
-
|
|
84878
|
+
fs21.stat(path23.join(root5, BRANCH_META_DIR, BRANCH_META_FILE)).then(
|
|
84426
84879
|
() => true,
|
|
84427
84880
|
() => false
|
|
84428
84881
|
)
|
|
@@ -84562,13 +85015,13 @@ async function runRebaseRounds(ctx, branchGit, branchDir, fetchedBaseTip, isLock
|
|
|
84562
85015
|
function conflictFilesToContentIds(conflictedFiles, contentRoot) {
|
|
84563
85016
|
const normalizedContentRoot = normalizeFilesystemPath(contentRoot);
|
|
84564
85017
|
const conflictIds = [...new Set(conflictedFiles)].map((f9) => {
|
|
84565
|
-
const fileId = extractIdFromFilename(
|
|
85018
|
+
const fileId = extractIdFromFilename(path24.basename(f9));
|
|
84566
85019
|
if (fileId) return fileId;
|
|
84567
|
-
const parentDir =
|
|
85020
|
+
const parentDir = path24.basename(path24.dirname(f9));
|
|
84568
85021
|
const dirId = extractIdFromFilename(parentDir);
|
|
84569
85022
|
if (dirId) return dirId;
|
|
84570
|
-
const parentPath = normalizeFilesystemPath(
|
|
84571
|
-
if (
|
|
85023
|
+
const parentPath = normalizeFilesystemPath(path24.dirname(f9));
|
|
85024
|
+
if (path24.basename(f9) === ".collection.json" && parentPath === normalizedContentRoot) {
|
|
84572
85025
|
return ROOT_COLLECTION_ID;
|
|
84573
85026
|
}
|
|
84574
85027
|
return null;
|
|
@@ -84604,7 +85057,7 @@ async function runRebaseCycle(ctx) {
|
|
|
84604
85057
|
const failed = [];
|
|
84605
85058
|
let branchDirs;
|
|
84606
85059
|
try {
|
|
84607
|
-
branchDirs = await
|
|
85060
|
+
branchDirs = await fs22.readdir(ctx.contentBranchesPath);
|
|
84608
85061
|
} catch {
|
|
84609
85062
|
return { rebased, skippedDirty, skippedLocked, failed };
|
|
84610
85063
|
}
|
|
@@ -84616,10 +85069,10 @@ async function runRebaseCycle(ctx) {
|
|
|
84616
85069
|
if (branchDir.startsWith(".") || branchDir === "branches.json") {
|
|
84617
85070
|
continue;
|
|
84618
85071
|
}
|
|
84619
|
-
const branchPath =
|
|
84620
|
-
const gitDir =
|
|
85072
|
+
const branchPath = path24.join(ctx.contentBranchesPath, branchDir);
|
|
85073
|
+
const gitDir = path24.join(branchPath, ".git");
|
|
84621
85074
|
try {
|
|
84622
|
-
const stat = await
|
|
85075
|
+
const stat = await fs22.stat(gitDir);
|
|
84623
85076
|
if (!stat.isDirectory()) {
|
|
84624
85077
|
workerLog(` Skipping ${branchDir}: .git is not a directory`);
|
|
84625
85078
|
continue;
|
|
@@ -84858,16 +85311,16 @@ async function rebaseOneBranch(ctx, branchDir, branchPath, isProvisioningLockCom
|
|
|
84858
85311
|
}
|
|
84859
85312
|
|
|
84860
85313
|
// ../canopycms/src/worker/git-sync.ts
|
|
84861
|
-
import
|
|
84862
|
-
import
|
|
85314
|
+
import fs27 from "node:fs/promises";
|
|
85315
|
+
import path29 from "node:path";
|
|
84863
85316
|
|
|
84864
85317
|
// ../canopycms/src/branch-health.ts
|
|
84865
85318
|
var ORPHAN_YOUTH_THRESHOLD_MS = 15 * 6e4;
|
|
84866
85319
|
|
|
84867
85320
|
// ../canopycms/src/branch-provisioning.ts
|
|
84868
85321
|
import { createHash, randomBytes as randomBytes2 } from "node:crypto";
|
|
84869
|
-
import
|
|
84870
|
-
import
|
|
85322
|
+
import fs23 from "node:fs/promises";
|
|
85323
|
+
import path25 from "node:path";
|
|
84871
85324
|
init_error();
|
|
84872
85325
|
init_logger();
|
|
84873
85326
|
var STAGING_MAX_AGE_MS = 20 * 6e4;
|
|
@@ -84899,7 +85352,7 @@ var DELETING_PREFIX = ".deleting-";
|
|
|
84899
85352
|
var NO_GIT = { hasGitDir: false, configLock: false, hasIndex: false };
|
|
84900
85353
|
async function listDir(dirPath) {
|
|
84901
85354
|
try {
|
|
84902
|
-
return await
|
|
85355
|
+
return await fs23.readdir(dirPath);
|
|
84903
85356
|
} catch (err) {
|
|
84904
85357
|
if (isNodeError(err) && (err.code === "ENOENT" || err.code === "ENOTDIR")) return null;
|
|
84905
85358
|
throw err;
|
|
@@ -84921,19 +85374,19 @@ function gitConfigRemoteUrls(text) {
|
|
|
84921
85374
|
}
|
|
84922
85375
|
function sameRemote(url, expected) {
|
|
84923
85376
|
if (isNetworkRemoteUrl(url) || isNetworkRemoteUrl(expected)) return url === expected;
|
|
84924
|
-
const local = (value) =>
|
|
85377
|
+
const local = (value) => path25.resolve(value.replace(/^file:\/\//i, ""));
|
|
84925
85378
|
return local(url) === local(expected);
|
|
84926
85379
|
}
|
|
84927
85380
|
async function classifyFinalDir(dirPath, expectedRemoteUrl) {
|
|
84928
85381
|
let stat;
|
|
84929
85382
|
try {
|
|
84930
|
-
stat = await
|
|
85383
|
+
stat = await fs23.lstat(dirPath);
|
|
84931
85384
|
} catch (err) {
|
|
84932
85385
|
if (isNotFoundError2(err)) return { kind: "vacant" };
|
|
84933
85386
|
throw err;
|
|
84934
85387
|
}
|
|
84935
85388
|
if (!stat.isDirectory()) return { kind: "residue", signature: NO_GIT };
|
|
84936
|
-
const metaEntries = await listDir(
|
|
85389
|
+
const metaEntries = await listDir(path25.join(dirPath, BRANCH_META_DIR)) ?? [];
|
|
84937
85390
|
if (metaEntries.includes(BRANCH_META_FILE)) {
|
|
84938
85391
|
try {
|
|
84939
85392
|
return await readBranchMetadataFile(dirPath) ? { kind: "live" } : { kind: "protected" };
|
|
@@ -84945,10 +85398,10 @@ async function classifyFinalDir(dirPath, expectedRemoteUrl) {
|
|
|
84945
85398
|
if (metaEntries.some((name2) => name2.startsWith(`${BRANCH_META_FILE}.corrupt-`))) {
|
|
84946
85399
|
return { kind: "protected" };
|
|
84947
85400
|
}
|
|
84948
|
-
const gitPath =
|
|
85401
|
+
const gitPath = path25.join(dirPath, ".git");
|
|
84949
85402
|
let gitStat;
|
|
84950
85403
|
try {
|
|
84951
|
-
gitStat = await
|
|
85404
|
+
gitStat = await fs23.lstat(gitPath);
|
|
84952
85405
|
} catch (err) {
|
|
84953
85406
|
if (isNotFoundError2(err)) return { kind: "residue", signature: NO_GIT };
|
|
84954
85407
|
throw err;
|
|
@@ -84962,7 +85415,7 @@ async function classifyFinalDir(dirPath, expectedRemoteUrl) {
|
|
|
84962
85415
|
};
|
|
84963
85416
|
let config;
|
|
84964
85417
|
try {
|
|
84965
|
-
config = await
|
|
85418
|
+
config = await fs23.readFile(path25.join(gitPath, "config"), "utf8");
|
|
84966
85419
|
} catch {
|
|
84967
85420
|
return { kind: "residue", signature };
|
|
84968
85421
|
}
|
|
@@ -84971,7 +85424,7 @@ async function classifyFinalDir(dirPath, expectedRemoteUrl) {
|
|
|
84971
85424
|
async function quietAgeMs(dirPath, now = Date.now()) {
|
|
84972
85425
|
const mtimes = await Promise.all(
|
|
84973
85426
|
["", ".git", BRANCH_META_DIR].map(
|
|
84974
|
-
(sub) =>
|
|
85427
|
+
(sub) => fs23.lstat(path25.join(dirPath, sub)).then(
|
|
84975
85428
|
(stat) => stat.mtimeMs,
|
|
84976
85429
|
() => 0
|
|
84977
85430
|
)
|
|
@@ -84980,25 +85433,25 @@ async function quietAgeMs(dirPath, now = Date.now()) {
|
|
|
84980
85433
|
return now - Math.max(...mtimes);
|
|
84981
85434
|
}
|
|
84982
85435
|
async function quarantineResidueAt(baseRoot, dirName, options) {
|
|
84983
|
-
const finalPath =
|
|
85436
|
+
const finalPath = path25.join(baseRoot, dirName);
|
|
84984
85437
|
let inode;
|
|
84985
85438
|
try {
|
|
84986
|
-
inode = (await
|
|
85439
|
+
inode = (await fs23.lstat(finalPath)).ino;
|
|
84987
85440
|
} catch (err) {
|
|
84988
85441
|
if (isNotFoundError2(err)) return { kind: "vacant" };
|
|
84989
85442
|
throw err;
|
|
84990
85443
|
}
|
|
84991
85444
|
const candidateName = stampedName(REPAIR_PREFIX, dirName, /* @__PURE__ */ new Date());
|
|
84992
|
-
const candidate =
|
|
85445
|
+
const candidate = path25.join(baseRoot, candidateName);
|
|
84993
85446
|
try {
|
|
84994
|
-
await
|
|
85447
|
+
await fs23.rename(finalPath, candidate);
|
|
84995
85448
|
} catch (err) {
|
|
84996
85449
|
if (isNotFoundError2(err)) return { kind: "vacant" };
|
|
84997
85450
|
throw err;
|
|
84998
85451
|
}
|
|
84999
85452
|
const moveBack = async (why) => {
|
|
85000
85453
|
try {
|
|
85001
|
-
await
|
|
85454
|
+
await fs23.rename(candidate, finalPath);
|
|
85002
85455
|
} catch (err) {
|
|
85003
85456
|
canopyLogError(
|
|
85004
85457
|
`[canopy] Could not move '${dirName}' back from ${candidateName} after ${why}: ${getErrorMessage(err)}. The worker's sweep restores or trashes it.`
|
|
@@ -85013,7 +85466,7 @@ async function quarantineResidueAt(baseRoot, dirName, options) {
|
|
|
85013
85466
|
);
|
|
85014
85467
|
if (reason === void 0 && state3.kind === "residue") {
|
|
85015
85468
|
const trashName = stampedName(TRASH_PREFIX, dirName, /* @__PURE__ */ new Date());
|
|
85016
|
-
await
|
|
85469
|
+
await fs23.rename(candidate, path25.join(baseRoot, trashName));
|
|
85017
85470
|
const { hasGitDir, configLock, hasIndex } = state3.signature;
|
|
85018
85471
|
canopyLogWarn(
|
|
85019
85472
|
`[canopy] Quarantined unfinished branch directory '${dirName}' as ${trashName} (git=${hasGitDir} config.lock=${configLock} index=${hasIndex} quiet=${Math.round(quiet / 1e3)}s)`
|
|
@@ -85025,7 +85478,7 @@ async function quarantineResidueAt(baseRoot, dirName, options) {
|
|
|
85025
85478
|
}
|
|
85026
85479
|
async function judgeQuarantineCandidate(candidate, inode, options) {
|
|
85027
85480
|
const state3 = await classifyFinalDir(candidate, options.expectedRemoteUrl);
|
|
85028
|
-
const moved = await
|
|
85481
|
+
const moved = await fs23.lstat(candidate).catch(() => null);
|
|
85029
85482
|
const quiet = await quietAgeMs(candidate, options.now);
|
|
85030
85483
|
let reason;
|
|
85031
85484
|
if (!moved || moved.ino !== inode) reason = "replaced";
|
|
@@ -85042,7 +85495,7 @@ async function sweepByAge(root5, rules, now) {
|
|
|
85042
85495
|
const stamp = rule ? parseDirStamp(name2) : null;
|
|
85043
85496
|
if (!rule || !stamp || now - stamp.getTime() < rule.maxAgeMs) continue;
|
|
85044
85497
|
try {
|
|
85045
|
-
await
|
|
85498
|
+
await fs23.rm(path25.join(root5, name2), {
|
|
85046
85499
|
recursive: true,
|
|
85047
85500
|
force: true,
|
|
85048
85501
|
maxRetries: 3,
|
|
@@ -85056,7 +85509,7 @@ async function sweepByAge(root5, rules, now) {
|
|
|
85056
85509
|
return actions;
|
|
85057
85510
|
}
|
|
85058
85511
|
async function recoverRepairDir(baseRoot, name2) {
|
|
85059
|
-
const repairPath =
|
|
85512
|
+
const repairPath = path25.join(baseRoot, name2);
|
|
85060
85513
|
const meta = await readBranchMetadataFile(repairPath).catch(() => null);
|
|
85061
85514
|
const dirName = meta ? sanitizeBranchName(meta.branch.name) : void 0;
|
|
85062
85515
|
if (dirName && name2.startsWith(`${REPAIR_PREFIX}${shortDirName(dirName)}-`)) {
|
|
@@ -85070,9 +85523,9 @@ async function recoverRepairDir(baseRoot, name2) {
|
|
|
85070
85523
|
throw err;
|
|
85071
85524
|
}
|
|
85072
85525
|
try {
|
|
85073
|
-
const finalPath =
|
|
85074
|
-
if (await
|
|
85075
|
-
await
|
|
85526
|
+
const finalPath = path25.join(baseRoot, dirName);
|
|
85527
|
+
if (await fs23.lstat(finalPath).catch(() => null) === null) {
|
|
85528
|
+
await fs23.rename(repairPath, finalPath);
|
|
85076
85529
|
return { name: name2, action: "restored", detail: dirName };
|
|
85077
85530
|
}
|
|
85078
85531
|
} finally {
|
|
@@ -85081,7 +85534,7 @@ async function recoverRepairDir(baseRoot, name2) {
|
|
|
85081
85534
|
}
|
|
85082
85535
|
}
|
|
85083
85536
|
const trashName = `${TRASH_PREFIX}${name2.slice(REPAIR_PREFIX.length)}`;
|
|
85084
|
-
await
|
|
85537
|
+
await fs23.rename(repairPath, path25.join(baseRoot, trashName));
|
|
85085
85538
|
return { name: name2, action: "trashed", detail: trashName };
|
|
85086
85539
|
}
|
|
85087
85540
|
async function sweepProvisioningLeftovers(baseRoot, workspaceRoot, now = Date.now()) {
|
|
@@ -85131,12 +85584,12 @@ async function maintainRemoteGit(gitDir) {
|
|
|
85131
85584
|
}
|
|
85132
85585
|
|
|
85133
85586
|
// ../canopycms/src/worker/sparse-cone.ts
|
|
85134
|
-
import
|
|
85135
|
-
import
|
|
85587
|
+
import fs25 from "node:fs/promises";
|
|
85588
|
+
import path27 from "node:path";
|
|
85136
85589
|
|
|
85137
85590
|
// ../canopycms/src/branch-sparse.ts
|
|
85138
|
-
import
|
|
85139
|
-
import
|
|
85591
|
+
import fs24 from "node:fs/promises";
|
|
85592
|
+
import path26 from "node:path";
|
|
85140
85593
|
init_error();
|
|
85141
85594
|
function sameCone(a9, b10) {
|
|
85142
85595
|
if (a9 === null || b10 === null) return a9 === b10;
|
|
@@ -85145,12 +85598,12 @@ function sameCone(a9, b10) {
|
|
|
85145
85598
|
}
|
|
85146
85599
|
var SPARSE_CONE_RECORD = ".sparse-cone.json";
|
|
85147
85600
|
function isConeDir(dir) {
|
|
85148
|
-
return typeof dir === "string" && dir.length > 0 && !
|
|
85601
|
+
return typeof dir === "string" && dir.length > 0 && !path26.isAbsolute(dir) && !dir.split("/").some((segment) => segment === "" || segment === "." || segment === "..");
|
|
85149
85602
|
}
|
|
85150
85603
|
async function readRecordedSparseCone(contentBranchesRoot) {
|
|
85151
85604
|
let raw;
|
|
85152
85605
|
try {
|
|
85153
|
-
raw = await
|
|
85606
|
+
raw = await fs24.readFile(path26.join(contentBranchesRoot, SPARSE_CONE_RECORD), "utf8");
|
|
85154
85607
|
} catch (err) {
|
|
85155
85608
|
if (isNodeError(err) && err.code === "ENOENT") return void 0;
|
|
85156
85609
|
throw err;
|
|
@@ -85183,15 +85636,15 @@ async function reapplySparseCones(ctx) {
|
|
|
85183
85636
|
if (!recorded) return report;
|
|
85184
85637
|
let entries;
|
|
85185
85638
|
try {
|
|
85186
|
-
entries = await
|
|
85639
|
+
entries = await fs25.readdir(ctx.contentBranchesPath, { withFileTypes: true });
|
|
85187
85640
|
} catch (err) {
|
|
85188
85641
|
if (isNodeError(err) && err.code === "ENOENT") return report;
|
|
85189
85642
|
throw err;
|
|
85190
85643
|
}
|
|
85191
85644
|
const dirNames = entries.filter((entry) => entry.isDirectory() && !entry.name.startsWith(".")).map((entry) => entry.name).sort();
|
|
85192
85645
|
for (const dirName of dirNames) {
|
|
85193
|
-
const branchPath =
|
|
85194
|
-
const isClone = await
|
|
85646
|
+
const branchPath = path27.join(ctx.contentBranchesPath, dirName);
|
|
85647
|
+
const isClone = await fs25.stat(path27.join(branchPath, ".git")).then(
|
|
85195
85648
|
(stat) => stat.isDirectory(),
|
|
85196
85649
|
() => false
|
|
85197
85650
|
);
|
|
@@ -85223,7 +85676,7 @@ async function reapplySparseCones(ctx) {
|
|
|
85223
85676
|
return report;
|
|
85224
85677
|
}
|
|
85225
85678
|
async function reapplyOne(contentBranchesPath, dirName, git, target) {
|
|
85226
|
-
const branchPath =
|
|
85679
|
+
const branchPath = path27.join(contentBranchesPath, dirName);
|
|
85227
85680
|
const hold = await holdProvisionedWorkspace(contentBranchesPath, dirName);
|
|
85228
85681
|
if (hold.kind !== "held") return "skipped";
|
|
85229
85682
|
try {
|
|
@@ -85262,11 +85715,11 @@ async function reapplyOne(contentBranchesPath, dirName, git, target) {
|
|
|
85262
85715
|
}
|
|
85263
85716
|
|
|
85264
85717
|
// ../canopycms/src/worker/stale-mirror.ts
|
|
85265
|
-
import
|
|
85266
|
-
import
|
|
85718
|
+
import fs26 from "node:fs/promises";
|
|
85719
|
+
import path28 from "node:path";
|
|
85267
85720
|
init_error();
|
|
85268
85721
|
async function readEditorWork(ctx) {
|
|
85269
|
-
const workspaces = new Set(await
|
|
85722
|
+
const workspaces = new Set(await fs26.readdir(ctx.contentBranchesPath).catch(() => []));
|
|
85270
85723
|
const queuedPushes = /* @__PURE__ */ new Set();
|
|
85271
85724
|
for (const status of ["pending", "processing"]) {
|
|
85272
85725
|
for (const task of await listTasks(ctx.taskDir, status, Number.POSITIVE_INFINITY)) {
|
|
@@ -85301,7 +85754,7 @@ async function settleStaleMirror(ctx, git, head, ownSettingsBranch, editorWork,
|
|
|
85301
85754
|
throw err;
|
|
85302
85755
|
}
|
|
85303
85756
|
try {
|
|
85304
|
-
if ((await
|
|
85757
|
+
if ((await fs26.readdir(ctx.contentBranchesPath)).includes(dirName)) {
|
|
85305
85758
|
return { kind: "kept", state: "workspace" };
|
|
85306
85759
|
}
|
|
85307
85760
|
const ref = `refs/heads/${name2}`;
|
|
@@ -85311,7 +85764,7 @@ async function settleStaleMirror(ctx, git, head, ownSettingsBranch, editorWork,
|
|
|
85311
85764
|
);
|
|
85312
85765
|
} catch (err) {
|
|
85313
85766
|
const message2 = getErrorMessage(err);
|
|
85314
|
-
if (lockHeld(message2) ===
|
|
85767
|
+
if (lockHeld(message2) === path28.join(ctx.remoteGitPath, "packed-refs.lock")) {
|
|
85315
85768
|
return { kind: "packed-refs-locked" };
|
|
85316
85769
|
}
|
|
85317
85770
|
if (/cannot lock ref|Unable to create '[^']*\.lock': File exists/.test(message2)) {
|
|
@@ -85326,7 +85779,7 @@ async function settleStaleMirror(ctx, git, head, ownSettingsBranch, editorWork,
|
|
|
85326
85779
|
}
|
|
85327
85780
|
function lockHeld(message2) {
|
|
85328
85781
|
const match2 = /Unable to create '([^']*)': File exists/.exec(message2);
|
|
85329
|
-
return match2 ?
|
|
85782
|
+
return match2 ? path28.normalize(match2[1]) : null;
|
|
85330
85783
|
}
|
|
85331
85784
|
async function sharesHistory(git, head, baseTip) {
|
|
85332
85785
|
try {
|
|
@@ -85677,6 +86130,7 @@ async function syncGit(ctx) {
|
|
|
85677
86130
|
await writeWorkerStatus(ctx.taskDir, report).catch(
|
|
85678
86131
|
(writeErr) => workerLogError("Failed to write worker status:", getErrorMessage(writeErr))
|
|
85679
86132
|
);
|
|
86133
|
+
workerLog("Git sync complete");
|
|
85680
86134
|
} catch (err) {
|
|
85681
86135
|
const report = ctx.ensureStatusReport();
|
|
85682
86136
|
report.lastGitSyncError = {
|
|
@@ -85698,7 +86152,7 @@ var reportedForeignDirs = /* @__PURE__ */ new Set();
|
|
|
85698
86152
|
async function repairBranchDirResidue(ctx, now = Date.now()) {
|
|
85699
86153
|
let entries;
|
|
85700
86154
|
try {
|
|
85701
|
-
entries = await
|
|
86155
|
+
entries = await fs27.readdir(ctx.contentBranchesPath, { withFileTypes: true });
|
|
85702
86156
|
} catch (err) {
|
|
85703
86157
|
if (isNodeError(err) && err.code === "ENOENT") return;
|
|
85704
86158
|
throw err;
|
|
@@ -85713,7 +86167,7 @@ async function repairBranchDirResidue(ctx, now = Date.now()) {
|
|
|
85713
86167
|
}
|
|
85714
86168
|
const leftovers = await sweepProvisioningLeftovers(
|
|
85715
86169
|
ctx.contentBranchesPath,
|
|
85716
|
-
|
|
86170
|
+
path29.dirname(ctx.contentBranchesPath),
|
|
85717
86171
|
now
|
|
85718
86172
|
);
|
|
85719
86173
|
for (const { name: name2, action, detail } of leftovers) {
|
|
@@ -85724,8 +86178,8 @@ async function repairBranchDirResidue(ctx, now = Date.now()) {
|
|
|
85724
86178
|
}
|
|
85725
86179
|
}
|
|
85726
86180
|
async function repairOneBranchDir(ctx, dirName, now) {
|
|
85727
|
-
const dirPath =
|
|
85728
|
-
const hasMeta = await
|
|
86181
|
+
const dirPath = path29.join(ctx.contentBranchesPath, dirName);
|
|
86182
|
+
const hasMeta = await fs27.access(path29.join(dirPath, BRANCH_META_DIR, BRANCH_META_FILE)).then(
|
|
85729
86183
|
() => true,
|
|
85730
86184
|
() => false
|
|
85731
86185
|
);
|
|
@@ -85761,7 +86215,7 @@ async function repairOneBranchDir(ctx, dirName, now) {
|
|
|
85761
86215
|
async function cleanupTrashedBranchDirs(ctx) {
|
|
85762
86216
|
let entries;
|
|
85763
86217
|
try {
|
|
85764
|
-
entries = await
|
|
86218
|
+
entries = await fs27.readdir(ctx.contentBranchesPath);
|
|
85765
86219
|
} catch (err) {
|
|
85766
86220
|
if (isNodeError(err) && err.code === "ENOENT") return 0;
|
|
85767
86221
|
throw err;
|
|
@@ -85781,7 +86235,7 @@ async function cleanupTrashedBranchDirs(ctx) {
|
|
|
85781
86235
|
}
|
|
85782
86236
|
if (now - stampDate.getTime() < TRASH_RETENTION_MS) continue;
|
|
85783
86237
|
try {
|
|
85784
|
-
await
|
|
86238
|
+
await fs27.rm(path29.join(ctx.contentBranchesPath, name2), {
|
|
85785
86239
|
recursive: true,
|
|
85786
86240
|
force: true,
|
|
85787
86241
|
maxRetries: 3,
|
|
@@ -85799,7 +86253,7 @@ async function cleanupTrashedBranchDirs(ctx) {
|
|
|
85799
86253
|
}
|
|
85800
86254
|
var warnedTrackedCanopyState = /* @__PURE__ */ new Set();
|
|
85801
86255
|
async function refreshBaseBranchWorkspace(ctx) {
|
|
85802
|
-
const basePath37 =
|
|
86256
|
+
const basePath37 = path29.join(ctx.contentBranchesPath, ctx.sanitizedBaseBranch);
|
|
85803
86257
|
let trackedCanopyMeta;
|
|
85804
86258
|
let releaseProvisioning;
|
|
85805
86259
|
let releaseContentLock;
|
|
@@ -85957,10 +86411,10 @@ async function refreshBaseBranchWorkspace(ctx) {
|
|
|
85957
86411
|
// ../canopycms/src/worker/github-gateway-http.ts
|
|
85958
86412
|
init_error();
|
|
85959
86413
|
import { randomBytes as randomBytes3 } from "node:crypto";
|
|
85960
|
-
import
|
|
86414
|
+
import fs28 from "node:fs/promises";
|
|
85961
86415
|
import http from "node:http";
|
|
85962
86416
|
import net from "node:net";
|
|
85963
|
-
import
|
|
86417
|
+
import path30 from "node:path";
|
|
85964
86418
|
import { PassThrough } from "node:stream";
|
|
85965
86419
|
import { pipeline as pipeline2 } from "node:stream/promises";
|
|
85966
86420
|
var MAX_POLL_WAIT_MS = 25e3;
|
|
@@ -85983,11 +86437,11 @@ async function serveGitHubGateway(gateway, listen, options = {}) {
|
|
|
85983
86437
|
if ("fd" in listen) {
|
|
85984
86438
|
await listenOn(server, { fd: listen.fd });
|
|
85985
86439
|
} else {
|
|
85986
|
-
await assertPrivateDirectory(
|
|
86440
|
+
await assertPrivateDirectory(path30.dirname(listen.path));
|
|
85987
86441
|
await removeStaleSocket(listen.path);
|
|
85988
86442
|
await listenOn(server, { path: listen.path });
|
|
85989
86443
|
try {
|
|
85990
|
-
await
|
|
86444
|
+
await fs28.chmod(listen.path, 384);
|
|
85991
86445
|
} catch (err) {
|
|
85992
86446
|
await closeServer(server, handler);
|
|
85993
86447
|
throw err;
|
|
@@ -86028,7 +86482,7 @@ function listenOn(server, options) {
|
|
|
86028
86482
|
});
|
|
86029
86483
|
}
|
|
86030
86484
|
async function assertPrivateDirectory(dir) {
|
|
86031
|
-
const stat = await
|
|
86485
|
+
const stat = await fs28.lstat(dir);
|
|
86032
86486
|
const uid = process.getuid?.();
|
|
86033
86487
|
if (!stat.isDirectory() || uid !== void 0 && (stat.uid !== uid || (stat.mode & 63) !== 0)) {
|
|
86034
86488
|
throw new Error(
|
|
@@ -86039,7 +86493,7 @@ async function assertPrivateDirectory(dir) {
|
|
|
86039
86493
|
async function removeStaleSocket(socketPath) {
|
|
86040
86494
|
let stat;
|
|
86041
86495
|
try {
|
|
86042
|
-
stat = await
|
|
86496
|
+
stat = await fs28.lstat(socketPath);
|
|
86043
86497
|
} catch (err) {
|
|
86044
86498
|
if (isNodeError(err) && err.code === "ENOENT") return;
|
|
86045
86499
|
throw err;
|
|
@@ -86055,7 +86509,7 @@ async function removeStaleSocket(socketPath) {
|
|
|
86055
86509
|
`Refusing to serve the GitHub gateway at ${socketPath}: a gateway already serves there`
|
|
86056
86510
|
);
|
|
86057
86511
|
}
|
|
86058
|
-
await
|
|
86512
|
+
await fs28.unlink(socketPath);
|
|
86059
86513
|
}
|
|
86060
86514
|
function isServed(socketPath) {
|
|
86061
86515
|
return new Promise((resolve) => {
|
|
@@ -86115,8 +86569,11 @@ var GatewayRequestHandler = class {
|
|
|
86115
86569
|
return {};
|
|
86116
86570
|
},
|
|
86117
86571
|
getPullRequest: async ({ number }, signal) => {
|
|
86118
|
-
const { merged, merged_at, state: state3, node_id } = await gateway.getPullRequest(
|
|
86119
|
-
|
|
86572
|
+
const { merged, merged_at, state: state3, node_id, body } = await gateway.getPullRequest(
|
|
86573
|
+
number,
|
|
86574
|
+
signal
|
|
86575
|
+
);
|
|
86576
|
+
return { merged, merged_at, state: state3, node_id, body: body ?? null };
|
|
86120
86577
|
},
|
|
86121
86578
|
createOrUpdatePullRequest: async (input, signal) => {
|
|
86122
86579
|
const { number, url, created } = await gateway.createOrUpdatePullRequest(input, signal);
|
|
@@ -86783,9 +87240,9 @@ async function readAnswer(res, schema, signal) {
|
|
|
86783
87240
|
|
|
86784
87241
|
// ../canopycms/src/worker/self-checks.ts
|
|
86785
87242
|
init_error();
|
|
86786
|
-
import
|
|
87243
|
+
import fs29 from "node:fs/promises";
|
|
86787
87244
|
import net2 from "node:net";
|
|
86788
|
-
import
|
|
87245
|
+
import path31 from "node:path";
|
|
86789
87246
|
var IMDS_HOST = "169.254.169.254";
|
|
86790
87247
|
var IMDS_CONNECT_TIMEOUT_MS = 1e3;
|
|
86791
87248
|
var NO_ROUTE_CODES = /* @__PURE__ */ new Set(["ENETUNREACH", "EAFNOSUPPORT"]);
|
|
@@ -86840,10 +87297,10 @@ async function imdsUnreachable(environment = {}) {
|
|
|
86840
87297
|
};
|
|
86841
87298
|
}
|
|
86842
87299
|
async function onlyLoopback(environment = {}) {
|
|
86843
|
-
const file =
|
|
87300
|
+
const file = path31.join(rootOf(environment), "proc", "self", "net", "dev");
|
|
86844
87301
|
let text;
|
|
86845
87302
|
try {
|
|
86846
|
-
text = await
|
|
87303
|
+
text = await fs29.readFile(file, "utf8");
|
|
86847
87304
|
} catch (err) {
|
|
86848
87305
|
return {
|
|
86849
87306
|
check: "network-namespace",
|
|
@@ -86860,21 +87317,21 @@ async function onlyLoopback(environment = {}) {
|
|
|
86860
87317
|
};
|
|
86861
87318
|
}
|
|
86862
87319
|
async function procShowsOnlyOwnProcesses(environment = {}) {
|
|
86863
|
-
const proc =
|
|
87320
|
+
const proc = path31.join(rootOf(environment), "proc");
|
|
86864
87321
|
const uid = environment.uid ?? process.getuid?.();
|
|
86865
87322
|
if (uid === void 0) {
|
|
86866
87323
|
return { check: "proc", ok: false, detail: "this platform has no process uid to compare" };
|
|
86867
87324
|
}
|
|
86868
87325
|
let entries;
|
|
86869
87326
|
try {
|
|
86870
|
-
entries = await
|
|
87327
|
+
entries = await fs29.readdir(proc);
|
|
86871
87328
|
} catch (err) {
|
|
86872
87329
|
return { check: "proc", ok: false, detail: `cannot list ${proc}: ${getErrorMessage(err)}` };
|
|
86873
87330
|
}
|
|
86874
87331
|
const others = [];
|
|
86875
87332
|
for (const entry of entries.filter((name2) => /^\d+$/.test(name2))) {
|
|
86876
87333
|
try {
|
|
86877
|
-
const stat = await
|
|
87334
|
+
const stat = await fs29.stat(path31.join(proc, entry));
|
|
86878
87335
|
if (stat.uid !== uid) others.push(`${entry} (uid ${stat.uid})`);
|
|
86879
87336
|
} catch (err) {
|
|
86880
87337
|
if (!(isNodeError(err) && err.code === "ENOENT")) {
|
|
@@ -86890,9 +87347,9 @@ async function procShowsOnlyOwnProcesses(environment = {}) {
|
|
|
86890
87347
|
};
|
|
86891
87348
|
}
|
|
86892
87349
|
async function homeIsEmpty(environment = {}) {
|
|
86893
|
-
const home =
|
|
87350
|
+
const home = path31.join(rootOf(environment), "home");
|
|
86894
87351
|
try {
|
|
86895
|
-
const entries = await
|
|
87352
|
+
const entries = await fs29.readdir(home);
|
|
86896
87353
|
return {
|
|
86897
87354
|
check: "home",
|
|
86898
87355
|
ok: entries.length === 0,
|
|
@@ -86915,9 +87372,9 @@ function noSecretsInEnv(environment = {}) {
|
|
|
86915
87372
|
};
|
|
86916
87373
|
}
|
|
86917
87374
|
async function efsUnreadable(environment = {}) {
|
|
86918
|
-
const efs =
|
|
87375
|
+
const efs = path31.join(rootOf(environment), "mnt", "efs");
|
|
86919
87376
|
try {
|
|
86920
|
-
await
|
|
87377
|
+
await fs29.readdir(efs);
|
|
86921
87378
|
} catch (err) {
|
|
86922
87379
|
const code = isNodeError(err) ? err.code : void 0;
|
|
86923
87380
|
const denied = code === "EACCES" || code === "EPERM";
|
|
@@ -86934,9 +87391,9 @@ async function efsUnreadable(environment = {}) {
|
|
|
86934
87391
|
};
|
|
86935
87392
|
}
|
|
86936
87393
|
async function corePatternNotPiped(environment = {}) {
|
|
86937
|
-
const file =
|
|
87394
|
+
const file = path31.join(rootOf(environment), "proc", "sys", "kernel", "core_pattern");
|
|
86938
87395
|
try {
|
|
86939
|
-
const pattern = (await
|
|
87396
|
+
const pattern = (await fs29.readFile(file, "utf8")).trim();
|
|
86940
87397
|
const ok = !pattern.startsWith("|");
|
|
86941
87398
|
return {
|
|
86942
87399
|
check: "core-pattern",
|
|
@@ -86952,10 +87409,10 @@ async function corePatternNotPiped(environment = {}) {
|
|
|
86952
87409
|
}
|
|
86953
87410
|
}
|
|
86954
87411
|
async function coreLimitZero(environment = {}) {
|
|
86955
|
-
const file =
|
|
87412
|
+
const file = path31.join(rootOf(environment), "proc", "self", "limits");
|
|
86956
87413
|
let text;
|
|
86957
87414
|
try {
|
|
86958
|
-
text = await
|
|
87415
|
+
text = await fs29.readFile(file, "utf8");
|
|
86959
87416
|
} catch (err) {
|
|
86960
87417
|
return {
|
|
86961
87418
|
check: "core-limit",
|
|
@@ -86977,11 +87434,11 @@ async function socketAccessIsOthers(environment = {}) {
|
|
|
86977
87434
|
const uid = environment.uid ?? process.getuid?.();
|
|
86978
87435
|
if (uid === void 0) return fail("this platform has no process uid to compare");
|
|
86979
87436
|
const fd = environment.listenFd ?? 3;
|
|
86980
|
-
const proc =
|
|
87437
|
+
const proc = path31.join(rootOf(environment), "proc", "self");
|
|
86981
87438
|
let socketPath;
|
|
86982
87439
|
try {
|
|
86983
|
-
const inode = (await
|
|
86984
|
-
const table = await
|
|
87440
|
+
const inode = (await fs29.stat(path31.join(proc, "fd", String(fd)))).ino;
|
|
87441
|
+
const table = await fs29.readFile(path31.join(proc, "net", "unix"), "utf8");
|
|
86985
87442
|
for (const line of table.split("\n").slice(1)) {
|
|
86986
87443
|
const fields = line.trim().split(/\s+/);
|
|
86987
87444
|
if (fields[6] === String(inode) && fields.length > 7) socketPath = fields.slice(7).join(" ");
|
|
@@ -86989,12 +87446,12 @@ async function socketAccessIsOthers(environment = {}) {
|
|
|
86989
87446
|
} catch (err) {
|
|
86990
87447
|
return fail(`cannot find the socket on descriptor ${fd}: ${getErrorMessage(err)}`);
|
|
86991
87448
|
}
|
|
86992
|
-
if (socketPath === void 0 || !
|
|
87449
|
+
if (socketPath === void 0 || !path31.isAbsolute(socketPath)) {
|
|
86993
87450
|
return fail(`the socket on descriptor ${fd} is not bound to a path`);
|
|
86994
87451
|
}
|
|
86995
87452
|
let node;
|
|
86996
87453
|
try {
|
|
86997
|
-
node = await
|
|
87454
|
+
node = await fs29.lstat(socketPath);
|
|
86998
87455
|
} catch (err) {
|
|
86999
87456
|
return fail(`cannot read ${socketPath}: ${getErrorMessage(err)}`);
|
|
87000
87457
|
}
|
|
@@ -87041,8 +87498,8 @@ function tcpConnect(host, port, timeoutMs) {
|
|
|
87041
87498
|
|
|
87042
87499
|
// ../canopycms/src/worker/cms-worker.ts
|
|
87043
87500
|
function defaultStateDirectory(workspacePath) {
|
|
87044
|
-
const key = createHash2("sha256").update(
|
|
87045
|
-
return
|
|
87501
|
+
const key = createHash2("sha256").update(path32.resolve(workspacePath)).digest("hex").slice(0, 16);
|
|
87502
|
+
return path32.join(os.tmpdir(), `canopycms-worker-${key}`);
|
|
87046
87503
|
}
|
|
87047
87504
|
var MAX_REFS_LISTED = 20;
|
|
87048
87505
|
var RemoteGitKeptError = class extends Error {
|
|
@@ -87090,7 +87547,7 @@ function lockWorkerTaskDir(taskDir, lockStaleMs, options) {
|
|
|
87090
87547
|
const waitMs = options.waitMs ?? 0;
|
|
87091
87548
|
const intervalMs = Math.max(250, Math.min(5e3, Math.floor(lockStaleMs / 4)));
|
|
87092
87549
|
return import_proper_lockfile3.default.lock(taskDir, {
|
|
87093
|
-
lockfilePath:
|
|
87550
|
+
lockfilePath: path32.join(taskDir, ".worker-lock"),
|
|
87094
87551
|
stale: lockStaleMs,
|
|
87095
87552
|
onCompromised: options.onCompromised,
|
|
87096
87553
|
...waitMs > 0 ? {
|
|
@@ -87113,10 +87570,10 @@ async function readCarriedFields(taskDir) {
|
|
|
87113
87570
|
};
|
|
87114
87571
|
}
|
|
87115
87572
|
async function recordWorkerStartupFailure(options) {
|
|
87116
|
-
const taskDir =
|
|
87573
|
+
const taskDir = path32.join(options.workspacePath, ".tasks");
|
|
87117
87574
|
let release2;
|
|
87118
87575
|
try {
|
|
87119
|
-
await
|
|
87576
|
+
await fs30.mkdir(taskDir, { recursive: true });
|
|
87120
87577
|
release2 = await lockWorkerTaskDir(taskDir, 2 * (options.lockStaleMs ?? DEFAULT_LOCK_STALE_MS), {
|
|
87121
87578
|
onCompromised: (err) => workerLogError("Worker lock lost while recording a startup failure:", getErrorMessage(err))
|
|
87122
87579
|
});
|
|
@@ -87172,17 +87629,17 @@ var CmsWorker = class {
|
|
|
87172
87629
|
this.selfStopped = new Promise((resolve) => {
|
|
87173
87630
|
this.settleSelfStopped = resolve;
|
|
87174
87631
|
});
|
|
87175
|
-
this.taskDir =
|
|
87176
|
-
this.remoteGitPath =
|
|
87177
|
-
this.stateDirectory =
|
|
87632
|
+
this.taskDir = path32.join(config.workspacePath, ".tasks");
|
|
87633
|
+
this.remoteGitPath = path32.join(path32.resolve(config.workspacePath), "remote.git");
|
|
87634
|
+
this.stateDirectory = path32.resolve(
|
|
87178
87635
|
config.stateDirectory ?? defaultStateDirectory(config.workspacePath)
|
|
87179
87636
|
);
|
|
87180
|
-
this.contentBranchesPath =
|
|
87637
|
+
this.contentBranchesPath = path32.join(config.workspacePath, "content-branches");
|
|
87181
87638
|
if (config.baseBranch !== void 0) this.setBaseBranch(config.baseBranch);
|
|
87182
87639
|
this.maxTasksPerCycle = config.maxTasksPerCycle ?? 10;
|
|
87183
87640
|
this.taskTimeoutMs = config.taskTimeoutMs ?? DEFAULT_TASK_TIMEOUT;
|
|
87184
87641
|
this.maxRetries = config.maxRetries ?? DEFAULT_MAX_RETRIES2;
|
|
87185
|
-
this.lockFilePath =
|
|
87642
|
+
this.lockFilePath = path32.join(config.workspacePath, ".tasks", ".worker-lock");
|
|
87186
87643
|
this.lockStaleMs = config.lockStaleMs ?? DEFAULT_LOCK_STALE_MS;
|
|
87187
87644
|
this.drainDeadlineMs = config.drainDeadlineMs ?? DEFAULT_DRAIN_DEADLINE_MS;
|
|
87188
87645
|
this.contentRoot = config.contentRoot ?? "content";
|
|
@@ -87476,7 +87933,7 @@ var CmsWorker = class {
|
|
|
87476
87933
|
* is negligible at the default TTL; a badly wrong clock misjudges liveness.
|
|
87477
87934
|
*/
|
|
87478
87935
|
async acquireLock() {
|
|
87479
|
-
await
|
|
87936
|
+
await fs30.mkdir(this.taskDir, { recursive: true });
|
|
87480
87937
|
try {
|
|
87481
87938
|
this.releaseLockFn = await lockWorkerTaskDir(this.taskDir, this.lockStaleMs, {
|
|
87482
87939
|
onCompromised: (err) => {
|
|
@@ -87610,7 +88067,7 @@ var CmsWorker = class {
|
|
|
87610
88067
|
);
|
|
87611
88068
|
let remoteGitExists;
|
|
87612
88069
|
try {
|
|
87613
|
-
remoteGitExists = await
|
|
88070
|
+
remoteGitExists = await fs30.stat(this.remoteGitPath).then(
|
|
87614
88071
|
() => true,
|
|
87615
88072
|
(err) => {
|
|
87616
88073
|
if (isNodeError(err) && err.code === "ENOENT") return false;
|
|
@@ -87688,7 +88145,7 @@ var CmsWorker = class {
|
|
|
87688
88145
|
);
|
|
87689
88146
|
if (current === this.baseBranch) return;
|
|
87690
88147
|
await sharedRepoGit(gitDir, "bare").raw(["symbolic-ref", "HEAD", ref]);
|
|
87691
|
-
workerLog(`${
|
|
88148
|
+
workerLog(`${path32.basename(gitDir)} HEAD now names the base branch '${this.baseBranch}'`);
|
|
87692
88149
|
}
|
|
87693
88150
|
/**
|
|
87694
88151
|
* Whether the bare repo at `gitDir` has a local `refs/heads/<baseBranch>`.
|
|
@@ -87788,7 +88245,7 @@ var CmsWorker = class {
|
|
|
87788
88245
|
async ensureRemoteGit() {
|
|
87789
88246
|
let exists3;
|
|
87790
88247
|
try {
|
|
87791
|
-
await
|
|
88248
|
+
await fs30.stat(this.remoteGitPath);
|
|
87792
88249
|
exists3 = true;
|
|
87793
88250
|
} catch {
|
|
87794
88251
|
exists3 = false;
|
|
@@ -87808,7 +88265,7 @@ var CmsWorker = class {
|
|
|
87808
88265
|
}
|
|
87809
88266
|
workerLog("Initializing remote.git from GitHub...");
|
|
87810
88267
|
const stagingPath = await this.seedRemoteGitStaging();
|
|
87811
|
-
await
|
|
88268
|
+
await fs30.rename(stagingPath, this.remoteGitPath);
|
|
87812
88269
|
workerLog("remote.git initialized");
|
|
87813
88270
|
}
|
|
87814
88271
|
/**
|
|
@@ -87864,7 +88321,7 @@ var CmsWorker = class {
|
|
|
87864
88321
|
if (err instanceof RemoteGitKeptError) throw err;
|
|
87865
88322
|
throw notReplaced(redactCredentials(getErrorMessage(err)));
|
|
87866
88323
|
});
|
|
87867
|
-
const discardStaging = () =>
|
|
88324
|
+
const discardStaging = () => fs30.rm(stagingPath, { recursive: true, force: true });
|
|
87868
88325
|
let current;
|
|
87869
88326
|
try {
|
|
87870
88327
|
current = await listRemoteGitRefs(this.remoteGitPath);
|
|
@@ -87882,21 +88339,21 @@ var CmsWorker = class {
|
|
|
87882
88339
|
}
|
|
87883
88340
|
const replaced = `${this.remoteGitPath}.replaced-${Date.now()}`;
|
|
87884
88341
|
try {
|
|
87885
|
-
await
|
|
88342
|
+
await fs30.rename(this.remoteGitPath, replaced);
|
|
87886
88343
|
} catch (err) {
|
|
87887
88344
|
await discardStaging();
|
|
87888
88345
|
throw err;
|
|
87889
88346
|
}
|
|
87890
88347
|
try {
|
|
87891
|
-
await
|
|
88348
|
+
await fs30.rename(stagingPath, this.remoteGitPath);
|
|
87892
88349
|
} catch (err) {
|
|
87893
|
-
await
|
|
88350
|
+
await fs30.rename(replaced, this.remoteGitPath);
|
|
87894
88351
|
await discardStaging();
|
|
87895
88352
|
throw err;
|
|
87896
88353
|
}
|
|
87897
88354
|
const after = await listRemoteGitRefs(replaced).catch(() => null);
|
|
87898
88355
|
if (after !== null && sameRefs(refs, after)) {
|
|
87899
|
-
await
|
|
88356
|
+
await fs30.rm(replaced, { recursive: true, force: true, maxRetries: 3 }).catch((err) => {
|
|
87900
88357
|
workerLogWarn(
|
|
87901
88358
|
`Could not remove the replaced remote.git at ${replaced}: ${getErrorMessage(err)}`
|
|
87902
88359
|
);
|
|
@@ -87916,7 +88373,7 @@ var CmsWorker = class {
|
|
|
87916
88373
|
*/
|
|
87917
88374
|
async seedRemoteGitStaging(check) {
|
|
87918
88375
|
const stagingPath = `${this.remoteGitPath}.cloning`;
|
|
87919
|
-
await
|
|
88376
|
+
await fs30.rm(stagingPath, { recursive: true, force: true });
|
|
87920
88377
|
try {
|
|
87921
88378
|
const githubBranches = await seedFromGitHub(
|
|
87922
88379
|
this.transferContext(),
|
|
@@ -87932,7 +88389,7 @@ var CmsWorker = class {
|
|
|
87932
88389
|
if (!(err instanceof RemoteGitKeptError)) {
|
|
87933
88390
|
workerLogError(`remote.git seeding failed: ${redactCredentials(getErrorMessage(err))}`);
|
|
87934
88391
|
}
|
|
87935
|
-
await
|
|
88392
|
+
await fs30.rm(stagingPath, { recursive: true, force: true });
|
|
87936
88393
|
if (err instanceof RemoteGitKeptError) throw err;
|
|
87937
88394
|
if (err instanceof SharedRepoRefusalError) {
|
|
87938
88395
|
throw new SharedRepoRefusalError(
|
|
@@ -88036,7 +88493,7 @@ var CmsWorker = class {
|
|
|
88036
88493
|
* sanitized.
|
|
88037
88494
|
*/
|
|
88038
88495
|
branchWorkspacePath(branchRefName) {
|
|
88039
|
-
return
|
|
88496
|
+
return path32.join(this.contentBranchesPath, sanitizeBranchName(branchRefName));
|
|
88040
88497
|
}
|
|
88041
88498
|
/**
|
|
88042
88499
|
* Test-only seam: awaited inside `rebaseActiveBranches()`'s conflict round,
|
|
@@ -88111,24 +88568,24 @@ var CmsWorker = class {
|
|
|
88111
88568
|
};
|
|
88112
88569
|
|
|
88113
88570
|
// ../canopycms/src/auth/file-based-auth-cache.ts
|
|
88114
|
-
import
|
|
88115
|
-
import
|
|
88571
|
+
import fs31 from "node:fs/promises";
|
|
88572
|
+
import path33 from "node:path";
|
|
88116
88573
|
var log5 = createDebugLogger({ prefix: "FileBasedAuthCache" });
|
|
88117
88574
|
async function writeAuthCacheSnapshot(cachePath, files) {
|
|
88118
|
-
await
|
|
88575
|
+
await fs31.mkdir(cachePath, { recursive: true });
|
|
88119
88576
|
const timestamp2 = Date.now();
|
|
88120
|
-
const snapshotDir =
|
|
88121
|
-
await
|
|
88577
|
+
const snapshotDir = path33.join(cachePath, `snapshot-${timestamp2}`);
|
|
88578
|
+
await fs31.mkdir(snapshotDir, { recursive: true });
|
|
88122
88579
|
for (const [fileName, data3] of Object.entries(files)) {
|
|
88123
|
-
const tmpPath =
|
|
88124
|
-
const finalPath =
|
|
88125
|
-
await
|
|
88126
|
-
await
|
|
88127
|
-
}
|
|
88128
|
-
const currentLink =
|
|
88129
|
-
const tmpLink =
|
|
88130
|
-
await
|
|
88131
|
-
await
|
|
88580
|
+
const tmpPath = path33.join(snapshotDir, `${fileName}.tmp`);
|
|
88581
|
+
const finalPath = path33.join(snapshotDir, fileName);
|
|
88582
|
+
await fs31.writeFile(tmpPath, JSON.stringify(data3, null, 2), "utf-8");
|
|
88583
|
+
await fs31.rename(tmpPath, finalPath);
|
|
88584
|
+
}
|
|
88585
|
+
const currentLink = path33.join(cachePath, "current");
|
|
88586
|
+
const tmpLink = path33.join(cachePath, `current-${timestamp2}`);
|
|
88587
|
+
await fs31.symlink(path33.basename(snapshotDir), tmpLink);
|
|
88588
|
+
await fs31.rename(tmpLink, currentLink);
|
|
88132
88589
|
await cleanupOldSnapshots(cachePath, 2);
|
|
88133
88590
|
return snapshotDir;
|
|
88134
88591
|
}
|
|
@@ -88145,14 +88602,14 @@ async function writeAuthSnapshot(cachePath, snapshot) {
|
|
|
88145
88602
|
async function cleanupOldSnapshots(cachePath, keepCount) {
|
|
88146
88603
|
let entries;
|
|
88147
88604
|
try {
|
|
88148
|
-
entries = await
|
|
88605
|
+
entries = await fs31.readdir(cachePath);
|
|
88149
88606
|
} catch {
|
|
88150
88607
|
return;
|
|
88151
88608
|
}
|
|
88152
88609
|
const snapshots = entries.filter((e9) => e9.startsWith("snapshot-")).sort().reverse();
|
|
88153
88610
|
for (const snapshot of snapshots.slice(keepCount)) {
|
|
88154
88611
|
try {
|
|
88155
|
-
await
|
|
88612
|
+
await fs31.rm(path33.join(cachePath, snapshot), {
|
|
88156
88613
|
recursive: true,
|
|
88157
88614
|
force: true
|
|
88158
88615
|
});
|
|
@@ -88403,7 +88860,7 @@ async function completeTerminationLifecycleAction(options = {}) {
|
|
|
88403
88860
|
|
|
88404
88861
|
// worker/run.ts
|
|
88405
88862
|
init_error();
|
|
88406
|
-
import
|
|
88863
|
+
import path34 from "node:path";
|
|
88407
88864
|
|
|
88408
88865
|
// worker/github-app-auth.ts
|
|
88409
88866
|
var import_auth_app = __toESM(require_dist_node20(), 1);
|
|
@@ -92788,10 +93245,10 @@ var SessionAPI = class extends AbstractAPI {
|
|
|
92788
93245
|
*/
|
|
92789
93246
|
async getToken(sessionId, template, expiresInSeconds) {
|
|
92790
93247
|
this.requireId(sessionId);
|
|
92791
|
-
const
|
|
93248
|
+
const path35 = template ? joinPaths(basePath29, sessionId, "tokens", template) : joinPaths(basePath29, sessionId, "tokens");
|
|
92792
93249
|
const requestOptions = {
|
|
92793
93250
|
method: "POST",
|
|
92794
|
-
path:
|
|
93251
|
+
path: path35
|
|
92795
93252
|
};
|
|
92796
93253
|
if (expiresInSeconds !== void 0) {
|
|
92797
93254
|
requestOptions.bodyParams = { expires_in_seconds: expiresInSeconds };
|
|
@@ -95541,12 +95998,12 @@ function buildRequest(options) {
|
|
|
95541
95998
|
userAgent = USER_AGENT2,
|
|
95542
95999
|
skipApiVersionInUrl = false
|
|
95543
96000
|
} = options;
|
|
95544
|
-
const { path:
|
|
96001
|
+
const { path: path35, method, queryParams, headerParams, bodyParams, formData, options: opts } = requestOptions;
|
|
95545
96002
|
const { deepSnakecaseBodyParamKeys = false } = opts || {};
|
|
95546
96003
|
if (requireSecretKey) {
|
|
95547
96004
|
assertValidSecretKey(secretKey);
|
|
95548
96005
|
}
|
|
95549
|
-
const url = skipApiVersionInUrl ? joinPaths(apiUrl,
|
|
96006
|
+
const url = skipApiVersionInUrl ? joinPaths(apiUrl, path35) : joinPaths(apiUrl, apiVersion, path35);
|
|
95550
96007
|
const finalUrl = new URL(url);
|
|
95551
96008
|
if (queryParams) {
|
|
95552
96009
|
const snakecasedQueryParams = snakecase_keys_default({ ...queryParams });
|
|
@@ -98062,7 +98519,7 @@ async function buildSingleProcessWorker(deps, workspacePath) {
|
|
|
98062
98519
|
const { githubToken, githubTokenSecret, githubAppAuth, clerkSecret } = await readWorkerCredentials(env2, deps.getSecret);
|
|
98063
98520
|
const refreshAuthCache = createClerkAuthCacheRefresher({
|
|
98064
98521
|
secret: clerkSecret,
|
|
98065
|
-
cachePath:
|
|
98522
|
+
cachePath: path34.join(workspacePath, ".cache"),
|
|
98066
98523
|
useOrganizationsAsGroups
|
|
98067
98524
|
});
|
|
98068
98525
|
const worker = deps.createWorker({
|
|
@@ -98124,7 +98581,7 @@ async function buildSplitWorker(deps, workspacePath, socketPath, onGatewayWait)
|
|
|
98124
98581
|
if (!health.ready) throw new Error("The GitHub gateway is not ready");
|
|
98125
98582
|
const refreshAuthCache = health.clerkConfigured ? async () => {
|
|
98126
98583
|
const snapshot = await gateway.authSnapshot();
|
|
98127
|
-
await deps.writeAuthSnapshot(
|
|
98584
|
+
await deps.writeAuthSnapshot(path34.join(workspacePath, ".cache"), snapshot);
|
|
98128
98585
|
workerLog(` ${snapshot.users.length} users, ${snapshot.groups.length} groups`);
|
|
98129
98586
|
} : void 0;
|
|
98130
98587
|
const worker = deps.createWorker({
|