@deslop/workbench 0.0.330 → 0.0.332
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/agent-ksblBy0b.js +2 -0
- package/dist/client/assets/{agent-BAplunWJ.js → agent-qBUgLqez.js} +1 -1
- package/dist/client/assets/{button-DJfQFnBl.js → button-Cl3QGxsE.js} +11 -11
- package/dist/client/assets/{diff-5y5Ly0fZ.js → diff-DRdkZUfM.js} +2 -2
- package/dist/client/assets/{diff-Cu8yhVQs.js → diff-V_u66cov.js} +24 -24
- package/dist/client/assets/{external-link-DSkEzLiB.js → external-link-CHsqlplI.js} +1 -1
- package/dist/client/assets/{fallbacks-2XEEl4BI.js → fallbacks-DRWx0EQv.js} +1 -1
- package/dist/client/assets/{index-CU4FmmbE.js → index-COqgQoHe.js} +3 -3
- package/dist/client/assets/{input-group-tkTwlIFp.js → input-group-DfylGHnW.js} +2 -2
- package/dist/client/assets/loader-circle-G9WKrfSd.js +1 -0
- package/dist/client/assets/{portless-DRWo8KFX.js → portless-CIQUkBPx.js} +1 -1
- package/dist/client/assets/portless-M280rnul.js +2 -0
- package/dist/client/assets/{resizable-BICft2JP.js → resizable-bJdqT1JF.js} +1 -1
- package/dist/client/assets/route-CzD0EIT6.js +2 -0
- package/dist/client/assets/route-JiIT6ta2.js +45 -0
- package/dist/client/assets/{run-C08WVAIM.js → run-JZrpFZA0.js} +1 -1
- package/dist/client/assets/run-nZsFjagi.js +2 -0
- package/dist/client/assets/state-DG0Oc1Jw.js +2 -0
- package/dist/client/assets/{terminal-CPpKsotd.js → terminal-BehqmxVT.js} +2 -2
- package/dist/client/assets/{terminal-BTXMxFEq.js → terminal-CRGNH_jn.js} +1 -1
- package/dist/client/assets/terminal-DtCniSNL.js +2 -0
- package/dist/client/assets/{triangle-alert-DrGIVhEI.js → triangle-alert-D2wmXkyn.js} +1 -1
- package/dist/client/index.html +11 -11
- package/dist/{execAsync-Gqapz_ET.mjs → execAsync-CgtnVVso.mjs} +1 -1
- package/dist/{getMachineId-bsd-D2D8E0zh.mjs → getMachineId-bsd-DYUtJhPR.mjs} +2 -2
- package/dist/{getMachineId-darwin-DD7WkQgq.mjs → getMachineId-darwin-BYjMzwa2.mjs} +2 -2
- package/dist/{getMachineId-linux-NsJbNTda.mjs → getMachineId-linux-7FQ_TPIw.mjs} +1 -1
- package/dist/{getMachineId-unsupported-BdKw63O1.mjs → getMachineId-unsupported-CqYci84U.mjs} +1 -1
- package/dist/{getMachineId-win-CpX0o49t.mjs → getMachineId-win-BxTTz_Ds.mjs} +2 -2
- package/dist/server.js +239 -230
- package/package.json +3 -3
- package/dist/client/assets/agent-DORiXY9q.js +0 -2
- package/dist/client/assets/loader-circle-vwjgn9E1.js +0 -1
- package/dist/client/assets/portless-Cn_0jtX4.js +0 -2
- package/dist/client/assets/route-D-VRm0UM.js +0 -2
- package/dist/client/assets/route-DAzFV54O.js +0 -45
- package/dist/client/assets/run-Dx2tn3Qe.js +0 -2
- package/dist/client/assets/state-DrPxOHMO.js +0 -2
- package/dist/client/assets/terminal-BGn5gevX.js +0 -2
package/dist/server.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
1
|
+
#!/usr/bin/env -S node --max-old-space-size=8192
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import * as Http from "node:http";
|
|
4
4
|
import { createServer } from "node:http";
|
|
@@ -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$
|
|
5445
|
+
const filter$2 = /*#__PURE__*/ dual(2, (self, predicate) => isNone(self) ? none() : predicate(self.value) ? some$1(self.value) : none());
|
|
5446
5446
|
//#endregion
|
|
5447
5447
|
//#region ../../node_modules/.pnpm/effect@4.0.0-beta.74/node_modules/effect/dist/Result.js
|
|
5448
5448
|
/**
|
|
@@ -6034,6 +6034,61 @@ const Array$1 = globalThis.Array;
|
|
|
6034
6034
|
*/
|
|
6035
6035
|
const allocate = (n) => new Array$1(n);
|
|
6036
6036
|
/**
|
|
6037
|
+
* Creates a `NonEmptyArray` of length `n` where element `i` is computed by `f(i)`.
|
|
6038
|
+
*
|
|
6039
|
+
* **When to use**
|
|
6040
|
+
*
|
|
6041
|
+
* Use when you need an array whose values depend on the index.
|
|
6042
|
+
* - `n` is normalized to an integer >= 1 — always returns at least one element.
|
|
6043
|
+
* - Dual: `Array.makeBy(5, f)` or `pipe(5, Array.makeBy(f))`.
|
|
6044
|
+
*
|
|
6045
|
+
* **Example** (Generating values from indices)
|
|
6046
|
+
*
|
|
6047
|
+
* ```ts
|
|
6048
|
+
* import { Array } from "effect"
|
|
6049
|
+
*
|
|
6050
|
+
* const result = Array.makeBy(5, (n) => n * 2)
|
|
6051
|
+
* console.log(result) // [0, 2, 4, 6, 8]
|
|
6052
|
+
* ```
|
|
6053
|
+
*
|
|
6054
|
+
* @see {@link range} — create a range of integers
|
|
6055
|
+
* @see {@link replicate} — repeat a single value
|
|
6056
|
+
*
|
|
6057
|
+
* @category constructors
|
|
6058
|
+
* @since 2.0.0
|
|
6059
|
+
*/
|
|
6060
|
+
const makeBy = /*#__PURE__*/ dual(2, (n, f) => {
|
|
6061
|
+
const max = Math.max(1, Math.floor(n));
|
|
6062
|
+
const out = new Array$1(max);
|
|
6063
|
+
for (let i = 0; i < max; i++) out[i] = f(i);
|
|
6064
|
+
return out;
|
|
6065
|
+
});
|
|
6066
|
+
/**
|
|
6067
|
+
* Creates a `NonEmptyArray` containing a range of integers, inclusive on both
|
|
6068
|
+
* ends.
|
|
6069
|
+
*
|
|
6070
|
+
* **When to use**
|
|
6071
|
+
*
|
|
6072
|
+
* Use when you need a sequence of consecutive integers.
|
|
6073
|
+
* - If `start > end`, returns `[start]`.
|
|
6074
|
+
* - Always returns a `NonEmptyArray`.
|
|
6075
|
+
*
|
|
6076
|
+
* **Example** (Creating a range)
|
|
6077
|
+
*
|
|
6078
|
+
* ```ts
|
|
6079
|
+
* import { Array } from "effect"
|
|
6080
|
+
*
|
|
6081
|
+
* const result = Array.range(1, 3)
|
|
6082
|
+
* console.log(result) // [1, 2, 3]
|
|
6083
|
+
* ```
|
|
6084
|
+
*
|
|
6085
|
+
* @see {@link makeBy} — generate values from a function
|
|
6086
|
+
*
|
|
6087
|
+
* @category constructors
|
|
6088
|
+
* @since 2.0.0
|
|
6089
|
+
*/
|
|
6090
|
+
const range = (start, end) => start <= end ? makeBy(end - start + 1, (i) => start + i) : [start];
|
|
6091
|
+
/**
|
|
6037
6092
|
* Converts an `Iterable` to an `Array`.
|
|
6038
6093
|
*
|
|
6039
6094
|
* **When to use**
|
|
@@ -6535,6 +6590,35 @@ const drop$1 = /*#__PURE__*/ dual(2, (self, n) => {
|
|
|
6535
6590
|
return input.slice(clamp(n, input), input.length);
|
|
6536
6591
|
});
|
|
6537
6592
|
/**
|
|
6593
|
+
* Removes the last `n` elements, creating a new array.
|
|
6594
|
+
*
|
|
6595
|
+
* **When to use**
|
|
6596
|
+
*
|
|
6597
|
+
* Use to remove the last `n` elements from an iterable.
|
|
6598
|
+
*
|
|
6599
|
+
* **Details**
|
|
6600
|
+
*
|
|
6601
|
+
* `n` is clamped to `[0, length]`.
|
|
6602
|
+
*
|
|
6603
|
+
* **Example** (Dropping from the end)
|
|
6604
|
+
*
|
|
6605
|
+
* ```ts
|
|
6606
|
+
* import { Array } from "effect"
|
|
6607
|
+
*
|
|
6608
|
+
* console.log(Array.dropRight([1, 2, 3, 4, 5], 2)) // [1, 2, 3]
|
|
6609
|
+
* ```
|
|
6610
|
+
*
|
|
6611
|
+
* @see {@link drop} — remove from the start
|
|
6612
|
+
* @see {@link takeRight} — keep from the end
|
|
6613
|
+
*
|
|
6614
|
+
* @category getters
|
|
6615
|
+
* @since 2.0.0
|
|
6616
|
+
*/
|
|
6617
|
+
const dropRight = /*#__PURE__*/ dual(2, (self, n) => {
|
|
6618
|
+
const input = fromIterable$2(self);
|
|
6619
|
+
return input.slice(0, input.length - clamp(n, input));
|
|
6620
|
+
});
|
|
6621
|
+
/**
|
|
6538
6622
|
* Reverses an iterable into a new array.
|
|
6539
6623
|
*
|
|
6540
6624
|
* **When to use**
|
|
@@ -6895,7 +6979,7 @@ const getSuccesses = (self) => {
|
|
|
6895
6979
|
* @category filtering
|
|
6896
6980
|
* @since 2.0.0
|
|
6897
6981
|
*/
|
|
6898
|
-
const filter$
|
|
6982
|
+
const filter$1 = /*#__PURE__*/ dual(2, (self, predicate) => {
|
|
6899
6983
|
const as = fromIterable$2(self);
|
|
6900
6984
|
const out = [];
|
|
6901
6985
|
for (let i = 0; i < as.length; i++) if (predicate(as[i], i)) out.push(as[i]);
|
|
@@ -19599,7 +19683,7 @@ function transformOptional(f) {
|
|
|
19599
19683
|
*/
|
|
19600
19684
|
function withDefault$1(defaultValue) {
|
|
19601
19685
|
return new Getter((o) => {
|
|
19602
|
-
const filtered = filter$
|
|
19686
|
+
const filtered = filter$2(o, isNotUndefined);
|
|
19603
19687
|
return isSome(filtered) ? succeed$3(filtered) : mapEager(defaultValue, some$1);
|
|
19604
19688
|
});
|
|
19605
19689
|
}
|
|
@@ -23209,7 +23293,7 @@ const takeAll$2 = (self) => takeN(self, self.length);
|
|
|
23209
23293
|
* @category elements
|
|
23210
23294
|
* @since 4.0.0
|
|
23211
23295
|
*/
|
|
23212
|
-
const take$
|
|
23296
|
+
const take$3 = (self) => {
|
|
23213
23297
|
if (!self.head) return Empty$2;
|
|
23214
23298
|
const message = self.head.array[self.head.offset];
|
|
23215
23299
|
if (self.head.mutable) self.head.array[self.head.offset] = void 0;
|
|
@@ -23263,7 +23347,7 @@ const take$4 = (self) => {
|
|
|
23263
23347
|
* @category mutations
|
|
23264
23348
|
* @since 4.0.0
|
|
23265
23349
|
*/
|
|
23266
|
-
const filter
|
|
23350
|
+
const filter = (self, f) => {
|
|
23267
23351
|
const array = [];
|
|
23268
23352
|
let chunk = self.head;
|
|
23269
23353
|
while (chunk) {
|
|
@@ -23329,7 +23413,7 @@ const filter$1 = (self, f) => {
|
|
|
23329
23413
|
* @category mutations
|
|
23330
23414
|
* @since 4.0.0
|
|
23331
23415
|
*/
|
|
23332
|
-
const remove$5 = (self, value) => filter
|
|
23416
|
+
const remove$5 = (self, value) => filter(self, (v) => v !== value);
|
|
23333
23417
|
//#endregion
|
|
23334
23418
|
//#region ../../node_modules/.pnpm/effect@4.0.0-beta.74/node_modules/effect/dist/MutableRef.js
|
|
23335
23419
|
const TypeId$38 = "~effect/MutableRef";
|
|
@@ -23911,7 +23995,7 @@ const unsubscribe = (self) => uninterruptible(withFiber((state) => {
|
|
|
23911
23995
|
* @category subscriptions
|
|
23912
23996
|
* @since 4.0.0
|
|
23913
23997
|
*/
|
|
23914
|
-
const take$
|
|
23998
|
+
const take$2 = (self) => suspend$2(() => {
|
|
23915
23999
|
if (self.shutdownFlag.current) return interrupt$1;
|
|
23916
24000
|
if (self.replayWindow.remaining > 0) return succeed$3(self.replayWindow.take());
|
|
23917
24001
|
const message = self.pollers.length === 0 ? self.subscription.poll() : Empty$2;
|
|
@@ -24657,7 +24741,7 @@ var BackPressureStrategy = class {
|
|
|
24657
24741
|
onPubSubEmptySpaceUnsafe(pubsub, subscribers) {
|
|
24658
24742
|
let keepPolling = true;
|
|
24659
24743
|
while (keepPolling && !pubsub.isFull()) {
|
|
24660
|
-
const publisher = take$
|
|
24744
|
+
const publisher = take$3(this.publishers);
|
|
24661
24745
|
if (publisher === Empty$2) keepPolling = false;
|
|
24662
24746
|
else {
|
|
24663
24747
|
const [value, deferred] = publisher;
|
|
@@ -24696,7 +24780,7 @@ var BackPressureStrategy = class {
|
|
|
24696
24780
|
}
|
|
24697
24781
|
}
|
|
24698
24782
|
removeUnsafe(deferred) {
|
|
24699
|
-
filter
|
|
24783
|
+
filter(this.publishers, ([_, d]) => d !== deferred);
|
|
24700
24784
|
}
|
|
24701
24785
|
};
|
|
24702
24786
|
/**
|
|
@@ -24769,7 +24853,7 @@ var DroppingStrategy = class {
|
|
|
24769
24853
|
const strategyCompletePollersUnsafe = (strategy, pubsub, subscribers, subscription, pollers) => {
|
|
24770
24854
|
let keepPolling = true;
|
|
24771
24855
|
while (keepPolling && !subscription.isEmpty()) {
|
|
24772
|
-
const poller = take$
|
|
24856
|
+
const poller = take$3(pollers);
|
|
24773
24857
|
if (poller === Empty$2) {
|
|
24774
24858
|
removeSubscribers(subscribers, subscription, pollers);
|
|
24775
24859
|
if (pollers.length === 0) keepPolling = false;
|
|
@@ -25155,7 +25239,7 @@ const offer = (self, message) => suspend$3(() => {
|
|
|
25155
25239
|
}
|
|
25156
25240
|
return offerRemainingSingle(self, message);
|
|
25157
25241
|
case "sliding":
|
|
25158
|
-
take$
|
|
25242
|
+
take$3(self.messages);
|
|
25159
25243
|
append(self.messages, message);
|
|
25160
25244
|
return exitTrue;
|
|
25161
25245
|
}
|
|
@@ -25198,7 +25282,7 @@ const offerUnsafe = (self, message) => {
|
|
|
25198
25282
|
if (self.state._tag !== "Open") return false;
|
|
25199
25283
|
else if (self.messages.length >= self.capacity) {
|
|
25200
25284
|
if (self.strategy === "sliding") {
|
|
25201
|
-
take$
|
|
25285
|
+
take$3(self.messages);
|
|
25202
25286
|
append(self.messages, message);
|
|
25203
25287
|
return true;
|
|
25204
25288
|
} else if (self.capacity <= 0 && self.state.takers.size > 0) {
|
|
@@ -25561,7 +25645,7 @@ const takeBetween = (self, min, max) => suspend$3(() => takeBetweenUnsafe(self,
|
|
|
25561
25645
|
* @category taking
|
|
25562
25646
|
* @since 2.0.0
|
|
25563
25647
|
*/
|
|
25564
|
-
const take$
|
|
25648
|
+
const take$1 = (self) => suspend$3(() => takeUnsafe(self) ?? andThen$1(awaitTake(self), take$1(self)));
|
|
25565
25649
|
/**
|
|
25566
25650
|
* Attempts to take one message from the queue synchronously.
|
|
25567
25651
|
*
|
|
@@ -25603,14 +25687,14 @@ const take$2 = (self) => suspend$3(() => takeUnsafe(self) ?? andThen$1(awaitTake
|
|
|
25603
25687
|
const takeUnsafe = (self) => {
|
|
25604
25688
|
if (self.state._tag === "Done") return self.state.exit;
|
|
25605
25689
|
if (self.messages.length > 0) {
|
|
25606
|
-
const message = take$
|
|
25690
|
+
const message = take$3(self.messages);
|
|
25607
25691
|
releaseCapacity(self);
|
|
25608
25692
|
return exitSucceed(message);
|
|
25609
25693
|
} else if (self.capacity <= 0 && self.state.offers.size > 0) {
|
|
25610
25694
|
self.capacity = 1;
|
|
25611
25695
|
releaseCapacity(self);
|
|
25612
25696
|
self.capacity = 0;
|
|
25613
|
-
const message = take$
|
|
25697
|
+
const message = take$3(self.messages);
|
|
25614
25698
|
releaseCapacity(self);
|
|
25615
25699
|
return exitSucceed(message);
|
|
25616
25700
|
}
|
|
@@ -25682,7 +25766,7 @@ const takeBetweenUnsafe = (self, min, max) => {
|
|
|
25682
25766
|
self.capacity = 1;
|
|
25683
25767
|
releaseCapacity(self);
|
|
25684
25768
|
self.capacity = 0;
|
|
25685
|
-
const messages = [take$
|
|
25769
|
+
const messages = [take$3(self.messages)];
|
|
25686
25770
|
releaseCapacity(self);
|
|
25687
25771
|
return exitSucceed(messages);
|
|
25688
25772
|
}
|
|
@@ -26841,7 +26925,7 @@ const mapEffectConcurrent = (self, f, options) => fromTransformBracket(fnUntrace
|
|
|
26841
26925
|
} else {
|
|
26842
26926
|
const effects = yield* bounded(concurrencyN - 2);
|
|
26843
26927
|
yield* addFinalizer$1(forkedScope, shutdown(queue));
|
|
26844
|
-
yield* take$
|
|
26928
|
+
yield* take$1(effects).pipe(flatten$1, flatMap$2((value) => offer(queue, value)), forever({ disableYield: true }), catchCause$1((cause) => failCause$1(queue, cause)), forkIn(forkedScope));
|
|
26845
26929
|
let errorCause;
|
|
26846
26930
|
const onExit = (exit) => {
|
|
26847
26931
|
if (exit._tag === "Success") return;
|
|
@@ -26856,7 +26940,7 @@ const mapEffectConcurrent = (self, f, options) => fromTransformBracket(fnUntrace
|
|
|
26856
26940
|
return offer(effects, join$1(fiber));
|
|
26857
26941
|
}), forever({ disableYield: true }), catchCause$1((cause) => offer(effects, failCause$3(cause)).pipe(andThen(failCause$1(effects, cause)))), forkIn(forkedScope));
|
|
26858
26942
|
}
|
|
26859
|
-
return take$
|
|
26943
|
+
return take$1(queue);
|
|
26860
26944
|
}));
|
|
26861
26945
|
/**
|
|
26862
26946
|
* Maps each output element to a channel and flattens the child channel
|
|
@@ -26966,47 +27050,6 @@ const flattenArray = (self) => transformPull$1(self, (pull) => {
|
|
|
26966
27050
|
}));
|
|
26967
27051
|
});
|
|
26968
27052
|
/**
|
|
26969
|
-
* Filters arrays of elements emitted by a channel, applying the filter
|
|
26970
|
-
* to each element within the arrays and only emitting non-empty filtered arrays.
|
|
26971
|
-
*
|
|
26972
|
-
* **Example** (Filtering array output)
|
|
26973
|
-
*
|
|
26974
|
-
* ```ts
|
|
26975
|
-
* import { Array, Channel } from "effect"
|
|
26976
|
-
*
|
|
26977
|
-
* const nonEmptyArrayPredicate = Array.isReadonlyArrayNonEmpty
|
|
26978
|
-
*
|
|
26979
|
-
* // Create a channel that outputs arrays of mixed data
|
|
26980
|
-
* const arrayChannel = Channel.fromIterable([
|
|
26981
|
-
* Array.make(1, 2, 3, 4, 5),
|
|
26982
|
-
* Array.make(6, 7, 8, 9, 10),
|
|
26983
|
-
* Array.make(11, 12, 13, 14, 15)
|
|
26984
|
-
* ]).pipe(Channel.filter(nonEmptyArrayPredicate))
|
|
26985
|
-
*
|
|
26986
|
-
* // Filter arrays to keep only even numbers
|
|
26987
|
-
* const evenArraysChannel = Channel.filterArray(arrayChannel, (n) => n % 2 === 0)
|
|
26988
|
-
* // Outputs: [2, 4], [6, 8, 10], [12, 14]
|
|
26989
|
-
* // Note: Only non-empty filtered arrays are emitted
|
|
26990
|
-
*
|
|
26991
|
-
* // Arrays that would become empty after filtering are discarded entirely
|
|
26992
|
-
* const oddChannel = Channel.fromIterable([
|
|
26993
|
-
* Array.make(1, 3, 5),
|
|
26994
|
-
* Array.make(2, 4),
|
|
26995
|
-
* Array.make(7, 9)
|
|
26996
|
-
* ]).pipe(Channel.filter(nonEmptyArrayPredicate))
|
|
26997
|
-
* const filteredOddChannel = Channel.filterArray(oddChannel, (n) => n % 2 === 0)
|
|
26998
|
-
* // Outputs: [2, 4] (the arrays [1,3,5] and [7,9] are discarded)
|
|
26999
|
-
* ```
|
|
27000
|
-
*
|
|
27001
|
-
* @category filtering
|
|
27002
|
-
* @since 4.0.0
|
|
27003
|
-
*/
|
|
27004
|
-
const filterArray = /*#__PURE__*/ dual(2, (self, predicate) => transformPull$1(self, (pull) => succeed$3(flatMap$2(pull, function loop(arr) {
|
|
27005
|
-
const passes = [];
|
|
27006
|
-
for (let i = 0; i < arr.length; i++) if (predicate(arr[i])) passes.push(arr[i]);
|
|
27007
|
-
return isReadonlyArrayNonEmpty(passes) ? succeed$3(passes) : flatMap$2(pull, loop);
|
|
27008
|
-
}))));
|
|
27009
|
-
/**
|
|
27010
27053
|
* Catches any cause of failure from the channel and allows recovery by
|
|
27011
27054
|
* creating a new channel based on the caught cause.
|
|
27012
27055
|
*
|
|
@@ -27175,7 +27218,7 @@ const mergeAll = /*#__PURE__*/ dual(2, (channels, { bufferSize = 16, concurrency
|
|
|
27175
27218
|
fibers.add(fiber);
|
|
27176
27219
|
}
|
|
27177
27220
|
}).pipe(catchCause$1((cause) => doneLatch.whenOpen(failCause$1(queue, cause))), forkIn(forkedScope));
|
|
27178
|
-
return take$
|
|
27221
|
+
return take$1(queue);
|
|
27179
27222
|
})));
|
|
27180
27223
|
/**
|
|
27181
27224
|
* Returns a new channel, which is the merge of this channel and the specified
|
|
@@ -27224,7 +27267,7 @@ const merge$2 = /*#__PURE__*/ dual((args) => isChannel(args[0]) && isChannel(arg
|
|
|
27224
27267
|
const runSide = (side, channel, scope) => toTransform(channel)(upstream, scope).pipe(flatMap$2((pull) => pull.pipe(flatMap$2((value) => offer(queue, value)), forever)), onError((cause) => andThen(close(scope, doneExitFromCause(cause)), onExit(side, cause))), forkIn(forkedScope));
|
|
27225
27268
|
yield* runSide("left", left, forkUnsafe(forkedScope));
|
|
27226
27269
|
yield* runSide("right", right, forkUnsafe(forkedScope));
|
|
27227
|
-
return take$
|
|
27270
|
+
return take$1(queue);
|
|
27228
27271
|
})));
|
|
27229
27272
|
/**
|
|
27230
27273
|
* Splits upstream string chunks into lines, recognizing `\n`, `\r\n`, and
|
|
@@ -27464,35 +27507,6 @@ const runWith = (self, f, onHalt) => suspend$2(() => {
|
|
|
27464
27507
|
*/
|
|
27465
27508
|
const provideContext$1 = /*#__PURE__*/ dual(2, (self, context) => fromTransform$1((upstream, scope) => map$4(provideContext$2(toTransform(self)(upstream, scope), context), provideContext$2(context))));
|
|
27466
27509
|
/**
|
|
27467
|
-
* Runs a channel and discards all output elements, returning only the final result.
|
|
27468
|
-
*
|
|
27469
|
-
* **Example** (Draining channel output at runtime)
|
|
27470
|
-
*
|
|
27471
|
-
* ```ts
|
|
27472
|
-
* import { Channel, Data } from "effect"
|
|
27473
|
-
*
|
|
27474
|
-
* class DrainError extends Data.TaggedError("DrainError")<{
|
|
27475
|
-
* readonly stage: string
|
|
27476
|
-
* }> {}
|
|
27477
|
-
*
|
|
27478
|
-
* // Create a channel that outputs elements and completes with a result
|
|
27479
|
-
* const resultChannel = Channel.fromIterable([1, 2, 3])
|
|
27480
|
-
* const completedChannel = Channel.concatWith(
|
|
27481
|
-
* resultChannel,
|
|
27482
|
-
* () => Channel.succeed("completed")
|
|
27483
|
-
* )
|
|
27484
|
-
*
|
|
27485
|
-
* // Drain all elements and get only the final result
|
|
27486
|
-
* const drainEffect = Channel.runDrain(completedChannel)
|
|
27487
|
-
*
|
|
27488
|
-
* // Effect.runSync(drainEffect) // Returns: "completed"
|
|
27489
|
-
* ```
|
|
27490
|
-
*
|
|
27491
|
-
* @category execution
|
|
27492
|
-
* @since 2.0.0
|
|
27493
|
-
*/
|
|
27494
|
-
const runDrain$1 = (self) => runWith(self, (pull) => forever(pull, { disableYield: true }));
|
|
27495
|
-
/**
|
|
27496
27510
|
* Runs a channel and applies an effect to each output element.
|
|
27497
27511
|
*
|
|
27498
27512
|
* **Example** (Running effects for each output)
|
|
@@ -27711,7 +27725,7 @@ const drain = /*#__PURE__*/ fromTransform((upstream) => catchDone(forever(upstre
|
|
|
27711
27725
|
* @category collecting
|
|
27712
27726
|
* @since 2.0.0
|
|
27713
27727
|
*/
|
|
27714
|
-
const take
|
|
27728
|
+
const take = (n) => fromTransform((upstream) => {
|
|
27715
27729
|
const taken = [];
|
|
27716
27730
|
if (n <= 0) return succeed$3([taken]);
|
|
27717
27731
|
let leftover = void 0;
|
|
@@ -28364,6 +28378,56 @@ const release = (self, key, entry) => withFiber((fiber) => {
|
|
|
28364
28378
|
})), runForkWith(fiber.context), runIn(self.scope));
|
|
28365
28379
|
return void_$1;
|
|
28366
28380
|
});
|
|
28381
|
+
/**
|
|
28382
|
+
* Invalidates and removes a specific key from the RcMap. If the resource is not
|
|
28383
|
+
* currently in use (reference count is 0), it will be immediately released.
|
|
28384
|
+
*
|
|
28385
|
+
* **When to use**
|
|
28386
|
+
*
|
|
28387
|
+
* Use to remove a resource by key so the next access performs a fresh lookup.
|
|
28388
|
+
*
|
|
28389
|
+
* **Example** (Invalidating a resource)
|
|
28390
|
+
*
|
|
28391
|
+
* ```ts
|
|
28392
|
+
* import { Effect, RcMap } from "effect"
|
|
28393
|
+
*
|
|
28394
|
+
* Effect.gen(function*() {
|
|
28395
|
+
* const map = yield* RcMap.make({
|
|
28396
|
+
* lookup: (key: string) =>
|
|
28397
|
+
* Effect.acquireRelease(
|
|
28398
|
+
* Effect.succeed(`Resource: ${key}`),
|
|
28399
|
+
* () => Effect.log(`Released ${key}`)
|
|
28400
|
+
* )
|
|
28401
|
+
* })
|
|
28402
|
+
*
|
|
28403
|
+
* // Get a resource
|
|
28404
|
+
* yield* RcMap.get(map, "cache")
|
|
28405
|
+
*
|
|
28406
|
+
* // Invalidate the resource - it will be removed from the map
|
|
28407
|
+
* // and released if no longer in use
|
|
28408
|
+
* yield* RcMap.invalidate(map, "cache")
|
|
28409
|
+
*
|
|
28410
|
+
* // Next access will create a new resource
|
|
28411
|
+
* yield* RcMap.get(map, "cache")
|
|
28412
|
+
* }).pipe(Effect.scoped)
|
|
28413
|
+
* ```
|
|
28414
|
+
*
|
|
28415
|
+
* @see {@link get} for acquiring or retaining the resource for a key
|
|
28416
|
+
* @see {@link touch} for extending the idle lifetime without removing the entry
|
|
28417
|
+
*
|
|
28418
|
+
* @category combinators
|
|
28419
|
+
* @since 3.13.0
|
|
28420
|
+
*/
|
|
28421
|
+
const invalidate = /*#__PURE__*/ dual(2, /*#__PURE__*/ fnUntraced(function* (self, key) {
|
|
28422
|
+
if (self.state._tag === "Closed") return;
|
|
28423
|
+
const o = get$7(self.state.map, key);
|
|
28424
|
+
if (o._tag === "None") return;
|
|
28425
|
+
const entry = o.value;
|
|
28426
|
+
remove$4(self.state.map, key);
|
|
28427
|
+
if (entry.refCount > 0) return;
|
|
28428
|
+
if (entry.fiber) yield* interrupt(entry.fiber);
|
|
28429
|
+
yield* close(entry.scope, void_$2);
|
|
28430
|
+
}, uninterruptible));
|
|
28367
28431
|
//#endregion
|
|
28368
28432
|
//#region ../../node_modules/.pnpm/effect@4.0.0-beta.74/node_modules/effect/dist/internal/rcRef.js
|
|
28369
28433
|
const TypeId$30 = "~effect/RcRef";
|
|
@@ -29313,30 +29377,6 @@ const concat = /*#__PURE__*/ dual(2, (self, that) => flatten(fromArray([self, th
|
|
|
29313
29377
|
* @since 2.0.0
|
|
29314
29378
|
*/
|
|
29315
29379
|
const merge$1 = /*#__PURE__*/ dual((args) => isStream(args[0]) && isStream(args[1]), (self, that, options) => fromChannel(merge$2(toChannel(self), toChannel(that), options)));
|
|
29316
|
-
/**
|
|
29317
|
-
* Filters a stream to the elements that satisfy a predicate.
|
|
29318
|
-
*
|
|
29319
|
-
* **Example** (Filtering stream values)
|
|
29320
|
-
*
|
|
29321
|
-
* ```ts
|
|
29322
|
-
* import { Console, Effect, Stream } from "effect"
|
|
29323
|
-
*
|
|
29324
|
-
* const program = Effect.gen(function*() {
|
|
29325
|
-
* const stream = Stream.make(1, 2, 3, 4).pipe(
|
|
29326
|
-
* Stream.filter((n) => n % 2 === 0)
|
|
29327
|
-
* )
|
|
29328
|
-
* const values = yield* Stream.runCollect(stream)
|
|
29329
|
-
* yield* Console.log(values)
|
|
29330
|
-
* })
|
|
29331
|
-
*
|
|
29332
|
-
* Effect.runPromise(program)
|
|
29333
|
-
* // Output: [ 2, 4 ]
|
|
29334
|
-
* ```
|
|
29335
|
-
*
|
|
29336
|
-
* @category filtering
|
|
29337
|
-
* @since 2.0.0
|
|
29338
|
-
*/
|
|
29339
|
-
const filter = /*#__PURE__*/ dual(2, (self, predicate) => fromChannel(filterArray(toChannel(self), predicate)));
|
|
29340
29380
|
const catch_ = /*#__PURE__*/ dual(2, (self, f) => fromChannel(catch_$1(self.channel, (error) => f(error).channel)));
|
|
29341
29381
|
/**
|
|
29342
29382
|
* Turns typed failures into defects, making the stream infallible.
|
|
@@ -29364,30 +29404,6 @@ const catch_ = /*#__PURE__*/ dual(2, (self, f) => fromChannel(catch_$1(self.chan
|
|
|
29364
29404
|
*/
|
|
29365
29405
|
const orDie = (self) => fromChannel(orDie$1(self.channel));
|
|
29366
29406
|
/**
|
|
29367
|
-
* Takes the first `n` elements from this stream, returning `Stream.empty` when `n < 1`.
|
|
29368
|
-
*
|
|
29369
|
-
* **Example** (Taking values from the left)
|
|
29370
|
-
*
|
|
29371
|
-
* ```ts
|
|
29372
|
-
* import { Console, Effect, Stream } from "effect"
|
|
29373
|
-
*
|
|
29374
|
-
* const program = Effect.gen(function*() {
|
|
29375
|
-
* const values = yield* Stream.make(1, 2, 3, 4, 5).pipe(
|
|
29376
|
-
* Stream.take(3),
|
|
29377
|
-
* Stream.runCollect
|
|
29378
|
-
* )
|
|
29379
|
-
* yield* Console.log(values)
|
|
29380
|
-
* })
|
|
29381
|
-
*
|
|
29382
|
-
* Effect.runPromise(program)
|
|
29383
|
-
* // Output: [ 1, 2, 3 ]
|
|
29384
|
-
* ```
|
|
29385
|
-
*
|
|
29386
|
-
* @category filtering
|
|
29387
|
-
* @since 2.0.0
|
|
29388
|
-
*/
|
|
29389
|
-
const take = /*#__PURE__*/ dual(2, (self, n) => n < 1 ? empty$8 : takeUntil(self, (_, i) => i === n - 1));
|
|
29390
|
-
/**
|
|
29391
29407
|
* Takes elements until the predicate matches.
|
|
29392
29408
|
*
|
|
29393
29409
|
* **Details**
|
|
@@ -29563,7 +29579,7 @@ const debounce = /*#__PURE__*/ dual(2, (self, duration) => transformPull(self, f
|
|
|
29563
29579
|
* @category grouping
|
|
29564
29580
|
* @since 2.0.0
|
|
29565
29581
|
*/
|
|
29566
|
-
const groupedWithin = /*#__PURE__*/ dual(3, (self, chunkSize, duration) => aggregateWithin(self, take
|
|
29582
|
+
const groupedWithin = /*#__PURE__*/ dual(3, (self, chunkSize, duration) => aggregateWithin(self, take(chunkSize), spaced(duration)));
|
|
29567
29583
|
/**
|
|
29568
29584
|
* Applies a sink transducer to the stream and emits each sink result.
|
|
29569
29585
|
*
|
|
@@ -29651,7 +29667,7 @@ const aggregateWithin = /*#__PURE__*/ dual(3, (self, sink, schedule) => fromChan
|
|
|
29651
29667
|
const stepToBuffer = suspend$2(function loop() {
|
|
29652
29668
|
return step(lastOutput).pipe(flatMap$2(() => !sinkHasInput ? loop() : offer(buffer, scheduleStep)), flatMap$2(() => never$1), catchDone(() => done()));
|
|
29653
29669
|
});
|
|
29654
|
-
const pullFromBuffer = take$
|
|
29670
|
+
const pullFromBuffer = take$1(buffer).pipe(flatMap$2((arr) => {
|
|
29655
29671
|
if (arr === scheduleStep) return done();
|
|
29656
29672
|
sinkHasInput = true;
|
|
29657
29673
|
return succeed$3(arr);
|
|
@@ -29939,32 +29955,6 @@ const runForEach = /*#__PURE__*/ dual(2, (self, f) => runForEach$1(self.channel,
|
|
|
29939
29955
|
*/
|
|
29940
29956
|
const runForEachArray = /*#__PURE__*/ dual(2, (self, f) => runForEach$1(self.channel, f));
|
|
29941
29957
|
/**
|
|
29942
|
-
* Runs the stream for its effects, discarding emitted elements.
|
|
29943
|
-
*
|
|
29944
|
-
* **Example** (Draining a stream run)
|
|
29945
|
-
*
|
|
29946
|
-
* ```ts
|
|
29947
|
-
* import { Console, Effect, Stream } from "effect"
|
|
29948
|
-
*
|
|
29949
|
-
* const program = Effect.gen(function*() {
|
|
29950
|
-
* const stream = Stream.make(1, 2, 3).pipe(
|
|
29951
|
-
* Stream.mapEffect((n) => Console.log(`Processing: ${n}`))
|
|
29952
|
-
* )
|
|
29953
|
-
*
|
|
29954
|
-
* yield* Stream.runDrain(stream)
|
|
29955
|
-
* })
|
|
29956
|
-
*
|
|
29957
|
-
* Effect.runPromise(program)
|
|
29958
|
-
* // Processing: 1
|
|
29959
|
-
* // Processing: 2
|
|
29960
|
-
* // Processing: 3
|
|
29961
|
-
* ```
|
|
29962
|
-
*
|
|
29963
|
-
* @category destructors
|
|
29964
|
-
* @since 2.0.0
|
|
29965
|
-
*/
|
|
29966
|
-
const runDrain = (self) => runDrain$1(self.channel);
|
|
29967
|
-
/**
|
|
29968
29958
|
* Concatenates all emitted strings into a single string.
|
|
29969
29959
|
*
|
|
29970
29960
|
* **Example** (Joining strings from a stream)
|
|
@@ -43790,7 +43780,7 @@ const make$16 = /*#__PURE__*/ fnUntraced(function* (group, options) {
|
|
|
43790
43780
|
}).pipe(provide$3(scope));
|
|
43791
43781
|
yield* forkChild(whileLoop({
|
|
43792
43782
|
while: constTrue,
|
|
43793
|
-
body: constant(flatMap$2(take$
|
|
43783
|
+
body: constant(flatMap$2(take$1(disconnects), (clientId) => {
|
|
43794
43784
|
clients.delete(clientId);
|
|
43795
43785
|
return server.disconnect(clientId);
|
|
43796
43786
|
})),
|
|
@@ -52380,6 +52370,7 @@ const AgentSession = Struct({
|
|
|
52380
52370
|
"pi"
|
|
52381
52371
|
]),
|
|
52382
52372
|
label: String$1,
|
|
52373
|
+
state: TerminalState,
|
|
52383
52374
|
uuid: String$1
|
|
52384
52375
|
});
|
|
52385
52376
|
var ReviewMark = class extends Class("ReviewMark")({
|
|
@@ -52677,7 +52668,7 @@ var GitWorkspace = class extends Service()("@deslop/git/service/GitWorkspace", {
|
|
|
52677
52668
|
gitDirectory,
|
|
52678
52669
|
root
|
|
52679
52670
|
}))), orElseSucceed(() => failVoid), flatMap$2((repository) => collectRepositoriesFromRoots(drop$1(remainingRoots, 1), append$1(repositories, repository))));
|
|
52680
|
-
return pipe(entries, filter$
|
|
52671
|
+
return pipe(entries, filter$1((entry) => !(new Set([
|
|
52681
52672
|
".git",
|
|
52682
52673
|
".next",
|
|
52683
52674
|
".turbo",
|
|
@@ -52685,7 +52676,7 @@ var GitWorkspace = class extends Service()("@deslop/git/service/GitWorkspace", {
|
|
|
52685
52676
|
"coverage",
|
|
52686
52677
|
"dist",
|
|
52687
52678
|
"node_modules"
|
|
52688
|
-
]).has(entry) || startsWith(".")(entry) && entry !== ".git")), forEach$1((entry) => pipe(fs.stat(path.join(root, entry)), map$4((info) => info.type === "Directory" ? path.join(root, entry) : ""), orElseSucceed(() => ""))), flatMap$2((nextRoots) => collectRepositoriesFromRoots(pipe(nextRoots, filter$
|
|
52679
|
+
]).has(entry) || startsWith(".")(entry) && entry !== ".git")), forEach$1((entry) => pipe(fs.stat(path.join(root, entry)), map$4((info) => info.type === "Directory" ? path.join(root, entry) : ""), orElseSucceed(() => ""))), flatMap$2((nextRoots) => collectRepositoriesFromRoots(pipe(nextRoots, filter$1(isNonEmpty$1), appendAll(drop$1(roots, 1))), repositories)));
|
|
52689
52680
|
}));
|
|
52690
52681
|
}
|
|
52691
52682
|
});
|
|
@@ -52767,11 +52758,11 @@ var GitWorkspace = class extends Service()("@deslop/git/service/GitWorkspace", {
|
|
|
52767
52758
|
"for-each-ref",
|
|
52768
52759
|
"--format=%(refname:short)",
|
|
52769
52760
|
"refs/remotes"
|
|
52770
|
-
]), map$4((lines) => pipe(lines, filter$
|
|
52761
|
+
]), map$4((lines) => pipe(lines, filter$1((name) => !endsWith("/HEAD")(name)), map$7((name) => new GitBranch({
|
|
52771
52762
|
name: pipe(split$1("/")(name), drop$1(1), join$2("/")),
|
|
52772
52763
|
remote: split$1("/")(name)[0],
|
|
52773
52764
|
type: "remote"
|
|
52774
|
-
})), filter$
|
|
52765
|
+
})), filter$1((branch) => isNonEmpty$1(branch.name)), appendAll(localBranches)))))),
|
|
52775
52766
|
defaultBranch: yield* getDefaultBranch(cwd)
|
|
52776
52767
|
});
|
|
52777
52768
|
}),
|
|
@@ -52905,7 +52896,7 @@ var GitWorktree = class extends Service()("@deslop/git/service/GitWorktree", { m
|
|
|
52905
52896
|
});
|
|
52906
52897
|
function diffsFromPatch(patch, segments) {
|
|
52907
52898
|
const groupedSegments = segmentsByFile(segments);
|
|
52908
|
-
return pipe(patch.split(/(?=^diff --git )/mu), filter$
|
|
52899
|
+
return pipe(patch.split(/(?=^diff --git )/mu), filter$1(isNonEmpty$1), map$7((chunk) => diffFromPatchChunk(chunk, groupedSegments)));
|
|
52909
52900
|
}
|
|
52910
52901
|
function attachSegments(diffs, segments) {
|
|
52911
52902
|
const groupedSegments = segmentsByFile(segments);
|
|
@@ -52952,13 +52943,13 @@ var GitWorktree = class extends Service()("@deslop/git/service/GitWorktree", { m
|
|
|
52952
52943
|
"--find-renames",
|
|
52953
52944
|
"--name-only",
|
|
52954
52945
|
`${input.from}..${input.to}`
|
|
52955
|
-
])).split("\0DESLOP-COMMIT\0"), filter$
|
|
52946
|
+
])).split("\0DESLOP-COMMIT\0"), filter$1(isNonEmpty$1), flatMap$5((entry) => {
|
|
52956
52947
|
const lines = split$1("\n")(entry);
|
|
52957
52948
|
const header = lines[0];
|
|
52958
52949
|
const parts = split$1("\0")(header);
|
|
52959
52950
|
const commit = parts[0];
|
|
52960
|
-
const id = `${pipe(parts[1] ?? "", split$1(" "), filter$
|
|
52961
|
-
return pipe(drop$1(lines, 1), filter$
|
|
52951
|
+
const id = `${pipe(parts[1] ?? "", split$1(" "), filter$1(isNonEmpty$1))[0] ?? `${commit}^`}->${commit}`;
|
|
52952
|
+
return pipe(drop$1(lines, 1), filter$1(isNonEmpty$1), map$7((filePath) => new GitDiffSegment({
|
|
52962
52953
|
filePath,
|
|
52963
52954
|
fingerprint: `${id}:${filePath}`,
|
|
52964
52955
|
id,
|
|
@@ -53039,7 +53030,7 @@ var GitWorktree = class extends Service()("@deslop/git/service/GitWorktree", { m
|
|
|
53039
53030
|
const subject = parts[2] ?? "";
|
|
53040
53031
|
return new GitCommit({
|
|
53041
53032
|
hash: parts[0],
|
|
53042
|
-
parents: pipe(parts[3] ?? "", split$1(" "), filter$
|
|
53033
|
+
parents: pipe(parts[3] ?? "", split$1(" "), filter$1(isNonEmpty$1)),
|
|
53043
53034
|
shortHash: parts[1] ?? "",
|
|
53044
53035
|
subject,
|
|
53045
53036
|
wip: isWipSubject(subject)
|
|
@@ -53308,14 +53299,14 @@ const discover = fnUntraced(function* (cwd, input) {
|
|
|
53308
53299
|
"package.json",
|
|
53309
53300
|
"**/package.json"
|
|
53310
53301
|
], { cwd }));
|
|
53311
|
-
return yield* pipe(pipe(split$1("\n")(output), filter$
|
|
53302
|
+
return yield* pipe(pipe(split$1("\n")(output), filter$1((packagePath) => packagePath === "package.json" || endsWith("/package.json")(packagePath))), map$7((packagePath) => pipe(fs.readFileString(path.join(cwd, packagePath)), flatMap$2((source) => try_({
|
|
53312
53303
|
catch: (error) => error,
|
|
53313
53304
|
try: () => pipe(JSON.parse(source), decodeUnknownOption(PackageJson))
|
|
53314
53305
|
})), catch_$2(() => succeed$3(none())), flatMap$2((packageJson) => {
|
|
53315
53306
|
if (isNone(packageJson)) return succeed$3([]);
|
|
53316
53307
|
const packageDirectory = packagePath === "package.json" ? cwd : path.join(cwd, path.dirname(packagePath));
|
|
53317
53308
|
const folder = path.basename(packageDirectory);
|
|
53318
|
-
const scriptEntries = pipe(Object.entries(packageJson.value.scripts ?? {}), filter$
|
|
53309
|
+
const scriptEntries = pipe(Object.entries(packageJson.value.scripts ?? {}), filter$1((entry) => entry[0] === "dev" || startsWith("dev:")(entry[0])));
|
|
53319
53310
|
const packageOrigin = input.origin([
|
|
53320
53311
|
folder,
|
|
53321
53312
|
path.basename(cwd),
|
|
@@ -53455,7 +53446,7 @@ const proxy = fnUntraced(function* (request, origin) {
|
|
|
53455
53446
|
});
|
|
53456
53447
|
const proxyWebSocket = fnUntraced(function* (request, origin) {
|
|
53457
53448
|
const [pathname = "/", search = ""] = request.url.split("?");
|
|
53458
|
-
const protocols = pipe(fromUndefinedOr(request.headers["sec-websocket-protocol"]), map$9((header) => pipe(header, split$1(","), map$7(trim), filter$
|
|
53449
|
+
const protocols = pipe(fromUndefinedOr(request.headers["sec-websocket-protocol"]), map$9((header) => pipe(header, split$1(","), map$7(trim), filter$1(isNonEmpty$1))));
|
|
53459
53450
|
const inbound = yield* request.upgrade;
|
|
53460
53451
|
const upstreamUrl = new URL(origin);
|
|
53461
53452
|
upstreamUrl.protocol = upstreamUrl.protocol === "https:" ? "wss:" : "ws:";
|
|
@@ -53611,7 +53602,6 @@ var import_addon_progress = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSM
|
|
|
53611
53602
|
})(), e;
|
|
53612
53603
|
})()));
|
|
53613
53604
|
})))(), 1);
|
|
53614
|
-
const eventBacklogCapacity = 512;
|
|
53615
53605
|
const terminalReset = "\x1Bc";
|
|
53616
53606
|
function parseTitleSignal(title) {
|
|
53617
53607
|
const trimmed = title.trim();
|
|
@@ -53649,24 +53639,17 @@ function parseTitleSignal(title) {
|
|
|
53649
53639
|
}
|
|
53650
53640
|
function snapshotEvents(data, sequence) {
|
|
53651
53641
|
if (data === "") return empty$13();
|
|
53652
|
-
|
|
53653
|
-
|
|
53654
|
-
data: data.slice(index, index + 256 * 1024),
|
|
53642
|
+
return pipe(range(0, Math.floor((data.length - 1) / (256 * 1024))), map$7((index) => ({
|
|
53643
|
+
data: data.slice(index * 256 * 1024, (index + 1) * 256 * 1024),
|
|
53655
53644
|
sequence,
|
|
53656
53645
|
type: "data"
|
|
53657
|
-
});
|
|
53658
|
-
return events;
|
|
53646
|
+
})));
|
|
53659
53647
|
}
|
|
53660
53648
|
function adjacentGroups(items, sameGroup, merge) {
|
|
53661
53649
|
return pipe(items, reduce(empty$13(), (groups, item) => {
|
|
53662
|
-
const next = groups;
|
|
53663
53650
|
const previous = groups.at(-1);
|
|
53664
|
-
if (previous === void 0 || !sameGroup(previous, item))
|
|
53665
|
-
|
|
53666
|
-
return next;
|
|
53667
|
-
}
|
|
53668
|
-
next[next.length - 1] = merge(previous, item);
|
|
53669
|
-
return next;
|
|
53651
|
+
if (previous === void 0 || !sameGroup(previous, item)) return append$1(groups, item);
|
|
53652
|
+
return append$1(dropRight(groups, 1), merge(previous, item));
|
|
53670
53653
|
}));
|
|
53671
53654
|
}
|
|
53672
53655
|
function queuedDataGroups(items, merge) {
|
|
@@ -53686,13 +53669,9 @@ function queuedWriteGroups(items) {
|
|
|
53686
53669
|
}
|
|
53687
53670
|
var Terminal = class extends Service()("@deslop/terminal/service/Terminal", { make: fnUntraced(function* (config) {
|
|
53688
53671
|
const dataQueue = yield* unbounded();
|
|
53689
|
-
const screenQueue = yield* unbounded();
|
|
53690
53672
|
const writeQueue = yield* unbounded();
|
|
53691
53673
|
const resizeQueue = yield* sliding(1);
|
|
53692
|
-
const events = yield* bounded$1(
|
|
53693
|
-
capacity: 1024,
|
|
53694
|
-
replay: eventBacklogCapacity
|
|
53695
|
-
});
|
|
53674
|
+
const events = yield* bounded$1(1024);
|
|
53696
53675
|
const lifecycleLock = yield* make$47(1);
|
|
53697
53676
|
const screenLock = yield* make$47(1);
|
|
53698
53677
|
const eventSequenceRef = yield* make$38(0);
|
|
@@ -53739,15 +53718,16 @@ var Terminal = class extends Service()("@deslop/terminal/service/Terminal", { ma
|
|
|
53739
53718
|
};
|
|
53740
53719
|
}));
|
|
53741
53720
|
function setState(state) {
|
|
53742
|
-
return update(stateRef, (current) =>
|
|
53721
|
+
return update(stateRef, (current) => current.state === state ? current : {
|
|
53743
53722
|
...current,
|
|
53744
53723
|
state
|
|
53745
|
-
})
|
|
53724
|
+
});
|
|
53746
53725
|
}
|
|
53747
53726
|
function setProgressState(progressState) {
|
|
53748
53727
|
return update(stateRef, (current) => {
|
|
53749
53728
|
if (current.state === "stopped" || current.state === "exited" || current.state === "failed") return current;
|
|
53750
53729
|
const state = pipe(progressState.state, value, when(0, () => "idle"), when(2, () => "failed"), when(4, () => "waiting"), orElse(() => "running"));
|
|
53730
|
+
if (current.state === state) return current;
|
|
53751
53731
|
return {
|
|
53752
53732
|
...current,
|
|
53753
53733
|
state
|
|
@@ -53757,9 +53737,11 @@ var Terminal = class extends Service()("@deslop/terminal/service/Terminal", { ma
|
|
|
53757
53737
|
function setTitle(title) {
|
|
53758
53738
|
return update(stateRef, (current) => {
|
|
53759
53739
|
if (!terminalStateActive(current.state)) return current;
|
|
53740
|
+
const next = parseTitleSignal(title);
|
|
53741
|
+
if (current.state === next.state && current.title === next.title) return current;
|
|
53760
53742
|
return {
|
|
53761
53743
|
...current,
|
|
53762
|
-
...
|
|
53744
|
+
...next
|
|
53763
53745
|
};
|
|
53764
53746
|
});
|
|
53765
53747
|
}
|
|
@@ -53871,16 +53853,11 @@ var Terminal = class extends Service()("@deslop/terminal/service/Terminal", { ma
|
|
|
53871
53853
|
yield* stopProcess();
|
|
53872
53854
|
return yield* spawnProcess();
|
|
53873
53855
|
});
|
|
53874
|
-
yield* pipe(fromQueue(dataQueue), groupedWithin(256, millis(
|
|
53875
|
-
if ((yield* get$3(screenGenerationRef)) !== item.generation) return;
|
|
53876
|
-
yield* offer(screenQueue, item);
|
|
53877
|
-
}), { discard: true })), forkScoped);
|
|
53878
|
-
yield* pipe(fromQueue(screenQueue), groupedWithin(256, millis(16)), runForEach((items) => forEach$1(queuedDataGroups(fromIterable$2(items), mergeQueuedData), writeScreen, { discard: true })), forkScoped);
|
|
53856
|
+
yield* pipe(fromQueue(dataQueue), groupedWithin(256, millis(16)), runForEach((items) => forEach$1(queuedDataGroups(fromIterable$2(items), mergeQueuedData), writeScreen, { discard: true })), forkScoped);
|
|
53879
53857
|
yield* addFinalizer(() => all([
|
|
53880
53858
|
stopProcess(),
|
|
53881
53859
|
shutdown$1(events),
|
|
53882
53860
|
shutdown(dataQueue),
|
|
53883
|
-
shutdown(screenQueue),
|
|
53884
53861
|
shutdown(writeQueue),
|
|
53885
53862
|
shutdown(resizeQueue),
|
|
53886
53863
|
sync(() => {
|
|
@@ -53931,7 +53908,7 @@ var Terminal = class extends Service()("@deslop/terminal/service/Terminal", { ma
|
|
|
53931
53908
|
const subscription = yield* subscribe(events);
|
|
53932
53909
|
const snapshot = yield* requestSnapshot;
|
|
53933
53910
|
const pending = yield* takeUpTo(subscription, Number.POSITIVE_INFINITY);
|
|
53934
|
-
const replay = filter$
|
|
53911
|
+
const replay = filter$1(pending, (event) => event.sequence > snapshot.sequence);
|
|
53935
53912
|
const replaySequence = replay.at(-1)?.sequence ?? snapshot.sequence;
|
|
53936
53913
|
return pipe(fromIterable$1([
|
|
53937
53914
|
{
|
|
@@ -53941,8 +53918,8 @@ var Terminal = class extends Service()("@deslop/terminal/service/Terminal", { ma
|
|
|
53941
53918
|
},
|
|
53942
53919
|
...snapshotEvents(snapshot.data, snapshot.sequence),
|
|
53943
53920
|
...replay,
|
|
53944
|
-
...filter$
|
|
53945
|
-
]), concat(fromEffectRepeat(take$
|
|
53921
|
+
...filter$1(pending, (event) => event.sequence > replaySequence)
|
|
53922
|
+
]), concat(fromEffectRepeat(take$2(subscription))));
|
|
53946
53923
|
})));
|
|
53947
53924
|
const stateUpdates = unwrap$1(pipe(get(stateRef), map$4((state) => concat(drop(1)(changes(stateRef)))(make$43(state)))));
|
|
53948
53925
|
const updates = merge$1(stateUpdates.pipe(map$2((state) => ({
|
|
@@ -54096,15 +54073,33 @@ const RpcHandlers = RpcContracts.toLayer(gen(function* () {
|
|
|
54096
54073
|
})), mapError$2((cause) => new GitError({ cause })));
|
|
54097
54074
|
});
|
|
54098
54075
|
const agents = yield* make$3(empty$6());
|
|
54076
|
+
const removeAgent = fnUntraced(function* (payload) {
|
|
54077
|
+
const session = pipe(yield* get(agents), get$1(payload), getOrUndefined$1);
|
|
54078
|
+
yield* update(agents, (current) => remove$2(current, payload));
|
|
54079
|
+
if (session === void 0) return;
|
|
54080
|
+
const input = terminalSessionInput({
|
|
54081
|
+
args: session.args,
|
|
54082
|
+
command: session.command,
|
|
54083
|
+
cwd: session.cwd,
|
|
54084
|
+
sessionId: session.uuid
|
|
54085
|
+
});
|
|
54086
|
+
yield* pipe(get$6(terminals, input), flatMap$2((terminal) => terminal.stop()), ignore$1);
|
|
54087
|
+
yield* pipe(invalidate(terminals, input), ignore$1);
|
|
54088
|
+
});
|
|
54099
54089
|
return RpcContracts.of({
|
|
54100
54090
|
"agents.create": (payload) => gen(function* () {
|
|
54101
|
-
const labelCount = pipe(fromIterable$2(values(yield* get(agents))), filter$
|
|
54091
|
+
const labelCount = pipe(fromIterable$2(values(yield* get(agents))), filter$1((agentSession) => agentSession.cwd === payload.cwd && agentSession.command === payload.command), length);
|
|
54102
54092
|
const agentSession = {
|
|
54103
54093
|
args: [...payload.args],
|
|
54104
54094
|
command: payload.command,
|
|
54105
54095
|
cwd: payload.cwd,
|
|
54106
54096
|
icon: payload.icon,
|
|
54107
54097
|
label: `${payload.label} ${labelCount + 1}`,
|
|
54098
|
+
state: {
|
|
54099
|
+
runId: 0,
|
|
54100
|
+
state: "starting",
|
|
54101
|
+
title: ""
|
|
54102
|
+
},
|
|
54108
54103
|
uuid: randomUUID()
|
|
54109
54104
|
};
|
|
54110
54105
|
yield* update(agents, (sessions) => set$2(sessions, AgentSessionKey.make({
|
|
@@ -54118,17 +54113,31 @@ const RpcHandlers = RpcContracts.toLayer(gen(function* () {
|
|
|
54118
54113
|
sessionId: agentSession.uuid
|
|
54119
54114
|
})).pipe(map$4(terminalSessionInput), flatMap$2((input) => get$6(terminals, input)));
|
|
54120
54115
|
yield* sessionTerminal.restart();
|
|
54121
|
-
yield* pipe(sessionTerminal.stateUpdates,
|
|
54122
|
-
|
|
54123
|
-
|
|
54124
|
-
|
|
54116
|
+
yield* pipe(sessionTerminal.stateUpdates, takeUntil((state) => state.state === "exited" || state.state === "failed" || state.state === "stopped"), runForEach((state) => gen(function* () {
|
|
54117
|
+
const key = AgentSessionKey.make({
|
|
54118
|
+
cwd: agentSession.cwd,
|
|
54119
|
+
uuid: agentSession.uuid
|
|
54120
|
+
});
|
|
54121
|
+
yield* update(agents, (sessions) => modifyAt(sessions, key, match$5({
|
|
54122
|
+
onNone: () => none(),
|
|
54123
|
+
onSome: (session) => some$1({
|
|
54124
|
+
...session,
|
|
54125
|
+
state
|
|
54126
|
+
})
|
|
54127
|
+
})));
|
|
54128
|
+
if (state.state !== "exited" && state.state !== "failed" && state.state !== "stopped") return;
|
|
54129
|
+
yield* update(agents, (sessions) => remove$2(sessions, key));
|
|
54130
|
+
yield* pipe(invalidate(terminals, terminalSessionInput({
|
|
54131
|
+
args: agentSession.args,
|
|
54132
|
+
command: agentSession.command,
|
|
54133
|
+
cwd: agentSession.cwd,
|
|
54134
|
+
sessionId: agentSession.uuid
|
|
54135
|
+
})), ignore$1);
|
|
54136
|
+
})), forkDetach);
|
|
54125
54137
|
return agentSession;
|
|
54126
54138
|
}),
|
|
54127
|
-
"agents.remove": (payload) =>
|
|
54128
|
-
|
|
54129
|
-
uuid: payload.uuid
|
|
54130
|
-
}))),
|
|
54131
|
-
"agents.watch": (payload) => unwrap$1(pipe(get(agents), map$4((current) => pipe(make$43(current), concat(drop(1)(changes(agents))), map$2((sessions) => pipe(fromIterable$2(values(sessions)), filter$2((session) => session.cwd === payload.cwd))))))),
|
|
54139
|
+
"agents.remove": (payload) => removeAgent(AgentSessionKey.make(payload)),
|
|
54140
|
+
"agents.watch": (payload) => unwrap$1(pipe(get(agents), map$4((current) => pipe(make$43(current), concat(drop(1)(changes(agents))), map$2((sessions) => pipe(fromIterable$2(values(sessions)), filter$1((session) => session.cwd === payload.cwd))))))),
|
|
54132
54141
|
"projects.branches": (payload) => git.branches(payload.cwd),
|
|
54133
54142
|
"projects.createWorktree": (payload) => git.createWorktree(payload),
|
|
54134
54143
|
"projects.deleteWorktree": (payload) => git.deleteWorktree(payload),
|
|
@@ -54136,14 +54145,14 @@ const RpcHandlers = RpcContracts.toLayer(gen(function* () {
|
|
|
54136
54145
|
"review.comments.resolve": (payload) => updateReviewState(payload, (state) => {
|
|
54137
54146
|
const key = commentKey(payload);
|
|
54138
54147
|
return new ReviewState({
|
|
54139
|
-
comments: filter$
|
|
54148
|
+
comments: filter$1(state.comments, (comment) => commentKey(comment) !== key),
|
|
54140
54149
|
marks: state.marks
|
|
54141
54150
|
});
|
|
54142
54151
|
}),
|
|
54143
54152
|
"review.comments.save": (payload) => updateReviewState(payload, (state) => {
|
|
54144
54153
|
const key = commentKey(payload.comment);
|
|
54145
54154
|
return new ReviewState({
|
|
54146
|
-
comments: append$1(filter$
|
|
54155
|
+
comments: append$1(filter$1(state.comments, (comment) => commentKey(comment) !== key), new ReviewComment({
|
|
54147
54156
|
...payload.comment,
|
|
54148
54157
|
resolved: false
|
|
54149
54158
|
})),
|
|
@@ -54164,14 +54173,14 @@ const RpcHandlers = RpcContracts.toLayer(gen(function* () {
|
|
|
54164
54173
|
const keys = new Set(map$7(payload.marks, markKey));
|
|
54165
54174
|
return new ReviewState({
|
|
54166
54175
|
comments: state.comments,
|
|
54167
|
-
marks: appendAll(filter$
|
|
54176
|
+
marks: appendAll(filter$1(state.marks, (mark) => !keys.has(markKey(mark))), payload.marks)
|
|
54168
54177
|
});
|
|
54169
54178
|
}),
|
|
54170
54179
|
"review.state.unmark": (payload) => updateReviewState(payload, (state) => {
|
|
54171
54180
|
const keys = new Set(map$7(payload.marks, markKey));
|
|
54172
54181
|
return new ReviewState({
|
|
54173
54182
|
comments: state.comments,
|
|
54174
|
-
marks: filter$
|
|
54183
|
+
marks: filter$1(state.marks, (mark) => !keys.has(markKey(mark)))
|
|
54175
54184
|
});
|
|
54176
54185
|
}),
|
|
54177
54186
|
"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))))))),
|
|
@@ -60287,19 +60296,19 @@ var require_getMachineId = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
60287
60296
|
async function getMachineId() {
|
|
60288
60297
|
if (!getMachineIdImpl) switch (process$1.platform) {
|
|
60289
60298
|
case "darwin":
|
|
60290
|
-
getMachineIdImpl = (await import("./getMachineId-darwin-
|
|
60299
|
+
getMachineIdImpl = (await import("./getMachineId-darwin-BYjMzwa2.mjs").then((m) => /* @__PURE__ */ __toESM(m.default))).getMachineId;
|
|
60291
60300
|
break;
|
|
60292
60301
|
case "linux":
|
|
60293
|
-
getMachineIdImpl = (await import("./getMachineId-linux-
|
|
60302
|
+
getMachineIdImpl = (await import("./getMachineId-linux-7FQ_TPIw.mjs").then((m) => /* @__PURE__ */ __toESM(m.default))).getMachineId;
|
|
60294
60303
|
break;
|
|
60295
60304
|
case "freebsd":
|
|
60296
|
-
getMachineIdImpl = (await import("./getMachineId-bsd-
|
|
60305
|
+
getMachineIdImpl = (await import("./getMachineId-bsd-DYUtJhPR.mjs").then((m) => /* @__PURE__ */ __toESM(m.default))).getMachineId;
|
|
60297
60306
|
break;
|
|
60298
60307
|
case "win32":
|
|
60299
|
-
getMachineIdImpl = (await import("./getMachineId-win-
|
|
60308
|
+
getMachineIdImpl = (await import("./getMachineId-win-BxTTz_Ds.mjs").then((m) => /* @__PURE__ */ __toESM(m.default))).getMachineId;
|
|
60300
60309
|
break;
|
|
60301
60310
|
default:
|
|
60302
|
-
getMachineIdImpl = (await import("./getMachineId-unsupported-
|
|
60311
|
+
getMachineIdImpl = (await import("./getMachineId-unsupported-CqYci84U.mjs").then((m) => /* @__PURE__ */ __toESM(m.default))).getMachineId;
|
|
60303
60312
|
break;
|
|
60304
60313
|
}
|
|
60305
60314
|
return getMachineIdImpl();
|