clanka 0.7.7 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Acp.d.ts +4 -4
- package/dist/Acp.d.ts.map +1 -1
- package/dist/Acp.js +8 -6
- package/dist/Acp.js.map +1 -1
- package/dist/Acp.test.js +66 -4
- package/dist/Acp.test.js.map +1 -1
- package/dist/AcpImage.test.js +7 -7
- package/dist/AcpImage.test.js.map +1 -1
- package/dist/Agent.d.ts +8 -8
- package/dist/Agent.d.ts.map +1 -1
- package/dist/Agent.js +17 -7
- package/dist/Agent.js.map +1 -1
- package/dist/Agent.test.js +53 -8
- package/dist/Agent.test.js.map +1 -1
- package/dist/AgentExecutor.d.ts +9 -9
- package/dist/AgentExecutor.d.ts.map +1 -1
- package/dist/AgentExecutor.js +5 -5
- package/dist/AgentExecutor.js.map +1 -1
- package/dist/AgentExecutorImage.test.js +6 -6
- package/dist/AgentExecutorImage.test.js.map +1 -1
- package/dist/AgentImage.test.js +3 -3
- package/dist/AgentImage.test.js.map +1 -1
- package/dist/AgentOutput.d.ts +10 -2
- package/dist/AgentOutput.d.ts.map +1 -1
- package/dist/AgentOutput.js +10 -2
- package/dist/AgentOutput.js.map +1 -1
- package/dist/AgentSkills.d.ts.map +1 -1
- package/dist/AgentSkills.js +6 -1
- package/dist/AgentSkills.js.map +1 -1
- package/dist/AgentSkills.test.js +21 -4
- package/dist/AgentSkills.test.js.map +1 -1
- package/dist/AgentTools.d.ts +4 -4
- package/dist/AgentTools.d.ts.map +1 -1
- package/dist/AgentTools.js +4 -4
- package/dist/AgentTools.js.map +1 -1
- package/dist/AgentToolsImage.test.js +2 -2
- package/dist/AgentToolsImage.test.js.map +1 -1
- package/dist/ChunkRepo.d.ts +10 -10
- package/dist/ChunkRepo.d.ts.map +1 -1
- package/dist/ChunkRepo.js +7 -7
- package/dist/ChunkRepo.js.map +1 -1
- package/dist/ChunkRepo.test.js +2 -2
- package/dist/ChunkRepo.test.js.map +1 -1
- package/dist/CodeChunker.d.ts +1 -1
- package/dist/CodeChunker.d.ts.map +1 -1
- package/dist/CodeChunker.js +2 -2
- package/dist/CodeChunker.js.map +1 -1
- package/dist/Codex.d.ts +5 -5
- package/dist/Codex.d.ts.map +1 -1
- package/dist/Codex.js +1 -1
- package/dist/Codex.js.map +1 -1
- package/dist/CodexAuth.d.ts +2 -2
- package/dist/CodexAuth.d.ts.map +1 -1
- package/dist/CodexAuth.js +6 -6
- package/dist/CodexAuth.js.map +1 -1
- package/dist/CodexAuth.test.js +3 -3
- package/dist/CodexAuth.test.js.map +1 -1
- package/dist/Compaction.d.ts +3 -3
- package/dist/Compaction.d.ts.map +1 -1
- package/dist/Compaction.js +3 -3
- package/dist/Compaction.js.map +1 -1
- package/dist/Compaction.test.js +3 -3
- package/dist/Compaction.test.js.map +1 -1
- package/dist/CompactionImage.test.js +4 -4
- package/dist/CompactionImage.test.js.map +1 -1
- package/dist/CompactionTokens.test.js +3 -3
- package/dist/CompactionTokens.test.js.map +1 -1
- package/dist/CompactionTransport.test.js +5 -5
- package/dist/CompactionTransport.test.js.map +1 -1
- package/dist/Copilot.d.ts +3 -3
- package/dist/Copilot.d.ts.map +1 -1
- package/dist/Copilot.js +1 -1
- package/dist/Copilot.js.map +1 -1
- package/dist/CopilotAuth.d.ts +2 -2
- package/dist/CopilotAuth.d.ts.map +1 -1
- package/dist/CopilotAuth.js +4 -4
- package/dist/CopilotAuth.js.map +1 -1
- package/dist/CopilotAuth.test.js +2 -2
- package/dist/CopilotAuth.test.js.map +1 -1
- package/dist/GlobalWebSocket.d.ts +1 -1
- package/dist/GlobalWebSocket.d.ts.map +1 -1
- package/dist/GlobalWebSocket.js +1 -1
- package/dist/GlobalWebSocket.js.map +1 -1
- package/dist/Image.d.ts +2 -2
- package/dist/Image.d.ts.map +1 -1
- package/dist/Image.js +3 -3
- package/dist/Image.js.map +1 -1
- package/dist/Image.test.js +2 -2
- package/dist/Image.test.js.map +1 -1
- package/dist/SemanticSearch.d.ts +3 -3
- package/dist/SemanticSearch.d.ts.map +1 -1
- package/dist/SemanticSearch.js +1 -1
- package/dist/SemanticSearch.js.map +1 -1
- package/dist/Sqlite.d.ts +2 -2
- package/dist/Sqlite.d.ts.map +1 -1
- package/dist/Sqlite.js +1 -1
- package/dist/Sqlite.js.map +1 -1
- package/dist/ToolkitRenderer.d.ts +2 -2
- package/dist/ToolkitRenderer.d.ts.map +1 -1
- package/dist/WebToMarkdown.d.ts +2 -2
- package/dist/WebToMarkdown.d.ts.map +1 -1
- package/dist/WebToMarkdown.js +1 -1
- package/dist/WebToMarkdown.js.map +1 -1
- package/dist/WebToMarkdown.test.js +1 -1
- package/dist/WebToMarkdown.test.js.map +1 -1
- package/dist/Xai.d.ts +10 -3
- package/dist/Xai.d.ts.map +1 -1
- package/dist/Xai.js +26 -2
- package/dist/Xai.js.map +1 -1
- package/dist/Xai.test.js +38 -4
- package/dist/Xai.test.js.map +1 -1
- package/dist/XaiAuth.d.ts +2 -2
- package/dist/XaiAuth.d.ts.map +1 -1
- package/dist/XaiAuth.js +4 -4
- package/dist/XaiAuth.js.map +1 -1
- package/dist/XaiAuth.test.js +2 -2
- package/dist/XaiAuth.test.js.map +1 -1
- package/dist/bin/{Effect-CeAMoJlg.mjs → Effect-DvI8YVcR.mjs} +81 -387
- package/dist/bin/Effect-DvI8YVcR.mjs.map +1 -0
- package/dist/bin/{McpClient-zQibhsnA.mjs → McpClient-CM7u8ZVd.mjs} +3 -3
- package/dist/bin/{McpClient-zQibhsnA.mjs.map → McpClient-CM7u8ZVd.mjs.map} +1 -1
- package/dist/bin/{OutputFormatter-C7Awn0DS.mjs → OutputFormatter-BpggeGvI.mjs} +3 -3
- package/dist/bin/{OutputFormatter-C7Awn0DS.mjs.map → OutputFormatter-BpggeGvI.mjs.map} +1 -1
- package/dist/bin/{Schema-Bc06DxcV.mjs → Schema-DyJ738Wp.mjs} +1979 -1663
- package/dist/bin/Schema-DyJ738Wp.mjs.map +1 -0
- package/dist/bin/{SemanticSearch-BPxQoRSC.mjs → SemanticSearch-BHUGFT1y.mjs} +46 -42
- package/dist/bin/SemanticSearch-BHUGFT1y.mjs.map +1 -0
- package/dist/bin/{Stream-DlGXvw0L.mjs → Stream-Dg7AGCgJ.mjs} +60 -61
- package/dist/bin/Stream-Dg7AGCgJ.mjs.map +1 -0
- package/dist/bin/cli.mjs +614 -371
- package/dist/bin/cli.mjs.map +1 -1
- package/dist/cli.js +7 -5
- package/dist/cli.js.map +1 -1
- package/dist/fixtures/TestImages.js +2 -2
- package/dist/fixtures/TestImages.js.map +1 -1
- package/package.json +7 -7
- package/src/Acp.test.ts +107 -5
- package/src/Acp.ts +10 -8
- package/src/AcpImage.test.ts +9 -9
- package/src/Agent.test.ts +61 -9
- package/src/Agent.ts +20 -10
- package/src/AgentExecutor.ts +8 -8
- package/src/AgentExecutorImage.test.ts +6 -6
- package/src/AgentImage.test.ts +5 -5
- package/src/AgentOutput.ts +10 -2
- package/src/AgentSkills.test.ts +81 -37
- package/src/AgentSkills.ts +5 -1
- package/src/AgentTools.ts +5 -5
- package/src/AgentToolsImage.test.ts +4 -4
- package/src/ChunkRepo.test.ts +2 -2
- package/src/ChunkRepo.ts +7 -7
- package/src/CodeChunker.ts +2 -2
- package/src/Codex.ts +4 -4
- package/src/CodexAuth.test.ts +3 -3
- package/src/CodexAuth.ts +6 -6
- package/src/Compaction.test.ts +3 -3
- package/src/Compaction.ts +3 -3
- package/src/CompactionImage.test.ts +4 -4
- package/src/CompactionTokens.test.ts +3 -3
- package/src/CompactionTransport.test.ts +6 -6
- package/src/Copilot.ts +2 -2
- package/src/CopilotAuth.test.ts +2 -6
- package/src/CopilotAuth.ts +4 -4
- package/src/GlobalWebSocket.ts +1 -1
- package/src/Image.test.ts +2 -2
- package/src/Image.ts +4 -4
- package/src/OutputFormatter.ts +1 -1
- package/src/SemanticSearch.test.ts +1 -1
- package/src/SemanticSearch.ts +3 -3
- package/src/Sqlite.ts +1 -1
- package/src/ToolkitRenderer.ts +2 -2
- package/src/WebToMarkdown.test.ts +1 -1
- package/src/WebToMarkdown.ts +2 -2
- package/src/Xai.test.ts +67 -8
- package/src/Xai.ts +52 -3
- package/src/XaiAuth.test.ts +2 -2
- package/src/XaiAuth.ts +4 -4
- package/src/cli.ts +9 -7
- package/src/fixtures/TestImages.ts +2 -2
- package/src/fixtures/patch13-broken.txt +4 -4
- package/src/fixtures/patch13-fixed.txt +4 -4
- package/dist/bin/Effect-CeAMoJlg.mjs.map +0 -1
- package/dist/bin/Schema-Bc06DxcV.mjs.map +0 -1
- package/dist/bin/SemanticSearch-BPxQoRSC.mjs.map +0 -1
- package/dist/bin/Stream-DlGXvw0L.mjs.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { $
|
|
2
|
-
//#region node_modules/.pnpm/effect@
|
|
1
|
+
import { $i as headUnsafe, $r as exitInterrupt$1, A as ensuring$2, B as fnUntraced, Br as succeed$3, C as catch_$2, Ci as succeedNone, Cn as isDoneCause, Ct as promise, Do as exitSucceed, Dr as doneUnsafe, Dt as raceFirst, E as contextWith, Ei as uninterruptibleMask, Eo as exitFailCause, Es as dual, Et as provideService$2, Fn as done, Fr as failCause$4, G as forkIn, Gr as andThen$1, Gt as tap$1, H as forEach, I as flatMap$2, Io as toJson, Ir as interrupt$1, K as forkScoped, Kr as asSome, L as flatMapEager, Lr as isExit, M as fail$3, Mr as makeUnsafe$3, N as failCause$3, Nt as runForkWith, Oa as get$1, Oi as void_$1, Oo as withFiber$1, Or as interruptWith, Os as identity, Pn as die$2, Pr as fail$5, Ps as pipeArguments, Qt as uninterruptible, R as flatten$1, Rn as findError, Rt as scopedWith, Si as succeed$4, Sn as filterDone, Ss as constTrue, T as context, Ti as sync$1, To as exitFail, Tr as _await, Ts as constant, Tt as provideContext$2, U as forever, Ui as isReadonlyArrayNonEmpty, Ut as suspend$2, Vi as isArrayNonEmpty, Vr as void_$2, Vt as succeed$2, W as forkChild, Wt as sync, Y as gen, Yi as of, Yt as tryPromise, Z as interrupt$2, _r as close, _s as isTagged, _t as onExit$1, a as andThen, aa as isSuccess$1, ai as fiberInterruptAllAs, an as whileLoop, bn as catchDone, br as makeUnsafe$2, c as as, ca as succeed$5, ci as fiberRunIn, di as getCurrentFiber, ea as fail$4, ei as exitVoid, es as hasProperty, gr as addFinalizerExit, gs as isString$1, gt as onError, hi as makeLatchUnsafe, hr as addFinalizer, ht as never, ia as isFailure, ii as fiberInterruptAll, in as when, io as some, j as exit, li as flatMap$3, m as catchCause$1, mi as makeLatch, mr as Scope, ni as fiberAwait, oi as fiberInterruptAs, on as withFiber, ot as map$2, pt as matchCauseEffect, qi as map$3, qr as callback$1, ri as fiberInterrupt, rn as void_, si as fiberJoin, t as acquireRelease, ti as exitZipRight, to as none, u as asVoid, un as yieldNow, vr as forkUnsafe, wi as suspend$3, wn as matchEffect, wo as causeFail, ws as constVoid, xi as scopeFinalizerCountUnsafe, xn as doneExitFromCause, xo as PipeInspectableProto, xr as provide, yi as onExitPrimitive, yo as Done, yt as onInterrupt, zi as fromIterable$1, zr as isSuccess } from "./Effect-DvI8YVcR.mjs";
|
|
2
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/internal/count.js
|
|
3
3
|
const normalize = (n) => n > 0 ? Math.floor(n) : 0;
|
|
4
4
|
const normalizeNonEmpty = (n) => Math.max(1, normalize(n));
|
|
5
5
|
//#endregion
|
|
6
|
-
//#region node_modules/.pnpm/effect@
|
|
6
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/Number.js
|
|
7
7
|
const Number$1 = globalThis.Number;
|
|
8
8
|
const nextPow2 = (n) => {
|
|
9
9
|
const nextPow = Math.ceil(Math.log(n) / Math.log(2));
|
|
@@ -22,13 +22,13 @@ const round = dual(2, (self, precision) => {
|
|
|
22
22
|
return Math.round(self * factor) / factor;
|
|
23
23
|
});
|
|
24
24
|
//#endregion
|
|
25
|
-
//#region node_modules/.pnpm/effect@
|
|
25
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/String.js
|
|
26
26
|
const String = globalThis.String;
|
|
27
27
|
const isString = isString$1;
|
|
28
28
|
const toLowerCase = (self) => self.toLowerCase();
|
|
29
29
|
const camelToSnake = (self) => self.replace(/([A-Z])/g, "_$1").toLowerCase();
|
|
30
30
|
//#endregion
|
|
31
|
-
//#region node_modules/.pnpm/effect@
|
|
31
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/Fiber.js
|
|
32
32
|
const await_ = fiberAwait;
|
|
33
33
|
const join = fiberJoin;
|
|
34
34
|
const interrupt = fiberInterrupt;
|
|
@@ -38,11 +38,11 @@ const interruptAllAs = fiberInterruptAllAs;
|
|
|
38
38
|
const getCurrent = getCurrentFiber;
|
|
39
39
|
const runIn = fiberRunIn;
|
|
40
40
|
//#endregion
|
|
41
|
-
//#region node_modules/.pnpm/effect@
|
|
41
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/Latch.js
|
|
42
42
|
const makeUnsafe$1 = makeLatchUnsafe;
|
|
43
43
|
const make$5 = makeLatch;
|
|
44
44
|
//#endregion
|
|
45
|
-
//#region node_modules/.pnpm/effect@
|
|
45
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/MutableRef.js
|
|
46
46
|
const TypeId$5 = "~effect/MutableRef";
|
|
47
47
|
const MutableRefProto = {
|
|
48
48
|
[TypeId$5]: TypeId$5,
|
|
@@ -66,7 +66,7 @@ const set = dual(2, (self, value) => {
|
|
|
66
66
|
});
|
|
67
67
|
const update = dual(2, (self, f) => set(self, f(get(self))));
|
|
68
68
|
//#endregion
|
|
69
|
-
//#region node_modules/.pnpm/effect@
|
|
69
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/MutableList.js
|
|
70
70
|
const Empty = Symbol.for("effect/MutableList/Empty");
|
|
71
71
|
const make$3 = () => ({
|
|
72
72
|
head: void 0,
|
|
@@ -179,7 +179,7 @@ const filter$1 = (self, f) => {
|
|
|
179
179
|
};
|
|
180
180
|
const remove = (self, value) => filter$1(self, (v) => v !== value);
|
|
181
181
|
//#endregion
|
|
182
|
-
//#region node_modules/.pnpm/effect@
|
|
182
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/PubSub.js
|
|
183
183
|
const TypeId$4 = "~effect/PubSub";
|
|
184
184
|
const SubscriptionTypeId = "~effect/PubSub/Subscription";
|
|
185
185
|
const make$2 = (options) => sync(() => makePubSubUnsafe(options.atomicPubSub(), new Map(), makeUnsafe$2(), makeUnsafe$1(false), make$4(false), options.strategy()));
|
|
@@ -1132,7 +1132,7 @@ const emptyReplayWindow = {
|
|
|
1132
1132
|
close: () => void 0
|
|
1133
1133
|
};
|
|
1134
1134
|
//#endregion
|
|
1135
|
-
//#region node_modules/.pnpm/effect@
|
|
1135
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/Queue.js
|
|
1136
1136
|
const TypeId$3 = "~effect/Queue";
|
|
1137
1137
|
const EnqueueTypeId = "~effect/Queue/Enqueue";
|
|
1138
1138
|
const DequeueTypeId = "~effect/Queue/Dequeue";
|
|
@@ -1170,7 +1170,7 @@ const make$1 = (options) => withFiber$1((fiber) => {
|
|
|
1170
1170
|
});
|
|
1171
1171
|
const bounded = (capacity) => make$1({ capacity });
|
|
1172
1172
|
const unbounded = () => make$1();
|
|
1173
|
-
const offer = (self, message) => suspend$3(() => {
|
|
1173
|
+
const offer = dual(2, (self, message) => suspend$3(() => {
|
|
1174
1174
|
if (self.state._tag !== "Open") return exitFalse;
|
|
1175
1175
|
else if (self.messages.length >= self.capacity) switch (self.strategy) {
|
|
1176
1176
|
case "dropping": return exitFalse;
|
|
@@ -1189,7 +1189,7 @@ const offer = (self, message) => suspend$3(() => {
|
|
|
1189
1189
|
append(self.messages, message);
|
|
1190
1190
|
scheduleReleaseTaker(self);
|
|
1191
1191
|
return exitTrue;
|
|
1192
|
-
});
|
|
1192
|
+
}));
|
|
1193
1193
|
const offerUnsafe = (self, message) => {
|
|
1194
1194
|
if (self.state._tag !== "Open") return false;
|
|
1195
1195
|
else if (self.messages.length >= self.capacity) {
|
|
@@ -1208,13 +1208,13 @@ const offerUnsafe = (self, message) => {
|
|
|
1208
1208
|
scheduleReleaseTaker(self);
|
|
1209
1209
|
return true;
|
|
1210
1210
|
};
|
|
1211
|
-
const offerAll = (self, messages) => suspend$3(() => {
|
|
1211
|
+
const offerAll = dual(2, (self, messages) => suspend$3(() => {
|
|
1212
1212
|
if (self.state._tag !== "Open") return succeed$4(fromIterable$1(messages));
|
|
1213
1213
|
const remaining = offerAllUnsafe(self, messages);
|
|
1214
1214
|
if (remaining.length === 0) return exitSucceed([]);
|
|
1215
1215
|
else if (self.strategy === "dropping") return succeed$4(remaining);
|
|
1216
1216
|
return offerRemainingArray(self, remaining);
|
|
1217
|
-
});
|
|
1217
|
+
}));
|
|
1218
1218
|
const offerAllUnsafe = (self, messages) => {
|
|
1219
1219
|
if (self.state._tag !== "Open") return fromIterable$1(messages);
|
|
1220
1220
|
else if (self.capacity === Number.POSITIVE_INFINITY || self.strategy === "sliding") {
|
|
@@ -1235,8 +1235,8 @@ const offerAllUnsafe = (self, messages) => {
|
|
|
1235
1235
|
scheduleReleaseTaker(self);
|
|
1236
1236
|
return remaining;
|
|
1237
1237
|
};
|
|
1238
|
-
const fail$2 = (self, error) => failCause$
|
|
1239
|
-
const failCause$
|
|
1238
|
+
const fail$2 = dual(2, (self, error) => failCause$2(self, causeFail(error)));
|
|
1239
|
+
const failCause$2 = dual(2, (self, cause) => sync$1(() => failCauseUnsafe(self, cause)));
|
|
1240
1240
|
const failCauseUnsafe = (self, cause) => {
|
|
1241
1241
|
if (self.state._tag !== "Open") return false;
|
|
1242
1242
|
const exit = exitFailCause(cause);
|
|
@@ -1252,26 +1252,24 @@ const failCauseUnsafe = (self, cause) => {
|
|
|
1252
1252
|
};
|
|
1253
1253
|
return true;
|
|
1254
1254
|
};
|
|
1255
|
-
const end = (self) => failCause$
|
|
1255
|
+
const end = (self) => failCause$2(self, causeFail(Done()));
|
|
1256
1256
|
const endUnsafe = (self) => failCauseUnsafe(self, causeFail(Done()));
|
|
1257
|
-
const shutdown = (self) => sync$1(() =>
|
|
1258
|
-
|
|
1257
|
+
const shutdown = (self) => sync$1(() => shutdownUnsafe(self));
|
|
1258
|
+
const shutdownUnsafe = (self) => {
|
|
1259
|
+
if (self.state._tag === "Done") return false;
|
|
1259
1260
|
clear(self.messages);
|
|
1260
1261
|
const offers = self.state.offers;
|
|
1261
1262
|
finalize(self, self.state._tag === "Open" ? exitInterrupt : self.state.exit);
|
|
1262
|
-
if (
|
|
1263
|
-
|
|
1264
|
-
else entry.resume(exitSucceed(entry.remaining.slice(entry.offset)));
|
|
1265
|
-
offers.clear();
|
|
1266
|
-
}
|
|
1263
|
+
for (const entry of offers) if (entry._tag === "Single") entry.resume(exitFalse);
|
|
1264
|
+
else entry.resume(exitSucceed(entry.remaining.slice(entry.offset)));
|
|
1267
1265
|
return true;
|
|
1268
|
-
}
|
|
1266
|
+
};
|
|
1269
1267
|
const takeAll = (self) => takeBetween(self, 1, Number.POSITIVE_INFINITY);
|
|
1270
|
-
const takeBetween = (self, min, max) => {
|
|
1268
|
+
const takeBetween = dual(3, (self, min, max) => {
|
|
1271
1269
|
min = normalize(min);
|
|
1272
1270
|
max = normalize(max);
|
|
1273
1271
|
return suspend$3(() => takeBetweenUnsafe(self, min, max) ?? andThen$1(awaitTake(self), takeBetween(self, 1, max)));
|
|
1274
|
-
};
|
|
1272
|
+
});
|
|
1275
1273
|
const take$1 = (self) => suspend$3(() => takeUnsafe(self) ?? andThen$1(awaitTake(self), take$1(self)));
|
|
1276
1274
|
const poll = (self) => suspend$3(() => {
|
|
1277
1275
|
const result = takeUnsafe(self);
|
|
@@ -1418,7 +1416,7 @@ const finalize = (self, exit) => {
|
|
|
1418
1416
|
openState.awaiters.clear();
|
|
1419
1417
|
};
|
|
1420
1418
|
//#endregion
|
|
1421
|
-
//#region node_modules/.pnpm/effect@
|
|
1419
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/Semaphore.js
|
|
1422
1420
|
const makeUnsafe = (permits) => new SemaphoreImpl(permits);
|
|
1423
1421
|
const waitForPermits = (self, n, effect) => callback$1((resume) => {
|
|
1424
1422
|
if (self.free >= n) return resume(effect);
|
|
@@ -1509,10 +1507,10 @@ var SemaphoreImpl = class {
|
|
|
1509
1507
|
};
|
|
1510
1508
|
const make = (permits) => sync$1(() => new SemaphoreImpl(permits));
|
|
1511
1509
|
//#endregion
|
|
1512
|
-
//#region node_modules/.pnpm/effect@
|
|
1510
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/Take.js
|
|
1513
1511
|
const toPull = (take) => isExit(take) ? isSuccess(take) ? done(take.value) : take : succeed$2(take);
|
|
1514
1512
|
//#endregion
|
|
1515
|
-
//#region node_modules/.pnpm/effect@
|
|
1513
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/Channel.js
|
|
1516
1514
|
const TypeId$2 = "~effect/Channel";
|
|
1517
1515
|
const isChannel = (u) => hasProperty(u, TypeId$2);
|
|
1518
1516
|
const ChannelProto = {
|
|
@@ -1529,7 +1527,7 @@ const ChannelProto = {
|
|
|
1529
1527
|
};
|
|
1530
1528
|
const fromTransform = (transform) => {
|
|
1531
1529
|
const self = Object.create(ChannelProto);
|
|
1532
|
-
self.transform = (upstream, scope) => catchCause$1(transform(upstream, scope), (cause) => succeed$2(failCause$
|
|
1530
|
+
self.transform = (upstream, scope) => catchCause$1(transform(upstream, scope), (cause) => succeed$2(failCause$3(cause)));
|
|
1533
1531
|
return self;
|
|
1534
1532
|
};
|
|
1535
1533
|
const transformPull$1 = (self, f) => fromTransform((upstream, scope) => flatMap$2(toTransform(self)(upstream, scope), (pull) => f(pull, scope)));
|
|
@@ -1573,8 +1571,8 @@ const fromIterableArray = (iterable, chunkSize = DefaultChunkSize) => fromIterat
|
|
|
1573
1571
|
const succeed$1 = (value) => fromEffect$1(succeed$2(value));
|
|
1574
1572
|
const empty$1 = fromPull$1(succeed$2(done()));
|
|
1575
1573
|
const fail$1 = (error) => fromPull$1(succeed$2(fail$3(error)));
|
|
1576
|
-
const failCause = (cause) => fromPull$1(failCause$
|
|
1577
|
-
const die$1 = (defect) => failCause(die$2(defect));
|
|
1574
|
+
const failCause$1 = (cause) => fromPull$1(failCause$3(cause));
|
|
1575
|
+
const die$1 = (defect) => failCause$1(die$2(defect));
|
|
1578
1576
|
const fromEffect$1 = (effect) => fromPull$1(sync(() => {
|
|
1579
1577
|
let done$15 = false;
|
|
1580
1578
|
return suspend$2(() => {
|
|
@@ -1603,7 +1601,7 @@ const readableStreamToPullUnsafe = (options) => {
|
|
|
1603
1601
|
try: () => reader.read(),
|
|
1604
1602
|
catch: options.onError
|
|
1605
1603
|
}), {
|
|
1606
|
-
onFailure: (cause) => exit.current ?? failCause$
|
|
1604
|
+
onFailure: (cause) => exit.current ?? failCause$3(cause),
|
|
1607
1605
|
onSuccess: ({ done: done$10, value }) => {
|
|
1608
1606
|
if (exit.current) return exit.current;
|
|
1609
1607
|
return done$10 ? done() : succeed$2(of(value));
|
|
@@ -1636,17 +1634,17 @@ const mapEffectConcurrent = (self, f, options) => fromTransformBracket(fnUntrace
|
|
|
1636
1634
|
const semaphore = makeUnsafe(concurrencyN);
|
|
1637
1635
|
const release = constant(semaphore.release(1));
|
|
1638
1636
|
const handle = matchCauseEffect({
|
|
1639
|
-
onFailure: (cause) => flatMap$2(failCause$
|
|
1637
|
+
onFailure: (cause) => flatMap$2(failCause$2(queue, cause), release),
|
|
1640
1638
|
onSuccess: (value) => flatMap$2(offer(queue, value), release)
|
|
1641
1639
|
});
|
|
1642
1640
|
yield* semaphore.take(1).pipe(flatMap$2(() => pull), flatMap$2((value) => {
|
|
1643
1641
|
trackFiber(runFork(handle(f(value, i++))));
|
|
1644
1642
|
return void_;
|
|
1645
|
-
}), forever({ disableYield: true }), catchCause$1((cause) => semaphore.withPermits(concurrencyN - 1)(failCause$
|
|
1643
|
+
}), forever({ disableYield: true }), catchCause$1((cause) => semaphore.withPermits(concurrencyN - 1)(failCause$2(queue, cause))), forkIn(forkedScope));
|
|
1646
1644
|
} else {
|
|
1647
1645
|
const effects = yield* bounded(concurrencyN - 2);
|
|
1648
1646
|
yield* addFinalizer(forkedScope, shutdown(effects));
|
|
1649
|
-
yield* take$1(effects).pipe(flatten$1, flatMap$2((value) => offer(queue, value)), forever({ disableYield: true }), catchCause$1((cause) => failCause$
|
|
1647
|
+
yield* take$1(effects).pipe(flatten$1, flatMap$2((value) => offer(queue, value)), forever({ disableYield: true }), catchCause$1((cause) => failCause$2(queue, cause)), forkIn(forkedScope));
|
|
1650
1648
|
let errorCause;
|
|
1651
1649
|
const onExit = (exit) => {
|
|
1652
1650
|
if (exit._tag === "Success") return;
|
|
@@ -1654,12 +1652,12 @@ const mapEffectConcurrent = (self, f, options) => fromTransformBracket(fnUntrace
|
|
|
1654
1652
|
failCauseUnsafe(queue, exit.cause);
|
|
1655
1653
|
};
|
|
1656
1654
|
yield* pull.pipe(flatMap$2((value) => {
|
|
1657
|
-
if (errorCause) return failCause$
|
|
1655
|
+
if (errorCause) return failCause$3(errorCause);
|
|
1658
1656
|
const fiber = runFork(f(value, i++));
|
|
1659
1657
|
trackFiber(fiber);
|
|
1660
1658
|
fiber.addObserver(onExit);
|
|
1661
1659
|
return offer(effects, join(fiber));
|
|
1662
|
-
}), forever({ disableYield: true }), catchCause$1((cause) => offer(effects, failCause$
|
|
1660
|
+
}), forever({ disableYield: true }), catchCause$1((cause) => offer(effects, failCause$4(cause)).pipe(andThen(failCause$2(effects, cause)))), forkIn(forkedScope));
|
|
1663
1661
|
}
|
|
1664
1662
|
return take$1(queue);
|
|
1665
1663
|
}));
|
|
@@ -1723,10 +1721,10 @@ const catchCause = dual(2, (self, f) => fromTransform((upstream, scope) => {
|
|
|
1723
1721
|
let forkedScope = forkUnsafe(scope);
|
|
1724
1722
|
return map$2(toTransform(self)(upstream, forkedScope), (pull) => {
|
|
1725
1723
|
let currentPull = pull.pipe(catchCause$1((cause) => {
|
|
1726
|
-
if (isDoneCause(cause)) return failCause$
|
|
1724
|
+
if (isDoneCause(cause)) return failCause$3(cause);
|
|
1727
1725
|
const toClose = forkedScope;
|
|
1728
1726
|
forkedScope = forkUnsafe(scope);
|
|
1729
|
-
return close(toClose, failCause$
|
|
1727
|
+
return close(toClose, failCause$4(cause)).pipe(andThen(toTransform(f(cause))(upstream, forkedScope)), flatMap$2((childPull) => {
|
|
1730
1728
|
currentPull = childPull;
|
|
1731
1729
|
return childPull;
|
|
1732
1730
|
}));
|
|
@@ -1736,7 +1734,7 @@ const catchCause = dual(2, (self, f) => fromTransform((upstream, scope) => {
|
|
|
1736
1734
|
}));
|
|
1737
1735
|
const catchCauseFilter = dual(3, (self, filter, f) => catchCause(self, (cause) => {
|
|
1738
1736
|
const result = filter(cause);
|
|
1739
|
-
return isFailure(result) ? failCause(result.failure) : f(result.success, cause);
|
|
1737
|
+
return isFailure(result) ? failCause$1(result.failure) : f(result.success, cause);
|
|
1740
1738
|
}));
|
|
1741
1739
|
const catch_$1 = dual(2, (self, f) => catchCauseFilter(self, findError, (e) => f(e)));
|
|
1742
1740
|
const catchIf$1 = dual((args) => isChannel(args[0]), (self, predicate, f, orElse) => catch_$1(self, (err) => {
|
|
@@ -1785,21 +1783,21 @@ const mergeAll$1 = dual(2, (channels, { bufferSize = 16, concurrency, switch: sw
|
|
|
1785
1783
|
}
|
|
1786
1784
|
const fiber = yield* childPull.pipe(tap$1(() => yieldNow), flatMap$2((value) => offer(queue, value)), forever({ disableYield: true }), onError(fnUntraced(function* (cause) {
|
|
1787
1785
|
const halt = filterDone(cause);
|
|
1788
|
-
yield* exit(close(childScope, !isFailure(halt) ? succeed$3(halt.success.value) : failCause$
|
|
1786
|
+
yield* exit(close(childScope, !isFailure(halt) ? succeed$3(halt.success.value) : failCause$4(halt.failure)));
|
|
1789
1787
|
if (!fibers.has(fiber)) return;
|
|
1790
1788
|
fibers.delete(fiber);
|
|
1791
1789
|
if (semaphore) yield* semaphore.release(1);
|
|
1792
1790
|
if (fibers.size === 0) yield* doneLatch.open;
|
|
1793
1791
|
if (isSuccess$1(halt)) return;
|
|
1794
|
-
return yield* failCause$
|
|
1792
|
+
return yield* failCause$2(queue, cause);
|
|
1795
1793
|
})), forkChild);
|
|
1796
1794
|
doneLatch.closeUnsafe();
|
|
1797
1795
|
fibers.add(fiber);
|
|
1798
1796
|
}
|
|
1799
1797
|
}).pipe(catchCause$1((cause) => {
|
|
1800
1798
|
const halt = filterDone(cause);
|
|
1801
|
-
if (isSuccess$1(halt)) return doneLatch.whenOpen(failCause$
|
|
1802
|
-
return failCause$
|
|
1799
|
+
if (isSuccess$1(halt)) return doneLatch.whenOpen(failCause$2(queue, cause));
|
|
1800
|
+
return failCause$2(queue, cause);
|
|
1803
1801
|
}), forkIn(forkedScope));
|
|
1804
1802
|
return take$1(queue);
|
|
1805
1803
|
})));
|
|
@@ -1810,12 +1808,12 @@ const merge$1 = dual((args) => isChannel(args[0]) && isChannel(args[1]), (left,
|
|
|
1810
1808
|
let done = 0;
|
|
1811
1809
|
function onExit(side, cause) {
|
|
1812
1810
|
done++;
|
|
1813
|
-
if (!isDoneCause(cause)) return failCause$
|
|
1811
|
+
if (!isDoneCause(cause)) return failCause$2(queue, cause);
|
|
1814
1812
|
switch (strategy) {
|
|
1815
|
-
case "both": return done === 2 ? failCause$
|
|
1813
|
+
case "both": return done === 2 ? failCause$2(queue, cause) : void_;
|
|
1816
1814
|
case "left":
|
|
1817
|
-
case "right": return side === strategy ? failCause$
|
|
1818
|
-
case "either": return failCause$
|
|
1815
|
+
case "right": return side === strategy ? failCause$2(queue, cause) : void_;
|
|
1816
|
+
case "either": return failCause$2(queue, cause);
|
|
1819
1817
|
}
|
|
1820
1818
|
}
|
|
1821
1819
|
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));
|
|
@@ -1874,7 +1872,7 @@ const splitLines$1 = () => fromTransform((upstream, _scope) => sync(() => {
|
|
|
1874
1872
|
if (done$12._tag === "Some") return done(done$12.value);
|
|
1875
1873
|
return matchEffect(upstream, {
|
|
1876
1874
|
onSuccess: loop,
|
|
1877
|
-
onFailure: failCause$
|
|
1875
|
+
onFailure: failCause$3,
|
|
1878
1876
|
onDone: (leftover) => {
|
|
1879
1877
|
done$12 = some(leftover);
|
|
1880
1878
|
if (stringBuilder.length > 0) {
|
|
@@ -1932,7 +1930,7 @@ const toPubSubTake$1 = dual(2, fnUntraced(function* (self, options) {
|
|
|
1932
1930
|
return pubsub;
|
|
1933
1931
|
}));
|
|
1934
1932
|
//#endregion
|
|
1935
|
-
//#region node_modules/.pnpm/effect@
|
|
1933
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/internal/stream.js
|
|
1936
1934
|
const TypeId$1 = "~effect/Stream";
|
|
1937
1935
|
const streamVariance = {
|
|
1938
1936
|
_R: identity,
|
|
@@ -1950,7 +1948,7 @@ Stream.prototype = {
|
|
|
1950
1948
|
};
|
|
1951
1949
|
const fromChannel$1 = (channel) => new Stream(channel);
|
|
1952
1950
|
//#endregion
|
|
1953
|
-
//#region node_modules/.pnpm/effect@
|
|
1951
|
+
//#region node_modules/.pnpm/effect@https+++pkg.pr.new+Effect-TS+effect+effect@24fa0ab_8fb3e3e1ff7f03df0873bfda51410aa1/node_modules/effect/dist/Stream.js
|
|
1954
1952
|
const TypeId = "~effect/Stream";
|
|
1955
1953
|
const isStream = (u) => hasProperty(u, TypeId);
|
|
1956
1954
|
const fromChannel = fromChannel$1;
|
|
@@ -1963,6 +1961,7 @@ const empty = fromChannel(empty$1);
|
|
|
1963
1961
|
const succeed = (value) => fromChannel(succeed$1(of(value)));
|
|
1964
1962
|
const suspend = (stream) => fromChannel(suspend$1(() => stream().channel));
|
|
1965
1963
|
const fail = (error) => fromChannel(fail$1(error));
|
|
1964
|
+
const failCause = (cause) => fromChannel(failCause$1(cause));
|
|
1966
1965
|
const die = (defect) => fromChannel(die$1(defect));
|
|
1967
1966
|
const fromIterable = (iterable, options) => Array.isArray(iterable) && options?.chunkSize === void 0 ? fromArray(iterable) : fromChannel(fromIterableArray(iterable, options?.chunkSize));
|
|
1968
1967
|
const fromArray = (array) => isReadonlyArrayNonEmpty(array) ? fromChannel(succeed$1(array)) : empty;
|
|
@@ -2006,11 +2005,11 @@ const take = dual(2, (self, n) => {
|
|
|
2006
2005
|
});
|
|
2007
2006
|
const takeUntil = dual((args) => isStream(args[0]), (self, predicate, options) => transformPull(self, (pull, _scope) => sync(() => {
|
|
2008
2007
|
let i = 0;
|
|
2009
|
-
let done$
|
|
2010
|
-
return flatMap$2(suspend$2(() => done$
|
|
2008
|
+
let done$4 = false;
|
|
2009
|
+
return flatMap$2(suspend$2(() => done$4 ? done() : pull), (chunk) => {
|
|
2011
2010
|
const index = chunk.findIndex((a) => predicate(a, i++));
|
|
2012
2011
|
if (index >= 0) {
|
|
2013
|
-
done$
|
|
2012
|
+
done$4 = true;
|
|
2014
2013
|
const arr = chunk.slice(0, options?.excludeLast ? index : index + 1);
|
|
2015
2014
|
return isReadonlyArrayNonEmpty(arr) ? succeed$2(arr) : done();
|
|
2016
2015
|
}
|
|
@@ -2032,7 +2031,7 @@ const drop = dual(2, (self, n) => {
|
|
|
2032
2031
|
}));
|
|
2033
2032
|
});
|
|
2034
2033
|
const transduce = dual(2, (self, sink) => transformPull(self, (upstream, scope) => sync(() => {
|
|
2035
|
-
let done$
|
|
2034
|
+
let done$1;
|
|
2036
2035
|
let leftover;
|
|
2037
2036
|
const upstreamWithLeftover = suspend$2(() => {
|
|
2038
2037
|
if (leftover !== void 0) {
|
|
@@ -2042,14 +2041,14 @@ const transduce = dual(2, (self, sink) => transformPull(self, (upstream, scope)
|
|
|
2042
2041
|
}
|
|
2043
2042
|
return upstream;
|
|
2044
2043
|
}).pipe(catch_$2((error) => {
|
|
2045
|
-
done$
|
|
2044
|
+
done$1 = fail$5(error);
|
|
2046
2045
|
return done();
|
|
2047
2046
|
}));
|
|
2048
2047
|
const pull = map$2(suspend$2(() => sink.transform(upstreamWithLeftover, scope)), ([value, leftover_]) => {
|
|
2049
2048
|
leftover = leftover_;
|
|
2050
2049
|
return of(value);
|
|
2051
2050
|
});
|
|
2052
|
-
return suspend$2(() => done$
|
|
2051
|
+
return suspend$2(() => done$1 ? done$1 : pull);
|
|
2053
2052
|
})));
|
|
2054
2053
|
const broadcast = dual(2, (self, options) => map$2(toPubSubTake(self, options), fromPubSubTake));
|
|
2055
2054
|
const pipeThroughChannel = dual(2, (self, channel) => fromChannel(pipeTo(self.channel, channel)));
|
|
@@ -2085,6 +2084,6 @@ const mkString = (self) => runFold$1(self.channel, () => "", (acc, chunk) => acc
|
|
|
2085
2084
|
const runIntoPubSub = dual((args) => isStream(args[0]), (self, pubsub, options) => runIntoPubSubArray(self.channel, pubsub, options));
|
|
2086
2085
|
const toPubSubTake = dual(2, (self, options) => toPubSubTake$1(self.channel, options));
|
|
2087
2086
|
//#endregion
|
|
2088
|
-
export {
|
|
2087
|
+
export { tap as $, mapArrayEffect as A, getCurrent as At, provideService as B, round as Bt, fromPubSub as C, unbounded as Ct, isStream as D, update as Dt, fromReadableStream as E, set as Et, mkString as F, join as Ft, runForEach as G, runCollect as H, onEnd as I, runIn as It, splitLines as J, runForEachArray as K, orDie as L, camelToSnake as Lt, mapError as M, interruptAll as Mt, merge as N, interruptAllAs as Nt, map as O, makeUnsafe$1 as Ot, mergeAll as P, interruptAs as Pt, takeUntil as Q, pipeThroughChannel as R, toLowerCase as Rt, fromIterable as S, take$1 as St, fromQueue as T, make$4 as Tt, runDrain as U, run as V, normalizeNonEmpty as Vt, runFold as W, suspend as X, succeed as Y, take as Z, flattenIterable as _, offer as _t, catchTags as a, pipeTo as at, fromChannel as b, offerUnsafe as bt, die as c, make as ct, ensuring as d, end as dt, transduce as et, fail as f, endUnsafe as ft, flatMap as g, make$1 as gt, filterMap as h, failCauseUnsafe as ht, catchReason as i, mapDone as it, mapEffect as j, interrupt as jt, mapArray as k, await_ as kt, drop as l, makeUnsafe as lt, filter as m, failCause$2 as mt, callback as n, fromTransform as nt, catch_ as o, toTransform as ot, failCause as p, fail$2 as pt, runIntoPubSub as q, catchIf as r, map$1 as rt, decodeText as s, unwrap$1 as st, broadcast as t, unwrap as tt, empty as u, bounded as ut, fromArray as v, offerAll as vt, fromPull as w, unbounded$1 as wt, fromEffect as x, poll as xt, fromArrayEffect as y, offerAllUnsafe as yt, provideContext as z, parse as zt };
|
|
2089
2088
|
|
|
2090
|
-
//# sourceMappingURL=Stream-
|
|
2089
|
+
//# sourceMappingURL=Stream-Dg7AGCgJ.mjs.map
|