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.
Files changed (185) hide show
  1. package/dist/Acp.d.ts +4 -4
  2. package/dist/Acp.d.ts.map +1 -1
  3. package/dist/Acp.js +8 -6
  4. package/dist/Acp.js.map +1 -1
  5. package/dist/Acp.test.js +66 -4
  6. package/dist/Acp.test.js.map +1 -1
  7. package/dist/AcpImage.test.js +7 -7
  8. package/dist/AcpImage.test.js.map +1 -1
  9. package/dist/Agent.d.ts +8 -8
  10. package/dist/Agent.d.ts.map +1 -1
  11. package/dist/Agent.js +17 -7
  12. package/dist/Agent.js.map +1 -1
  13. package/dist/Agent.test.js +53 -8
  14. package/dist/Agent.test.js.map +1 -1
  15. package/dist/AgentExecutor.d.ts +9 -9
  16. package/dist/AgentExecutor.d.ts.map +1 -1
  17. package/dist/AgentExecutor.js +5 -5
  18. package/dist/AgentExecutor.js.map +1 -1
  19. package/dist/AgentExecutorImage.test.js +6 -6
  20. package/dist/AgentExecutorImage.test.js.map +1 -1
  21. package/dist/AgentImage.test.js +3 -3
  22. package/dist/AgentImage.test.js.map +1 -1
  23. package/dist/AgentOutput.d.ts +10 -2
  24. package/dist/AgentOutput.d.ts.map +1 -1
  25. package/dist/AgentOutput.js +10 -2
  26. package/dist/AgentOutput.js.map +1 -1
  27. package/dist/AgentSkills.d.ts.map +1 -1
  28. package/dist/AgentSkills.js +6 -1
  29. package/dist/AgentSkills.js.map +1 -1
  30. package/dist/AgentSkills.test.js +21 -4
  31. package/dist/AgentSkills.test.js.map +1 -1
  32. package/dist/AgentTools.d.ts +4 -4
  33. package/dist/AgentTools.d.ts.map +1 -1
  34. package/dist/AgentTools.js +4 -4
  35. package/dist/AgentTools.js.map +1 -1
  36. package/dist/AgentToolsImage.test.js +2 -2
  37. package/dist/AgentToolsImage.test.js.map +1 -1
  38. package/dist/ChunkRepo.d.ts +10 -10
  39. package/dist/ChunkRepo.d.ts.map +1 -1
  40. package/dist/ChunkRepo.js +7 -7
  41. package/dist/ChunkRepo.js.map +1 -1
  42. package/dist/ChunkRepo.test.js +2 -2
  43. package/dist/ChunkRepo.test.js.map +1 -1
  44. package/dist/CodeChunker.d.ts +1 -1
  45. package/dist/CodeChunker.d.ts.map +1 -1
  46. package/dist/CodeChunker.js +2 -2
  47. package/dist/CodeChunker.js.map +1 -1
  48. package/dist/Codex.d.ts +5 -5
  49. package/dist/Codex.d.ts.map +1 -1
  50. package/dist/Codex.js +1 -1
  51. package/dist/Codex.js.map +1 -1
  52. package/dist/CodexAuth.d.ts +2 -2
  53. package/dist/CodexAuth.d.ts.map +1 -1
  54. package/dist/CodexAuth.js +6 -6
  55. package/dist/CodexAuth.js.map +1 -1
  56. package/dist/CodexAuth.test.js +3 -3
  57. package/dist/CodexAuth.test.js.map +1 -1
  58. package/dist/Compaction.d.ts +3 -3
  59. package/dist/Compaction.d.ts.map +1 -1
  60. package/dist/Compaction.js +3 -3
  61. package/dist/Compaction.js.map +1 -1
  62. package/dist/Compaction.test.js +3 -3
  63. package/dist/Compaction.test.js.map +1 -1
  64. package/dist/CompactionImage.test.js +4 -4
  65. package/dist/CompactionImage.test.js.map +1 -1
  66. package/dist/CompactionTokens.test.js +3 -3
  67. package/dist/CompactionTokens.test.js.map +1 -1
  68. package/dist/CompactionTransport.test.js +5 -5
  69. package/dist/CompactionTransport.test.js.map +1 -1
  70. package/dist/Copilot.d.ts +3 -3
  71. package/dist/Copilot.d.ts.map +1 -1
  72. package/dist/Copilot.js +1 -1
  73. package/dist/Copilot.js.map +1 -1
  74. package/dist/CopilotAuth.d.ts +2 -2
  75. package/dist/CopilotAuth.d.ts.map +1 -1
  76. package/dist/CopilotAuth.js +4 -4
  77. package/dist/CopilotAuth.js.map +1 -1
  78. package/dist/CopilotAuth.test.js +2 -2
  79. package/dist/CopilotAuth.test.js.map +1 -1
  80. package/dist/GlobalWebSocket.d.ts +1 -1
  81. package/dist/GlobalWebSocket.d.ts.map +1 -1
  82. package/dist/GlobalWebSocket.js +1 -1
  83. package/dist/GlobalWebSocket.js.map +1 -1
  84. package/dist/Image.d.ts +2 -2
  85. package/dist/Image.d.ts.map +1 -1
  86. package/dist/Image.js +3 -3
  87. package/dist/Image.js.map +1 -1
  88. package/dist/Image.test.js +2 -2
  89. package/dist/Image.test.js.map +1 -1
  90. package/dist/SemanticSearch.d.ts +3 -3
  91. package/dist/SemanticSearch.d.ts.map +1 -1
  92. package/dist/SemanticSearch.js +1 -1
  93. package/dist/SemanticSearch.js.map +1 -1
  94. package/dist/Sqlite.d.ts +2 -2
  95. package/dist/Sqlite.d.ts.map +1 -1
  96. package/dist/Sqlite.js +1 -1
  97. package/dist/Sqlite.js.map +1 -1
  98. package/dist/ToolkitRenderer.d.ts +2 -2
  99. package/dist/ToolkitRenderer.d.ts.map +1 -1
  100. package/dist/WebToMarkdown.d.ts +2 -2
  101. package/dist/WebToMarkdown.d.ts.map +1 -1
  102. package/dist/WebToMarkdown.js +1 -1
  103. package/dist/WebToMarkdown.js.map +1 -1
  104. package/dist/WebToMarkdown.test.js +1 -1
  105. package/dist/WebToMarkdown.test.js.map +1 -1
  106. package/dist/Xai.d.ts +10 -3
  107. package/dist/Xai.d.ts.map +1 -1
  108. package/dist/Xai.js +26 -2
  109. package/dist/Xai.js.map +1 -1
  110. package/dist/Xai.test.js +38 -4
  111. package/dist/Xai.test.js.map +1 -1
  112. package/dist/XaiAuth.d.ts +2 -2
  113. package/dist/XaiAuth.d.ts.map +1 -1
  114. package/dist/XaiAuth.js +4 -4
  115. package/dist/XaiAuth.js.map +1 -1
  116. package/dist/XaiAuth.test.js +2 -2
  117. package/dist/XaiAuth.test.js.map +1 -1
  118. package/dist/bin/{Effect-CeAMoJlg.mjs → Effect-DvI8YVcR.mjs} +81 -387
  119. package/dist/bin/Effect-DvI8YVcR.mjs.map +1 -0
  120. package/dist/bin/{McpClient-zQibhsnA.mjs → McpClient-CM7u8ZVd.mjs} +3 -3
  121. package/dist/bin/{McpClient-zQibhsnA.mjs.map → McpClient-CM7u8ZVd.mjs.map} +1 -1
  122. package/dist/bin/{OutputFormatter-C7Awn0DS.mjs → OutputFormatter-BpggeGvI.mjs} +3 -3
  123. package/dist/bin/{OutputFormatter-C7Awn0DS.mjs.map → OutputFormatter-BpggeGvI.mjs.map} +1 -1
  124. package/dist/bin/{Schema-Bc06DxcV.mjs → Schema-DyJ738Wp.mjs} +1979 -1663
  125. package/dist/bin/Schema-DyJ738Wp.mjs.map +1 -0
  126. package/dist/bin/{SemanticSearch-BPxQoRSC.mjs → SemanticSearch-BHUGFT1y.mjs} +46 -42
  127. package/dist/bin/SemanticSearch-BHUGFT1y.mjs.map +1 -0
  128. package/dist/bin/{Stream-DlGXvw0L.mjs → Stream-Dg7AGCgJ.mjs} +60 -61
  129. package/dist/bin/Stream-Dg7AGCgJ.mjs.map +1 -0
  130. package/dist/bin/cli.mjs +614 -371
  131. package/dist/bin/cli.mjs.map +1 -1
  132. package/dist/cli.js +7 -5
  133. package/dist/cli.js.map +1 -1
  134. package/dist/fixtures/TestImages.js +2 -2
  135. package/dist/fixtures/TestImages.js.map +1 -1
  136. package/package.json +7 -7
  137. package/src/Acp.test.ts +107 -5
  138. package/src/Acp.ts +10 -8
  139. package/src/AcpImage.test.ts +9 -9
  140. package/src/Agent.test.ts +61 -9
  141. package/src/Agent.ts +20 -10
  142. package/src/AgentExecutor.ts +8 -8
  143. package/src/AgentExecutorImage.test.ts +6 -6
  144. package/src/AgentImage.test.ts +5 -5
  145. package/src/AgentOutput.ts +10 -2
  146. package/src/AgentSkills.test.ts +81 -37
  147. package/src/AgentSkills.ts +5 -1
  148. package/src/AgentTools.ts +5 -5
  149. package/src/AgentToolsImage.test.ts +4 -4
  150. package/src/ChunkRepo.test.ts +2 -2
  151. package/src/ChunkRepo.ts +7 -7
  152. package/src/CodeChunker.ts +2 -2
  153. package/src/Codex.ts +4 -4
  154. package/src/CodexAuth.test.ts +3 -3
  155. package/src/CodexAuth.ts +6 -6
  156. package/src/Compaction.test.ts +3 -3
  157. package/src/Compaction.ts +3 -3
  158. package/src/CompactionImage.test.ts +4 -4
  159. package/src/CompactionTokens.test.ts +3 -3
  160. package/src/CompactionTransport.test.ts +6 -6
  161. package/src/Copilot.ts +2 -2
  162. package/src/CopilotAuth.test.ts +2 -6
  163. package/src/CopilotAuth.ts +4 -4
  164. package/src/GlobalWebSocket.ts +1 -1
  165. package/src/Image.test.ts +2 -2
  166. package/src/Image.ts +4 -4
  167. package/src/OutputFormatter.ts +1 -1
  168. package/src/SemanticSearch.test.ts +1 -1
  169. package/src/SemanticSearch.ts +3 -3
  170. package/src/Sqlite.ts +1 -1
  171. package/src/ToolkitRenderer.ts +2 -2
  172. package/src/WebToMarkdown.test.ts +1 -1
  173. package/src/WebToMarkdown.ts +2 -2
  174. package/src/Xai.test.ts +67 -8
  175. package/src/Xai.ts +52 -3
  176. package/src/XaiAuth.test.ts +2 -2
  177. package/src/XaiAuth.ts +4 -4
  178. package/src/cli.ts +9 -7
  179. package/src/fixtures/TestImages.ts +2 -2
  180. package/src/fixtures/patch13-broken.txt +4 -4
  181. package/src/fixtures/patch13-fixed.txt +4 -4
  182. package/dist/bin/Effect-CeAMoJlg.mjs.map +0 -1
  183. package/dist/bin/Schema-Bc06DxcV.mjs.map +0 -1
  184. package/dist/bin/SemanticSearch-BPxQoRSC.mjs.map +0 -1
  185. package/dist/bin/Stream-DlGXvw0L.mjs.map +0 -1
@@ -1,9 +1,9 @@
1
- import { $r as exitVoid, A as ensuring$2, Ao as exitFailCause, B as fnUntraced, Br as void_$2, C as catch_$2, Ci as suspend$3, Cn as isDoneCause, Ct as promise, Di as void_$1, Dr as interruptWith, Ds as constVoid, Dt as raceFirst, E as contextWith, Eo as PipeInspectableProto, Er as doneUnsafe, Et as provideService$2, Fr as interrupt$1, G as forkIn, Gr as asSome, Gt as tap$1, H as forEach, I as flatMap$2, Ir as isExit, Is as pipeArguments, Ji as isArrayNonEmpty, K as forkScoped, Ki as fromIterable$1, Kr as callback$1, L as flatMapEager, Ln as findError, M as fail$3, Mo as withFiber$1, N as failCause$2, Nn as die$2, Nr as fail$5, Nt as runForkWith, Oo as causeFail, Os as constant, Pa as get$1, Pn as done, Pr as failCause$3, Qr as exitInterrupt$1, Qt as uninterruptible, R as flatten$1, Rr as isSuccess, Rt as scopedWith, Si as succeedNone, Sn as filterDone, T as context, Ti as uninterruptibleMask, Ts as constTrue, Tt as provideContext$2, U as forever, Ut as suspend$2, Vt as succeed$2, W as forkChild, Wr as andThen$1, Wt as sync, Xi as isReadonlyArrayNonEmpty, Y as gen, Yt as tryPromise, Z as interrupt$2, _r as forkUnsafe, _t as onExit$1, a as andThen, ai as fiberInterruptAs, an as whileLoop, bi as scopeFinalizerCountUnsafe, bn as catchDone, br as provide, bs as isTagged, c as as, ci as flatMap$3, da as isFailure, ea as map$3, ei as exitZipRight, fa as isSuccess$1, gr as close, gt as onError, hr as addFinalizerExit, ht as never, ii as fiberInterruptAllAs, in as when, j as exit, jo as exitSucceed, jr as makeUnsafe$3, js as identity, ko as exitFail, ks as dual, m as catchCause$1, ma as succeed$5, mi as makeLatchUnsafe, mr as addFinalizer, na as of, ni as fiberInterrupt, oa as headUnsafe, oi as fiberJoin, on as withFiber, ot as map$2, pi as makeLatch, pr as Scope, pt as matchCauseEffect, ri as fiberInterruptAll, rn as void_, rs as hasProperty, sa as fail$4, si as fiberRunIn, so as none, t as acquireRelease, ti as fiberAwait, u as asVoid, ui as getCurrentFiber, un as yieldNow, uo as some, vi as onExitPrimitive, wi as sync$1, wn as matchEffect, wo as Done, wr as _await, xi as succeed$4, xn as doneExitFromCause, yr as makeUnsafe$2, ys as isString$1, yt as onInterrupt, zo as toJson, zr as succeed$3 } from "./Effect-CeAMoJlg.mjs";
2
- //#region node_modules/.pnpm/effect@4.0.0-rc.115/node_modules/effect/dist/internal/count.js
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@4.0.0-rc.115/node_modules/effect/dist/Number.js
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@4.0.0-rc.115/node_modules/effect/dist/String.js
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@4.0.0-rc.115/node_modules/effect/dist/Fiber.js
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@4.0.0-rc.115/node_modules/effect/dist/Latch.js
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@4.0.0-rc.115/node_modules/effect/dist/MutableRef.js
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@4.0.0-rc.115/node_modules/effect/dist/MutableList.js
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@4.0.0-rc.115/node_modules/effect/dist/PubSub.js
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@4.0.0-rc.115/node_modules/effect/dist/Queue.js
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$1(self, causeFail(error));
1239
- const failCause$1 = dual(2, (self, cause) => sync$1(() => failCauseUnsafe(self, cause)));
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$1(self, causeFail(Done()));
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
- if (self.state._tag === "Done") return true;
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 (offers.size > 0) {
1263
- for (const entry of offers) if (entry._tag === "Single") entry.resume(exitFalse);
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@4.0.0-rc.115/node_modules/effect/dist/Semaphore.js
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@4.0.0-rc.115/node_modules/effect/dist/Take.js
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@4.0.0-rc.115/node_modules/effect/dist/Channel.js
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$2(cause)));
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$2(cause));
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$2(cause),
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$1(queue, cause), release),
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$1(queue, cause))), forkIn(forkedScope));
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$1(queue, cause)), forkIn(forkedScope));
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$2(errorCause);
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$3(cause)).pipe(andThen(failCause$1(effects, cause)))), forkIn(forkedScope));
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$2(cause);
1724
+ if (isDoneCause(cause)) return failCause$3(cause);
1727
1725
  const toClose = forkedScope;
1728
1726
  forkedScope = forkUnsafe(scope);
1729
- return close(toClose, failCause$3(cause)).pipe(andThen(toTransform(f(cause))(upstream, forkedScope)), flatMap$2((childPull) => {
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$3(halt.failure)));
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$1(queue, cause);
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$1(queue, cause));
1802
- return failCause$1(queue, cause);
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$1(queue, cause);
1811
+ if (!isDoneCause(cause)) return failCause$2(queue, cause);
1814
1812
  switch (strategy) {
1815
- case "both": return done === 2 ? failCause$1(queue, cause) : void_;
1813
+ case "both": return done === 2 ? failCause$2(queue, cause) : void_;
1816
1814
  case "left":
1817
- case "right": return side === strategy ? failCause$1(queue, cause) : void_;
1818
- case "either": return failCause$1(queue, cause);
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$2,
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@4.0.0-rc.115/node_modules/effect/dist/internal/stream.js
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@4.0.0-rc.115/node_modules/effect/dist/Stream.js
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$1 = false;
2010
- return flatMap$2(suspend$2(() => done$1 ? done() : pull), (chunk) => {
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$1 = true;
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$6;
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$6 = fail$5(error);
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$6 ? done$6 : pull);
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 { transduce as $, mapEffect as A, interrupt as At, run as B, normalizeNonEmpty as Bt, fromPull as C, unbounded$1 as Ct, map as D, makeUnsafe$1 as Dt, isStream as E, update as Et, onEnd as F, runIn as Ft, runForEachArray as G, runDrain as H, orDie as I, camelToSnake as It, succeed as J, runIntoPubSub as K, pipeThroughChannel as L, toLowerCase as Lt, merge as M, interruptAllAs as Mt, mergeAll as N, interruptAs as Nt, mapArray as O, await_ as Ot, mkString as P, join as Pt, tap as Q, provideContext as R, parse as Rt, fromPubSub as S, unbounded as St, fromReadableStream as T, set as Tt, runFold as U, runCollect as V, runForEach as W, take as X, suspend as Y, takeUntil as Z, fromArray as _, offerAll as _t, catchTags as a, toTransform as at, fromEffect as b, poll as bt, die as c, makeUnsafe as ct, ensuring as d, endUnsafe as dt, unwrap as et, fail as f, fail$2 as ft, flattenIterable as g, offer as gt, flatMap as h, make$1 as ht, catchReason as i, pipeTo as it, mapError as j, interruptAll as jt, mapArrayEffect as k, getCurrent as kt, drop as l, bounded as lt, filterMap as m, failCauseUnsafe as mt, callback as n, map$1 as nt, catch_ as o, unwrap$1 as ot, filter as p, failCause$1 as pt, splitLines as q, catchIf as r, mapDone as rt, decodeText as s, make as st, broadcast as t, fromTransform as tt, empty as u, end as ut, fromArrayEffect as v, offerAllUnsafe as vt, fromQueue as w, make$4 as wt, fromIterable as x, take$1 as xt, fromChannel as y, offerUnsafe as yt, provideService as z, round as zt };
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-DlGXvw0L.mjs.map
2089
+ //# sourceMappingURL=Stream-Dg7AGCgJ.mjs.map