jj-octo 0.8.1 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/jj-octo.js +282 -122
- package/package.json +1 -1
package/dist/jj-octo.js
CHANGED
|
@@ -1187,6 +1187,15 @@ var TaggedError = (tag) => {
|
|
|
1187
1187
|
Base.prototype.name = tag;
|
|
1188
1188
|
return Base;
|
|
1189
1189
|
};
|
|
1190
|
+
var NoSuchElementErrorTypeId = "~effect/Cause/NoSuchElementError";
|
|
1191
|
+
class NoSuchElementError extends (/* @__PURE__ */ TaggedError("NoSuchElementError")) {
|
|
1192
|
+
[NoSuchElementErrorTypeId] = NoSuchElementErrorTypeId;
|
|
1193
|
+
constructor(message) {
|
|
1194
|
+
super({
|
|
1195
|
+
message
|
|
1196
|
+
});
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1190
1199
|
var DoneTypeId = "~effect/Cause/Done";
|
|
1191
1200
|
var isDone = (u) => hasProperty(u, DoneTypeId);
|
|
1192
1201
|
var DoneVoid = {
|
|
@@ -3360,6 +3369,7 @@ var provideService = function() {
|
|
|
3360
3369
|
return dual(3, (self, service, impl) => provideServiceImpl(self, service, impl)).apply(this, arguments);
|
|
3361
3370
|
};
|
|
3362
3371
|
var provideServiceImpl = (self, service, implementation) => updateContext(self, add(service, implementation));
|
|
3372
|
+
var filterOrFail = /* @__PURE__ */ dual((args) => isEffect(args[0]), (self, predicate, orFailWith) => filterOrElse(self, predicate, orFailWith ? (a) => fail3(orFailWith(a)) : () => fail3(new NoSuchElementError)));
|
|
3363
3373
|
var forever = /* @__PURE__ */ dual((args) => isEffect(args[0]), (self, options) => whileLoop({
|
|
3364
3374
|
while: constTrue,
|
|
3365
3375
|
body: constant(options?.disableYield ? self : flatMap2(self, (_) => yieldNow)),
|
|
@@ -4017,6 +4027,7 @@ var forEachConcurrent = /* @__PURE__ */ iterateConcurrentImpl({
|
|
|
4017
4027
|
}
|
|
4018
4028
|
}
|
|
4019
4029
|
});
|
|
4030
|
+
var filterOrElse = /* @__PURE__ */ dual(3, (self, predicate, orElse) => flatMap2(self, (a) => predicate(a) ? succeed3(a) : orElse(a)));
|
|
4020
4031
|
var forkUnsafe = (parent, effect, immediate = false, daemon = false, uninterruptible = false) => {
|
|
4021
4032
|
const parentRuntime = parent;
|
|
4022
4033
|
const interruptible = uninterruptible === "inherit" ? parentRuntime.interruptible : !uninterruptible;
|
|
@@ -5013,6 +5024,7 @@ var ignore2 = ignore;
|
|
|
5013
5024
|
var orElseSucceed2 = orElseSucceed;
|
|
5014
5025
|
var sleep2 = sleep;
|
|
5015
5026
|
var raceFirst2 = raceFirst;
|
|
5027
|
+
var filterOrFail2 = filterOrFail;
|
|
5016
5028
|
var match6 = match5;
|
|
5017
5029
|
var matchCauseEffect2 = matchCauseEffect;
|
|
5018
5030
|
var matchEffect3 = matchEffect;
|
|
@@ -5744,8 +5756,18 @@ var asyncQueue = (scope, f, options) => make9({
|
|
|
5744
5756
|
}).pipe(tap2((queue) => addFinalizer2(scope, shutdown(queue))), tap2((queue) => provide(f(queue), scope).pipe(catchCause2((cause) => failCause4(queue, cause)), forkIn2(scope))));
|
|
5745
5757
|
var callbackArray = (f, options) => fromTransform((_, scope) => map7(asyncQueue(scope, f, options), takeAll2));
|
|
5746
5758
|
var suspend3 = (evaluate) => fromTransform((upstream, scope) => suspend2(() => toTransform(evaluate())(upstream, scope)));
|
|
5759
|
+
var succeed7 = (value) => fromEffect(succeed6(value));
|
|
5747
5760
|
var empty3 = /* @__PURE__ */ fromPull(/* @__PURE__ */ succeed6(/* @__PURE__ */ done2()));
|
|
5748
5761
|
var fail7 = (error) => fromPull(succeed6(fail6(error)));
|
|
5762
|
+
var fromEffect = (effect) => fromPull(sync2(() => {
|
|
5763
|
+
let done = false;
|
|
5764
|
+
return suspend2(() => {
|
|
5765
|
+
if (done)
|
|
5766
|
+
return done2();
|
|
5767
|
+
done = true;
|
|
5768
|
+
return effect;
|
|
5769
|
+
});
|
|
5770
|
+
}));
|
|
5749
5771
|
var fromReadableStream = (options) => fromTransform((_, scope) => readableStreamToPullUnsafe({
|
|
5750
5772
|
scope,
|
|
5751
5773
|
readable: options.evaluate(),
|
|
@@ -6125,8 +6147,10 @@ var transformPull2 = (self, f) => fromChannel3(fromTransform((_, scope) => flatM
|
|
|
6125
6147
|
var toChannel2 = (stream) => stream.channel;
|
|
6126
6148
|
var callback3 = (f, options) => fromChannel3(callbackArray(f, options));
|
|
6127
6149
|
var empty4 = /* @__PURE__ */ fromChannel3(empty3);
|
|
6150
|
+
var make12 = (...values) => fromArray2(values);
|
|
6128
6151
|
var suspend4 = (stream) => fromChannel3(suspend3(() => stream().channel));
|
|
6129
6152
|
var fail8 = (error) => fromChannel3(fail7(error));
|
|
6153
|
+
var fromArray2 = (array) => isReadonlyArrayNonEmpty(array) ? fromChannel3(succeed7(array)) : empty4;
|
|
6130
6154
|
var fromReadableStream2 = (options) => fromChannel3(fromReadableStream(options));
|
|
6131
6155
|
var unwrap4 = (effect) => fromChannel3(unwrap2(map7(effect, toChannel2)));
|
|
6132
6156
|
var map9 = /* @__PURE__ */ dual(2, (self, f) => suspend4(() => {
|
|
@@ -6160,6 +6184,10 @@ var decodeText = /* @__PURE__ */ dual((args) => isStream(args[0]), (self, option
|
|
|
6160
6184
|
stream: true
|
|
6161
6185
|
}));
|
|
6162
6186
|
}));
|
|
6187
|
+
var encodeText = (self) => suspend4(() => {
|
|
6188
|
+
const encoder = new TextEncoder;
|
|
6189
|
+
return map9(self, (chunk) => encoder.encode(chunk));
|
|
6190
|
+
});
|
|
6163
6191
|
var splitLines2 = (self) => self.channel.pipe(pipeTo(splitLines()), fromChannel3);
|
|
6164
6192
|
var ensuring4 = /* @__PURE__ */ dual(2, (self, finalizer) => fromChannel3(ensuring3(self.channel, finalizer)));
|
|
6165
6193
|
var run = /* @__PURE__ */ dual(2, (self, sink) => scopedWith2((scope) => toPullScoped(self.channel, scope).pipe(flatMap4((upstream) => sink.transform(upstream, scope)), map7(([a]) => a))));
|
|
@@ -6226,7 +6254,7 @@ var toReadableStreamEffect = /* @__PURE__ */ dual((args) => isStream(args[0]), (
|
|
|
6226
6254
|
// node_modules/effect/dist/FileSystem.js
|
|
6227
6255
|
var TypeId16 = "~effect/FileSystem";
|
|
6228
6256
|
var FileSystem = /* @__PURE__ */ Service("effect/FileSystem");
|
|
6229
|
-
var
|
|
6257
|
+
var make13 = (impl) => FileSystem.of({
|
|
6230
6258
|
...impl,
|
|
6231
6259
|
[TypeId16]: TypeId16,
|
|
6232
6260
|
exists: (path) => pipe(impl.access(path), as2(true), catchTag2("PlatformError", (e) => e.reason._tag === "NotFound" ? succeed6(false) : fail6(e))),
|
|
@@ -6285,7 +6313,7 @@ class WatchBackend extends (/* @__PURE__ */ Service()("effect/FileSystem/WatchBa
|
|
|
6285
6313
|
// node_modules/effect/dist/Path.js
|
|
6286
6314
|
var TypeId17 = "~effect/Path";
|
|
6287
6315
|
var Path = /* @__PURE__ */ Service("effect/Path");
|
|
6288
|
-
var
|
|
6316
|
+
var make14 = (impl) => Path.of({
|
|
6289
6317
|
...impl,
|
|
6290
6318
|
[TypeId17]: TypeId17,
|
|
6291
6319
|
resolveWithin(root, input) {
|
|
@@ -8538,7 +8566,7 @@ var HandleProto = {
|
|
|
8538
8566
|
var makeHandle = (params) => Object.setPrototypeOf({
|
|
8539
8567
|
...params
|
|
8540
8568
|
}, HandleProto);
|
|
8541
|
-
var
|
|
8569
|
+
var make15 = (spawn) => {
|
|
8542
8570
|
const streamString = (command, options) => spawn(command).pipe(map7((handle) => decodeText(options?.includeStderr === true ? handle.all : handle.stdout)), unwrap4);
|
|
8543
8571
|
const streamLines = (command, options) => splitLines2(streamString(command, options));
|
|
8544
8572
|
return ChildProcessSpawner.of({
|
|
@@ -8571,7 +8599,7 @@ var makeStandardCommand = (command, args, options) => Object.assign(Object.creat
|
|
|
8571
8599
|
args,
|
|
8572
8600
|
options
|
|
8573
8601
|
});
|
|
8574
|
-
var
|
|
8602
|
+
var make16 = function make(...args) {
|
|
8575
8603
|
if (isTemplateString(args[0])) {
|
|
8576
8604
|
const [templates, ...expressions] = args;
|
|
8577
8605
|
const tokens = parseTemplates(templates, expressions);
|
|
@@ -8897,7 +8925,7 @@ var taskkill = (childProcess, onExit = () => {}) => {
|
|
|
8897
8925
|
windowsHide: true
|
|
8898
8926
|
}, onExit);
|
|
8899
8927
|
};
|
|
8900
|
-
var
|
|
8928
|
+
var make17 = /* @__PURE__ */ gen2(function* () {
|
|
8901
8929
|
const fs = yield* FileSystem;
|
|
8902
8930
|
const path = yield* Path;
|
|
8903
8931
|
const resolveWorkingDirectory = fnUntraced2(function* (options) {
|
|
@@ -9299,7 +9327,7 @@ var make16 = /* @__PURE__ */ gen2(function* () {
|
|
|
9299
9327
|
const sourceStream = unwrap4(succeed6(getSourceStream(handles[handles.length - 1], options.from)));
|
|
9300
9328
|
const toOption = options.to ?? "stdin";
|
|
9301
9329
|
if (toOption === "stdin") {
|
|
9302
|
-
handles.push(yield* spawnCommand(
|
|
9330
|
+
handles.push(yield* spawnCommand(make16(command.command, command.args, {
|
|
9303
9331
|
...command.options,
|
|
9304
9332
|
stdin: {
|
|
9305
9333
|
...stdinConfig,
|
|
@@ -9311,7 +9339,7 @@ var make16 = /* @__PURE__ */ gen2(function* () {
|
|
|
9311
9339
|
if (isNotUndefined(fd)) {
|
|
9312
9340
|
const fdName2 = fdName(fd);
|
|
9313
9341
|
const existingFds = command.options.additionalFds ?? {};
|
|
9314
|
-
handles.push(yield* spawnCommand(
|
|
9342
|
+
handles.push(yield* spawnCommand(make16(command.command, command.args, {
|
|
9315
9343
|
...command.options,
|
|
9316
9344
|
additionalFds: {
|
|
9317
9345
|
...existingFds,
|
|
@@ -9322,7 +9350,7 @@ var make16 = /* @__PURE__ */ gen2(function* () {
|
|
|
9322
9350
|
}
|
|
9323
9351
|
})));
|
|
9324
9352
|
} else {
|
|
9325
|
-
handles.push(yield* spawnCommand(
|
|
9353
|
+
handles.push(yield* spawnCommand(make16(command.command, command.args, {
|
|
9326
9354
|
...command.options,
|
|
9327
9355
|
stdin: {
|
|
9328
9356
|
...stdinConfig,
|
|
@@ -9361,9 +9389,9 @@ var make16 = /* @__PURE__ */ gen2(function* () {
|
|
|
9361
9389
|
}
|
|
9362
9390
|
}
|
|
9363
9391
|
});
|
|
9364
|
-
return
|
|
9392
|
+
return make15(spawnCommand);
|
|
9365
9393
|
});
|
|
9366
|
-
var layer = /* @__PURE__ */ effect(ChildProcessSpawner,
|
|
9394
|
+
var layer = /* @__PURE__ */ effect(ChildProcessSpawner, make17);
|
|
9367
9395
|
var flattenCommand = (command) => {
|
|
9368
9396
|
const commands = [];
|
|
9369
9397
|
const pipeOptions = [];
|
|
@@ -9448,7 +9476,7 @@ function v7Bytes(timestampMillis, bytes = randomBytes()) {
|
|
|
9448
9476
|
// node_modules/effect/dist/Crypto.js
|
|
9449
9477
|
var TypeId22 = "~effect/Crypto";
|
|
9450
9478
|
var Crypto = /* @__PURE__ */ Service("effect/Crypto");
|
|
9451
|
-
var
|
|
9479
|
+
var make18 = (impl) => {
|
|
9452
9480
|
const randomBytesUnsafe = impl.randomBytes;
|
|
9453
9481
|
const randomBytes = (size) => map7(validateSize("randomBytes", size), randomBytesUnsafe);
|
|
9454
9482
|
const readUint53 = (bytes) => (bytes[0] & 31) * 2 ** 48 + bytes[1] * 2 ** 40 + bytes[2] * 2 ** 32 + bytes[3] * 2 ** 24 + bytes[4] * 2 ** 16 + bytes[5] * 2 ** 8 + bytes[6];
|
|
@@ -9534,11 +9562,11 @@ var digest = (algorithm, data) => try_3({
|
|
|
9534
9562
|
cause
|
|
9535
9563
|
})
|
|
9536
9564
|
});
|
|
9537
|
-
var
|
|
9565
|
+
var make19 = /* @__PURE__ */ make18({
|
|
9538
9566
|
randomBytes: NodeCrypto.randomBytes,
|
|
9539
9567
|
digest
|
|
9540
9568
|
});
|
|
9541
|
-
var layer2 = /* @__PURE__ */ succeed5(Crypto,
|
|
9569
|
+
var layer2 = /* @__PURE__ */ succeed5(Crypto, make19);
|
|
9542
9570
|
|
|
9543
9571
|
// node_modules/@effect/platform-bun/dist/BunCrypto.js
|
|
9544
9572
|
var layer3 = layer2;
|
|
@@ -9990,7 +10018,7 @@ var writeFile2 = (path, data, options) => callback2((resume, signal) => {
|
|
|
9990
10018
|
resume(fail6(handleBadArgument("writeFile")(err)));
|
|
9991
10019
|
}
|
|
9992
10020
|
});
|
|
9993
|
-
var makeFileSystem = /* @__PURE__ */ map7(/* @__PURE__ */ serviceOption2(WatchBackend), (backend) =>
|
|
10021
|
+
var makeFileSystem = /* @__PURE__ */ map7(/* @__PURE__ */ serviceOption2(WatchBackend), (backend) => make13({
|
|
9994
10022
|
access: access2,
|
|
9995
10023
|
chmod: chmod2,
|
|
9996
10024
|
chown: chown2,
|
|
@@ -10049,15 +10077,15 @@ var fileUrlOps = (windows) => ({
|
|
|
10049
10077
|
})
|
|
10050
10078
|
})
|
|
10051
10079
|
});
|
|
10052
|
-
var layerPosix = /* @__PURE__ */ succeed5(Path)(/* @__PURE__ */
|
|
10080
|
+
var layerPosix = /* @__PURE__ */ succeed5(Path)(/* @__PURE__ */ make14({
|
|
10053
10081
|
...NodePath.posix,
|
|
10054
10082
|
.../* @__PURE__ */ fileUrlOps(false)
|
|
10055
10083
|
}));
|
|
10056
|
-
var layerWin32 = /* @__PURE__ */ succeed5(Path)(/* @__PURE__ */
|
|
10084
|
+
var layerWin32 = /* @__PURE__ */ succeed5(Path)(/* @__PURE__ */ make14({
|
|
10057
10085
|
...NodePath.win32,
|
|
10058
10086
|
.../* @__PURE__ */ fileUrlOps(true)
|
|
10059
10087
|
}));
|
|
10060
|
-
var layer6 = /* @__PURE__ */ succeed5(Path)(/* @__PURE__ */
|
|
10088
|
+
var layer6 = /* @__PURE__ */ succeed5(Path)(/* @__PURE__ */ make14({
|
|
10061
10089
|
...NodePath,
|
|
10062
10090
|
.../* @__PURE__ */ fileUrlOps(undefined)
|
|
10063
10091
|
}));
|
|
@@ -10068,7 +10096,7 @@ var layer7 = layer6;
|
|
|
10068
10096
|
// node_modules/effect/dist/Stdio.js
|
|
10069
10097
|
var TypeId23 = "~effect/Stdio";
|
|
10070
10098
|
var Stdio = /* @__PURE__ */ Service(TypeId23);
|
|
10071
|
-
var
|
|
10099
|
+
var make20 = (options) => ({
|
|
10072
10100
|
[TypeId23]: TypeId23,
|
|
10073
10101
|
stdinIsTerminal: succeed6(false),
|
|
10074
10102
|
stdoutIsTerminal: succeed6(false),
|
|
@@ -10077,7 +10105,7 @@ var make19 = (options) => ({
|
|
|
10077
10105
|
});
|
|
10078
10106
|
|
|
10079
10107
|
// node_modules/@effect/platform-node-shared/dist/NodeStdio.js
|
|
10080
|
-
var layer8 = /* @__PURE__ */ succeed5(Stdio, /* @__PURE__ */
|
|
10108
|
+
var layer8 = /* @__PURE__ */ succeed5(Stdio, /* @__PURE__ */ make20({
|
|
10081
10109
|
args: /* @__PURE__ */ sync2(() => process.argv.slice(2)),
|
|
10082
10110
|
stdinIsTerminal: /* @__PURE__ */ sync2(() => process.stdin.isTTY === true),
|
|
10083
10111
|
stdoutIsTerminal: /* @__PURE__ */ sync2(() => process.stdout.isTTY === true),
|
|
@@ -10314,7 +10342,7 @@ var stringOrRedacted = (val) => typeof val === "string" ? val : value(val);
|
|
|
10314
10342
|
// node_modules/effect/dist/Redacted.js
|
|
10315
10343
|
var TypeId25 = "~effect/Redacted";
|
|
10316
10344
|
var isRedacted = (u) => hasProperty(u, TypeId25);
|
|
10317
|
-
var
|
|
10345
|
+
var make21 = (value, options) => {
|
|
10318
10346
|
const self = Object.create(Proto4);
|
|
10319
10347
|
if (options?.label) {
|
|
10320
10348
|
self.label = options.label;
|
|
@@ -10377,7 +10405,7 @@ var Proto5 = /* @__PURE__ */ Object.defineProperties(/* @__PURE__ */ Object.crea
|
|
|
10377
10405
|
value: BaseProto[NodeInspectSymbol]
|
|
10378
10406
|
}
|
|
10379
10407
|
});
|
|
10380
|
-
var
|
|
10408
|
+
var make22 = (input) => Object.assign(Object.create(Proto5), input);
|
|
10381
10409
|
var Equivalence2 = /* @__PURE__ */ makeEquivalence2(/* @__PURE__ */ strictEqual());
|
|
10382
10410
|
var empty5 = /* @__PURE__ */ Object.create(Proto5);
|
|
10383
10411
|
var fromInput = (input) => {
|
|
@@ -10402,21 +10430,21 @@ var fromInput = (input) => {
|
|
|
10402
10430
|
};
|
|
10403
10431
|
var fromRecordUnsafe = (input) => Object.setPrototypeOf(input, Proto5);
|
|
10404
10432
|
var set2 = /* @__PURE__ */ dual(3, (self, key, value) => {
|
|
10405
|
-
const out =
|
|
10433
|
+
const out = make22(self);
|
|
10406
10434
|
out[key.toLowerCase()] = value;
|
|
10407
10435
|
return out;
|
|
10408
10436
|
});
|
|
10409
|
-
var setAll = /* @__PURE__ */ dual(2, (self, headers) =>
|
|
10437
|
+
var setAll = /* @__PURE__ */ dual(2, (self, headers) => make22({
|
|
10410
10438
|
...self,
|
|
10411
10439
|
...fromInput(headers)
|
|
10412
10440
|
}));
|
|
10413
10441
|
var merge4 = /* @__PURE__ */ dual(2, (self, headers) => {
|
|
10414
|
-
const out =
|
|
10442
|
+
const out = make22(self);
|
|
10415
10443
|
Object.assign(out, headers);
|
|
10416
10444
|
return out;
|
|
10417
10445
|
});
|
|
10418
10446
|
var remove3 = /* @__PURE__ */ dual(2, (self, key) => {
|
|
10419
|
-
const out =
|
|
10447
|
+
const out = make22(self);
|
|
10420
10448
|
delete out[key.toLowerCase()];
|
|
10421
10449
|
return out;
|
|
10422
10450
|
});
|
|
@@ -10428,12 +10456,12 @@ var redact2 = /* @__PURE__ */ dual(2, (self, key) => {
|
|
|
10428
10456
|
if (typeof key === "string") {
|
|
10429
10457
|
const k = key.toLowerCase();
|
|
10430
10458
|
if (k in self) {
|
|
10431
|
-
out[k] =
|
|
10459
|
+
out[k] = make21(self[k]);
|
|
10432
10460
|
}
|
|
10433
10461
|
} else {
|
|
10434
10462
|
for (const name in self) {
|
|
10435
10463
|
if (name.search(key) !== -1) {
|
|
10436
|
-
out[name] =
|
|
10464
|
+
out[name] = make21(self[name]);
|
|
10437
10465
|
}
|
|
10438
10466
|
}
|
|
10439
10467
|
}
|
|
@@ -10493,7 +10521,7 @@ var Proto6 = {
|
|
|
10493
10521
|
return array(this.params.flat());
|
|
10494
10522
|
}
|
|
10495
10523
|
};
|
|
10496
|
-
var
|
|
10524
|
+
var make23 = (params) => {
|
|
10497
10525
|
const self = Object.create(Proto6);
|
|
10498
10526
|
self.params = params;
|
|
10499
10527
|
return self;
|
|
@@ -10512,7 +10540,7 @@ var fromInput2 = (input) => {
|
|
|
10512
10540
|
out.push(parsed[i]);
|
|
10513
10541
|
}
|
|
10514
10542
|
}
|
|
10515
|
-
return
|
|
10543
|
+
return make23(out);
|
|
10516
10544
|
};
|
|
10517
10545
|
var fromInputNested = (input) => {
|
|
10518
10546
|
const entries = typeof input[Symbol.iterator] === "function" ? fromIterable(input) : Object.entries(input);
|
|
@@ -10538,7 +10566,7 @@ var fromInputNested = (input) => {
|
|
|
10538
10566
|
var coerce = (value) => isRedacted(value) ? value : String(value);
|
|
10539
10567
|
var Equivalence3 = /* @__PURE__ */ make((a, b) => arrayEquivalence(a.params, b.params));
|
|
10540
10568
|
var arrayEquivalence = /* @__PURE__ */ makeEquivalence3(/* @__PURE__ */ makeEquivalence([/* @__PURE__ */ strictEqual(), /* @__PURE__ */ asEquivalence()]));
|
|
10541
|
-
var empty6 = /* @__PURE__ */
|
|
10569
|
+
var empty6 = /* @__PURE__ */ make23([]);
|
|
10542
10570
|
var setAll2 = /* @__PURE__ */ dual(2, (self, input) => {
|
|
10543
10571
|
const params = fromInput2(input).params.slice();
|
|
10544
10572
|
const keys = new Set;
|
|
@@ -10550,11 +10578,11 @@ var setAll2 = /* @__PURE__ */ dual(2, (self, input) => {
|
|
|
10550
10578
|
continue;
|
|
10551
10579
|
params.push(self.params[i]);
|
|
10552
10580
|
}
|
|
10553
|
-
return
|
|
10581
|
+
return make23(params);
|
|
10554
10582
|
});
|
|
10555
10583
|
var redact3 = /* @__PURE__ */ dual(2, (self, key) => {
|
|
10556
10584
|
const patterns = Array.isArray(key) ? key : [key];
|
|
10557
|
-
return self.params.map(([name, value]) => [name, typeof value === "string" && isRedactedName2(name, patterns) ?
|
|
10585
|
+
return self.params.map(([name, value]) => [name, typeof value === "string" && isRedactedName2(name, patterns) ? make21(value) : value]);
|
|
10558
10586
|
});
|
|
10559
10587
|
var isRedactedName2 = isRedactedName;
|
|
10560
10588
|
var redactUrl = (url, redactedNames = currentRedactedNames()) => {
|
|
@@ -10895,7 +10923,7 @@ function makeOption(schema) {
|
|
|
10895
10923
|
return none2();
|
|
10896
10924
|
};
|
|
10897
10925
|
}
|
|
10898
|
-
function
|
|
10926
|
+
function make24(schema) {
|
|
10899
10927
|
return makeConstructorSync(toType(schema.ast));
|
|
10900
10928
|
}
|
|
10901
10929
|
function is(schema) {
|
|
@@ -11045,7 +11073,7 @@ var RebuildOptions = /* @__PURE__ */ Symbol();
|
|
|
11045
11073
|
var SchemaProto = {
|
|
11046
11074
|
[TypeId28]: TypeId28,
|
|
11047
11075
|
get make() {
|
|
11048
|
-
const value =
|
|
11076
|
+
const value = make24(this);
|
|
11049
11077
|
Object.defineProperty(this, "make", {
|
|
11050
11078
|
value,
|
|
11051
11079
|
enumerable: true
|
|
@@ -11081,10 +11109,10 @@ var SchemaProto = {
|
|
|
11081
11109
|
return this.rebuild(appendChecks(this.ast, checks));
|
|
11082
11110
|
},
|
|
11083
11111
|
rebuild(ast) {
|
|
11084
|
-
return
|
|
11112
|
+
return make25(ast, this[RebuildOptions]);
|
|
11085
11113
|
}
|
|
11086
11114
|
};
|
|
11087
|
-
function
|
|
11115
|
+
function make25(ast, options) {
|
|
11088
11116
|
function Schema() {}
|
|
11089
11117
|
const self = Object.setPrototypeOf(Schema, SchemaProto);
|
|
11090
11118
|
if (options && (Object.hasOwn(options, "name") || Object.hasOwn(options, "length") || Object.hasOwn(options, "__proto__"))) {
|
|
@@ -11101,7 +11129,7 @@ function make24(ast, options) {
|
|
|
11101
11129
|
|
|
11102
11130
|
// node_modules/effect/dist/internal/schema/toCodec.js
|
|
11103
11131
|
function toCodecJson(schema) {
|
|
11104
|
-
return
|
|
11132
|
+
return make25(toCodecJsonAST(schema.ast), {
|
|
11105
11133
|
schema
|
|
11106
11134
|
});
|
|
11107
11135
|
}
|
|
@@ -11148,7 +11176,7 @@ function toCodecJsonASTStep(ast, recur) {
|
|
|
11148
11176
|
if (!isFunction(getLink)) {
|
|
11149
11177
|
return replaceEncoding(ast, [unknownToJson]);
|
|
11150
11178
|
}
|
|
11151
|
-
const typeParameters = ast.typeParameters.map((tp) =>
|
|
11179
|
+
const typeParameters = ast.typeParameters.map((tp) => make25(toEncoded(tp)));
|
|
11152
11180
|
const link = getLink(typeParameters);
|
|
11153
11181
|
return link === undefined ? ast : replaceEncoding(ast, [mapLink(link, recur)]);
|
|
11154
11182
|
}
|
|
@@ -11183,7 +11211,7 @@ function toCodecJsonASTStep(ast, recur) {
|
|
|
11183
11211
|
return ast;
|
|
11184
11212
|
}
|
|
11185
11213
|
function toCodecStringTree(schema) {
|
|
11186
|
-
return
|
|
11214
|
+
return make25(toCodecStringTreeAST(schema.ast), {
|
|
11187
11215
|
schema
|
|
11188
11216
|
});
|
|
11189
11217
|
}
|
|
@@ -11203,7 +11231,7 @@ var toStringTreeReorder = /* @__PURE__ */ makeReorder((ast) => {
|
|
|
11203
11231
|
function toCodecStringTreeASTStep(ast, recur, onMissingAnnotation) {
|
|
11204
11232
|
switch (ast._tag) {
|
|
11205
11233
|
case "Declaration": {
|
|
11206
|
-
const typeParameters = ast.typeParameters.map((tp) =>
|
|
11234
|
+
const typeParameters = ast.typeParameters.map((tp) => make25(recur(toEncoded(tp))));
|
|
11207
11235
|
const getStringTreeLink = ast.annotations?.toCodecStringTree;
|
|
11208
11236
|
if (isFunction(getStringTreeLink)) {
|
|
11209
11237
|
const link = getStringTreeLink(typeParameters);
|
|
@@ -11276,7 +11304,7 @@ var SchemaErrorTypeId = "~effect/Schema/SchemaError";
|
|
|
11276
11304
|
var TypeId29 = TypeId28;
|
|
11277
11305
|
function declareConstructor() {
|
|
11278
11306
|
return (typeParameters, run, annotations) => {
|
|
11279
|
-
return
|
|
11307
|
+
return make26(new Declaration(typeParameters.map(getAST), (typeParameters) => run(typeParameters.map((ast) => make26(ast))), annotations));
|
|
11280
11308
|
};
|
|
11281
11309
|
}
|
|
11282
11310
|
function declare(is, annotations) {
|
|
@@ -11329,21 +11357,21 @@ function decodeUnknownEffect2(schema, options) {
|
|
|
11329
11357
|
}
|
|
11330
11358
|
var decodeEffect2 = decodeUnknownEffect2;
|
|
11331
11359
|
var decodeUnknownOption2 = decodeUnknownOption;
|
|
11332
|
-
var
|
|
11360
|
+
var make26 = make25;
|
|
11333
11361
|
function isSchema(u) {
|
|
11334
11362
|
return hasProperty(u, TypeId29) && u[TypeId29] === TypeId29;
|
|
11335
11363
|
}
|
|
11336
|
-
var optionalKey2 = /* @__PURE__ */ lambda((schema) =>
|
|
11364
|
+
var optionalKey2 = /* @__PURE__ */ lambda((schema) => make26(optionalKey(schema.ast), {
|
|
11337
11365
|
schema
|
|
11338
11366
|
}));
|
|
11339
11367
|
var optional2 = /* @__PURE__ */ lambda((self) => {
|
|
11340
11368
|
const schema = UndefinedOr(self);
|
|
11341
|
-
return
|
|
11369
|
+
return make26(optional(self.ast), {
|
|
11342
11370
|
schema
|
|
11343
11371
|
});
|
|
11344
11372
|
});
|
|
11345
11373
|
function Literal2(literal) {
|
|
11346
|
-
const out =
|
|
11374
|
+
const out = make26(new Literal(literal), {
|
|
11347
11375
|
literal,
|
|
11348
11376
|
transform(to) {
|
|
11349
11377
|
return out.pipe(decodeTo2(Literal2(to), {
|
|
@@ -11354,14 +11382,14 @@ function Literal2(literal) {
|
|
|
11354
11382
|
});
|
|
11355
11383
|
return out;
|
|
11356
11384
|
}
|
|
11357
|
-
var Unknown2 = /* @__PURE__ */
|
|
11358
|
-
var Null2 = /* @__PURE__ */
|
|
11359
|
-
var Undefined2 = /* @__PURE__ */
|
|
11360
|
-
var String4 = /* @__PURE__ */
|
|
11361
|
-
var Number6 = /* @__PURE__ */
|
|
11362
|
-
var Boolean3 = /* @__PURE__ */
|
|
11385
|
+
var Unknown2 = /* @__PURE__ */ make26(unknown);
|
|
11386
|
+
var Null2 = /* @__PURE__ */ make26(null_);
|
|
11387
|
+
var Undefined2 = /* @__PURE__ */ make26(undefined_2);
|
|
11388
|
+
var String4 = /* @__PURE__ */ make26(string2);
|
|
11389
|
+
var Number6 = /* @__PURE__ */ make26(number2);
|
|
11390
|
+
var Boolean3 = /* @__PURE__ */ make26(boolean);
|
|
11363
11391
|
function makeStruct(ast, fields) {
|
|
11364
|
-
return
|
|
11392
|
+
return make26(ast, {
|
|
11365
11393
|
fields,
|
|
11366
11394
|
mapFields(f, options) {
|
|
11367
11395
|
const fields = f(this.fields);
|
|
@@ -11373,7 +11401,7 @@ function Struct(fields) {
|
|
|
11373
11401
|
return makeStruct(struct(fields, undefined), fields);
|
|
11374
11402
|
}
|
|
11375
11403
|
function makeTuple(ast, elements) {
|
|
11376
|
-
return
|
|
11404
|
+
return make26(ast, {
|
|
11377
11405
|
elements,
|
|
11378
11406
|
mapElements(f, options) {
|
|
11379
11407
|
const elements = f(this.elements);
|
|
@@ -11384,11 +11412,11 @@ function makeTuple(ast, elements) {
|
|
|
11384
11412
|
function Tuple2(elements) {
|
|
11385
11413
|
return makeTuple(tuple(elements), elements);
|
|
11386
11414
|
}
|
|
11387
|
-
var ArraySchema = /* @__PURE__ */ lambda((schema) =>
|
|
11415
|
+
var ArraySchema = /* @__PURE__ */ lambda((schema) => make26(new Arrays(false, [], [schema.ast]), {
|
|
11388
11416
|
value: schema
|
|
11389
11417
|
}));
|
|
11390
11418
|
function makeUnion(ast, members) {
|
|
11391
|
-
return
|
|
11419
|
+
return make26(ast, {
|
|
11392
11420
|
members,
|
|
11393
11421
|
mapMembers(f, options) {
|
|
11394
11422
|
const members = f(this.members);
|
|
@@ -11401,7 +11429,7 @@ function Union2(members, options) {
|
|
|
11401
11429
|
}
|
|
11402
11430
|
function Literals(literals) {
|
|
11403
11431
|
const members = literals.map(Literal2);
|
|
11404
|
-
return
|
|
11432
|
+
return make26(union(members, undefined, undefined), {
|
|
11405
11433
|
literals,
|
|
11406
11434
|
members,
|
|
11407
11435
|
mapMembers(f) {
|
|
@@ -11418,14 +11446,14 @@ function Literals(literals) {
|
|
|
11418
11446
|
var NullOr = /* @__PURE__ */ lambda((self) => Union2([self, Null2]));
|
|
11419
11447
|
var UndefinedOr = /* @__PURE__ */ lambda((self) => Union2([self, Undefined2]));
|
|
11420
11448
|
function brand(identifier) {
|
|
11421
|
-
return (schema) =>
|
|
11449
|
+
return (schema) => make26(schema.ast, {
|
|
11422
11450
|
schema,
|
|
11423
11451
|
identifier
|
|
11424
11452
|
});
|
|
11425
11453
|
}
|
|
11426
11454
|
function decodeTo2(to, transformation) {
|
|
11427
11455
|
return (from) => {
|
|
11428
|
-
return
|
|
11456
|
+
return make26(decodeTo(from.ast, to.ast, transformation ? makeTransformation(transformation) : passthrough3()), {
|
|
11429
11457
|
from,
|
|
11430
11458
|
to
|
|
11431
11459
|
});
|
|
@@ -11438,7 +11466,7 @@ var BooleanLiterals = /* @__PURE__ */ Literals([...TrueLiterals.literals, ...Fal
|
|
|
11438
11466
|
encode: (value) => value ? "true" : "false"
|
|
11439
11467
|
})));
|
|
11440
11468
|
function withConstructorDefault2(defaultValue) {
|
|
11441
|
-
return (schema) =>
|
|
11469
|
+
return (schema) => make26(withConstructorDefault(schema.ast, defaultValue), {
|
|
11442
11470
|
schema
|
|
11443
11471
|
});
|
|
11444
11472
|
}
|
|
@@ -11734,7 +11762,7 @@ function Redacted(value, options) {
|
|
|
11734
11762
|
if (isRedacted(input)) {
|
|
11735
11763
|
const label = decodeLabel !== undefined ? mapErrorEager2(decodeLabel(input.label, poptions), (issue) => new Pointer(["label"], issue)) : void_3;
|
|
11736
11764
|
return flatMapEager2(label, () => mapBothEager2(decodeUnknownEffect(value)(value2(input), poptions), {
|
|
11737
|
-
onSuccess: (value) =>
|
|
11765
|
+
onSuccess: (value) => make21(value, {
|
|
11738
11766
|
label: input.label
|
|
11739
11767
|
}),
|
|
11740
11768
|
onFailure: () => {
|
|
@@ -11757,14 +11785,14 @@ function Redacted(value, options) {
|
|
|
11757
11785
|
}),
|
|
11758
11786
|
expected: "Redacted",
|
|
11759
11787
|
toCodecJson: ([value]) => link3()(value, {
|
|
11760
|
-
decode: transform((e) =>
|
|
11788
|
+
decode: transform((e) => make21(e, {
|
|
11761
11789
|
label
|
|
11762
11790
|
})),
|
|
11763
11791
|
encode: disallowJsonEncode ? forbidden((oe) => "Cannot serialize Redacted" + (isSome2(oe) && typeof oe.value.label === "string" ? ` with label: "${oe.value.label}"` : "")) : transform(value2)
|
|
11764
11792
|
}),
|
|
11765
11793
|
toEquivalence: ([value]) => makeEquivalence4(value)
|
|
11766
11794
|
});
|
|
11767
|
-
return
|
|
11795
|
+
return make26(schema.ast, {
|
|
11768
11796
|
value
|
|
11769
11797
|
});
|
|
11770
11798
|
}
|
|
@@ -11804,7 +11832,7 @@ function makeClass(Inherited, identifier, struct2, annotations, proto) {
|
|
|
11804
11832
|
return getClassSchema(this).rebuild(ast);
|
|
11805
11833
|
}
|
|
11806
11834
|
static make(input, options) {
|
|
11807
|
-
return
|
|
11835
|
+
return make24(getClassSchema(this))(input ?? {}, options);
|
|
11808
11836
|
}
|
|
11809
11837
|
static makeOption(input, options) {
|
|
11810
11838
|
return makeOption(getClassSchema(this))(input ?? {}, options);
|
|
@@ -11863,7 +11891,7 @@ function getClassSchemaFactory(from, identifier, annotations) {
|
|
|
11863
11891
|
const ClassTypeId = getClassTypeId(identifier);
|
|
11864
11892
|
const isClassValue = (input) => input instanceof self || hasProperty(input, ClassTypeId);
|
|
11865
11893
|
const transformation = getClassTransformation(self);
|
|
11866
|
-
const to =
|
|
11894
|
+
const to = make26(new Declaration([from.ast], () => (input, ast, options) => {
|
|
11867
11895
|
return isClassValue(input) ? succeed6(input) : fail6(new InvalidType(ast, input, options));
|
|
11868
11896
|
}, {
|
|
11869
11897
|
identifier,
|
|
@@ -11903,7 +11931,7 @@ var TaggedError3 = (identifier) => {
|
|
|
11903
11931
|
};
|
|
11904
11932
|
var toCodecJson2 = toCodecJson;
|
|
11905
11933
|
var toCodecStringTree2 = toCodecStringTree;
|
|
11906
|
-
var Json2 = /* @__PURE__ */
|
|
11934
|
+
var Json2 = /* @__PURE__ */ make26(/* @__PURE__ */ annotate(Json, {
|
|
11907
11935
|
toCode: () => ({
|
|
11908
11936
|
runtime: "Schema.Json",
|
|
11909
11937
|
Type: "Schema.Json"
|
|
@@ -11921,14 +11949,14 @@ class QuitError extends (/* @__PURE__ */ Error4("QuitError")({
|
|
|
11921
11949
|
}
|
|
11922
11950
|
var isQuitError = (u) => hasProperty(u, QuitErrorTypeId);
|
|
11923
11951
|
var Terminal = /* @__PURE__ */ Service("effect/Terminal");
|
|
11924
|
-
var
|
|
11952
|
+
var make27 = (impl) => Terminal.of({
|
|
11925
11953
|
...impl,
|
|
11926
11954
|
[TypeId30]: TypeId30
|
|
11927
11955
|
});
|
|
11928
11956
|
|
|
11929
11957
|
// node_modules/@effect/platform-node-shared/dist/NodeTerminal.js
|
|
11930
11958
|
import * as readline from "readline";
|
|
11931
|
-
var
|
|
11959
|
+
var make28 = /* @__PURE__ */ fnUntraced2(function* (shouldQuit = defaultShouldQuit) {
|
|
11932
11960
|
const stdin = process.stdin;
|
|
11933
11961
|
const stdout = process.stdout;
|
|
11934
11962
|
const lines = yield* make9();
|
|
@@ -12033,7 +12061,7 @@ var make27 = /* @__PURE__ */ fnUntraced2(function* (shouldQuit = defaultShouldQu
|
|
|
12033
12061
|
cause: err
|
|
12034
12062
|
}))));
|
|
12035
12063
|
}));
|
|
12036
|
-
return
|
|
12064
|
+
return make27({
|
|
12037
12065
|
columns,
|
|
12038
12066
|
rows,
|
|
12039
12067
|
readInput,
|
|
@@ -12041,7 +12069,7 @@ var make27 = /* @__PURE__ */ fnUntraced2(function* (shouldQuit = defaultShouldQu
|
|
|
12041
12069
|
display
|
|
12042
12070
|
});
|
|
12043
12071
|
});
|
|
12044
|
-
var layer10 = /* @__PURE__ */ effect(Terminal, /* @__PURE__ */
|
|
12072
|
+
var layer10 = /* @__PURE__ */ effect(Terminal, /* @__PURE__ */ make28(defaultShouldQuit));
|
|
12045
12073
|
function defaultShouldQuit(input) {
|
|
12046
12074
|
const key = input.key;
|
|
12047
12075
|
return key.name === "escape" || key.ctrl && (key.name === "c" || key.name === "d");
|
|
@@ -12094,7 +12122,7 @@ function makeProvider(load, mapInput) {
|
|
|
12094
12122
|
function makeSource(get, transform) {
|
|
12095
12123
|
return makeProvider((path) => get(transform(path)), (f) => makeSource(get, (path) => f(transform(path))));
|
|
12096
12124
|
}
|
|
12097
|
-
function
|
|
12125
|
+
function make29(get) {
|
|
12098
12126
|
return makeSource(get, identityPath);
|
|
12099
12127
|
}
|
|
12100
12128
|
function emptyStringAsMissing(value, preserveEmptyStrings) {
|
|
@@ -12103,7 +12131,7 @@ function emptyStringAsMissing(value, preserveEmptyStrings) {
|
|
|
12103
12131
|
function fromEnvRecord(env, options) {
|
|
12104
12132
|
const preserveEmptyStrings = options?.preserveEmptyStrings === true;
|
|
12105
12133
|
const trie = buildEnvTrie(env);
|
|
12106
|
-
return
|
|
12134
|
+
return make29((path) => succeed6(nodeAtEnv(trie, env, path, preserveEmptyStrings)));
|
|
12107
12135
|
}
|
|
12108
12136
|
function fromEnv(options) {
|
|
12109
12137
|
const env = options?.env ?? {
|
|
@@ -12185,7 +12213,7 @@ var Proto8 = {
|
|
|
12185
12213
|
};
|
|
12186
12214
|
}
|
|
12187
12215
|
};
|
|
12188
|
-
function
|
|
12216
|
+
function make30(evaluator) {
|
|
12189
12217
|
const self = Object.create(Proto8);
|
|
12190
12218
|
self.evaluator = evaluator;
|
|
12191
12219
|
self.parse = (provider) => flatMapEager2(evaluator(provider, []), fromResult2);
|
|
@@ -12193,10 +12221,10 @@ function make29(evaluator) {
|
|
|
12193
12221
|
}
|
|
12194
12222
|
var evaluateAt = (self, provider, pathPrefix) => self.evaluator(provider, pathPrefix);
|
|
12195
12223
|
var map10 = /* @__PURE__ */ dual(2, (self, f) => {
|
|
12196
|
-
return
|
|
12224
|
+
return make30((provider, pathPrefix) => map7(evaluateAt(self, provider, pathPrefix), map2(f)));
|
|
12197
12225
|
});
|
|
12198
12226
|
var orElse2 = /* @__PURE__ */ dual(2, (self, that) => {
|
|
12199
|
-
return
|
|
12227
|
+
return make30((provider, pathPrefix) => matchCauseEffect2(evaluateAt(self, provider, pathPrefix), {
|
|
12200
12228
|
onFailure: (cause) => {
|
|
12201
12229
|
const error = findErrorOption2(cause);
|
|
12202
12230
|
return isSome2(error) && cause.reasons.every(isFailReason2) ? evaluateAt(that(error.value), provider, pathPrefix) : failCause3(cause);
|
|
@@ -12205,7 +12233,7 @@ var orElse2 = /* @__PURE__ */ dual(2, (self, that) => {
|
|
|
12205
12233
|
}));
|
|
12206
12234
|
});
|
|
12207
12235
|
var withDefault3 = /* @__PURE__ */ dual(2, (self, defaultValue) => {
|
|
12208
|
-
return
|
|
12236
|
+
return make30((provider, pathPrefix) => mapEager2(evaluateAt(self, provider, pathPrefix), (resolution) => isFailure2(resolution) ? succeed2(defaultValue) : resolution));
|
|
12209
12237
|
});
|
|
12210
12238
|
var option2 = (self) => self.pipe(map10(some2), withDefault3(none2()));
|
|
12211
12239
|
var isSourceError = (u) => isTagged(u, "SourceError");
|
|
@@ -12317,9 +12345,9 @@ var toConfigCursorAST = /* @__PURE__ */ memoize((root) => {
|
|
|
12317
12345
|
function schema(codec, path) {
|
|
12318
12346
|
const codecStringTree = toCodecStringTree2(codec);
|
|
12319
12347
|
const encodedAst = toEncoded(codecStringTree.ast);
|
|
12320
|
-
const decodeCursor = decodeUnknownEffect(
|
|
12348
|
+
const decodeCursor = decodeUnknownEffect(make26(toConfigCursorAST(codecStringTree.ast)));
|
|
12321
12349
|
const localPath = typeof path === "string" ? [path] : path ?? [];
|
|
12322
|
-
return
|
|
12350
|
+
return make30((provider, pathPrefix) => {
|
|
12323
12351
|
const fullPath = [...pathPrefix, ...localPath];
|
|
12324
12352
|
return loadCursor(provider, fullPath).pipe(flatMapEager2((cursor) => decodeCursor(cursor).pipe(mapEager2(succeed2), catchEager2((issue) => {
|
|
12325
12353
|
const error = new ConfigError(new SchemaError(fullPath.length > 0 ? new Pointer(fullPath, issue) : issue));
|
|
@@ -12906,7 +12934,7 @@ var Int2 = (options) => {
|
|
|
12906
12934
|
});
|
|
12907
12935
|
};
|
|
12908
12936
|
var map11 = /* @__PURE__ */ dual(2, (self, f) => flatMap6(self, (a) => succeed9(f(a))));
|
|
12909
|
-
var Password = (options) => basePrompt(options, "password").pipe(map11(
|
|
12937
|
+
var Password = (options) => basePrompt(options, "password").pipe(map11(make21));
|
|
12910
12938
|
var run3 = /* @__PURE__ */ fnUntraced2(function* (self) {
|
|
12911
12939
|
const terminal = yield* Terminal;
|
|
12912
12940
|
const input = yield* cached2(terminal.readInput);
|
|
@@ -16387,11 +16415,11 @@ class CliConfig extends (/* @__PURE__ */ Reference("effect/cli/CliConfig", {
|
|
|
16387
16415
|
var defaults = {
|
|
16388
16416
|
builtIns: BuiltIns
|
|
16389
16417
|
};
|
|
16390
|
-
var
|
|
16418
|
+
var make31 = (options) => ({
|
|
16391
16419
|
...defaults,
|
|
16392
16420
|
...options
|
|
16393
16421
|
});
|
|
16394
|
-
var layer13 = (options) => succeed5(CliConfig,
|
|
16422
|
+
var layer13 = (options) => succeed5(CliConfig, make31(options));
|
|
16395
16423
|
// node_modules/effect/dist/cli/internal/lexer.js
|
|
16396
16424
|
function lex(argv) {
|
|
16397
16425
|
const endIndex = argv.indexOf("--");
|
|
@@ -17224,7 +17252,7 @@ var formatShellArg = (arg) => /^[A-Za-z0-9_./:@%+=,-]+$/.test(arg) ? arg : `'${a
|
|
|
17224
17252
|
|
|
17225
17253
|
// node_modules/effect/dist/cli/Command.js
|
|
17226
17254
|
var isCommand = (u) => hasProperty(u, TypeId37);
|
|
17227
|
-
var
|
|
17255
|
+
var make32 = (name, config, handler) => {
|
|
17228
17256
|
const parsedConfig = parseConfig(config ?? {});
|
|
17229
17257
|
return makeCommand({
|
|
17230
17258
|
name,
|
|
@@ -17542,7 +17570,7 @@ class Uint8Array3 extends Proto12 {
|
|
|
17542
17570
|
this.contentLength = contentLength;
|
|
17543
17571
|
}
|
|
17544
17572
|
get body() {
|
|
17545
|
-
return this._body ??=
|
|
17573
|
+
return this._body ??= encodeText2(this.text);
|
|
17546
17574
|
}
|
|
17547
17575
|
toJSON() {
|
|
17548
17576
|
const toString = this.contentType.startsWith("text/") || this.contentType.endsWith("json");
|
|
@@ -17557,7 +17585,7 @@ class Uint8Array3 extends Proto12 {
|
|
|
17557
17585
|
}
|
|
17558
17586
|
var encoder2 = /* @__PURE__ */ new TextEncoder;
|
|
17559
17587
|
var buffer2 = globalThis.Buffer;
|
|
17560
|
-
var
|
|
17588
|
+
var encodeText2 = buffer2 !== undefined ? (body) => buffer2.from(body, "utf8") : (body) => encoder2.encode(body);
|
|
17561
17589
|
var text = (body, contentType) => {
|
|
17562
17590
|
if (typeof body !== "string") {
|
|
17563
17591
|
body = body === undefined ? "" : String(body);
|
|
@@ -17660,7 +17688,7 @@ var updateHeaders = (headers, body) => {
|
|
|
17660
17688
|
// node_modules/effect/dist/http/Url.js
|
|
17661
17689
|
class UrlError extends (/* @__PURE__ */ TaggedError2("UrlError")) {
|
|
17662
17690
|
}
|
|
17663
|
-
var
|
|
17691
|
+
var make33 = (url, params, hash) => try_({
|
|
17664
17692
|
try: () => {
|
|
17665
17693
|
const urlInstance = new URL(url, baseUrl());
|
|
17666
17694
|
for (let i = 0;i < params.params.length; i++) {
|
|
@@ -17716,15 +17744,15 @@ function makeWith(method, url, urlParams, hash, headers, body) {
|
|
|
17716
17744
|
return self;
|
|
17717
17745
|
}
|
|
17718
17746
|
var empty8 = /* @__PURE__ */ makeWith("GET", "", empty6, /* @__PURE__ */ none2(), empty5, empty7);
|
|
17719
|
-
var
|
|
17747
|
+
var make34 = (method) => (url, options) => modify(empty8, {
|
|
17720
17748
|
method,
|
|
17721
17749
|
url,
|
|
17722
17750
|
...options ?? undefined
|
|
17723
17751
|
});
|
|
17724
|
-
var get4 = /* @__PURE__ */
|
|
17725
|
-
var post = /* @__PURE__ */
|
|
17726
|
-
var patch = /* @__PURE__ */
|
|
17727
|
-
var put = /* @__PURE__ */
|
|
17752
|
+
var get4 = /* @__PURE__ */ make34("GET");
|
|
17753
|
+
var post = /* @__PURE__ */ make34("POST");
|
|
17754
|
+
var patch = /* @__PURE__ */ make34("PATCH");
|
|
17755
|
+
var put = /* @__PURE__ */ make34("PUT");
|
|
17728
17756
|
var modify = /* @__PURE__ */ dual(2, (self, options) => {
|
|
17729
17757
|
let result = self;
|
|
17730
17758
|
if (options.method) {
|
|
@@ -17789,7 +17817,7 @@ var setBody = /* @__PURE__ */ dual(2, (self, body) => {
|
|
|
17789
17817
|
});
|
|
17790
17818
|
var bodyJsonUnsafe = /* @__PURE__ */ dual(2, (self, body) => setBody(self, jsonUnsafe(body)));
|
|
17791
17819
|
function toUrl(self) {
|
|
17792
|
-
const r =
|
|
17820
|
+
const r = make33(self.url, self.urlParams, getOrUndefined(self.hash));
|
|
17793
17821
|
if (isSuccess2(r)) {
|
|
17794
17822
|
return some2(r.success);
|
|
17795
17823
|
}
|
|
@@ -18023,13 +18051,13 @@ var Proto14 = {
|
|
|
18023
18051
|
};
|
|
18024
18052
|
},
|
|
18025
18053
|
.../* @__PURE__ */ Object.fromEntries(/* @__PURE__ */ allShort.map(([fullMethod, method]) => [method, function(url, options) {
|
|
18026
|
-
return this.execute(
|
|
18054
|
+
return this.execute(make34(fullMethod)(url, options));
|
|
18027
18055
|
}]))
|
|
18028
18056
|
};
|
|
18029
|
-
var
|
|
18057
|
+
var make35 = (f) => makeWith2((effect) => flatMap4(effect, (request) => withFiber2((fiber) => {
|
|
18030
18058
|
const scopedController = scopedRequests.get(request);
|
|
18031
18059
|
const controller = scopedController ?? new AbortController;
|
|
18032
|
-
const urlResult =
|
|
18060
|
+
const urlResult = make33(request.url, request.urlParams, getOrUndefined(request.hash));
|
|
18033
18061
|
if (isFailure2(urlResult)) {
|
|
18034
18062
|
return fail6(new HttpClientError({
|
|
18035
18063
|
reason: new InvalidUrlError({
|
|
@@ -18226,7 +18254,7 @@ var Fetch = /* @__PURE__ */ Reference("effect/http/FetchHttpClient/Fetch", {
|
|
|
18226
18254
|
|
|
18227
18255
|
class RequestInit extends (/* @__PURE__ */ Service()("effect/http/FetchHttpClient/RequestInit")) {
|
|
18228
18256
|
}
|
|
18229
|
-
var fetch = /* @__PURE__ */
|
|
18257
|
+
var fetch = /* @__PURE__ */ make35((request, url, signal, fiber) => {
|
|
18230
18258
|
const fetch = fiber.getRef(Fetch);
|
|
18231
18259
|
const options = getOrUndefined2(fiber.context, RequestInit) ?? {};
|
|
18232
18260
|
let headers = options.headers ? merge4(fromInput(options.headers), request.headers) : request.headers;
|
|
@@ -18264,7 +18292,7 @@ var layer14 = /* @__PURE__ */ layerMergedContext(/* @__PURE__ */ succeed6(fetch)
|
|
|
18264
18292
|
// package.json
|
|
18265
18293
|
var package_default = {
|
|
18266
18294
|
name: "jj-octo",
|
|
18267
|
-
version: "0.
|
|
18295
|
+
version: "0.9.0",
|
|
18268
18296
|
description: "A jj subcommand for GitHub that supports stacked pull requests and works in Claude Code cloud sessions",
|
|
18269
18297
|
license: "MIT",
|
|
18270
18298
|
repository: {
|
|
@@ -18337,7 +18365,7 @@ var gitLayer = ({ cwd, env } = {}) => effect(Git, gen2(function* () {
|
|
|
18337
18365
|
`, local: `${local}
|
|
18338
18366
|
` };
|
|
18339
18367
|
yield* all2(Object.entries(written).map(([name, text]) => fs.writeFileString(path.join(directory, name), text)));
|
|
18340
|
-
const handle = yield* spawner.spawn(
|
|
18368
|
+
const handle = yield* spawner.spawn(make16("git", [
|
|
18341
18369
|
"merge-file",
|
|
18342
18370
|
"-p",
|
|
18343
18371
|
"-L",
|
|
@@ -18361,7 +18389,7 @@ var gitLayer = ({ cwd, env } = {}) => effect(Git, gen2(function* () {
|
|
|
18361
18389
|
return { conflicted: code > 0, text: text.trimEnd() };
|
|
18362
18390
|
})).pipe(catchTag2("PlatformError", (error) => fail6(new GitFailed({ message: `git merge-file failed: ${error.message}` })))),
|
|
18363
18391
|
read: (args) => scoped2(gen2(function* () {
|
|
18364
|
-
const handle = yield* spawner.spawn(
|
|
18392
|
+
const handle = yield* spawner.spawn(make16("git", args, { cwd, env, extendEnv: true }));
|
|
18365
18393
|
const [stdout, stderr, code] = yield* all2([
|
|
18366
18394
|
mkString(decodeText(handle.stdout)),
|
|
18367
18395
|
mkString(decodeText(handle.stderr)),
|
|
@@ -18406,7 +18434,7 @@ var jjLayer = ({ cwd, env, printed } = {}) => effect(Jj, gen2(function* () {
|
|
|
18406
18434
|
const spawner = yield* ChildProcessSpawner;
|
|
18407
18435
|
const location2 = { cwd, env, extendEnv: true };
|
|
18408
18436
|
const captured = (args) => scoped2(gen2(function* () {
|
|
18409
|
-
const handle = yield* spawner.spawn(
|
|
18437
|
+
const handle = yield* spawner.spawn(make16("jj", args, location2));
|
|
18410
18438
|
return yield* all2([
|
|
18411
18439
|
mkString(decodeText(handle.stdout)),
|
|
18412
18440
|
mkString(decodeText(handle.stderr)),
|
|
@@ -18414,7 +18442,7 @@ var jjLayer = ({ cwd, env, printed } = {}) => effect(Jj, gen2(function* () {
|
|
|
18414
18442
|
], { concurrency: "unbounded" });
|
|
18415
18443
|
})).pipe(catchTag2("PlatformError", (error) => fail6(failed(args, error.message))));
|
|
18416
18444
|
const read = (args) => flatMap4(captured(args), ([stdout, stderr, code]) => code === 0 ? succeed6(stdout) : fail6(failed(args, stderr)));
|
|
18417
|
-
const run = (args) => printed === undefined ? spawner.exitCode(
|
|
18445
|
+
const run = (args) => printed === undefined ? spawner.exitCode(make16("jj", args, {
|
|
18418
18446
|
...location2,
|
|
18419
18447
|
stderr: "inherit",
|
|
18420
18448
|
stdout: "inherit"
|
|
@@ -18587,12 +18615,7 @@ var bodyOf = (body) => bodyJsonUnsafe(body);
|
|
|
18587
18615
|
var PullRequestNumberSchema = Number6.pipe(brand("PullRequestNumber"));
|
|
18588
18616
|
var StackNumberSchema = Number6.pipe(brand("StackNumber"));
|
|
18589
18617
|
|
|
18590
|
-
// src/clients/github/
|
|
18591
|
-
class GitHubFailed extends TaggedError2("GitHubFailed") {
|
|
18592
|
-
}
|
|
18593
|
-
|
|
18594
|
-
class GitHub extends Service()("jj-octo/GitHub") {
|
|
18595
|
-
}
|
|
18618
|
+
// src/clients/github/responses.ts
|
|
18596
18619
|
var CreatedPullRequest = responseOf()(Struct({ number: PullRequestNumberSchema }));
|
|
18597
18620
|
var CreatedStack = responseOf()(Struct({ number: StackNumberSchema }));
|
|
18598
18621
|
var PullRequests = responseOf()(ArraySchema(Struct({
|
|
@@ -18602,9 +18625,14 @@ var PullRequests = responseOf()(ArraySchema(Struct({
|
|
|
18602
18625
|
number: PullRequestNumberSchema,
|
|
18603
18626
|
title: String4
|
|
18604
18627
|
})));
|
|
18605
|
-
var
|
|
18628
|
+
var AnyPullRequests = responseOf()(ArraySchema(Struct({
|
|
18629
|
+
draft: optionalKey2(Boolean3),
|
|
18606
18630
|
head: Struct({ sha: String4 }),
|
|
18607
|
-
|
|
18631
|
+
html_url: String4,
|
|
18632
|
+
merged_at: NullOr(String4),
|
|
18633
|
+
number: PullRequestNumberSchema,
|
|
18634
|
+
state: String4,
|
|
18635
|
+
title: String4
|
|
18608
18636
|
})));
|
|
18609
18637
|
var StackedPullRequest = Struct({
|
|
18610
18638
|
number: PullRequestNumberSchema,
|
|
@@ -18621,6 +18649,26 @@ var MergeRequest = Struct({
|
|
|
18621
18649
|
});
|
|
18622
18650
|
var StartedMerge = responseOf()(MergeRequest);
|
|
18623
18651
|
var MergeResult = responseOf()(MergeRequest);
|
|
18652
|
+
var listedPullRequest = ({
|
|
18653
|
+
draft,
|
|
18654
|
+
head,
|
|
18655
|
+
html_url,
|
|
18656
|
+
merged_at,
|
|
18657
|
+
number,
|
|
18658
|
+
state,
|
|
18659
|
+
title
|
|
18660
|
+
}) => {
|
|
18661
|
+
const open = draft === true ? "draft" : "ready";
|
|
18662
|
+
const closed = merged_at === null ? "closed" : "merged";
|
|
18663
|
+
return { head: head.sha, number, state: state === "open" ? open : closed, title, url: html_url };
|
|
18664
|
+
};
|
|
18665
|
+
|
|
18666
|
+
// src/clients/github/client.ts
|
|
18667
|
+
class GitHubFailed extends TaggedError2("GitHubFailed") {
|
|
18668
|
+
}
|
|
18669
|
+
|
|
18670
|
+
class GitHub extends Service()("jj-octo/GitHub") {
|
|
18671
|
+
}
|
|
18624
18672
|
var GitHubLive = (repository, connection) => {
|
|
18625
18673
|
const repo = (path) => `/repos/${repository.owner}/${repository.name}${path}`;
|
|
18626
18674
|
return effect(GitHub, gen2(function* () {
|
|
@@ -18678,7 +18726,6 @@ var GitHubLive = (repository, connection) => {
|
|
|
18678
18726
|
message: `merging #${pullRequest} ended ${settled.status}: ${settled.details.message}`
|
|
18679
18727
|
});
|
|
18680
18728
|
}),
|
|
18681
|
-
mergedHeads: (branch) => json(ClosedPullRequests)(get4(fromBranch(branch, "closed"))).pipe(map7((closed) => closed.filter(({ merged_at }) => merged_at !== null).map(({ head }) => head.sha))),
|
|
18682
18729
|
openPullRequest: (branch) => json(PullRequests)(get4(fromBranch(branch, "open"))).pipe(map7((found) => map(fromNullishOr(found[0]), ({ base, body, draft, number, title }) => ({
|
|
18683
18730
|
base: base.ref,
|
|
18684
18731
|
body: body ?? "",
|
|
@@ -18686,6 +18733,7 @@ var GitHubLive = (repository, connection) => {
|
|
|
18686
18733
|
number,
|
|
18687
18734
|
title
|
|
18688
18735
|
})))),
|
|
18736
|
+
pullRequestsFrom: (branch) => json(AnyPullRequests)(get4(`${fromBranch(branch, "all")}&per_page=100`)).pipe(map7((found) => found.map((listed) => listedPullRequest(listed)))),
|
|
18689
18737
|
setBase: (pullRequest, base) => send(patch(repo(`/pulls/${pullRequest}`)).pipe(bodyOf({ base }))).pipe(asVoid2),
|
|
18690
18738
|
setDescription: (pullRequest, { body, title }) => send(patch(repo(`/pulls/${pullRequest}`)).pipe(bodyOf({ body, title }))).pipe(asVoid2),
|
|
18691
18739
|
stackOf,
|
|
@@ -18821,7 +18869,7 @@ var doctor = gen2(function* () {
|
|
|
18821
18869
|
}
|
|
18822
18870
|
yield* error("set up for jj-octo");
|
|
18823
18871
|
});
|
|
18824
|
-
var doctorCommand =
|
|
18872
|
+
var doctorCommand = make32("doctor", {}, () => asUserError(doctor)).pipe(withHelp("Check that a checkout is set up for the other commands", "Runs the checks of everything `init` sets up or requires, and changes nothing. Fails with each problem, and what fixes it."));
|
|
18825
18873
|
|
|
18826
18874
|
// src/cli/gh/init.ts
|
|
18827
18875
|
var fixed = ({ check, fix }) => gen2(function* () {
|
|
@@ -18841,7 +18889,72 @@ var init = gen2(function* () {
|
|
|
18841
18889
|
}
|
|
18842
18890
|
yield* error(`set up jj, with trunk() as ${yield* branch}@origin`);
|
|
18843
18891
|
});
|
|
18844
|
-
var initCommand =
|
|
18892
|
+
var initCommand = make32("init", {}, () => asUserError(init)).pipe(withHelp("Set up a git checkout for the other commands", "Makes it a jj repository colocated with git, unless it already is one, and copies git's name and email into the repository's jj config where jj has none. Where neither has them, set them with `jj config set --user`.", "Reads the default branch from `origin`, fetches and tracks it, and sets `trunk()` to it in the repository's config. jj's own `trunk()` guesses from branch names, so without this a default branch it doesn't guess would be the base of pull requests but not of local rebases. `submit`, `merge` and `sync` check that the two agree.", "Sets the `jj gh` alias to run `jj-octo` from `PATH`, in the repository's config, unless the repository has one, such as one that runs another build.", "Needs no GitHub token. Running it again changes nothing that is already set up. Run it again after the default branch changes on GitHub. Fails with what it couldn't set up, after setting up the rest. Where it can't make a colocated jj repository, such as in a git worktree, it sets up nothing else."));
|
|
18893
|
+
|
|
18894
|
+
// src/clients/clipboard.ts
|
|
18895
|
+
class ClipboardFailed extends TaggedError2("ClipboardFailed") {
|
|
18896
|
+
}
|
|
18897
|
+
|
|
18898
|
+
class Clipboard extends Service()("jj-octo/Clipboard") {
|
|
18899
|
+
}
|
|
18900
|
+
var MACOS_SCRIPT = `
|
|
18901
|
+
ObjC.import("AppKit");
|
|
18902
|
+
function run([html, text]) {
|
|
18903
|
+
const pasteboard = $.NSPasteboard.generalPasteboard;
|
|
18904
|
+
pasteboard.clearContents;
|
|
18905
|
+
if (
|
|
18906
|
+
!pasteboard.setStringForType($(html), $.NSPasteboardTypeHTML) ||
|
|
18907
|
+
!pasteboard.setStringForType($(text), $.NSPasteboardTypeString)
|
|
18908
|
+
) {
|
|
18909
|
+
throw new Error("the pasteboard didn't take the links");
|
|
18910
|
+
}
|
|
18911
|
+
}`;
|
|
18912
|
+
var commandsFor = ({ html, text }, platform, env) => {
|
|
18913
|
+
const make = (name, args, input) => ({
|
|
18914
|
+
command: make16(name, args, {
|
|
18915
|
+
detached: false,
|
|
18916
|
+
env,
|
|
18917
|
+
extendEnv: true,
|
|
18918
|
+
stdout: "ignore",
|
|
18919
|
+
...input === "stdin" ? { stderr: "ignore", stdin: make12(html).pipe(encodeText) } : { stderr: "inherit", stdin: "ignore" }
|
|
18920
|
+
}),
|
|
18921
|
+
name
|
|
18922
|
+
});
|
|
18923
|
+
if (platform === "darwin") {
|
|
18924
|
+
return [make("osascript", ["-l", "JavaScript", "-e", MACOS_SCRIPT, html, text], "arguments")];
|
|
18925
|
+
}
|
|
18926
|
+
if (platform !== "linux") {
|
|
18927
|
+
return [];
|
|
18928
|
+
}
|
|
18929
|
+
const xclip = make("xclip", ["-selection", "clipboard", "-t", "text/html"], "stdin");
|
|
18930
|
+
const wayland = env["WAYLAND_DISPLAY"] ?? process.env["WAYLAND_DISPLAY"] ?? "";
|
|
18931
|
+
return wayland === "" ? [xclip] : [make("wl-copy", ["--type", "text/html"], "stdin"), xclip];
|
|
18932
|
+
};
|
|
18933
|
+
var clipboardLayer = ({
|
|
18934
|
+
env = {},
|
|
18935
|
+
platform = process.platform
|
|
18936
|
+
} = {}) => effect(Clipboard, gen2(function* () {
|
|
18937
|
+
const spawner = yield* ChildProcessSpawner;
|
|
18938
|
+
return {
|
|
18939
|
+
write: (content) => {
|
|
18940
|
+
const commands = commandsFor(content, platform, env);
|
|
18941
|
+
if (commands.length === 0) {
|
|
18942
|
+
return fail6(new ClipboardFailed({
|
|
18943
|
+
message: `copying to the clipboard needs macOS, or Linux with wl-copy or xclip, not ${platform}`
|
|
18944
|
+
}));
|
|
18945
|
+
}
|
|
18946
|
+
const PATH = env["PATH"] ?? process.env["PATH"] ?? "";
|
|
18947
|
+
const installed = commands.find(({ name }) => Bun.which(name, { PATH }) !== null);
|
|
18948
|
+
if (installed === undefined) {
|
|
18949
|
+
const names = commands.map(({ name }) => name).join(" or ");
|
|
18950
|
+
return fail6(new ClipboardFailed({ message: `couldn't find ${names}` }));
|
|
18951
|
+
}
|
|
18952
|
+
const { command, name } = installed;
|
|
18953
|
+
return spawner.exitCode(command).pipe(catchTag2("PlatformError", (error) => fail6(new ClipboardFailed({ message: `${name} failed: ${error.message}` }))), flatMap4((code) => code === 0 ? void_3 : fail6(new ClipboardFailed({ message: `${name} exited with ${code}` }))));
|
|
18954
|
+
}
|
|
18955
|
+
};
|
|
18956
|
+
}));
|
|
18957
|
+
var ClipboardLive = clipboardLayer();
|
|
18845
18958
|
|
|
18846
18959
|
// src/clients/github/connection.ts
|
|
18847
18960
|
var authKey = "jj-octo.github-auth";
|
|
@@ -18851,8 +18964,8 @@ var ownToken = gen2(function* () {
|
|
|
18851
18964
|
return fromEnvironment.value;
|
|
18852
18965
|
}
|
|
18853
18966
|
const spawner = yield* ChildProcessSpawner;
|
|
18854
|
-
const stored = (yield* spawner.string(
|
|
18855
|
-
return stored === "" ? yield* fail6("no token") :
|
|
18967
|
+
const stored = (yield* spawner.string(make16("gh", ["auth", "token"]))).trim();
|
|
18968
|
+
return stored === "" ? yield* fail6("no token") : make21(stored);
|
|
18856
18969
|
}).pipe(mapError3(() => new GitHubFailed({ message: "no GitHub token: set GH_TOKEN, or run `gh auth login`" })));
|
|
18857
18970
|
var gitSetting = (name) => gen2(function* () {
|
|
18858
18971
|
const value = yield* gitConfig(["--get-urlmatch", name, "https://github.com"]).pipe(mapError3(({ message }) => new GitHubFailed({ message })));
|
|
@@ -18873,7 +18986,7 @@ var gitProxy = gen2(function* () {
|
|
|
18873
18986
|
const withScheme = /^[a-z][\d+.a-z-]*:\/\//iu.test(url.value) ? url.value : `http://${url.value}`;
|
|
18874
18987
|
const connection = {
|
|
18875
18988
|
proxy: some2({ ca, url: withScheme }),
|
|
18876
|
-
token:
|
|
18989
|
+
token: make21("proxy-injected")
|
|
18877
18990
|
};
|
|
18878
18991
|
return connection;
|
|
18879
18992
|
});
|
|
@@ -18917,6 +19030,54 @@ var GitHubFromOrigin = unwrap(gen2(function* () {
|
|
|
18917
19030
|
return GitHubLive(repository.value, yield* connection);
|
|
18918
19031
|
}));
|
|
18919
19032
|
|
|
19033
|
+
// src/cli/gh/links.ts
|
|
19034
|
+
class NoPullRequests extends TaggedError2("NoPullRequests") {
|
|
19035
|
+
}
|
|
19036
|
+
var EMOJI = {
|
|
19037
|
+
closed: "\uD83D\uDEAB",
|
|
19038
|
+
draft: "\uD83D\uDCDD",
|
|
19039
|
+
merged: "\u2705",
|
|
19040
|
+
ready: "\uD83D\uDC40"
|
|
19041
|
+
};
|
|
19042
|
+
var OPEN = {
|
|
19043
|
+
closed: false,
|
|
19044
|
+
draft: true,
|
|
19045
|
+
merged: false,
|
|
19046
|
+
ready: true
|
|
19047
|
+
};
|
|
19048
|
+
var markdownLinks = (pullRequests) => pullRequests.map(({ number, state, title, url }) => `${EMOJI[state]} [#${number} ${title}](${url})`).join(`
|
|
19049
|
+
`);
|
|
19050
|
+
var htmlLinks = (pullRequests) => `<meta charset="utf-8">${pullRequests.map(({ number, state, title, url }) => `${EMOJI[state]} <a href="${Bun.escapeHTML(url)}">#${number} ${Bun.escapeHTML(title)}</a>`).join("<br>")}`;
|
|
19051
|
+
var pullRequestOf = (pullRequests, commitId, pushed) => fromNullishOr(pullRequests.find(({ state }) => OPEN[state]) ?? pullRequests.find(({ head }) => head === commitId || head === pushed));
|
|
19052
|
+
var stackPullRequests = (revision) => gen2(function* () {
|
|
19053
|
+
const github = yield* GitHub;
|
|
19054
|
+
const stack = yield* stackChanges(revision);
|
|
19055
|
+
const [targets, found] = yield* all2([
|
|
19056
|
+
bookmarkTargets,
|
|
19057
|
+
forEach2(stack, ({ bookmark }) => github.pullRequestsFrom(bookmark), {
|
|
19058
|
+
concurrency: "unbounded"
|
|
19059
|
+
})
|
|
19060
|
+
], { concurrency: "unbounded" });
|
|
19061
|
+
return stack.flatMap(({ bookmark, commitId }, index) => toArray(pullRequestOf(found[index] ?? [], commitId, targets.get(bookmark)?.origin))).toReversed();
|
|
19062
|
+
});
|
|
19063
|
+
var links = ({
|
|
19064
|
+
copy,
|
|
19065
|
+
revision
|
|
19066
|
+
}) => gen2(function* () {
|
|
19067
|
+
const pullRequests = yield* stackPullRequests(revision).pipe(filterOrFail2((found) => found.length > 0, () => new NoPullRequests({ message: "no change of the stack has a pull request" })));
|
|
19068
|
+
const text = markdownLinks(pullRequests);
|
|
19069
|
+
yield* log(text);
|
|
19070
|
+
if (copy) {
|
|
19071
|
+
const clipboard = yield* Clipboard;
|
|
19072
|
+
yield* clipboard.write({ html: htmlLinks(pullRequests), text });
|
|
19073
|
+
yield* error("copied the links to the clipboard");
|
|
19074
|
+
}
|
|
19075
|
+
});
|
|
19076
|
+
var linksCommand = make32("links", {
|
|
19077
|
+
copy: Boolean6("copy").pipe(withDefault5(false), withDescription2("Also copy the links to the clipboard, as links that Slack pastes")),
|
|
19078
|
+
revision: revisionFlag("A change of the stack to list")
|
|
19079
|
+
}, (options) => asUserError(links(options).pipe(provide3([GitHubFromOrigin, ClipboardLive])))).pipe(withHelp("Print the stack's pull requests as Markdown links", "Prints one line per pull request, top first: \uD83D\uDCDD for a draft, \uD83D\uDC40 for one ready for review, \u2705 for a merged one and \uD83D\uDEAB for one closed unmerged, then a Markdown link showing its number and title.", "A change's pull request is the open one from its branch, or else the newest closed one whose head is the change or the commit pushed for it. A change with no pull request is left out, as is one that `sync` abandoned because its pull request merged. Fails where no change has one.", "With `--copy`, also puts the links on the clipboard as HTML, which Slack and other apps paste as links. That runs `osascript` on macOS, which also copies the Markdown as plain text, and `wl-copy` or `xclip` on Linux, which copy the HTML alone.", "Fails if the changes aren't a chain, if one has conflicts, or if one doesn't have exactly one bookmark, as `log` does. Changes nothing, locally or on GitHub."));
|
|
19080
|
+
|
|
18920
19081
|
// src/cli/gh/log.ts
|
|
18921
19082
|
var logLines2 = (entries) => {
|
|
18922
19083
|
const rows = entries.toReversed().map(({ bookmark, pullRequest, pushed }) => [
|
|
@@ -18941,7 +19102,7 @@ var log2 = (revision) => gen2(function* () {
|
|
|
18941
19102
|
pushed: pushedState(targets.get(change.bookmark), change)
|
|
18942
19103
|
})));
|
|
18943
19104
|
});
|
|
18944
|
-
var logCommand =
|
|
19105
|
+
var logCommand = make32("log", { revision: revisionFlag("A change of the stack to show") }, ({ revision }) => asUserError(log2(revision).pipe(provide3(GitHubFromOrigin))).pipe(flatMap4((printed) => log(printed.join(`
|
|
18945
19106
|
`))))).pipe(withHelp("Show changes and their pull requests", "Prints one line per change, top first: its bookmark, its pull request with whether that is a draft or ready for review, and whether the change is pushed, changed since the push, or not pushed.", "Fails if the changes aren't a chain, if one has conflicts, or if one doesn't have exactly one bookmark. `submit` makes the same check before it changes anything.", "Changes nothing, locally or on GitHub."));
|
|
18946
19107
|
|
|
18947
19108
|
// src/clients/pr-descriptions.ts
|
|
@@ -19272,9 +19433,7 @@ var notMerged = (merged) => (name) => merged.every(({ bookmark }) => bookmark !=
|
|
|
19272
19433
|
var mergedHeadsOf = (bookmarks) => gen2(function* () {
|
|
19273
19434
|
const github = yield* GitHub;
|
|
19274
19435
|
const pushed = pushedOf(bookmarks);
|
|
19275
|
-
const heads = yield* forEach2(pushed, ({ name }) => github.
|
|
19276
|
-
concurrency: "unbounded"
|
|
19277
|
-
});
|
|
19436
|
+
const heads = yield* forEach2(pushed, ({ name }) => github.pullRequestsFrom(name).pipe(map7((pullRequests) => pullRequests.filter(({ state }) => state === "merged").map(({ head }) => head))), { concurrency: "unbounded" });
|
|
19278
19437
|
return Object.fromEntries(pushed.map(({ name }, index) => [name, heads[index] ?? []]));
|
|
19279
19438
|
});
|
|
19280
19439
|
var mergedIn = (bookmarks, heads) => gen2(function* () {
|
|
@@ -19559,7 +19718,7 @@ var sync4 = (known = []) => gen2(function* () {
|
|
|
19559
19718
|
];
|
|
19560
19719
|
yield* reconcile({ before, merged, scope: "every stack" });
|
|
19561
19720
|
});
|
|
19562
|
-
var syncCommand =
|
|
19721
|
+
var syncCommand = make32("sync", {}, () => asUserError(gen2(function* () {
|
|
19563
19722
|
yield* checkedTrunk;
|
|
19564
19723
|
yield* sync4();
|
|
19565
19724
|
}).pipe(provide3(GitHubFromOrigin)))).pipe(withHelp("Fetch, and rebase every change onto the trunk", "Fetches, then rebases every change that isn't merged yet onto the trunk, keeping each on the changes below it. A change whose pull request GitHub merged is abandoned and its bookmark forgotten, unless it was edited after the merge.", "A stack that would conflict with the trunk is left where it was, and named. Rebase it yourself with `jj rebase` when you want to resolve it. The rest of a stack whose changes merged is rebased even where it conflicts, and the conflict is recorded in the change.", "Commits added to a branch on GitHub are squashed into the branch's local change, whether or not that change was also edited locally. Where GitHub only rebased a branch, the local change is kept.", "Fails before fetching if `trunk()` isn't GitHub's default branch, which `jj-octo init` sets.", "Pushes nothing. Run `jj gh submit` to update the pull requests of a change and the ones below it."));
|
|
@@ -19621,24 +19780,25 @@ var merge5 = (revision) => gen2(function* () {
|
|
|
19621
19780
|
}
|
|
19622
19781
|
}
|
|
19623
19782
|
});
|
|
19624
|
-
var mergeCommand =
|
|
19783
|
+
var mergeCommand = make32("merge", { revision: revisionFlag("The top change to merge") }, ({ revision }) => asUserError(merge5(revision).pipe(provide3(GitHubFromOrigin)))).pipe(withHelp("Merge the pull requests of a change and the ones below it", "Squash-merges them, and prints which before it does. An empty working copy means the change below it. Fails before merging if any of the changes has edits that aren't pushed.", "A pull request in a GitHub stack is merged together with the pull requests below it. Either all of them merge or none does. A pull request outside a stack is merged alone, and only if its base is the trunk.", "Then syncs, as `jj gh sync` does: it abandons the merged changes, forgets their bookmarks, and rebases the rest of the stack onto the trunk even where it conflicts, recording the conflict in the change. Then it pushes what is left of the change's stack again, up to the highest branch already on GitHub.", "If GitHub queues the merge instead, nothing is synced. Run `jj gh sync` once it has merged."));
|
|
19625
19784
|
|
|
19626
19785
|
// src/cli/gh/submit.ts
|
|
19627
|
-
var submitCommand =
|
|
19786
|
+
var submitCommand = make32("submit", {
|
|
19628
19787
|
overwriteDescriptions: Boolean6("overwrite-descriptions").pipe(withDefault5(false), withDescription2("Where a description changed both locally and on GitHub, send the local one instead of merging the two")),
|
|
19629
19788
|
publish: Boolean6("publish").pipe(withDefault5(false), withDescription2("Open new pull requests ready for review, instead of as drafts")),
|
|
19630
19789
|
revision: revisionFlag("The top change to submit")
|
|
19631
19790
|
}, ({ overwriteDescriptions, publish, revision }) => asUserError(submit(revision, { draft: !publish, overwriteDescriptions }).pipe(provide3(GitHubFromOrigin)))).pipe(withHelp("Push a change and the ones below it, and open their pull requests", "Pushes the bookmark of each of those changes. An empty working copy means the change below it, so from the top of a stack this submits all of it. Opens a pull request for each branch that has none, with the title and body from the change's description. Points each pull request at the branch below it, and the bottom one at the default branch.", "New pull requests are opened as drafts, or ready for review with `--publish`. The flag doesn't change a pull request that already exists.", "Keeps each pull request's title and body the same as its change's description. A description edited on GitHub is written into the change, one edited locally is sent to the pull request, and edits on both sides are merged line by line. That holds for a local edit pushed with `jj git push` too, since submit records the description that both sides last agreed on in `jj-octo/pr-descriptions` under the repository's `.jj/repo`, in the main workspace. Edits to the same lines stop the submit before anything is pushed.", "First, where any of those changes' pull requests merged or any of their branches changed on GitHub, syncs their stack as `jj gh sync` does, and leaves other stacks alone. That drops the merged changes, takes what GitHub added to the branches, and rebases the rest onto the trunk, so the push doesn't undo GitHub's work.", "Stops before changing anything where one of their branches was deleted on GitHub and their change doesn't count as merged: no pull request from it merged, another commit merged, or the change was edited since. It says how to push the change again, or drop it.", "Registers the pull requests as one GitHub stack. A stack of one change is a single pull request, which GitHub has no stack for.", "If changes were reordered, inserted or dropped since the last submit, the GitHub stack is dissolved and registered again under a new number. The pull requests stay open, including the one of a dropped change."));
|
|
19632
19791
|
|
|
19633
19792
|
// src/cli/gh/command.ts
|
|
19634
|
-
var jjGhCommand =
|
|
19793
|
+
var jjGhCommand = make32("jj gh").pipe(withSubcommands([
|
|
19635
19794
|
doctorCommand,
|
|
19636
19795
|
initCommand,
|
|
19796
|
+
linksCommand,
|
|
19637
19797
|
logCommand,
|
|
19638
19798
|
mergeCommand,
|
|
19639
19799
|
submitCommand,
|
|
19640
19800
|
syncCommand
|
|
19641
|
-
]), withHelp("Commands for publishing jj changes as GitHub pull requests", "A stack is a chain of changes, each published as one pull request on the branch its bookmark names. Each pull request targets the branch of the change below it, so it shows only that change's diff. A single change is a stack of one, and is published as an ordinary pull request.", "The stack of a change is every change connected to it through mutable changes. An empty working copy with no description isn't part of it. `log` shows the whole stack. `submit` and `merge` act on a change and the ones below it, which must be a chain: no merges, no conflicts, and exactly one bookmark on each change.", "The repository is the one the `origin` remote points to. The token is read from `GH_TOKEN` or `GITHUB_TOKEN`, and otherwise from `gh auth token`."));
|
|
19801
|
+
]), withHelp("Commands for publishing jj changes as GitHub pull requests", "A stack is a chain of changes, each published as one pull request on the branch its bookmark names. Each pull request targets the branch of the change below it, so it shows only that change's diff. A single change is a stack of one, and is published as an ordinary pull request.", "The stack of a change is every change connected to it through mutable changes. An empty working copy with no description isn't part of it. `log` shows the whole stack, and `links` lists its pull requests as Markdown links. `submit` and `merge` act on a change and the ones below it, which must be a chain: no merges, no conflicts, and exactly one bookmark on each change.", "The repository is the one the `origin` remote points to. The token is read from `GH_TOKEN` or `GITHUB_TOKEN`, and otherwise from `gh auth token`."));
|
|
19642
19802
|
|
|
19643
19803
|
// src/main.ts
|
|
19644
19804
|
runMain2(run5(jjGhCommand, { version: package_default.version }).pipe(provide3([GitLive, provideMerge(prDescriptionsLayer, JjLive)]), provide3(layer13({
|