@deslop/workbench 0.0.302 → 0.0.315
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/client/assets/{(home)-DOBmFAyb.js → (home)-DVKAaI4b.js} +1 -1
- package/dist/client/assets/{agent-CUtT0LEY.js → agent-BIuVSeAF.js} +1 -1
- package/dist/client/assets/agent-Cvk2rNLW.js +2 -0
- package/dist/client/assets/arc-CuHXSNPr.js +1 -0
- package/dist/client/assets/architecture-7EHR7CIX-BQpCYB3J.js +1 -0
- package/dist/client/assets/architectureDiagram-3BPJPVTR-hs4IN-ZW.js +36 -0
- package/dist/client/assets/array-BifhSqXX.js +1 -0
- package/dist/client/assets/blockDiagram-GPEHLZMM-D3jiL-uN.js +132 -0
- package/dist/client/assets/browser-ZCteqApb.js +2 -0
- package/dist/client/assets/browser-qFOBXYmj.js +1 -0
- package/dist/client/assets/button-CP1KTzaA.js +16 -0
- package/dist/client/assets/c4Diagram-AAUBKEIU-bA47L7u8.js +10 -0
- package/dist/client/assets/channel-CHiC1IgU.js +1 -0
- package/dist/client/assets/chunk-2J33WTMH-optplvap.js +1 -0
- package/dist/client/assets/chunk-3OPIFGDE-k7mTnOn5.js +62 -0
- package/dist/client/assets/chunk-4BX2VUAB-Co5qfYem.js +1 -0
- package/dist/client/assets/chunk-4EGX6M5U-BfCFom1o.js +1 -0
- package/dist/client/assets/chunk-55IACEB6-7AWIUH7L.js +1 -0
- package/dist/client/assets/chunk-5DO6E6H7-DP8QnaJj.js +1 -0
- package/dist/client/assets/chunk-5ZQYHXKU-Bub4jU0C.js +2 -0
- package/dist/client/assets/chunk-727SXJPM-DcofuxtV.js +206 -0
- package/dist/client/assets/chunk-AQP2D5EJ-CBwGmuY5.js +231 -0
- package/dist/client/assets/chunk-BR22UD5L-CT6fcRkN.js +1 -0
- package/dist/client/assets/chunk-BSJP7CBP-BInTsaMb.js +1 -0
- package/dist/client/assets/chunk-CSCIHK7Q-BTHSw3Fl.js +124 -0
- package/dist/client/assets/chunk-FHYWG6QK-Ce318laP.js +1 -0
- package/dist/client/assets/chunk-FMBD7UC4-BQD4ioRx.js +15 -0
- package/dist/client/assets/chunk-KSCS5N6A-CUDSaUx0.js +10 -0
- package/dist/client/assets/chunk-L5ZTLDWV-D0-tvK0S.js +1 -0
- package/dist/client/assets/chunk-LZXEDZCA-BkJ5xlLM.js +2 -0
- package/dist/client/assets/chunk-MPE355IW-C_vkbqLj.js +1 -0
- package/dist/client/assets/chunk-MZUSXYTE-BnVcgphH.js +1 -0
- package/dist/client/assets/chunk-N66VUXT2-B6CG-CnY.js +1 -0
- package/dist/client/assets/chunk-ND2GUHAM-COdW9HuZ.js +1 -0
- package/dist/client/assets/chunk-NNHCCRGN-DlpIbxXb.js +159 -0
- package/dist/client/assets/chunk-NZK2D7GU-Byrnkfto.js +1 -0
- package/dist/client/assets/chunk-O5CBEL6O-C_CProRX.js +70 -0
- package/dist/client/assets/chunk-PUPMXCY4-BZ88kQjK.js +1 -0
- package/dist/client/assets/chunk-QTnfLwEv.js +1 -0
- package/dist/client/assets/chunk-QZHKN3VN-SFi3gsXX.js +1 -0
- package/dist/client/assets/chunk-UIBZB4QT-r8p3pBHw.js +1 -0
- package/dist/client/assets/chunk-WCWK7LTN-DrKYkgXF.js +1 -0
- package/dist/client/assets/chunk-WU5MYG2G-OzrGGim9.js +1 -0
- package/dist/client/assets/chunk-XPW4576I-DWr3727k.js +32 -0
- package/dist/client/assets/classDiagram-4FO5ZUOK-DvZGz7Ek.js +1 -0
- package/dist/client/assets/classDiagram-v2-Q7XG4LA2-DvZGz7Ek.js +1 -0
- package/dist/client/assets/compiler-runtime-rGeCHUuX.js +1 -0
- package/dist/client/assets/composite-DrpN5NPU.js +1 -0
- package/dist/client/assets/cose-bilkent-S5V4N54A-BzitJXTQ.js +1 -0
- package/dist/client/assets/cytoscape.esm-FqbQrHcz.js +321 -0
- package/dist/client/assets/dagre-BM42HDAG-Bwiv8kFL.js +4 -0
- package/dist/client/assets/dagre-Bx709z4p.js +1 -0
- package/dist/client/assets/defaultLocale-C8Fc0cco.js +1 -0
- package/dist/client/assets/diagram-2AECGRRQ-BY9KXQPi.js +43 -0
- package/dist/client/assets/diagram-5GNKFQAL-C-jmG8LL.js +10 -0
- package/dist/client/assets/diagram-KO2AKTUF-qDHWGr5P.js +3 -0
- package/dist/client/assets/diagram-LMA3HP47-Dg8zuIuL.js +24 -0
- package/dist/client/assets/diagram-OG6HWLK6-DupmLmKo.js +24 -0
- package/dist/client/assets/dialog-DNzOF5Pr.js +153 -0
- package/dist/client/assets/diff-B287sB8S.js +217 -0
- package/dist/client/assets/diff-Dz1s0ttU.js +2 -0
- package/dist/client/assets/dist-lRkD-JPF.js +1 -0
- package/dist/client/assets/erDiagram-TEJ5UH35-DcYoMsDA.js +85 -0
- package/dist/client/assets/eventmodeling-FCH6USID-D-VxYsbw.js +1 -0
- package/dist/client/assets/external-link-DxUqDR8g.js +1 -0
- package/dist/client/assets/{fallbacks-C5pf0-4z.js → fallbacks-D55g6vQC.js} +1 -1
- package/dist/client/assets/flowDiagram-I6XJVG4X-xLfWiyaL.js +162 -0
- package/dist/client/assets/ganttDiagram-6RSMTGT7-hA3inn7u.js +292 -0
- package/dist/client/assets/gitGraph-WXDBUCRP-CRS5XD98.js +1 -0
- package/dist/client/assets/gitGraphDiagram-PVQCEYII-DE7nmb1q.js +106 -0
- package/dist/client/assets/graphlib-B8gBHxth.js +1 -0
- package/dist/client/assets/index-4j0hsxXB.css +2 -0
- package/dist/client/assets/{index-C6Z4obLz.js → index-C8lKBTMr.js} +4 -4
- package/dist/client/assets/info-J43DQDTF-CdrjkAmK.js +1 -0
- package/dist/client/assets/infoDiagram-5YYISTIA-CUzdfhph.js +2 -0
- package/dist/client/assets/init-D6jRqBbL.js +1 -0
- package/dist/client/assets/ishikawaDiagram-YF4QCWOH-D3h5fT3O.js +70 -0
- package/dist/client/assets/journeyDiagram-JHISSGLW-DXqP7IZk.js +139 -0
- package/dist/client/assets/kanban-definition-UN3LZRKU-BBdz3OGi.js +89 -0
- package/dist/client/assets/katex-Vhh-h91d.js +257 -0
- package/dist/client/assets/line-D2nnU070.js +1 -0
- package/dist/client/assets/linear-BifnMVyn.js +1 -0
- package/dist/client/assets/loader-circle-CjJdQ-6r.js +1 -0
- package/dist/client/assets/mermaid-parser.core-CKHoAf1J.js +4 -0
- package/dist/client/assets/mindmap-definition-RKZ34NQL-BAbACAeS.js +96 -0
- package/dist/client/assets/ordinal-hYBb2elL.js +1 -0
- package/dist/client/assets/packet-YPE3B663-r4oAflYS.js +1 -0
- package/dist/client/assets/path-BWPyau1x.js +1 -0
- package/dist/client/assets/pie-LRSECV5Y-DkaVktH1.js +1 -0
- package/dist/client/assets/pieDiagram-4H26LBE5-YjWBEaV3.js +30 -0
- package/dist/client/assets/preload-helper-CjdClQve.js +1 -0
- package/dist/client/assets/quadrantDiagram-W4KKPZXB-0qpR8bhI.js +7 -0
- package/dist/client/assets/radar-GUYGQ44K-Bjhhjq-k.js +1 -0
- package/dist/client/assets/requirementDiagram-4Y6WPE33-UxrH60_h.js +84 -0
- package/dist/client/assets/rough.esm-CSKSodPl.js +1 -0
- package/dist/client/assets/route-CaWOfZWN.js +2 -0
- package/dist/client/assets/route-VC_QtiiN.js +45 -0
- package/dist/client/assets/run-B0jQ0k3F.js +2 -0
- package/dist/client/assets/{run-fctUUzCf.js → run-CFcWKZn5.js} +1 -1
- package/dist/client/assets/sankeyDiagram-5OEKKPKP-CtfCq9EV.js +40 -0
- package/dist/client/assets/sequenceDiagram-3UESZ5HK-BgLwmDnV.js +162 -0
- package/dist/client/assets/src-oaGqIoNi.js +1 -0
- package/dist/client/assets/state-m9GNWCBT.js +2 -0
- package/dist/client/assets/stateDiagram-AJRCARHV--lvnWH2s.js +1 -0
- package/dist/client/assets/stateDiagram-v2-BHNVJYJU-BggoNPhO.js +1 -0
- package/dist/client/assets/{terminal-BU19EPvo.js → terminal-CMql1niz.js} +8 -8
- package/dist/client/assets/terminal-CgkXzq-O.js +2 -0
- package/dist/client/assets/{terminal-CwEzAjQe.js → terminal-DWl9BK6U.js} +1 -1
- package/dist/client/assets/timeline-definition-PNZ67QCA-BbIMEZmJ.js +120 -0
- package/dist/client/assets/treeView-BLDUP644-DbX5QpdZ.js +1 -0
- package/dist/client/assets/treemap-LRROVOQU-DT4YRX1p.js +1 -0
- package/dist/client/assets/{triangle-alert-CvzZ7Dfq.js → triangle-alert-BBj9uTaq.js} +1 -1
- package/dist/client/assets/vennDiagram-CIIHVFJN-ClrNZ6mc.js +34 -0
- package/dist/client/assets/wardley-L42UT6IY-Ba5lVG9E.js +1 -0
- package/dist/client/assets/wardleyDiagram-YWT4CUSO-B104yVOC.js +78 -0
- package/dist/client/assets/xychartDiagram-2RQKCTM6-BBRSu-ZO.js +7 -0
- package/dist/client/index.html +15 -13
- package/dist/server.js +387 -169
- package/package.json +1 -1
- package/dist/client/assets/agent-DTPZf-YX.js +0 -2
- package/dist/client/assets/browser-CUUn0AHR.js +0 -2
- package/dist/client/assets/browser-Dw04YNrj.js +0 -1
- package/dist/client/assets/button-Bqawukg7.js +0 -16
- package/dist/client/assets/compiler-runtime-CUwoe8mk.js +0 -1
- package/dist/client/assets/composite-fb6R8ReV.js +0 -1
- package/dist/client/assets/dialog-C8oDbe5L.js +0 -153
- package/dist/client/assets/diff-CQTMrBFJ.js +0 -113
- package/dist/client/assets/diff-CXqhtElY.js +0 -2
- package/dist/client/assets/index-Btb80mKI.css +0 -2
- package/dist/client/assets/loader-circle-DCgJgOPt.js +0 -1
- package/dist/client/assets/route-C3Ef_5wU.js +0 -45
- package/dist/client/assets/route-DCY3zhD4.js +0 -2
- package/dist/client/assets/run-DrpOX8D_.js +0 -2
- package/dist/client/assets/state-C9Tv9T9Z.js +0 -2
- package/dist/client/assets/terminal-BCKOITUk.js +0 -2
package/dist/server.js
CHANGED
|
@@ -4562,7 +4562,7 @@ const isSome$1 = (fa) => fa._tag === "Some";
|
|
|
4562
4562
|
/** @internal */
|
|
4563
4563
|
const none$1 = /*#__PURE__*/ Object.create(NoneProto);
|
|
4564
4564
|
/** @internal */
|
|
4565
|
-
const some$
|
|
4565
|
+
const some$2 = (value) => {
|
|
4566
4566
|
const a = Object.create(SomeProto);
|
|
4567
4567
|
a.value = value;
|
|
4568
4568
|
return a;
|
|
@@ -5061,7 +5061,7 @@ const none = () => none$1;
|
|
|
5061
5061
|
* @category constructors
|
|
5062
5062
|
* @since 2.0.0
|
|
5063
5063
|
*/
|
|
5064
|
-
const some = some$
|
|
5064
|
+
const some$1 = some$2;
|
|
5065
5065
|
/**
|
|
5066
5066
|
* Checks whether an `Option` is `None` (absent).
|
|
5067
5067
|
*
|
|
@@ -5256,7 +5256,7 @@ const orElse$1 = /*#__PURE__*/ dual(2, (self, that) => isNone(self) ? that() : s
|
|
|
5256
5256
|
* @category converting
|
|
5257
5257
|
* @since 4.0.0
|
|
5258
5258
|
*/
|
|
5259
|
-
const fromNullishOr = (a) => a == null ? none() : some(a);
|
|
5259
|
+
const fromNullishOr = (a) => a == null ? none() : some$1(a);
|
|
5260
5260
|
/**
|
|
5261
5261
|
* Converts a possibly `undefined` value into an `Option`, leaving `null`
|
|
5262
5262
|
* as a valid `Some`.
|
|
@@ -5291,7 +5291,7 @@ const fromNullishOr = (a) => a == null ? none() : some(a);
|
|
|
5291
5291
|
* @category converting
|
|
5292
5292
|
* @since 4.0.0
|
|
5293
5293
|
*/
|
|
5294
|
-
const fromUndefinedOr = (a) => a === void 0 ? none() : some(a);
|
|
5294
|
+
const fromUndefinedOr = (a) => a === void 0 ? none() : some$1(a);
|
|
5295
5295
|
/**
|
|
5296
5296
|
* Extracts the value from a `Some`, or returns `undefined` for `None`.
|
|
5297
5297
|
*
|
|
@@ -5355,7 +5355,7 @@ const getOrUndefined$1 = /*#__PURE__*/ getOrElse$1(constUndefined);
|
|
|
5355
5355
|
* @category mapping
|
|
5356
5356
|
* @since 2.0.0
|
|
5357
5357
|
*/
|
|
5358
|
-
const map$9 = /*#__PURE__*/ dual(2, (self, f) => isNone(self) ? none() : some(f(self.value)));
|
|
5358
|
+
const map$9 = /*#__PURE__*/ dual(2, (self, f) => isNone(self) ? none() : some$1(f(self.value)));
|
|
5359
5359
|
/**
|
|
5360
5360
|
* Applies a function that returns an `Option` to the value of a `Some`,
|
|
5361
5361
|
* flattening the result. Returns `None` if the input is `None`.
|
|
@@ -5442,7 +5442,7 @@ const flatMap$6 = /*#__PURE__*/ dual(2, (self, f) => isNone(self) ? none() : f(s
|
|
|
5442
5442
|
* @category filtering
|
|
5443
5443
|
* @since 2.0.0
|
|
5444
5444
|
*/
|
|
5445
|
-
const filter$3 = /*#__PURE__*/ dual(2, (self, predicate) => isNone(self) ? none() : predicate(self.value) ? some(self.value) : none());
|
|
5445
|
+
const filter$3 = /*#__PURE__*/ dual(2, (self, predicate) => isNone(self) ? none() : predicate(self.value) ? some$1(self.value) : none());
|
|
5446
5446
|
/**
|
|
5447
5447
|
* Lifts a `Predicate` or `Refinement` into the `Option` context: returns
|
|
5448
5448
|
* `Some(value)` when the predicate holds, `None` otherwise.
|
|
@@ -5478,7 +5478,7 @@ const filter$3 = /*#__PURE__*/ dual(2, (self, predicate) => isNone(self) ? none(
|
|
|
5478
5478
|
* @category lifting
|
|
5479
5479
|
* @since 2.0.0
|
|
5480
5480
|
*/
|
|
5481
|
-
const liftPredicate = /*#__PURE__*/ dual(2, (b, predicate) => predicate(b) ? some(b) : none());
|
|
5481
|
+
const liftPredicate = /*#__PURE__*/ dual(2, (b, predicate) => predicate(b) ? some$1(b) : none());
|
|
5482
5482
|
//#endregion
|
|
5483
5483
|
//#region ../../node_modules/.pnpm/effect@4.0.0-beta.74/node_modules/effect/dist/Result.js
|
|
5484
5484
|
/**
|
|
@@ -6386,7 +6386,7 @@ const headNonEmpty = /*#__PURE__*/ (/* @__PURE__ */ dual(2, (self, index) => {
|
|
|
6386
6386
|
* @category getters
|
|
6387
6387
|
* @since 2.0.0
|
|
6388
6388
|
*/
|
|
6389
|
-
const last = (self) => isReadonlyArrayNonEmpty(self) ? some(lastNonEmpty(self)) : none();
|
|
6389
|
+
const last = (self) => isReadonlyArrayNonEmpty(self) ? some$1(lastNonEmpty(self)) : none();
|
|
6390
6390
|
/**
|
|
6391
6391
|
* Returns the last element of a `NonEmptyReadonlyArray` directly (no `Option`
|
|
6392
6392
|
* wrapper).
|
|
@@ -6433,6 +6433,45 @@ const lastNonEmpty = (self) => self[self.length - 1];
|
|
|
6433
6433
|
*/
|
|
6434
6434
|
const tailNonEmpty = (self) => self.slice(1);
|
|
6435
6435
|
/**
|
|
6436
|
+
* Takes elements from the start while the predicate holds, stopping at the
|
|
6437
|
+
* first element that fails.
|
|
6438
|
+
*
|
|
6439
|
+
* **When to use**
|
|
6440
|
+
*
|
|
6441
|
+
* Use to keep the leading elements of an iterable while each element satisfies
|
|
6442
|
+
* a predicate, returning the retained prefix as an array.
|
|
6443
|
+
*
|
|
6444
|
+
* **Details**
|
|
6445
|
+
*
|
|
6446
|
+
* - Supports refinements for type narrowing.
|
|
6447
|
+
* - The predicate receives `(element, index)`.
|
|
6448
|
+
*
|
|
6449
|
+
* **Example** (Taking while condition holds)
|
|
6450
|
+
*
|
|
6451
|
+
* ```ts
|
|
6452
|
+
* import { Array } from "effect"
|
|
6453
|
+
*
|
|
6454
|
+
* console.log(Array.takeWhile([1, 3, 2, 4, 1, 2], (x) => x < 4)) // [1, 3, 2]
|
|
6455
|
+
* ```
|
|
6456
|
+
*
|
|
6457
|
+
* @see {@link take} for keeping a fixed number of leading elements
|
|
6458
|
+
* @see {@link dropWhile} for removing the matching prefix and keeping the rest
|
|
6459
|
+
* @see {@link span} for splitting the matching prefix from the remaining elements
|
|
6460
|
+
*
|
|
6461
|
+
* @category getters
|
|
6462
|
+
* @since 2.0.0
|
|
6463
|
+
*/
|
|
6464
|
+
const takeWhile = /*#__PURE__*/ dual(2, (self, predicate) => {
|
|
6465
|
+
let i = 0;
|
|
6466
|
+
const out = [];
|
|
6467
|
+
for (const a of self) {
|
|
6468
|
+
if (!predicate(a, i)) break;
|
|
6469
|
+
out.push(a);
|
|
6470
|
+
i++;
|
|
6471
|
+
}
|
|
6472
|
+
return out;
|
|
6473
|
+
});
|
|
6474
|
+
/**
|
|
6436
6475
|
* Removes the first `n` elements, creating a new array.
|
|
6437
6476
|
*
|
|
6438
6477
|
* **When to use**
|
|
@@ -6929,6 +6968,26 @@ const reduce = /*#__PURE__*/ dual(3, (self, b, f) => fromIterable$2(self).reduce
|
|
|
6929
6968
|
*/
|
|
6930
6969
|
const every = /*#__PURE__*/ dual(2, (self, refinement) => self.every(refinement));
|
|
6931
6970
|
/**
|
|
6971
|
+
* Checks whether at least one element satisfies the predicate. Narrows the type
|
|
6972
|
+
* to `NonEmptyReadonlyArray` on success.
|
|
6973
|
+
*
|
|
6974
|
+
* **Example** (Testing for any match)
|
|
6975
|
+
*
|
|
6976
|
+
* ```ts
|
|
6977
|
+
* import { Array } from "effect"
|
|
6978
|
+
*
|
|
6979
|
+
* console.log(Array.some([1, 3, 4], (x) => x % 2 === 0)) // true
|
|
6980
|
+
* console.log(Array.some([1, 3, 5], (x) => x % 2 === 0)) // false
|
|
6981
|
+
* ```
|
|
6982
|
+
*
|
|
6983
|
+
* @see {@link every} — test if all elements match
|
|
6984
|
+
* @see {@link contains} — test for a specific value
|
|
6985
|
+
*
|
|
6986
|
+
* @category elements
|
|
6987
|
+
* @since 2.0.0
|
|
6988
|
+
*/
|
|
6989
|
+
const some = /*#__PURE__*/ dual(2, (self, predicate) => self.some(predicate));
|
|
6990
|
+
/**
|
|
6932
6991
|
* Creates an `Equivalence` for arrays based on an element `Equivalence`. Two
|
|
6933
6992
|
* arrays are equivalent when they have the same length and all elements are
|
|
6934
6993
|
* pairwise equivalent.
|
|
@@ -7598,8 +7657,8 @@ const serviceNotFoundError = (service) => {
|
|
|
7598
7657
|
* @since 2.0.0
|
|
7599
7658
|
*/
|
|
7600
7659
|
const getOption = /*#__PURE__*/ dual(2, (self, service) => {
|
|
7601
|
-
if (self.mapUnsafe.has(service.key)) return some(self.mapUnsafe.get(service.key));
|
|
7602
|
-
return isReference(service) ? some(getDefaultValue(service)) : none();
|
|
7660
|
+
if (self.mapUnsafe.has(service.key)) return some$1(self.mapUnsafe.get(service.key));
|
|
7661
|
+
return isReference(service) ? some$1(getDefaultValue(service)) : none();
|
|
7603
7662
|
});
|
|
7604
7663
|
/**
|
|
7605
7664
|
* Merges two `Context`s into one.
|
|
@@ -9454,7 +9513,7 @@ const yieldNow$1 = /*#__PURE__*/ (/* @__PURE__ */ makePrimitive({
|
|
|
9454
9513
|
}
|
|
9455
9514
|
}))(0);
|
|
9456
9515
|
/** @internal */
|
|
9457
|
-
const succeedSome$1 = (a) => succeed$6(some(a));
|
|
9516
|
+
const succeedSome$1 = (a) => succeed$6(some$1(a));
|
|
9458
9517
|
/** @internal */
|
|
9459
9518
|
const succeedNone$1 = /*#__PURE__*/ succeed$6(/*#__PURE__*/ none());
|
|
9460
9519
|
/** @internal */
|
|
@@ -9609,7 +9668,7 @@ const as$1 = /*#__PURE__*/ dual(2, (self, value) => {
|
|
|
9609
9668
|
return flatMap$4(self, (_) => b);
|
|
9610
9669
|
});
|
|
9611
9670
|
/** @internal */
|
|
9612
|
-
const asSome$1 = (self) => map$6(self, some);
|
|
9671
|
+
const asSome$1 = (self) => map$6(self, some$1);
|
|
9613
9672
|
/** @internal */
|
|
9614
9673
|
const andThen$1 = /*#__PURE__*/ dual(2, (self, f) => flatMap$4(self, (a) => isEffect$1(f) ? f : internalCall(() => f(a))));
|
|
9615
9674
|
/** @internal */
|
|
@@ -9726,7 +9785,7 @@ const exitAsVoidAll = (exits) => {
|
|
|
9726
9785
|
return failures.length === 0 ? exitVoid : exitFailCause(causeFromReasons(failures));
|
|
9727
9786
|
};
|
|
9728
9787
|
/** @internal */
|
|
9729
|
-
const exitGetSuccess = (self) => exitIsSuccess(self) ? some(self.value) : none();
|
|
9788
|
+
const exitGetSuccess = (self) => exitIsSuccess(self) ? some$1(self.value) : none();
|
|
9730
9789
|
/** @internal */
|
|
9731
9790
|
const service$1 = (service) => service;
|
|
9732
9791
|
/** @internal */
|
|
@@ -9853,7 +9912,7 @@ const ignore$2 = /*#__PURE__*/ dual((args) => isEffect$1(args[0]), (self, option
|
|
|
9853
9912
|
/** @internal */
|
|
9854
9913
|
const option$2 = (self) => match$1(self, {
|
|
9855
9914
|
onFailure: none,
|
|
9856
|
-
onSuccess: some
|
|
9915
|
+
onSuccess: some$1
|
|
9857
9916
|
});
|
|
9858
9917
|
/** @internal */
|
|
9859
9918
|
const result = (self) => matchEager(self, {
|
|
@@ -10160,7 +10219,7 @@ const findFirst$1 = /*#__PURE__*/ dual((args) => isIterable(args[0]) && !isEffec
|
|
|
10160
10219
|
return succeed$6(none());
|
|
10161
10220
|
}));
|
|
10162
10221
|
const findFirstLoop = (iterator, index, predicate, value) => flatMap$4(predicate(value, index), (keep) => {
|
|
10163
|
-
if (keep) return succeed$6(some(value));
|
|
10222
|
+
if (keep) return succeed$6(some$1(value));
|
|
10164
10223
|
const next = iterator.next();
|
|
10165
10224
|
if (!next.done) return findFirstLoop(iterator, index + 1, predicate, next.value);
|
|
10166
10225
|
return succeed$6(none());
|
|
@@ -10494,12 +10553,12 @@ const NoopSpanProto = {
|
|
|
10494
10553
|
const noopSpan = (options) => Object.assign(Object.create(NoopSpanProto), options);
|
|
10495
10554
|
const filterDisablePropagation = (span) => {
|
|
10496
10555
|
if (!span) return none();
|
|
10497
|
-
return get$9(span.annotations, DisablePropagation) ? span._tag === "Span" ? filterDisablePropagation(getOrUndefined$1(span.parent)) : none() : some(span);
|
|
10556
|
+
return get$9(span.annotations, DisablePropagation) ? span._tag === "Span" ? filterDisablePropagation(getOrUndefined$1(span.parent)) : none() : some$1(span);
|
|
10498
10557
|
};
|
|
10499
10558
|
/** @internal */
|
|
10500
10559
|
const makeSpanUnsafe = (fiber, name, options) => {
|
|
10501
10560
|
const disablePropagation = !fiber.getRef(TracerEnabled$1) || options?.annotations && get$9(options.annotations, DisablePropagation);
|
|
10502
|
-
const parent = options?.parent !== void 0 ? some(options.parent) : options?.root ? none() : filterDisablePropagation(fiber.currentSpan);
|
|
10561
|
+
const parent = options?.parent !== void 0 ? some$1(options.parent) : options?.root ? none() : filterDisablePropagation(fiber.currentSpan);
|
|
10503
10562
|
let span;
|
|
10504
10563
|
if (disablePropagation) span = noopSpan({
|
|
10505
10564
|
name,
|
|
@@ -13767,12 +13826,12 @@ const nextPow2 = (n) => {
|
|
|
13767
13826
|
* @since 2.0.0
|
|
13768
13827
|
*/
|
|
13769
13828
|
const parse$2 = (s) => {
|
|
13770
|
-
if (s === "NaN") return some(NaN);
|
|
13771
|
-
if (s === "Infinity") return some(Infinity);
|
|
13772
|
-
if (s === "-Infinity") return some(-Infinity);
|
|
13829
|
+
if (s === "NaN") return some$1(NaN);
|
|
13830
|
+
if (s === "Infinity") return some$1(Infinity);
|
|
13831
|
+
if (s === "-Infinity") return some$1(-Infinity);
|
|
13773
13832
|
if (s.trim() === "") return none();
|
|
13774
13833
|
const n = Number$4(s);
|
|
13775
|
-
return Number$4.isNaN(n) ? none() : some(n);
|
|
13834
|
+
return Number$4.isNaN(n) ? none() : some$1(n);
|
|
13776
13835
|
};
|
|
13777
13836
|
globalThis.String;
|
|
13778
13837
|
/**
|
|
@@ -13818,6 +13877,23 @@ const replace = (searchValue, replaceValue) => (self) => self.replace(searchValu
|
|
|
13818
13877
|
*/
|
|
13819
13878
|
const trim = (self) => self.trim();
|
|
13820
13879
|
/**
|
|
13880
|
+
* Checks whether a `string` is empty.
|
|
13881
|
+
*
|
|
13882
|
+
* **Example** (Checking for empty strings)
|
|
13883
|
+
*
|
|
13884
|
+
* ```ts
|
|
13885
|
+
* import { String } from "effect"
|
|
13886
|
+
* import * as assert from "node:assert"
|
|
13887
|
+
*
|
|
13888
|
+
* assert.deepStrictEqual(String.isEmpty(""), true)
|
|
13889
|
+
* assert.deepStrictEqual(String.isEmpty("a"), false)
|
|
13890
|
+
* ```
|
|
13891
|
+
*
|
|
13892
|
+
* @category predicates
|
|
13893
|
+
* @since 2.0.0
|
|
13894
|
+
*/
|
|
13895
|
+
const isEmpty$1 = (self) => self.length === 0;
|
|
13896
|
+
/**
|
|
13821
13897
|
* Checks whether a `string` is non-empty.
|
|
13822
13898
|
*
|
|
13823
13899
|
* **Example** (Checking for non-empty strings)
|
|
@@ -14565,7 +14641,7 @@ const repeatOrElse = /*#__PURE__*/ dual(3, (self, schedule, orElse) => flatMap$4
|
|
|
14565
14641
|
let meta = CurrentMetadata.defaultValue();
|
|
14566
14642
|
return catch_$3(forever$2(tap$1(flatMap$4(suspend$3(() => provideService$1(self, CurrentMetadata, meta)), step), (meta_) => sync$1(() => {
|
|
14567
14643
|
meta = meta_;
|
|
14568
|
-
})), { disableYield: true }), (error) => isDone$2(error) ? succeed$6(error.value) : orElse(error, meta.attempt === 0 ? none() : some(meta)));
|
|
14644
|
+
})), { disableYield: true }), (error) => isDone$2(error) ? succeed$6(error.value) : orElse(error, meta.attempt === 0 ? none() : some$1(meta)));
|
|
14569
14645
|
}));
|
|
14570
14646
|
/** @internal */
|
|
14571
14647
|
const repeat$1 = /*#__PURE__*/ dual(2, (self, options) => {
|
|
@@ -19406,14 +19482,14 @@ var OneOf = class extends Base$1 {
|
|
|
19406
19482
|
};
|
|
19407
19483
|
function makeFilterIssue(input, entry) {
|
|
19408
19484
|
if (isIssue(entry)) return entry;
|
|
19409
|
-
if (typeof entry === "string") return new InvalidValue(some(input), { message: entry });
|
|
19410
|
-
const inner = typeof entry.issue === "string" ? new InvalidValue(some(input), { message: entry.issue }) : entry.issue;
|
|
19485
|
+
if (typeof entry === "string") return new InvalidValue(some$1(input), { message: entry });
|
|
19486
|
+
const inner = typeof entry.issue === "string" ? new InvalidValue(some$1(input), { message: entry.issue }) : entry.issue;
|
|
19411
19487
|
return new Pointer(entry.path, inner);
|
|
19412
19488
|
}
|
|
19413
19489
|
/** @internal */
|
|
19414
19490
|
function makeSingle(input, out) {
|
|
19415
19491
|
if (out === void 0) return;
|
|
19416
|
-
if (typeof out === "boolean") return out ? void 0 : new InvalidValue(some(input));
|
|
19492
|
+
if (typeof out === "boolean") return out ? void 0 : new InvalidValue(some$1(input));
|
|
19417
19493
|
return makeFilterIssue(input, out);
|
|
19418
19494
|
}
|
|
19419
19495
|
/** @internal */
|
|
@@ -19421,7 +19497,7 @@ function make$55(input, ast, out) {
|
|
|
19421
19497
|
if (Array.isArray(out)) {
|
|
19422
19498
|
if (isReadonlyArrayNonEmpty(out)) {
|
|
19423
19499
|
if (out.length === 1) return makeFilterIssue(input, out[0]);
|
|
19424
|
-
return new Composite(ast, some(input), map$7(out, (entry) => makeFilterIssue(input, entry)));
|
|
19500
|
+
return new Composite(ast, some$1(input), map$7(out, (entry) => makeFilterIssue(input, entry)));
|
|
19425
19501
|
}
|
|
19426
19502
|
return;
|
|
19427
19503
|
}
|
|
@@ -19898,7 +19974,7 @@ function transformOptional(f) {
|
|
|
19898
19974
|
function withDefault$1(defaultValue) {
|
|
19899
19975
|
return new Getter((o) => {
|
|
19900
19976
|
const filtered = filter$3(o, isNotUndefined);
|
|
19901
|
-
return isSome(filtered) ? succeed$3(filtered) : mapEager(defaultValue, some);
|
|
19977
|
+
return isSome(filtered) ? succeed$3(filtered) : mapEager(defaultValue, some$1);
|
|
19902
19978
|
});
|
|
19903
19979
|
}
|
|
19904
19980
|
/**
|
|
@@ -19961,8 +20037,8 @@ function Number$3() {
|
|
|
19961
20037
|
}
|
|
19962
20038
|
function parseJson(options) {
|
|
19963
20039
|
return onSome((input) => try_({
|
|
19964
|
-
try: () => some(JSON.parse(input, options?.reviver)),
|
|
19965
|
-
catch: (e) => new InvalidValue(some(input), { message: globalThis.String(e) })
|
|
20040
|
+
try: () => some$1(JSON.parse(input, options?.reviver)),
|
|
20041
|
+
catch: (e) => new InvalidValue(some$1(input), { message: globalThis.String(e) })
|
|
19966
20042
|
}));
|
|
19967
20043
|
}
|
|
19968
20044
|
/**
|
|
@@ -19999,8 +20075,8 @@ function parseJson(options) {
|
|
|
19999
20075
|
*/
|
|
20000
20076
|
function stringifyJson(options) {
|
|
20001
20077
|
return onSome((input) => try_({
|
|
20002
|
-
try: () => some(JSON.stringify(input, options?.replacer, options?.space)),
|
|
20003
|
-
catch: (e) => new InvalidValue(some(input), { message: globalThis.String(e) })
|
|
20078
|
+
try: () => some$1(JSON.stringify(input, options?.replacer, options?.space)),
|
|
20079
|
+
catch: (e) => new InvalidValue(some$1(input), { message: globalThis.String(e) })
|
|
20004
20080
|
}));
|
|
20005
20081
|
}
|
|
20006
20082
|
/**
|
|
@@ -21019,7 +21095,7 @@ var Declaration = class Declaration extends Base {
|
|
|
21019
21095
|
const run = this.run(this.typeParameters);
|
|
21020
21096
|
return (oinput, options) => {
|
|
21021
21097
|
if (isNone(oinput)) return succeedNone;
|
|
21022
|
-
return mapEager(run(oinput.value, this, options), some);
|
|
21098
|
+
return mapEager(run(oinput.value, this, options), some$1);
|
|
21023
21099
|
};
|
|
21024
21100
|
}
|
|
21025
21101
|
/** @internal */
|
|
@@ -21510,7 +21586,7 @@ var Arrays = class Arrays extends Base {
|
|
|
21510
21586
|
else return yield* fail$3(new Composite(ast, oinput, [issue]));
|
|
21511
21587
|
}
|
|
21512
21588
|
if (state.issues) return yield* fail$3(new Composite(ast, oinput, state.issues));
|
|
21513
|
-
return some(state.output);
|
|
21589
|
+
return some$1(state.output);
|
|
21514
21590
|
});
|
|
21515
21591
|
}
|
|
21516
21592
|
/** @internal */
|
|
@@ -21526,7 +21602,7 @@ var Arrays = class Arrays extends Base {
|
|
|
21526
21602
|
};
|
|
21527
21603
|
const parseArray = /*#__PURE__*/ iterateEager()({
|
|
21528
21604
|
onItem(s, item, i) {
|
|
21529
|
-
const value = i < s.len ? some(item) : none();
|
|
21605
|
+
const value = i < s.len ? some$1(item) : none();
|
|
21530
21606
|
return s.getParser(s.tailThreshold, i).parser(value, s.options);
|
|
21531
21607
|
},
|
|
21532
21608
|
step(s, _, exit, i) {
|
|
@@ -21730,14 +21806,14 @@ var Objects = class Objects extends Base {
|
|
|
21730
21806
|
if (ast.propertySignatures.length === 0 && ast.indexSignatures.length === 0) return fromRefinement(ast, isNotNullish);
|
|
21731
21807
|
const parseIndexes = indexCount > 0 ? iterateEager()({
|
|
21732
21808
|
onItem: fnUntracedEager(function* (s, [key, is]) {
|
|
21733
|
-
const effKey = recur(indexSignatureParameterFromString(is.parameter))(some(key), s.options);
|
|
21809
|
+
const effKey = recur(indexSignatureParameterFromString(is.parameter))(some$1(key), s.options);
|
|
21734
21810
|
const exitKey = effectIsExit(effKey) ? effKey : yield* exit(effKey);
|
|
21735
21811
|
if (exitKey._tag === "Failure") {
|
|
21736
21812
|
const eff = wrapPropertyKeyIssue(s, ast, key, exitKey);
|
|
21737
21813
|
if (eff) yield* eff;
|
|
21738
21814
|
return;
|
|
21739
21815
|
}
|
|
21740
|
-
const value = some(s.input[key]);
|
|
21816
|
+
const value = some$1(s.input[key]);
|
|
21741
21817
|
const effValue = recur(is.type)(value, s.options);
|
|
21742
21818
|
const exitValue = effectIsExit(effValue) ? effValue : yield* exit(effValue);
|
|
21743
21819
|
if (exitValue._tag === "Failure") {
|
|
@@ -21807,9 +21883,9 @@ var Objects = class Objects extends Base {
|
|
|
21807
21883
|
const keys = (inputKeys ?? Reflect.ownKeys(input)).concat(expectedKeys);
|
|
21808
21884
|
const preserved = {};
|
|
21809
21885
|
for (const key of keys) if (Object.hasOwn(out, key)) set$7(preserved, key, out[key]);
|
|
21810
|
-
return some(preserved);
|
|
21886
|
+
return some$1(preserved);
|
|
21811
21887
|
}
|
|
21812
|
-
return some(out);
|
|
21888
|
+
return some$1(out);
|
|
21813
21889
|
});
|
|
21814
21890
|
}
|
|
21815
21891
|
rebuild(recur, flipMerge) {
|
|
@@ -21841,7 +21917,7 @@ var Objects = class Objects extends Base {
|
|
|
21841
21917
|
};
|
|
21842
21918
|
const parseProperties = /*#__PURE__*/ iterateEager()({
|
|
21843
21919
|
onItem(s, p) {
|
|
21844
|
-
const value = Object.hasOwn(s.input, p.name) ? some(s.input[p.name]) : none();
|
|
21920
|
+
const value = Object.hasOwn(s.input, p.name) ? some$1(s.input[p.name]) : none();
|
|
21845
21921
|
return p.parser(value, s.options);
|
|
21846
21922
|
},
|
|
21847
21923
|
step(s, p, exit) {
|
|
@@ -22641,7 +22717,7 @@ function isJson(u) {
|
|
|
22641
22717
|
}
|
|
22642
22718
|
}
|
|
22643
22719
|
/** @internal */
|
|
22644
|
-
const Json = /*#__PURE__*/ new Declaration([], () => (input, ast) => isJson(input) ? succeed$3(input) : fail$3(new InvalidType(ast, some(input))), {
|
|
22720
|
+
const Json = /*#__PURE__*/ new Declaration([], () => (input, ast) => isJson(input) ? succeed$3(input) : fail$3(new InvalidType(ast, some$1(input))), {
|
|
22645
22721
|
typeConstructor: { _tag: "effect/Json" },
|
|
22646
22722
|
generation: {
|
|
22647
22723
|
runtime: `Schema.Json`,
|
|
@@ -22674,7 +22750,7 @@ function isStringTree(u) {
|
|
|
22674
22750
|
}
|
|
22675
22751
|
}
|
|
22676
22752
|
/** @internal */
|
|
22677
|
-
const unknownToStringTree = /*#__PURE__*/ new Link(/* @__PURE__ */ new Declaration([], () => (input, ast) => isStringTree(input) ? succeed$3(input) : fail$3(new InvalidType(ast, some(input))), {
|
|
22753
|
+
const unknownToStringTree = /*#__PURE__*/ new Link(/* @__PURE__ */ new Declaration([], () => (input, ast) => isStringTree(input) ? succeed$3(input) : fail$3(new InvalidType(ast, some$1(input))), {
|
|
22678
22754
|
expected: "StringTree",
|
|
22679
22755
|
toCodecStringTree: () => new Link(unknown, passthrough())
|
|
22680
22756
|
}), /*#__PURE__*/ passthrough());
|
|
@@ -22695,7 +22771,7 @@ const unknownToStringTree = /*#__PURE__*/ new Link(/* @__PURE__ */ new Declarati
|
|
|
22695
22771
|
*/
|
|
22696
22772
|
function nominal() {
|
|
22697
22773
|
return Object.assign((input) => input, {
|
|
22698
|
-
option: (input) => some(input),
|
|
22774
|
+
option: (input) => some$1(input),
|
|
22699
22775
|
result: (input) => succeed$7(input),
|
|
22700
22776
|
is: (_) => true
|
|
22701
22777
|
});
|
|
@@ -26505,7 +26581,7 @@ const fromIteratorArray = (iterator, chunkSize = DefaultChunkSize) => fromPull$1
|
|
|
26505
26581
|
const state = iter.next();
|
|
26506
26582
|
if (state.done) {
|
|
26507
26583
|
if (buffer.length === 0) return done(state.value);
|
|
26508
|
-
done$15 = some(state.value);
|
|
26584
|
+
done$15 = some$1(state.value);
|
|
26509
26585
|
break;
|
|
26510
26586
|
}
|
|
26511
26587
|
buffer.push(state.value);
|
|
@@ -27587,7 +27663,7 @@ const splitLines$1 = () => fromTransform$1((upstream, _scope) => sync(() => {
|
|
|
27587
27663
|
onSuccess: loop,
|
|
27588
27664
|
onFailure: failCause$2,
|
|
27589
27665
|
onDone: (leftover) => {
|
|
27590
|
-
done$13 = some(leftover);
|
|
27666
|
+
done$13 = some$1(leftover);
|
|
27591
27667
|
if (stringBuilder.length > 0 || midCRLF) {
|
|
27592
27668
|
const last = stringBuilder;
|
|
27593
27669
|
stringBuilder = "";
|
|
@@ -28159,10 +28235,10 @@ const empty$9 = () => {
|
|
|
28159
28235
|
* @since 2.0.0
|
|
28160
28236
|
*/
|
|
28161
28237
|
const get$7 = /*#__PURE__*/ dual(2, (self, key) => {
|
|
28162
|
-
if (self.backing.has(key)) return some(self.backing.get(key));
|
|
28238
|
+
if (self.backing.has(key)) return some$1(self.backing.get(key));
|
|
28163
28239
|
else if (isSimpleKey(key)) return none();
|
|
28164
28240
|
const refKey = referentialKeysCache.get(self);
|
|
28165
|
-
if (refKey !== void 0) return self.backing.has(refKey) ? some(self.backing.get(refKey)) : none();
|
|
28241
|
+
if (refKey !== void 0) return self.backing.has(refKey) ? some$1(self.backing.get(refKey)) : none();
|
|
28166
28242
|
const hash$5 = hash(key);
|
|
28167
28243
|
const bucket = self.buckets.get(hash$5);
|
|
28168
28244
|
if (bucket === void 0) return none();
|
|
@@ -28174,7 +28250,7 @@ const getFromBucket = (self, bucket, key) => {
|
|
|
28174
28250
|
for (let i = 0, len = bucket.length; i < len; i++) if (equals$2(key, bucket[i])) {
|
|
28175
28251
|
const refKey = bucket[i];
|
|
28176
28252
|
referentialKeysCache.set(key, refKey);
|
|
28177
|
-
return some(self.backing.get(refKey));
|
|
28253
|
+
return some$1(self.backing.get(refKey));
|
|
28178
28254
|
}
|
|
28179
28255
|
return none();
|
|
28180
28256
|
};
|
|
@@ -31970,7 +32046,7 @@ var LeafNode = class LeafNode extends Node {
|
|
|
31970
32046
|
return 1;
|
|
31971
32047
|
}
|
|
31972
32048
|
get(_shift, hash, key) {
|
|
31973
|
-
if (this.hash === hash && equals$2(this.key, key)) return some(this.value);
|
|
32049
|
+
if (this.hash === hash && equals$2(this.key, key)) return some$1(this.value);
|
|
31974
32050
|
return none();
|
|
31975
32051
|
}
|
|
31976
32052
|
has(_shift, hash, key) {
|
|
@@ -32023,7 +32099,7 @@ var CollisionNode = class CollisionNode extends Node {
|
|
|
32023
32099
|
}
|
|
32024
32100
|
get(_shift, hash, key) {
|
|
32025
32101
|
if (this.hash !== hash) return none();
|
|
32026
|
-
for (const [k, v] of this.entries) if (equals$2(k, key)) return some(v);
|
|
32102
|
+
for (const [k, v] of this.entries) if (equals$2(k, key)) return some$1(v);
|
|
32027
32103
|
return none();
|
|
32028
32104
|
}
|
|
32029
32105
|
has(_shift, hash, key) {
|
|
@@ -32974,7 +33050,7 @@ const mergeParseOptions = (options, overrideOptions) => overrideOptions === void
|
|
|
32974
33050
|
/** @internal */
|
|
32975
33051
|
function run(ast) {
|
|
32976
33052
|
const parser = recur$1(ast);
|
|
32977
|
-
return (input, options) => flatMapEager(parser(some(input), options ?? defaultParseOptions), (oa) => {
|
|
33053
|
+
return (input, options) => flatMapEager(parser(some$1(input), options ?? defaultParseOptions), (oa) => {
|
|
32978
33054
|
if (oa._tag === "None") return fail$3(new InvalidValue(oa));
|
|
32979
33055
|
return succeed$3(oa.value);
|
|
32980
33056
|
});
|
|
@@ -33204,7 +33280,7 @@ function declareConstructor() {
|
|
|
33204
33280
|
* @since 3.10.0
|
|
33205
33281
|
*/
|
|
33206
33282
|
function declare(is, annotations) {
|
|
33207
|
-
return declareConstructor()([], () => (input, ast) => is(input) ? succeed$3(input) : fail$3(new InvalidType(ast, some(input))), annotations);
|
|
33283
|
+
return declareConstructor()([], () => (input, ast) => is(input) ? succeed$3(input) : fail$3(new InvalidType(ast, some$1(input))), annotations);
|
|
33208
33284
|
}
|
|
33209
33285
|
/**
|
|
33210
33286
|
* Returns `true` if `u` is a {@link SchemaError}.
|
|
@@ -34072,15 +34148,15 @@ function isInt(annotations) {
|
|
|
34072
34148
|
*/
|
|
34073
34149
|
function CauseReason(error, defect) {
|
|
34074
34150
|
return make$35(declareConstructor()([error, defect], ([error, defect]) => (input, ast, options) => {
|
|
34075
|
-
if (!isReason(input)) return fail$3(new InvalidType(ast, some(input)));
|
|
34151
|
+
if (!isReason(input)) return fail$3(new InvalidType(ast, some$1(input)));
|
|
34076
34152
|
switch (input._tag) {
|
|
34077
34153
|
case "Fail": return mapBothEager(decodeUnknownEffect$1(error)(input.error, options), {
|
|
34078
34154
|
onSuccess: makeFailReason,
|
|
34079
|
-
onFailure: (issue) => new Composite(ast, some(input), [new Pointer(["error"], issue)])
|
|
34155
|
+
onFailure: (issue) => new Composite(ast, some$1(input), [new Pointer(["error"], issue)])
|
|
34080
34156
|
});
|
|
34081
34157
|
case "Die": return mapBothEager(decodeUnknownEffect$1(defect)(input.defect, options), {
|
|
34082
34158
|
onSuccess: makeDieReason,
|
|
34083
|
-
onFailure: (issue) => new Composite(ast, some(input), [new Pointer(["defect"], issue)])
|
|
34159
|
+
onFailure: (issue) => new Composite(ast, some$1(input), [new Pointer(["defect"], issue)])
|
|
34084
34160
|
});
|
|
34085
34161
|
case "Interrupt": return succeed$3(input);
|
|
34086
34162
|
}
|
|
@@ -34175,10 +34251,10 @@ function Cause(error, defect) {
|
|
|
34175
34251
|
return make$35(declareConstructor()([error, defect], ([error, defect]) => {
|
|
34176
34252
|
const failures = ArraySchema(CauseReason(error, defect));
|
|
34177
34253
|
return (input, ast, options) => {
|
|
34178
|
-
if (!isCause(input)) return fail$3(new InvalidType(ast, some(input)));
|
|
34254
|
+
if (!isCause(input)) return fail$3(new InvalidType(ast, some$1(input)));
|
|
34179
34255
|
return mapBothEager(decodeUnknownEffect$1(failures)(input.reasons, options), {
|
|
34180
34256
|
onSuccess: fromReasons,
|
|
34181
|
-
onFailure: (issue) => new Composite(ast, some(input), [new Pointer(["failures"], issue)])
|
|
34257
|
+
onFailure: (issue) => new Composite(ast, some$1(input), [new Pointer(["failures"], issue)])
|
|
34182
34258
|
});
|
|
34183
34259
|
};
|
|
34184
34260
|
}, {
|
|
@@ -34282,15 +34358,15 @@ function Exit(value, error, defect) {
|
|
|
34282
34358
|
], ([value, error, defect]) => {
|
|
34283
34359
|
const cause = Cause(error, defect);
|
|
34284
34360
|
return (input, ast, options) => {
|
|
34285
|
-
if (!isExit(input)) return fail$3(new InvalidType(ast, some(input)));
|
|
34361
|
+
if (!isExit(input)) return fail$3(new InvalidType(ast, some$1(input)));
|
|
34286
34362
|
switch (input._tag) {
|
|
34287
34363
|
case "Success": return mapBothEager(decodeUnknownEffect$1(value)(input.value, options), {
|
|
34288
34364
|
onSuccess: succeed$5,
|
|
34289
|
-
onFailure: (issue) => new Composite(ast, some(input), [new Pointer(["value"], issue)])
|
|
34365
|
+
onFailure: (issue) => new Composite(ast, some$1(input), [new Pointer(["value"], issue)])
|
|
34290
34366
|
});
|
|
34291
34367
|
case "Failure": return mapBothEager(decodeUnknownEffect$1(cause)(input.cause, options), {
|
|
34292
34368
|
onSuccess: failCause$3,
|
|
34293
|
-
onFailure: (issue) => new Composite(ast, some(input), [new Pointer(["cause"], issue)])
|
|
34369
|
+
onFailure: (issue) => new Composite(ast, some$1(input), [new Pointer(["cause"], issue)])
|
|
34294
34370
|
});
|
|
34295
34371
|
}
|
|
34296
34372
|
};
|
|
@@ -34518,7 +34594,7 @@ function getClassSchemaFactory(from, identifier, annotations) {
|
|
|
34518
34594
|
if (memo === void 0) {
|
|
34519
34595
|
const transformation = getClassTransformation(self);
|
|
34520
34596
|
const to = make$35(new Declaration([from.ast], () => (input, ast) => {
|
|
34521
|
-
return input instanceof self || hasProperty(input, getClassTypeId(identifier)) ? succeed$3(input) : fail$3(new InvalidType(ast, some(input)));
|
|
34597
|
+
return input instanceof self || hasProperty(input, getClassTypeId(identifier)) ? succeed$3(input) : fail$3(new InvalidType(ast, some$1(input)));
|
|
34522
34598
|
}, {
|
|
34523
34599
|
identifier,
|
|
34524
34600
|
[ClassTypeId]: ([from]) => new Link(from, transformation),
|
|
@@ -36145,7 +36221,7 @@ const setUrlParams = /*#__PURE__*/ dual(2, (self, input) => makeWith$1(self.meth
|
|
|
36145
36221
|
* @category combinators
|
|
36146
36222
|
* @since 4.0.0
|
|
36147
36223
|
*/
|
|
36148
|
-
const setHash = /*#__PURE__*/ dual(2, (self, hash) => makeWith$1(self.method, self.url, self.urlParams, some(hash), self.headers, self.body));
|
|
36224
|
+
const setHash = /*#__PURE__*/ dual(2, (self, hash) => makeWith$1(self.method, self.url, self.urlParams, some$1(hash), self.headers, self.body));
|
|
36149
36225
|
/**
|
|
36150
36226
|
* Sets the request body and updates `Content-Type` and `Content-Length` headers from the body metadata when available.
|
|
36151
36227
|
*
|
|
@@ -36479,7 +36555,7 @@ const b3 = (headers) => {
|
|
|
36479
36555
|
if (!("b3" in headers)) return none();
|
|
36480
36556
|
const parts = headers["b3"].split("-");
|
|
36481
36557
|
if (parts.length < 2) return none();
|
|
36482
|
-
return some(externalSpan({
|
|
36558
|
+
return some$1(externalSpan({
|
|
36483
36559
|
traceId: parts[0],
|
|
36484
36560
|
spanId: parts[1],
|
|
36485
36561
|
sampled: parts[2] ? parts[2] === "1" : true
|
|
@@ -36498,7 +36574,7 @@ const b3 = (headers) => {
|
|
|
36498
36574
|
*/
|
|
36499
36575
|
const xb3 = (headers) => {
|
|
36500
36576
|
if (!headers["x-b3-traceid"] || !headers["x-b3-spanid"]) return none();
|
|
36501
|
-
return some(externalSpan({
|
|
36577
|
+
return some$1(externalSpan({
|
|
36502
36578
|
traceId: headers["x-b3-traceid"],
|
|
36503
36579
|
spanId: headers["x-b3-spanid"],
|
|
36504
36580
|
sampled: headers["x-b3-sampled"] ? headers["x-b3-sampled"] === "1" : true
|
|
@@ -36524,7 +36600,7 @@ const w3c = (headers) => {
|
|
|
36524
36600
|
switch (version) {
|
|
36525
36601
|
case "00":
|
|
36526
36602
|
if (w3cTraceId.test(traceId) === false || w3cSpanId.test(spanId) === false) return none();
|
|
36527
|
-
return some(externalSpan({
|
|
36603
|
+
return some$1(externalSpan({
|
|
36528
36604
|
traceId,
|
|
36529
36605
|
spanId,
|
|
36530
36606
|
sampled: (parseInt(flags, 16) & 1) === 1
|
|
@@ -37972,7 +38048,7 @@ const causeResponseStripped = (cause) => {
|
|
|
37972
38048
|
}
|
|
37973
38049
|
return true;
|
|
37974
38050
|
});
|
|
37975
|
-
return [response ?? internalServerError, failures.length > 0 ? some(fromReasons(failures)) : none()];
|
|
38051
|
+
return [response ?? internalServerError, failures.length > 0 ? some$1(fromReasons(failures)) : none()];
|
|
37976
38052
|
};
|
|
37977
38053
|
const internalServerError = /*#__PURE__*/ empty({ status: 500 });
|
|
37978
38054
|
const succeedInternalServerError = /*#__PURE__*/ succeed$3(internalServerError);
|
|
@@ -39711,7 +39787,7 @@ const toURL = (self) => {
|
|
|
39711
39787
|
const host = self.headers.host ?? "localhost";
|
|
39712
39788
|
const protocol = self.headers["x-forwarded-proto"] === "https" ? "https" : "http";
|
|
39713
39789
|
try {
|
|
39714
|
-
return some(new URL(self.url, `${protocol}://${host}`));
|
|
39790
|
+
return some$1(new URL(self.url, `${protocol}://${host}`));
|
|
39715
39791
|
} catch {
|
|
39716
39792
|
return none();
|
|
39717
39793
|
}
|
|
@@ -40456,7 +40532,7 @@ const RouteTypeId = "~effect/http/HttpRouter/Route";
|
|
|
40456
40532
|
const makeRoute = (options) => ({
|
|
40457
40533
|
...options,
|
|
40458
40534
|
uninterruptible: options.uninterruptible ?? false,
|
|
40459
|
-
prefix: typeof options.prefix === "string" ? some(options.prefix) : options.prefix ?? none(),
|
|
40535
|
+
prefix: typeof options.prefix === "string" ? some$1(options.prefix) : options.prefix ?? none(),
|
|
40460
40536
|
[RouteTypeId]: RouteTypeId
|
|
40461
40537
|
});
|
|
40462
40538
|
/**
|
|
@@ -40787,7 +40863,7 @@ function isStreamSchema(schema) {
|
|
|
40787
40863
|
}
|
|
40788
40864
|
/** @internal */
|
|
40789
40865
|
function getStreamSchemas(schema) {
|
|
40790
|
-
return isStreamSchema(schema) ? some({
|
|
40866
|
+
return isStreamSchema(schema) ? some$1({
|
|
40791
40867
|
success: schema.success,
|
|
40792
40868
|
error: schema.error
|
|
40793
40869
|
}) : none();
|
|
@@ -45091,7 +45167,7 @@ const withDefault = /*#__PURE__*/ dual(2, (self, defaultValue) => {
|
|
|
45091
45167
|
* @category combinators
|
|
45092
45168
|
* @since 2.0.0
|
|
45093
45169
|
*/
|
|
45094
|
-
const option = (self) => self.pipe(map(some), withDefault(none()));
|
|
45170
|
+
const option = (self) => self.pipe(map(some$1), withDefault(none()));
|
|
45095
45171
|
/**
|
|
45096
45172
|
* Constructs a `Config<T>` from a value matching `Wrap<T>`.
|
|
45097
45173
|
*
|
|
@@ -49117,10 +49193,10 @@ const makeFile = /*#__PURE__*/ (() => {
|
|
|
49117
49193
|
}), (bytesRead) => {
|
|
49118
49194
|
if (bytesRead === 0) return none();
|
|
49119
49195
|
this.position = position + BigInt(bytesRead);
|
|
49120
|
-
if (bytesRead === sizeNumber) return some(buffer);
|
|
49196
|
+
if (bytesRead === sizeNumber) return some$1(buffer);
|
|
49121
49197
|
const dst = Buffer.allocUnsafeSlow(bytesRead);
|
|
49122
49198
|
buffer.copy(dst, 0, 0, bytesRead);
|
|
49123
|
-
return some(dst);
|
|
49199
|
+
return some$1(dst);
|
|
49124
49200
|
});
|
|
49125
49201
|
});
|
|
49126
49202
|
}
|
|
@@ -49219,7 +49295,7 @@ const makeFileInfo = (stat) => ({
|
|
|
49219
49295
|
uid: fromNullishOr(stat.uid),
|
|
49220
49296
|
gid: fromNullishOr(stat.gid),
|
|
49221
49297
|
size: Size(stat.size),
|
|
49222
|
-
blksize: stat.blksize !== void 0 ? some(Size(stat.blksize)) : none(),
|
|
49298
|
+
blksize: stat.blksize !== void 0 ? some$1(Size(stat.blksize)) : none(),
|
|
49223
49299
|
blocks: fromNullishOr(stat.blocks)
|
|
49224
49300
|
});
|
|
49225
49301
|
const stat = /*#__PURE__*/ (() => {
|
|
@@ -51527,7 +51603,7 @@ const toSchemaStore = (self, schema) => {
|
|
|
51527
51603
|
const modify = (key, f) => flatMap$2(get(key), (o) => {
|
|
51528
51604
|
if (isNone(o)) return succeedNone;
|
|
51529
51605
|
const newValue = f(o.value);
|
|
51530
|
-
return as(set(key, newValue), some(newValue));
|
|
51606
|
+
return as(set(key, newValue), some$1(newValue));
|
|
51531
51607
|
});
|
|
51532
51608
|
return {
|
|
51533
51609
|
[SchemaStoreTypeId]: SchemaStoreTypeId,
|
|
@@ -52122,7 +52198,6 @@ const GitDiffStatus = Literals([
|
|
|
52122
52198
|
"modified",
|
|
52123
52199
|
"renamed"
|
|
52124
52200
|
]);
|
|
52125
|
-
const GitDiffScope = Literals(["staged-to-worktree", "head-to-staged"]);
|
|
52126
52201
|
var GitDiffSegment = class extends Class("GitDiffSegment")({
|
|
52127
52202
|
filePath: String$1,
|
|
52128
52203
|
fingerprint: String$1,
|
|
@@ -52155,8 +52230,21 @@ var GitCommit = class extends Class("GitCommit")({
|
|
|
52155
52230
|
}) {};
|
|
52156
52231
|
var GitReviewMetadata = class extends Class("GitReviewMetadata")({
|
|
52157
52232
|
base: String$1,
|
|
52233
|
+
branch: String$1,
|
|
52158
52234
|
commits: ArraySchema(GitCommit),
|
|
52159
|
-
|
|
52235
|
+
defaultBranch: String$1,
|
|
52236
|
+
dirty: Boolean$1,
|
|
52237
|
+
prUrl: optional(String$1),
|
|
52238
|
+
unpushedCommits: Boolean$1
|
|
52239
|
+
}) {};
|
|
52240
|
+
var GitHubReviewThread = class extends Class("GitHubReviewThread")({
|
|
52241
|
+
body: String$1,
|
|
52242
|
+
filePath: String$1,
|
|
52243
|
+
id: String$1,
|
|
52244
|
+
lineNumber: Number$1,
|
|
52245
|
+
resolved: Boolean$1,
|
|
52246
|
+
side: optional(Literals(["additions", "deletions"])),
|
|
52247
|
+
url: optional(String$1)
|
|
52160
52248
|
}) {};
|
|
52161
52249
|
var GitRepository = class extends Class("GitRepository")({
|
|
52162
52250
|
gitDirectory: String$1,
|
|
@@ -52264,6 +52352,7 @@ var ReviewComment = class extends Class("ReviewComment")({
|
|
|
52264
52352
|
body: String$1,
|
|
52265
52353
|
filePath: String$1,
|
|
52266
52354
|
lineNumber: Number$1,
|
|
52355
|
+
resolved: optional(Boolean$1),
|
|
52267
52356
|
side: optional(Literals(["additions", "deletions"]))
|
|
52268
52357
|
}) {};
|
|
52269
52358
|
var ReviewState = class extends Class("ReviewState")({
|
|
@@ -52302,14 +52391,6 @@ var RpcContracts = class extends make$15(make$18("agents.create", {
|
|
|
52302
52391
|
error: GitError,
|
|
52303
52392
|
payload: Struct({ cwd: String$1 }),
|
|
52304
52393
|
success: GitBranchesSnapshot
|
|
52305
|
-
}), make$18("review.watch", {
|
|
52306
|
-
error: GitError,
|
|
52307
|
-
payload: Struct({
|
|
52308
|
-
cwd: String$1,
|
|
52309
|
-
scope: GitDiffScope
|
|
52310
|
-
}),
|
|
52311
|
-
stream: true,
|
|
52312
|
-
success: ArraySchema(GitDiff)
|
|
52313
52394
|
}), make$18("review.metadata", {
|
|
52314
52395
|
error: GitError,
|
|
52315
52396
|
payload: Struct({
|
|
@@ -52355,7 +52436,7 @@ var RpcContracts = class extends make$15(make$18("agents.create", {
|
|
|
52355
52436
|
comment: ReviewComment,
|
|
52356
52437
|
cwd: String$1
|
|
52357
52438
|
})
|
|
52358
|
-
}), make$18("review.comments.
|
|
52439
|
+
}), make$18("review.comments.resolve", {
|
|
52359
52440
|
error: GitError,
|
|
52360
52441
|
payload: Struct({
|
|
52361
52442
|
base: String$1,
|
|
@@ -52377,6 +52458,16 @@ var RpcContracts = class extends make$15(make$18("agents.create", {
|
|
|
52377
52458
|
cwd: String$1,
|
|
52378
52459
|
message: String$1
|
|
52379
52460
|
})
|
|
52461
|
+
}), make$18("review.githubThreads", {
|
|
52462
|
+
error: GitError,
|
|
52463
|
+
payload: Struct({ cwd: String$1 }),
|
|
52464
|
+
success: ArraySchema(GitHubReviewThread)
|
|
52465
|
+
}), make$18("review.githubThreads.resolve", {
|
|
52466
|
+
error: GitError,
|
|
52467
|
+
payload: Struct({
|
|
52468
|
+
cwd: String$1,
|
|
52469
|
+
threadId: String$1
|
|
52470
|
+
})
|
|
52380
52471
|
}), make$18("review.stageFile", {
|
|
52381
52472
|
error: GitError,
|
|
52382
52473
|
payload: Struct({
|
|
@@ -52737,12 +52828,11 @@ var GitWorkspace = class extends Service()("@deslop/git/service/GitWorkspace", {
|
|
|
52737
52828
|
static layer = effect(this, this.make);
|
|
52738
52829
|
};
|
|
52739
52830
|
var GitWorktree = class extends Service()("@deslop/git/service/GitWorktree", { make: fnUntraced(function* (config) {
|
|
52831
|
+
const execString = yield* ChildProcessSpawner.useSync((spawner) => spawner.string);
|
|
52740
52832
|
const git = yield* makeGitExecutor;
|
|
52741
52833
|
const fs = yield* FileSystem;
|
|
52742
52834
|
const path = yield* Path$1;
|
|
52743
|
-
const hasWorktreeChanges =
|
|
52744
|
-
return yield* pipe(git.lines(config.cwd, ["status", "--porcelain"]), map$4((lines) => !isReadonlyArrayEmpty(lines)));
|
|
52745
|
-
});
|
|
52835
|
+
const hasWorktreeChanges = pipe(git.lines(config.cwd, ["status", "--porcelain"]), map$4((lines) => !isReadonlyArrayEmpty(lines)));
|
|
52746
52836
|
const resolveFrom = fnUntraced(function* (from) {
|
|
52747
52837
|
if (from.type === "ref") return from.ref;
|
|
52748
52838
|
return yield* pipe(git.string(config.cwd, [
|
|
@@ -52755,7 +52845,7 @@ var GitWorktree = class extends Service()("@deslop/git/service/GitWorktree", { m
|
|
|
52755
52845
|
return to.type === "ref" ? [to.ref] : empty$13();
|
|
52756
52846
|
}
|
|
52757
52847
|
function segmentsByFile(segments) {
|
|
52758
|
-
return reduce(segments, empty$6(), (groups, segment) => modifyAt(groups, segment.filePath, (current) => some(append$1(getOrElse$1(current, () => empty$13()), segment))));
|
|
52848
|
+
return reduce(segments, empty$6(), (groups, segment) => modifyAt(groups, segment.filePath, (current) => some$1(append$1(getOrElse$1(current, () => empty$13()), segment))));
|
|
52759
52849
|
}
|
|
52760
52850
|
function diffFromPatchChunk(chunk, segments) {
|
|
52761
52851
|
const deleted = /^deleted file mode /mu.test(chunk);
|
|
@@ -52794,31 +52884,21 @@ var GitWorktree = class extends Service()("@deslop/git/service/GitWorktree", { m
|
|
|
52794
52884
|
"--no-ext-diff"
|
|
52795
52885
|
]), input.segments);
|
|
52796
52886
|
});
|
|
52797
|
-
const untrackedDiffs =
|
|
52798
|
-
|
|
52799
|
-
|
|
52800
|
-
|
|
52801
|
-
|
|
52802
|
-
|
|
52887
|
+
const untrackedDiffs = pipe(git.lines(config.cwd, [
|
|
52888
|
+
"ls-files",
|
|
52889
|
+
"--others",
|
|
52890
|
+
"--exclude-standard"
|
|
52891
|
+
]), flatMap$2((files) => forEach$1(files, (filePath) => pipe(fs.readFileString(path.join(config.cwd, filePath)), orElseSucceed(() => ""), map$4((content) => new GitDiff({
|
|
52892
|
+
filePath,
|
|
52893
|
+
patch: `diff --git a/${filePath} b/${filePath}\nnew file mode 100644\n--- /dev/null\n+++ b/${filePath}\n@@ -0,0 +1,${length(split$1("\n")(content))} @@\n${pipe(split$1("\n")(content), map$7((line) => `+${line}`), join$3("\n"))}`,
|
|
52894
|
+
segments: [new GitDiffSegment({
|
|
52803
52895
|
filePath,
|
|
52804
|
-
|
|
52805
|
-
|
|
52806
|
-
|
|
52807
|
-
|
|
52808
|
-
|
|
52809
|
-
|
|
52810
|
-
})],
|
|
52811
|
-
status: "added"
|
|
52812
|
-
}))), { concurrency: "unbounded" });
|
|
52813
|
-
});
|
|
52814
|
-
const reviewDiffs = fnUntraced(function* (scope) {
|
|
52815
|
-
const diffs = yield* gitDiffs({
|
|
52816
|
-
args: scope === "head-to-staged" ? ["--cached"] : empty$13(),
|
|
52817
|
-
segments: empty$13()
|
|
52818
|
-
});
|
|
52819
|
-
if (scope === "head-to-staged") return diffs;
|
|
52820
|
-
return yield* pipe(untrackedDiffs, map$4(appendAll(diffs)));
|
|
52821
|
-
});
|
|
52896
|
+
fingerprint: content,
|
|
52897
|
+
id: "HEAD->worktree",
|
|
52898
|
+
type: "worktree"
|
|
52899
|
+
})],
|
|
52900
|
+
status: "added"
|
|
52901
|
+
}))), { concurrency: "unbounded" })));
|
|
52822
52902
|
const commitSegmentDiffs = fnUntraced(function* (input) {
|
|
52823
52903
|
return pipe((yield* git.string(config.cwd, [
|
|
52824
52904
|
"log",
|
|
@@ -52885,23 +52965,44 @@ var GitWorktree = class extends Service()("@deslop/git/service/GitWorktree", { m
|
|
|
52885
52965
|
if (input.to.type === "ref") return diffsWithSegments;
|
|
52886
52966
|
return appendAll(diffsWithSegments, untracked);
|
|
52887
52967
|
});
|
|
52888
|
-
const
|
|
52889
|
-
return yield* pipe(
|
|
52890
|
-
|
|
52891
|
-
|
|
52892
|
-
|
|
52893
|
-
|
|
52894
|
-
|
|
52895
|
-
|
|
52896
|
-
|
|
52897
|
-
|
|
52898
|
-
|
|
52899
|
-
], findFirst((candidate) => pipe(git.string(config.cwd, [
|
|
52968
|
+
const ghString = fnUntraced(function* (args) {
|
|
52969
|
+
return yield* pipe(execString(make$40("gh", args, { cwd: config.cwd })), mapError$2((cause) => new GitError({ cause })));
|
|
52970
|
+
});
|
|
52971
|
+
const currentBranch = pipe(git.string(config.cwd, ["branch", "--show-current"]), map$4(trim));
|
|
52972
|
+
const defaultBranchName = pipe(git.string(config.cwd, [
|
|
52973
|
+
"symbolic-ref",
|
|
52974
|
+
"--short",
|
|
52975
|
+
"refs/remotes/origin/HEAD"
|
|
52976
|
+
]), map$4(flow(trim, replace(/^origin\//u, ""))));
|
|
52977
|
+
const branchBase = fnUntraced(function* (defaultBranch) {
|
|
52978
|
+
return yield* pipe([`origin/${defaultBranch}`, defaultBranch], findFirst((candidate) => pipe(git.string(config.cwd, [
|
|
52900
52979
|
"rev-parse",
|
|
52901
52980
|
"--verify",
|
|
52902
52981
|
candidate
|
|
52903
52982
|
]), as(true), orElseSucceed(() => false))), map$4(getOrElse$1(() => "HEAD")));
|
|
52904
52983
|
});
|
|
52984
|
+
const branchPrUrl = pipe(ghString([
|
|
52985
|
+
"pr",
|
|
52986
|
+
"view",
|
|
52987
|
+
"--json",
|
|
52988
|
+
"url",
|
|
52989
|
+
"--jq",
|
|
52990
|
+
".url"
|
|
52991
|
+
]), map$4(trim), map$4((url) => isNonEmpty$1(url) ? some$1(url) : none()), catchTag("GitError", () => succeed$3(none())));
|
|
52992
|
+
function isWipSubject(subject) {
|
|
52993
|
+
return subject === "wip" || startsWith("wip: ")(subject);
|
|
52994
|
+
}
|
|
52995
|
+
function commitFromLogLine(line) {
|
|
52996
|
+
const parts = split$1("\0")(line);
|
|
52997
|
+
const subject = parts[2] ?? "";
|
|
52998
|
+
return new GitCommit({
|
|
52999
|
+
hash: parts[0] ?? "",
|
|
53000
|
+
parents: pipe(parts[3] ?? "", split$1(" "), filter$2(isNonEmpty$1)),
|
|
53001
|
+
shortHash: parts[1] ?? "",
|
|
53002
|
+
subject,
|
|
53003
|
+
wip: isWipSubject(subject)
|
|
53004
|
+
});
|
|
53005
|
+
}
|
|
52905
53006
|
const commits = fnUntraced(function* (base) {
|
|
52906
53007
|
const from = yield* pipe(git.string(config.cwd, [
|
|
52907
53008
|
"merge-base",
|
|
@@ -52913,55 +53014,148 @@ var GitWorktree = class extends Service()("@deslop/git/service/GitWorktree", { m
|
|
|
52913
53014
|
"--max-count=80",
|
|
52914
53015
|
"--format=%H%x00%h%x00%s%x00%P",
|
|
52915
53016
|
`${from}..HEAD`
|
|
52916
|
-
]), map$4(map$7(
|
|
52917
|
-
|
|
52918
|
-
|
|
52919
|
-
|
|
52920
|
-
|
|
52921
|
-
|
|
52922
|
-
|
|
52923
|
-
|
|
52924
|
-
|
|
52925
|
-
|
|
53017
|
+
]), map$4(map$7(commitFromLogLine)));
|
|
53018
|
+
});
|
|
53019
|
+
const firstParentCommits = pipe(git.lines(config.cwd, [
|
|
53020
|
+
"log",
|
|
53021
|
+
"--first-parent",
|
|
53022
|
+
"--max-count=80",
|
|
53023
|
+
"--format=%H%x00%h%x00%s%x00%P",
|
|
53024
|
+
"HEAD"
|
|
53025
|
+
]), map$4(map$7(commitFromLogLine)));
|
|
53026
|
+
const pushCurrentBranch = gen(function* () {
|
|
53027
|
+
const branch = yield* currentBranch;
|
|
53028
|
+
yield* pipe(git.string(config.cwd, [
|
|
53029
|
+
"push",
|
|
53030
|
+
"-u",
|
|
53031
|
+
"origin",
|
|
53032
|
+
`HEAD:${branch}`
|
|
53033
|
+
]), asVoid);
|
|
53034
|
+
});
|
|
53035
|
+
const hasPushableCommits = pipe(gen(function* () {
|
|
53036
|
+
const remoteBranch = `origin/${yield* currentBranch}`;
|
|
53037
|
+
if (yield* pipe(git.string(config.cwd, [
|
|
53038
|
+
"rev-parse",
|
|
53039
|
+
"--verify",
|
|
53040
|
+
remoteBranch
|
|
53041
|
+
]), as(true), orElseSucceed(() => false))) return yield* git.lines(config.cwd, [
|
|
53042
|
+
"log",
|
|
53043
|
+
"--format=%s",
|
|
53044
|
+
`${remoteBranch}..HEAD`
|
|
53045
|
+
]);
|
|
53046
|
+
const base = yield* branchBase(yield* defaultBranchName);
|
|
53047
|
+
const from = yield* pipe(git.string(config.cwd, [
|
|
53048
|
+
"merge-base",
|
|
53049
|
+
base,
|
|
53050
|
+
"HEAD"
|
|
53051
|
+
]), map$4(trim), catchTag("GitError", () => succeed$3(base)));
|
|
53052
|
+
return yield* git.lines(config.cwd, [
|
|
53053
|
+
"log",
|
|
53054
|
+
"--format=%s",
|
|
53055
|
+
`${from}..HEAD`
|
|
53056
|
+
]);
|
|
53057
|
+
}), map$4((subjects) => !some(subjects, isWipSubject) && !isReadonlyArrayEmpty(subjects)));
|
|
53058
|
+
const createDraftPr = pipe(ghString([
|
|
53059
|
+
"pr",
|
|
53060
|
+
"create",
|
|
53061
|
+
"--draft",
|
|
53062
|
+
"--fill"
|
|
53063
|
+
]), map$4((output) => {
|
|
53064
|
+
const url = output.match(/https?:\/\/\S+/u)?.[0] ?? trim(output);
|
|
53065
|
+
return isNonEmpty$1(url) ? some$1(url) : none();
|
|
53066
|
+
}));
|
|
53067
|
+
const prReviewThreads = gen(function* () {
|
|
53068
|
+
const pr = yield* pipe(ghString([
|
|
53069
|
+
"pr",
|
|
53070
|
+
"view",
|
|
53071
|
+
"--json",
|
|
53072
|
+
"number",
|
|
53073
|
+
"--jq",
|
|
53074
|
+
".number"
|
|
53075
|
+
]), map$4(flow(trim, parse$2)), flatMap$2(match$5({
|
|
53076
|
+
onNone: () => new GitError({ message: "No PR found." }),
|
|
53077
|
+
onSome: succeed$3
|
|
52926
53078
|
})));
|
|
53079
|
+
const repository = yield* pipe(ghString([
|
|
53080
|
+
"repo",
|
|
53081
|
+
"view",
|
|
53082
|
+
"--json",
|
|
53083
|
+
"owner,name"
|
|
53084
|
+
]), map$4((output) => JSON.parse(output)));
|
|
53085
|
+
const response = yield* ghString([
|
|
53086
|
+
"api",
|
|
53087
|
+
"graphql",
|
|
53088
|
+
"-f",
|
|
53089
|
+
`query=
|
|
53090
|
+
query(\$owner: String!, \$name: String!, \$number: Int!) {
|
|
53091
|
+
repository(owner: \$owner, name: \$name) {
|
|
53092
|
+
pullRequest(number: \$number) {
|
|
53093
|
+
reviewThreads(first: 100) {
|
|
53094
|
+
nodes {
|
|
53095
|
+
id
|
|
53096
|
+
isResolved
|
|
53097
|
+
diffSide
|
|
53098
|
+
comments(first: 20) {
|
|
53099
|
+
nodes {
|
|
53100
|
+
body
|
|
53101
|
+
line
|
|
53102
|
+
originalLine
|
|
53103
|
+
path
|
|
53104
|
+
url
|
|
53105
|
+
}
|
|
53106
|
+
}
|
|
53107
|
+
}
|
|
53108
|
+
}
|
|
53109
|
+
}
|
|
53110
|
+
}
|
|
53111
|
+
}`,
|
|
53112
|
+
"-f",
|
|
53113
|
+
`owner=${repository.owner.login}`,
|
|
53114
|
+
"-f",
|
|
53115
|
+
`name=${repository.name}`,
|
|
53116
|
+
"-F",
|
|
53117
|
+
`number=${pr}`
|
|
53118
|
+
]);
|
|
53119
|
+
return pipe(JSON.parse(response).data?.repository?.pullRequest?.reviewThreads?.nodes ?? [], filter$2((thread) => thread.id !== void 0), flatMap$5((thread) => pipe(thread.comments?.nodes ?? [], filter$2((comment) => comment.body !== void 0 && comment.path !== void 0), map$7((comment) => new GitHubReviewThread({
|
|
53120
|
+
body: comment.body ?? "",
|
|
53121
|
+
filePath: comment.path ?? "",
|
|
53122
|
+
id: thread.id ?? "",
|
|
53123
|
+
lineNumber: comment.line ?? comment.originalLine ?? 1,
|
|
53124
|
+
resolved: thread.isResolved === true,
|
|
53125
|
+
side: thread.diffSide === "LEFT" ? "deletions" : "additions",
|
|
53126
|
+
url: comment.url
|
|
53127
|
+
})))));
|
|
52927
53128
|
});
|
|
52928
53129
|
const worktreeChanges = pipe(make$43(void 0), merge$1(pipe(fs.watch(config.cwd), catch_(() => empty$8), map$2(() => void 0))), debounce(millis(50)));
|
|
52929
53130
|
return {
|
|
52930
53131
|
commitAndPush: fnUntraced(function* (input) {
|
|
52931
|
-
|
|
52932
|
-
const
|
|
52933
|
-
if (
|
|
52934
|
-
yield* pipe(git.string(config.cwd, [
|
|
53132
|
+
const oldestWip = pipe(yield* commits(input.base), takeWhile((commit) => commit.wip), last, getOrUndefined$1);
|
|
53133
|
+
const dirty = yield* hasWorktreeChanges;
|
|
53134
|
+
if (oldestWip) yield* pipe(git.string(config.cwd, [
|
|
52935
53135
|
"reset",
|
|
52936
53136
|
"--soft",
|
|
52937
53137
|
`${oldestWip.hash}^`
|
|
52938
53138
|
]), asVoid);
|
|
53139
|
+
else if (!dirty) return yield* new GitError({ message: "No changes to commit." });
|
|
53140
|
+
yield* pipe(git.string(config.cwd, ["add", "-A"]), asVoid);
|
|
52939
53141
|
yield* pipe(git.string(config.cwd, [
|
|
52940
53142
|
"commit",
|
|
52941
53143
|
"-m",
|
|
52942
53144
|
input.message
|
|
52943
53145
|
]), asVoid);
|
|
52944
|
-
|
|
52945
|
-
yield*
|
|
52946
|
-
|
|
52947
|
-
"--abbrev-ref",
|
|
52948
|
-
"--symbolic-full-name",
|
|
52949
|
-
"@{u}"
|
|
52950
|
-
]), as(true), orElseSucceed(() => false))) ? git.string(config.cwd, ["push"]) : git.string(config.cwd, [
|
|
52951
|
-
"push",
|
|
52952
|
-
"-u",
|
|
52953
|
-
"origin",
|
|
52954
|
-
branch
|
|
52955
|
-
]), asVoid);
|
|
53146
|
+
yield* pushCurrentBranch;
|
|
53147
|
+
if (yield* hasPushableCommits) return yield* new GitError({ message: "Push completed but the branch still has unpushed commits." });
|
|
53148
|
+
if ((yield* currentBranch) !== (yield* defaultBranchName) && isNone(yield* branchPrUrl)) yield* createDraftPr;
|
|
52956
53149
|
}),
|
|
52957
53150
|
commits,
|
|
52958
53151
|
createWipCommit: fnUntraced(function* (message) {
|
|
52959
|
-
if (!(yield* hasWorktreeChanges)) return yield*
|
|
53152
|
+
if (!(yield* hasWorktreeChanges)) return yield* new GitError({ message: "No changes to commit." });
|
|
52960
53153
|
yield* pipe(git.string(config.cwd, ["add", "-A"]), asVoid);
|
|
53154
|
+
const subject = pipe(message, trim, (message) => isEmpty$1(message) ? "wip" : `wip: ${message}`);
|
|
52961
53155
|
yield* pipe(git.string(config.cwd, [
|
|
52962
53156
|
"commit",
|
|
52963
53157
|
"-m",
|
|
52964
|
-
|
|
53158
|
+
subject
|
|
52965
53159
|
]), asVoid);
|
|
52966
53160
|
}),
|
|
52967
53161
|
discardFile: fnUntraced(function* (filePath) {
|
|
@@ -52986,15 +53180,38 @@ var GitWorktree = class extends Service()("@deslop/git/service/GitWorktree", { m
|
|
|
52986
53180
|
]), asVoid);
|
|
52987
53181
|
}),
|
|
52988
53182
|
metadata: fnUntraced(function* (input) {
|
|
52989
|
-
const
|
|
53183
|
+
const branch = yield* currentBranch;
|
|
53184
|
+
const defaultBranch = yield* defaultBranchName;
|
|
53185
|
+
const base = input?.base ?? (yield* branchBase(defaultBranch));
|
|
52990
53186
|
return new GitReviewMetadata({
|
|
52991
53187
|
base,
|
|
52992
|
-
|
|
52993
|
-
|
|
53188
|
+
branch,
|
|
53189
|
+
commits: branch === defaultBranch ? yield* firstParentCommits : yield* commits(base),
|
|
53190
|
+
defaultBranch,
|
|
53191
|
+
dirty: yield* hasWorktreeChanges,
|
|
53192
|
+
prUrl: getOrUndefined$1(yield* branchPrUrl),
|
|
53193
|
+
unpushedCommits: yield* hasPushableCommits
|
|
52994
53194
|
});
|
|
52995
53195
|
}),
|
|
52996
|
-
|
|
53196
|
+
resolveReviewThread: fnUntraced(function* (threadId) {
|
|
53197
|
+
yield* pipe(ghString([
|
|
53198
|
+
"api",
|
|
53199
|
+
"graphql",
|
|
53200
|
+
"-f",
|
|
53201
|
+
`query=
|
|
53202
|
+
mutation(\$threadId: ID!) {
|
|
53203
|
+
resolveReviewThread(input: {threadId: \$threadId}) {
|
|
53204
|
+
thread {
|
|
53205
|
+
id
|
|
53206
|
+
}
|
|
53207
|
+
}
|
|
53208
|
+
}`,
|
|
53209
|
+
"-f",
|
|
53210
|
+
`threadId=${threadId}`
|
|
53211
|
+
]), asVoid);
|
|
53212
|
+
}),
|
|
52997
53213
|
reviewRangeDiffs,
|
|
53214
|
+
reviewThreads: pipe(prReviewThreads, catchTag("GitError", () => succeed$3(empty$13()))),
|
|
52998
53215
|
stageFile: fnUntraced(function* (filePath) {
|
|
52999
53216
|
yield* pipe(git.string(config.cwd, [
|
|
53000
53217
|
"add",
|
|
@@ -53010,7 +53227,6 @@ var GitWorktree = class extends Service()("@deslop/git/service/GitWorktree", { m
|
|
|
53010
53227
|
filePath
|
|
53011
53228
|
]), asVoid);
|
|
53012
53229
|
}),
|
|
53013
|
-
watchReviewDiffs: (scope) => pipe(worktreeChanges, mapEffect(() => pipe(reviewDiffs(scope), catchTag("GitError", () => succeed$3(empty$13())))), changesWith((left, right) => length(left) === length(right) && every(left, (leftDiff, index) => right[index] !== void 0 && leftDiff.filePath === right[index].filePath && leftDiff.status === right[index].status && leftDiff.patch === right[index].patch))),
|
|
53014
53230
|
watchReviewRangeDiffs: (input) => pipe(worktreeChanges, mapEffect(() => pipe(reviewRangeDiffs(input), catchTag("GitError", () => succeed$3(empty$13())))), changesWith((left, right) => length(left) === length(right) && every(left, (leftDiff, index) => right[index] !== void 0 && leftDiff.filePath === right[index].filePath && leftDiff.status === right[index].status && leftDiff.patch === right[index].patch)))
|
|
53015
53231
|
};
|
|
53016
53232
|
}) }) {
|
|
@@ -53201,7 +53417,7 @@ var Terminal = class extends Service()("@deslop/terminal/service/Terminal", { ma
|
|
|
53201
53417
|
title: ""
|
|
53202
53418
|
})), andThen(get(stateRef)));
|
|
53203
53419
|
function setPorts(ports) {
|
|
53204
|
-
return updateSome(stateRef, (state) => samePorts(state.ports, ports) ? none() : some({
|
|
53420
|
+
return updateSome(stateRef, (state) => samePorts(state.ports, ports) ? none() : some$1({
|
|
53205
53421
|
...state,
|
|
53206
53422
|
ports: [...ports]
|
|
53207
53423
|
}));
|
|
@@ -53483,6 +53699,10 @@ const TerminalSessionKey = Struct({
|
|
|
53483
53699
|
cwd: String$1,
|
|
53484
53700
|
sessionId: optional(String$1)
|
|
53485
53701
|
});
|
|
53702
|
+
const emptyReviewState = new ReviewState({
|
|
53703
|
+
comments: empty$13(),
|
|
53704
|
+
marks: empty$13()
|
|
53705
|
+
});
|
|
53486
53706
|
const AgentSessionKey = Struct({
|
|
53487
53707
|
cwd: String$1,
|
|
53488
53708
|
uuid: String$1
|
|
@@ -53510,13 +53730,7 @@ const RpcHandlers = RpcContracts.toLayer(gen(function* () {
|
|
|
53510
53730
|
return Buffer.from(`${root}\u0000${input.base}`, "utf8").toString("base64url");
|
|
53511
53731
|
});
|
|
53512
53732
|
const readReviewState = fnUntraced(function* (key) {
|
|
53513
|
-
return yield* pipe(reviewStore.get(`review-state/${key}`), map$4(getOrElse$1(() =>
|
|
53514
|
-
comments: empty$13(),
|
|
53515
|
-
marks: empty$13()
|
|
53516
|
-
}))), orElseSucceed(() => new ReviewState({
|
|
53517
|
-
comments: empty$13(),
|
|
53518
|
-
marks: empty$13()
|
|
53519
|
-
})));
|
|
53733
|
+
return yield* pipe(reviewStore.get(`review-state/${key}`), map$4(getOrElse$1(() => emptyReviewState)), orElseSucceed(() => emptyReviewState));
|
|
53520
53734
|
});
|
|
53521
53735
|
const reviewStates = yield* make$46({
|
|
53522
53736
|
idleTimeToLive: minutes(5),
|
|
@@ -53578,7 +53792,7 @@ const RpcHandlers = RpcContracts.toLayer(gen(function* () {
|
|
|
53578
53792
|
"projects.createWorktree": (payload) => git.createWorktree(payload),
|
|
53579
53793
|
"projects.deleteWorktree": (payload) => git.deleteWorktree(payload),
|
|
53580
53794
|
"projects.watch": () => unwrap$1(pipe(get(git.projects), map$4((projects) => pipe(make$43(projects), concat(drop(1)(changes(git.projects))))))),
|
|
53581
|
-
"review.comments.
|
|
53795
|
+
"review.comments.resolve": (payload) => updateReviewState(payload, (state) => {
|
|
53582
53796
|
const key = commentKey(payload);
|
|
53583
53797
|
return new ReviewState({
|
|
53584
53798
|
comments: filter$2(state.comments, (comment) => commentKey(comment) !== key),
|
|
@@ -53588,7 +53802,10 @@ const RpcHandlers = RpcContracts.toLayer(gen(function* () {
|
|
|
53588
53802
|
"review.comments.save": (payload) => updateReviewState(payload, (state) => {
|
|
53589
53803
|
const key = commentKey(payload.comment);
|
|
53590
53804
|
return new ReviewState({
|
|
53591
|
-
comments: append$1(filter$2(state.comments, (comment) => commentKey(comment) !== key),
|
|
53805
|
+
comments: append$1(filter$2(state.comments, (comment) => commentKey(comment) !== key), new ReviewComment({
|
|
53806
|
+
...payload.comment,
|
|
53807
|
+
resolved: false
|
|
53808
|
+
})),
|
|
53592
53809
|
marks: state.marks
|
|
53593
53810
|
});
|
|
53594
53811
|
}),
|
|
@@ -53598,6 +53815,8 @@ const RpcHandlers = RpcContracts.toLayer(gen(function* () {
|
|
|
53598
53815
|
}))),
|
|
53599
53816
|
"review.createWipCommit": (payload) => pipe(get$6(gitWorktrees, payload.cwd), flatMap$2((worktree) => worktree.createWipCommit(payload.message))),
|
|
53600
53817
|
"review.discardFile": (payload) => pipe(get$6(gitWorktrees, payload.cwd), flatMap$2((worktree) => worktree.discardFile(payload.filePath))),
|
|
53818
|
+
"review.githubThreads": (payload) => pipe(get$6(gitWorktrees, payload.cwd), flatMap$2((worktree) => worktree.reviewThreads)),
|
|
53819
|
+
"review.githubThreads.resolve": (payload) => pipe(get$6(gitWorktrees, payload.cwd), flatMap$2((worktree) => worktree.resolveReviewThread(payload.threadId))),
|
|
53601
53820
|
"review.metadata": (payload) => pipe(get$6(gitWorktrees, payload.cwd), flatMap$2((worktree) => worktree.metadata({ base: payload.base }))),
|
|
53602
53821
|
"review.stageFile": (payload) => pipe(get$6(gitWorktrees, payload.cwd), flatMap$2((worktree) => worktree.stageFile(payload.filePath))),
|
|
53603
53822
|
"review.state.mark": (payload) => updateReviewState(payload, (state) => {
|
|
@@ -53616,7 +53835,6 @@ const RpcHandlers = RpcContracts.toLayer(gen(function* () {
|
|
|
53616
53835
|
}),
|
|
53617
53836
|
"review.state.watch": (payload) => unwrap$1(pipe(reviewStateKey(payload), flatMap$2((key) => get$6(reviewStates, key)), flatMap$2((ref) => pipe(get(ref), map$4((state) => concat(drop(1)(changes(ref)))(make$43(state))))))),
|
|
53618
53837
|
"review.unstageFile": (payload) => pipe(get$6(gitWorktrees, payload.cwd), flatMap$2((worktree) => worktree.unstageFile(payload.filePath))),
|
|
53619
|
-
"review.watch": (payload) => unwrap$1(pipe(get$6(gitWorktrees, payload.cwd), map$4((worktree) => worktree.watchReviewDiffs(payload.scope)))),
|
|
53620
53838
|
"review.watchRange": (payload) => unwrap$1(pipe(get$6(gitWorktrees, payload.cwd), map$4((worktree) => worktree.watchReviewRangeDiffs({
|
|
53621
53839
|
from: payload.from,
|
|
53622
53840
|
to: payload.to
|
|
@@ -67202,7 +67420,7 @@ const isSampled = (traceFlags) => (traceFlags & TraceFlags.SAMPLED) === TraceFla
|
|
|
67202
67420
|
const getOtelParent = (tracer, context, annotations) => {
|
|
67203
67421
|
const otelParent = tracer.getSpan(context)?.spanContext();
|
|
67204
67422
|
if (!otelParent) return none();
|
|
67205
|
-
return some(externalSpan({
|
|
67423
|
+
return some$1(externalSpan({
|
|
67206
67424
|
spanId: otelParent.spanId,
|
|
67207
67425
|
traceId: otelParent.traceId,
|
|
67208
67426
|
sampled: (otelParent.traceFlags & 1) === 1,
|