codexuse-cli 3.6.4 → 3.6.6

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.
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env bun
2
2
 
3
- import { $ as encodeUnknownEffect, $i as isFailure, $n as asSome$1, $o as BaseProto, $r as scoped, $t as runFold, A as NullOr, Aa as gen$1, An as make$21, Ao as getOrThrow, Ar as log$1, At as Size, B as Union, Ba as succeedNone, Bi as close, Bn as parseJson, Bo as map$5, Br as onInterrupt, Bt as fromChannel$1, C as Finite, Ca as fiberInterrupt, Ci as catchDone, Cn as offerAll, Co as sort, Cr as forkIn, Ct as assign, D as NonEmptyArray, Da as forkDetach, Di as TaggedError, Dn as unbounded, Do as makeEquivalence$2, Dr as ignoreCause, Dt as FileDescriptor, E as Literals, Ea as forever$1, Ei as Error$1, En as take, Eo as filterMap, Er as ignore, Et as TypeId$17, F as TaggedErrorClass, Fa as scopeAddFinalizerExit, Fi as succeed$2, Fn as badArgument, Fo as getOrElse, Fr as map$3, Ft as decodeText, G as decodeEffect, Ga as updateServices, Gi as fail$4, Gn as encodeBase64Url, Go as make$27, Gr as provideService, Gt as fromReadableStream, H as Void, Ha as sync$1, Hi as provide$2, Hn as InvalidValue$1, Ho as none$3, Hr as orElseSucceed, Ht as fromIterable$1, I as TemplateLiteral, Ia as servicesWith, Ii as sync$2, In as systemError, Io as getOrNull, Ir as mapError, J as decodeUnknownEffect, Ja as CurrentLogSpans, Ji as make$28, Jn as addFinalizer$1, Jo as PipeInspectableProto, Jr as runFork, Jt as merge$1, K as decodeExit, Ka as void_$2, Ki as failCause$1, Kn as acquireRelease, Ko as make$33, Kr as provideServices, Kt as isStream, L as Trim, La as sleep$1, Li as unwrap$1, Ln as nominal, Lo as getOrUndefined, Lr as matchCauseEffect, Lt as empty$4, M as Record, Ma as loggerMake, Mi as mergeAll, Mn as makeUnsafe$1, Mo as succeed$4, Mr as logError$1, Mt as make$22, N as String$1, Na as onExit, Ni as provide$1, No as filter$1, Nr as logInfo$1, Nt as callback$1, O as NonEmptyString, Oa as formatLabel, Oi as effect, On as publish, Oo as fail$3, Or as interrupt, Ot as FileSystem, P as Struct, Pa as scope, Pi as provideMerge, Pn as BadArgument, Po as fromNullishOr, Pr as logWarning$1, Pt as concat, Q as encodeEffect, Qa as Service, Qi as hasInterrupts$1, Qn as as, Qo as withFiber, Qt as runCollect, R as Tuple, Ra as structuredMessage, Ri as Scope, Rn as transform$1, Ro as isNone, Rr as matchEffect, Rt as fail$5, S as ErrorClass, Sa as defaultLogger$1, Si as zipWith, Sn as offer$1, So as of, Sr as forkDetach$1, St as withDecodingDefault, T as Literal, Ta as fnUntraced$1, Ti as Class, Tn as shutdown, To as map$7, Tr as gen, Tt as Path$1, U as brand, Ua as tracerLogger$1, Ui as _await, Un as makeFormatterDefault, Uo as some, Ur as promise, Ut as fromPubSub, V as Unknown, Va as suspend$1, Vi as make$29, Vn as stringifyJson, Vo as match, Vr as orDie, Vt as fromEffect, W as declare, Wa as uninterruptibleMask, Wi as doneUnsafe, Wn as make$32, Wo as Number$2, Wr as provide, Wt as fromQueue, X as decodeUnknownSync, Xa as DisablePropagation, Xi as succeed$5, Xn as andThen, Xo as exitSucceed, Xr as runPromiseWith, Xt as onExit$1, Y as decodeUnknownExit, Ya as MinimumLogLevel, Yi as makeUnsafe$2, Yn as all, Yo as YieldableProto, Yr as runPromise, Yt as mkString, Z as encode, Za as Reference, Zi as fail, Zn as annotateLogs, Zo as isEffect$1, Zr as runSync, Zt as run$2, _ as url, _a as andThen$1, _i as useSpan, _n as set$3, _o as fromIterable$2, _r as fn, _s as constVoid, _t as tag, aa as UnknownError, ai as succeedNone$1, an as unwrap, ao as fromInputUnsafe, ar as catchFilter, as as symbolRedactable, at as isLessThanOrEqualTo, b as DateValid, ba as causePretty, bi as withParentSpan, bn as failCauseUnsafe, bo as makeEquivalence$1, br as forever, bs as pipe, bt as toType, c as FalseValues, ca as hasInterrupts, ci as tap, cn as drain, co as isZero, cr as catch_, cs as structure, ct as isMinLength, d as boolean$3, da as squash, di as timeoutOrElse, dn as fromTransform, do as toMillis, dr as ensuring, ds as isNotNull, dt as isSchemaError, ea as isSuccess, ei as service, en as runForEach, eo as empty$5, er as asVoid, es as Class$1, et as fromJsonString, f as map$6, fa as ClockRef, fi as tryPromise, fn as mapDone, fo as toSeconds, fr as exit, fs as isNotUndefined, ft as link$1, ga as addFinalizer$2, gi as updateServices$1, gn as remove$2, go as flatMapNullishOr, gr as flatMap, gs as constTrue, gt as suspend$2, h as string$3, ha as LogToStderr$1, hi as uninterruptibleMask$1, hn as make$25, ho as filter, hr as filterOrFail, hs as constFalse, ht as optional$2, ia as NoSuchElementError, ii as succeed, in as transduce, io as merge$2, ir as catchDefect, is as redact$1, it as isGreaterThanOrEqualTo, j as Number$1, ja as ignore$1, ji as empty$6, jn as set$4, jo as isFailure$1, jr as logDebug, jt as WatchBackend, k as Null, ka as formatLogSpan, ki as effectDiscard, kn as unbounded$1, ko as failVoid, kr as isEffect, kt as FileTypeId, l as TrueValues, la as hasInterruptsOnly, li as tapCause, ln as fromChannel, lo as minutes, lr as die, ls as symbol$1, lt as isNonEmpty, m as port, ma as CurrentLoggers$1, mi as uninterruptible, mn as get$3, mo as ensure, mr as failCause, ms as isUndefined, mt as mutable, n as SqlClient, na as void_$3, ni as services, nn as suspend$3, nr as callback, ns as format$1, nt as isBetween, oa as done, oi as suspend, on as get$2, oo as infinity, or as catchTag, os as symbol, ot as isMaxLength, p as option, pa as ConsoleRef, pi as try_, pn as make$30, po as zero, pr as fail$1, ps as isNullish, pt as makeFilter, q as decodeTo, qa as CurrentLogAnnotations, qi as isDone, qn as acquireUseRelease, qo as strictEqual, qr as result, qt as make$31, ra as Done, ri as servicesWith$1, rn as toReadableStreamEffect, ro as make$26, rr as catchCause, rs as formatJson$1, rt as isGreaterThan, s as Boolean$1, sa as fail$2, si as sync, sn as make$23, so as isFinite$1, sr as catchTags, ss as array, st as isMaxProperties, ta as succeed$1, ti as serviceOption, tn as splitLines, to as get$4, tr as cached, ts as NodeInspectSymbol, tt as is, u as all$1, ua as pretty, ui as timeoutOption, un as isSink, uo as seconds, ur as effectify, us as hasProperty, ut as isPattern, v as Array$1, va as as$1, vi as void_$1, vn as size, vo as isArray, vr as fnUntraced, vs as dual, vt as toCodecStringTree, w as Int, wa as flatMap$1, wi as clamp, wn as offerUnsafe, wo as makeEquivalence, wr as forkScoped, wt as omit, x as Defect, xa as consolePretty$1, xi as withSpan, xn as make$24, xo as map$4, xr as forkChild, xs as pipeArguments, xt as withConstructorDefault, y as Boolean$2, ya as asSome, yi as withFiber$1, yn as endUnsafe, yo as isReadonlyArrayNonEmpty, yr as forEach, ys as identity, yt as toJsonSchemaDocument, z as URLFromString, za as succeed$3, zi as addFinalizer, zn as transformOrFail, zo as isSome, zr as never, zt as flatMap$2 } from "./SqlClient-DSf3-WP1.mjs";
3
+ import { $ as is, $a as fromInputUnsafe, $i as succeed$1, $n as cached, $o as structure, $r as serviceOption, $t as splitLines, A as Record, Aa as scope, Ai as mergeAll, An as makeUnsafe$1, Ao as isNone, Ar as logError$1, At as make$21, B as Void, Ba as void_$2, Bi as provide$2, Bn as InvalidValue$1, Bo as PipeInspectableProto, Br as orElseSucceed, Bt as fromIterable$1, C as Literal, Ca as forkDetach, Ci as Class, Cn as shutdown, Co as isFailure$1, Cr as gen, Ct as Path$1, D as Null, Da as ignore$1, Di as effectDiscard, Dn as unbounded$1, Do as getOrElse, Dr as isEffect, Dt as FileTypeId, E as NonEmptyString, Ea as gen$1, Ei as effect, En as publish, Eo as fromNullishOr, Er as interrupt, Et as FileSystem, F as Trim, Fa as succeedNone, Fi as unwrap$1, Fn as nominal, Fo as some, Fr as matchCauseEffect, Ft as empty$4, G as decodeTo, Ga as Reference, Gi as isDone, Gn as acquireUseRelease, Go as BaseProto, Gr as result, Gt as make$30, H as declare, Ha as CurrentLogSpans, Hi as doneUnsafe, Hn as make$31, Ho as exitSucceed, Hr as provide, Ht as fromQueue, I as Tuple, Ia as suspend$1, Ii as Scope, In as transform$1, Io as Number$2, Ir as matchEffect, It as fail$5, J as decodeUnknownSync, Ja as empty$5, Ji as succeed$5, Jn as andThen, Jo as format$1, Jr as runPromiseWith, Jt as onExit$1, K as decodeUnknownEffect, Ka as Service, Ki as make$27, Kn as addFinalizer$1, Ko as Class$1, Kr as runFork, Kt as merge$1, L as URLFromString, La as sync$1, Li as addFinalizer, Ln as transformOrFail, Lo as make$26, Lr as never, Lt as flatMap$2, M as Struct, Ma as servicesWith, Mi as provideMerge, Mn as BadArgument, Mo as map$4, Mr as logWarning$1, Mt as concat, N as TaggedErrorClass, Na as sleep$1, Ni as succeed$2, Nn as badArgument, No as match, Nr as map$2, Nt as decodeText, O as NullOr, Oa as loggerMake, On as make$20, Oo as getOrNull, Or as log$1, Ot as Size, P as TemplateLiteral, Pa as succeed$3, Pi as sync$2, Pn as systemError, Po as none, Pr as mapError, Q as fromJsonString, Qa as merge$2, Qi as isSuccess, Qn as asVoid, Qo as array, Qr as service, Qt as runForEach, R as Union, Ra as uninterruptibleMask, Ri as close, Rn as parseJson, Ro as make$32, Rr as onInterrupt, Rt as fromChannel$1, S as Int, Sa as forever$1, Si as clamp, Sn as offerUnsafe, So as failVoid, Sr as forkScoped, St as omit, T as NonEmptyArray, Ta as formatLogSpan, Ti as TaggedError, Tn as unbounded, To as filter$1, Tr as ignoreCause, Tt as FileDescriptor, U as decodeEffect, Ua as MinimumLogLevel, Ui as fail$4, Un as encodeBase64Url, Uo as isEffect$1, Ur as provideService, Ut as fromReadableStream, V as brand, Va as CurrentLogAnnotations, Vi as _await, Vn as makeFormatterDefault, Vo as YieldableProto, Vr as promise, Vt as fromPubSub, W as decodeExit, Wa as DisablePropagation, Wi as failCause$1, Wn as acquireRelease, Wo as withFiber, Wr as provideServices, Wt as isStream, X as encodeEffect, Xi as hasInterrupts$1, Xn as as, Xo as symbolRedactable, Xt as runCollect, Y as encode, Ya as get$4, Yi as fail, Yn as annotateLogs, Yo as redact$1, Yr as runSync, Yt as run$2, Z as encodeUnknownEffect, Za as make$25, Zi as isFailure, Zn as asSome$1, Zo as symbol, Zr as scoped, Zt as runFold, _ as url, _a as causePretty, _i as withFiber$1, _n as endUnsafe, _o as makeEquivalence, _r as forEach, _t as toJsonSchemaDocument, aa as fail$2, ai as sync, an as make$22, ao as toMillis, ar as catchTags, as as isUndefined, at as isMaxProperties, b as Defect, ba as flatMap$1, bi as zipWith, bn as offer$1, bo as makeEquivalence$2, br as forkDetach$1, bt as withDecodingDefault, c as FalseValues, ca as pretty, ci as timeoutOption, cn as isSink, co as filter, cr as effectify, cs as constVoid, ct as isPattern, d as boolean$3, da as ConsoleRef, di as try_, dn as make$29, do as isArray, dr as fail$1, ds as pipe, dt as makeFilter, ea as void_$3, ei as services, en as suspend$3, eo as infinity, er as callback, es as symbol$1, et as isBetween, f as map$5, fa as CurrentLoggers$1, fi as uninterruptible, fn as get$3, fo as isReadonlyArrayNonEmpty, fr as failCause, fs as pipeArguments, ft as mutable, ga as asSome, gi as void_$1, gn as size, go as sort, gr as fnUntraced, gt as toCodecStringTree, h as string$3, ha as as$1, hi as useSpan, hn as set$3, ho as of, hr as fn, ht as tag, ia as done, ii as suspend, in as get$2, io as seconds, ir as catchTag, is as isNullish, it as isMaxLength, j as String$1, ja as scopeAddFinalizerExit, ji as provide$1, jo as isSome, jr as logInfo$1, jt as callback$1, k as Number$1, ka as onExit, ki as empty$6, kn as set$4, ko as getOrUndefined, kr as logDebug, kt as WatchBackend, l as TrueValues, la as squash, li as timeoutOrElse, ln as fromTransform, lo as flatMapNullishOr, lr as ensuring, ls as dual, lt as isSchemaError, m as port, ma as andThen$1, mi as updateServices$1, mn as remove$2, mo as map$3, mr as flatMap, mt as suspend$2, n as SqlClient, na as NoSuchElementError, ni as succeed, nn as transduce, no as isZero, nr as catchDefect, ns as isNotNull, nt as isGreaterThanOrEqualTo, oa as hasInterrupts, oi as tap, on as drain, oo as zero, or as catch_, os as constFalse, ot as isMinLength, p as option, pa as addFinalizer$2, pi as uninterruptibleMask$1, pn as make$24, po as makeEquivalence$1, pr as filterOrFail, pt as optional$2, q as decodeUnknownExit, qi as makeUnsafe$2, qn as all, qo as NodeInspectSymbol, qr as runPromise, qt as mkString, ra as UnknownError, ri as succeedNone$1, rn as unwrap, ro as minutes, rr as catchFilter, rs as isNotUndefined, rt as isLessThanOrEqualTo, s as Boolean$1, sa as hasInterruptsOnly, si as tapCause, sn as fromChannel, so as ensure, sr as die, ss as constTrue, st as isNonEmpty, ta as Done, ti as servicesWith$1, tn as toReadableStreamEffect, to as isFinite$1, tr as catchCause, ts as hasProperty, tt as isGreaterThan, u as all$1, ua as ClockRef, ui as tryPromise, un as mapDone, uo as fromIterable$2, ur as exit, us as identity, ut as link$1, v as Array$1, va as defaultLogger$1, vi as withParentSpan, vn as failCauseUnsafe, vo as map$6, vr as forever, vt as toType, w as Literals, wa as formatLabel, wi as Error$1, wn as take, wo as succeed$4, wr as ignore, wt as TypeId$17, x as ErrorClass, xa as fnUntraced$1, xi as catchDone, xn as offerAll, xo as fail$3, xr as forkIn, xt as assign, y as Boolean$2, ya as fiberInterrupt, yi as withSpan, yn as make$23, yo as filterMap, yr as forkChild, yt as withConstructorDefault, z as Unknown, za as updateServices, zi as make$28, zn as stringifyJson, zo as strictEqual, zr as orDie, zt as fromEffect } from "./SqlClient-B-Bb00hw.mjs";
4
4
  import { createRequire } from "node:module";
5
5
  import * as NodeChildProcess from "node:child_process";
6
6
  import { execFileSync, spawn, spawnSync } from "node:child_process";
@@ -33,7 +33,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
33
33
  var __getOwnPropNames = Object.getOwnPropertyNames;
34
34
  var __getProtoOf = Object.getPrototypeOf;
35
35
  var __hasOwnProp = Object.prototype.hasOwnProperty;
36
- var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
36
+ var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
37
37
  var __copyProps = (to, from, except, desc) => {
38
38
  if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
39
39
  key = keys[i];
@@ -294,8 +294,8 @@ const makeHandle = (params) => Object.assign(Object.create(HandleProto), params)
294
294
  * @since 4.0.0
295
295
  * @category Models
296
296
  */
297
- const make$20 = (spawn) => {
298
- const streamString = (command, options) => spawn(command).pipe(map$3((handle) => decodeText(options?.includeStderr === true ? handle.all : handle.stdout)), unwrap);
297
+ const make$19 = (spawn) => {
298
+ const streamString = (command, options) => spawn(command).pipe(map$2((handle) => decodeText(options?.includeStderr === true ? handle.all : handle.stdout)), unwrap);
299
299
  const streamLines = (command, options) => splitLines(streamString(command, options));
300
300
  return ChildProcessSpawner.of({
301
301
  spawn,
@@ -358,7 +358,7 @@ const makeStandardCommand = (command, args, options) => Object.assign(Object.cre
358
358
  * @since 4.0.0
359
359
  * @category Constructors
360
360
  */
361
- const make$19 = function make(...args) {
361
+ const make$18 = function make(...args) {
362
362
  if (isTemplateString(args[0])) {
363
363
  const [templates, ...expressions] = args;
364
364
  const tokens = parseTemplates(templates, expressions);
@@ -604,7 +604,7 @@ const readableToPullUnsafe = (options) => {
604
604
  const readable = options.readable;
605
605
  if (readable.readableEnded) return succeed(done());
606
606
  const closeOnDone = options.closeOnDone ?? true;
607
- const exit = options.exit ?? make$21(void 0);
607
+ const exit = options.exit ?? make$20(void 0);
608
608
  const latch = makeUnsafe$1(false);
609
609
  function onReadable() {
610
610
  latch.openUnsafe();
@@ -654,7 +654,7 @@ const toPlatformError = (method, error, command) => {
654
654
  }, "");
655
655
  return handleErrnoException("ChildProcess", method)(error, [commandStr]);
656
656
  };
657
- const make$18 = /* @__PURE__ */ gen(function* () {
657
+ const make$17 = /* @__PURE__ */ gen(function* () {
658
658
  const fs = yield* FileSystem;
659
659
  const path = yield* Path$1;
660
660
  const resolveWorkingDirectory = fnUntraced(function* (options) {
@@ -873,7 +873,7 @@ const make$18 = /* @__PURE__ */ gen(function* () {
873
873
  const stdin = yield* setupChildStdin(cmd, childProcess, stdinConfig);
874
874
  const { all, stderr, stdout } = setupChildOutputStreams(cmd, childProcess, stdoutConfig, stderrConfig);
875
875
  const { getInputFd, getOutputFd } = yield* setupAdditionalFds(cmd, childProcess, resolvedAdditionalFds);
876
- const isRunning = map$3(isDone(exitSignal), (done) => !done);
876
+ const isRunning = map$2(isDone(exitSignal), (done) => !done);
877
877
  const exitCode = flatMap(_await(exitSignal), ([code, signal]) => {
878
878
  if (isNotNull(code)) return succeed(ExitCode(code));
879
879
  return fail$1(toPlatformError("exitCode", new globalThis.Error(`Process interrupted due to receipt of signal: '${signal}'`), cmd));
@@ -902,9 +902,9 @@ const make$18 = /* @__PURE__ */ gen(function* () {
902
902
  const command = pipeline[i];
903
903
  const options = pipeOptions[i] ?? {};
904
904
  const stdinConfig = resolveStdinOption(command.options);
905
- const sourceStream = unwrap(map$3(handle, (h) => getSourceStream(h, options.from)));
905
+ const sourceStream = unwrap(map$2(handle, (h) => getSourceStream(h, options.from)));
906
906
  const toOption = options.to ?? "stdin";
907
- if (toOption === "stdin") handle = spawnCommand(make$19(command.command, command.args, {
907
+ if (toOption === "stdin") handle = spawnCommand(make$18(command.command, command.args, {
908
908
  ...command.options,
909
909
  stdin: {
910
910
  ...stdinConfig,
@@ -916,7 +916,7 @@ const make$18 = /* @__PURE__ */ gen(function* () {
916
916
  if (isNotUndefined(fd)) {
917
917
  const fdName$1 = fdName(fd);
918
918
  const existingFds = command.options.additionalFds ?? {};
919
- handle = spawnCommand(make$19(command.command, command.args, {
919
+ handle = spawnCommand(make$18(command.command, command.args, {
920
920
  ...command.options,
921
921
  additionalFds: {
922
922
  ...existingFds,
@@ -926,7 +926,7 @@ const make$18 = /* @__PURE__ */ gen(function* () {
926
926
  }
927
927
  }
928
928
  }));
929
- } else handle = spawnCommand(make$19(command.command, command.args, {
929
+ } else handle = spawnCommand(make$18(command.command, command.args, {
930
930
  ...command.options,
931
931
  stdin: {
932
932
  ...stdinConfig,
@@ -939,7 +939,7 @@ const make$18 = /* @__PURE__ */ gen(function* () {
939
939
  }
940
940
  }
941
941
  });
942
- return make$20(spawnCommand);
942
+ return make$19(spawnCommand);
943
943
  });
944
944
  /**
945
945
  * Layer providing the `NodeChildProcessSpawner` implementation.
@@ -947,7 +947,7 @@ const make$18 = /* @__PURE__ */ gen(function* () {
947
947
  * @since 4.0.0
948
948
  * @category Layers
949
949
  */
950
- const layer$11 = /* @__PURE__ */ effect(ChildProcessSpawner, make$18);
950
+ const layer$11 = /* @__PURE__ */ effect(ChildProcessSpawner, make$17);
951
951
  /**
952
952
  * Flattens a `Command` into an array of `StandardCommand`s along with pipe
953
953
  * options for each connection.
@@ -1053,7 +1053,7 @@ const makeTempDirectoryScoped = /* @__PURE__ */ (() => {
1053
1053
  const openFactory = (method) => {
1054
1054
  const nodeOpen = effectify(NFS.open, handleErrnoException("FileSystem", method), handleBadArgument(method));
1055
1055
  const nodeClose = effectify(NFS.close, handleErrnoException("FileSystem", method), handleBadArgument(method));
1056
- return (path, options) => pipe(acquireRelease(nodeOpen(path, options?.flag ?? "r", options?.mode), (fd) => orDie(nodeClose(fd))), map$3((fd) => makeFile(FileDescriptor(fd), options?.flag?.startsWith("a") ?? false)));
1056
+ return (path, options) => pipe(acquireRelease(nodeOpen(path, options?.flag ?? "r", options?.mode), (fd) => orDie(nodeClose(fd))), map$2((fd) => makeFile(FileDescriptor(fd), options?.flag?.startsWith("a") ?? false)));
1057
1057
  };
1058
1058
  const open = /* @__PURE__ */ openFactory("open");
1059
1059
  const makeFile = /* @__PURE__ */ (() => {
@@ -1077,7 +1077,7 @@ const makeFile = /* @__PURE__ */ (() => {
1077
1077
  this.append = append;
1078
1078
  }
1079
1079
  get stat() {
1080
- return map$3(nodeStat(this.fd), makeFileInfo);
1080
+ return map$2(nodeStat(this.fd), makeFileInfo);
1081
1081
  }
1082
1082
  get sync() {
1083
1083
  return nodeSync(this.fd);
@@ -1093,7 +1093,7 @@ const makeFile = /* @__PURE__ */ (() => {
1093
1093
  read(buffer) {
1094
1094
  return suspend(() => {
1095
1095
  const position = this.position;
1096
- return map$3(nodeRead(this.fd, {
1096
+ return map$2(nodeRead(this.fd, {
1097
1097
  buffer,
1098
1098
  position
1099
1099
  }), (bytesRead) => {
@@ -1108,7 +1108,7 @@ const makeFile = /* @__PURE__ */ (() => {
1108
1108
  return suspend(() => {
1109
1109
  const buffer = Buffer.allocUnsafeSlow(sizeNumber);
1110
1110
  const position = this.position;
1111
- return map$3(nodeReadAlloc(this.fd, {
1111
+ return map$2(nodeReadAlloc(this.fd, {
1112
1112
  buffer,
1113
1113
  position
1114
1114
  }), (bytesRead) => {
@@ -1122,7 +1122,7 @@ const makeFile = /* @__PURE__ */ (() => {
1122
1122
  });
1123
1123
  }
1124
1124
  truncate(length) {
1125
- return map$3(nodeTruncate(this.fd, length ? Number(length) : void 0), () => {
1125
+ return map$2(nodeTruncate(this.fd, length ? Number(length) : void 0), () => {
1126
1126
  if (!this.append) {
1127
1127
  const len = BigInt(length ?? 0);
1128
1128
  if (this.position > len) this.position = len;
@@ -1132,7 +1132,7 @@ const makeFile = /* @__PURE__ */ (() => {
1132
1132
  write(buffer) {
1133
1133
  return suspend(() => {
1134
1134
  const position = this.position;
1135
- return map$3(nodeWrite(this.fd, buffer, void 0, void 0, this.append ? void 0 : Number(position)), (bytesWritten) => {
1135
+ return map$2(nodeWrite(this.fd, buffer, void 0, void 0, this.append ? void 0 : Number(position)), (bytesWritten) => {
1136
1136
  const sizeWritten = Size(bytesWritten);
1137
1137
  if (!this.append) this.position = position + sizeWritten;
1138
1138
  return sizeWritten;
@@ -1221,7 +1221,7 @@ const makeFileInfo = (stat) => ({
1221
1221
  });
1222
1222
  const stat$1 = /* @__PURE__ */ (() => {
1223
1223
  const nodeStat = /* @__PURE__ */ effectify(NFS.stat, /* @__PURE__ */ handleErrnoException("FileSystem", "stat"), /* @__PURE__ */ handleBadArgument("stat"));
1224
- return (path) => map$3(nodeStat(path), makeFileInfo);
1224
+ return (path) => map$2(nodeStat(path), makeFileInfo);
1225
1225
  })();
1226
1226
  const symlink = /* @__PURE__ */ (() => {
1227
1227
  const nodeSymlink = /* @__PURE__ */ effectify(NFS.symlink, /* @__PURE__ */ handleErrnoException("FileSystem", "symlink"), /* @__PURE__ */ handleBadArgument("symlink"));
@@ -1273,7 +1273,7 @@ const watchNode = (path) => callback$1((queue) => acquireRelease(sync(() => {
1273
1273
  });
1274
1274
  return watcher;
1275
1275
  }), (watcher) => sync(() => watcher.close())));
1276
- const watch = (backend, path) => stat$1(path).pipe(map$3((stat) => {
1276
+ const watch = (backend, path) => stat$1(path).pipe(map$2((stat) => {
1277
1277
  if (backend) {
1278
1278
  const stream = backend.register(path, stat);
1279
1279
  if (stream) return stream;
@@ -1294,7 +1294,7 @@ const writeFile$1 = (path, data, options) => callback((resume, signal) => {
1294
1294
  resume(fail$1(handleBadArgument("writeFile")(err)));
1295
1295
  }
1296
1296
  });
1297
- const makeFileSystem = /* @__PURE__ */ map$3(/* @__PURE__ */ serviceOption(WatchBackend), (backend) => make$22({
1297
+ const makeFileSystem = /* @__PURE__ */ map$2(/* @__PURE__ */ serviceOption(WatchBackend), (backend) => make$21({
1298
1298
  access,
1299
1299
  chmod,
1300
1300
  chown,
@@ -1362,7 +1362,7 @@ const toFileUrl = (path) => try_({
1362
1362
  * @since 1.0.0
1363
1363
  * @category Layers
1364
1364
  */
1365
- const layerPosix$1 = /* @__PURE__ */ succeed$2(Path$1)({
1365
+ const layerPosix = /* @__PURE__ */ succeed$2(Path$1)({
1366
1366
  [TypeId$17]: TypeId$17,
1367
1367
  ...Path.posix,
1368
1368
  fromFileUrl,
@@ -1372,7 +1372,7 @@ const layerPosix$1 = /* @__PURE__ */ succeed$2(Path$1)({
1372
1372
  * @since 1.0.0
1373
1373
  * @category Layers
1374
1374
  */
1375
- const layerWin32$1 = /* @__PURE__ */ succeed$2(Path$1)({
1375
+ const layerWin32 = /* @__PURE__ */ succeed$2(Path$1)({
1376
1376
  [TypeId$17]: TypeId$17,
1377
1377
  ...Path.win32,
1378
1378
  fromFileUrl,
@@ -1398,16 +1398,6 @@ const layer$8 = /* @__PURE__ */ succeed$2(Path$1)({
1398
1398
  * @category layer
1399
1399
  */
1400
1400
  const layer$7 = layer$8;
1401
- /**
1402
- * @since 1.0.0
1403
- * @category layer
1404
- */
1405
- const layerPosix = layerPosix$1;
1406
- /**
1407
- * @since 1.0.0
1408
- * @category layer
1409
- */
1410
- const layerWin32 = layerWin32$1;
1411
1401
  //#endregion
1412
1402
  //#region ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect-smol+effect@8881a9b/node_modules/effect/dist/Stdio.js
1413
1403
  /**
@@ -1424,7 +1414,7 @@ const Stdio = /* @__PURE__ */ Service(TypeId$15);
1424
1414
  * @since 4.0.0
1425
1415
  * @category Constructors
1426
1416
  */
1427
- const make$17 = (options) => ({
1417
+ const make$16 = (options) => ({
1428
1418
  [TypeId$15]: TypeId$15,
1429
1419
  ...options
1430
1420
  });
@@ -1437,7 +1427,7 @@ const make$17 = (options) => ({
1437
1427
  * @category Layers
1438
1428
  * @since 1.0.0
1439
1429
  */
1440
- const layer$6 = /* @__PURE__ */ succeed$2(Stdio, /* @__PURE__ */ make$17({
1430
+ const layer$6 = /* @__PURE__ */ succeed$2(Stdio, /* @__PURE__ */ make$16({
1441
1431
  stdout: /* @__PURE__ */ fromWritable({
1442
1432
  evaluate: () => process.stdout,
1443
1433
  onError: (cause) => systemError({
@@ -1510,7 +1500,7 @@ const Terminal = /* @__PURE__ */ Service("effect/platform/Terminal");
1510
1500
  * @since 4.0.0
1511
1501
  * @category Constructors
1512
1502
  */
1513
- const make$16 = (impl) => Terminal.of({
1503
+ const make$15 = (impl) => Terminal.of({
1514
1504
  ...impl,
1515
1505
  [TypeId$14]: TypeId$14
1516
1506
  });
@@ -1520,10 +1510,10 @@ const make$16 = (impl) => Terminal.of({
1520
1510
  * @since 1.0.0
1521
1511
  * @category constructors
1522
1512
  */
1523
- const make$15 = /* @__PURE__ */ fnUntraced(function* (shouldQuit = defaultShouldQuit) {
1513
+ const make$14 = /* @__PURE__ */ fnUntraced(function* (shouldQuit = defaultShouldQuit) {
1524
1514
  const stdin = process.stdin;
1525
1515
  const stdout = process.stdout;
1526
- const rlRef = yield* make$23({ acquire: acquireRelease(sync(() => {
1516
+ const rlRef = yield* make$22({ acquire: acquireRelease(sync(() => {
1527
1517
  const rl = readline$1.createInterface({
1528
1518
  input: stdin,
1529
1519
  escapeCodeTimeout: 50
@@ -1538,7 +1528,7 @@ const make$15 = /* @__PURE__ */ fnUntraced(function* (shouldQuit = defaultShould
1538
1528
  const columns = sync(() => stdout.columns ?? 0);
1539
1529
  const readInput = gen(function* () {
1540
1530
  yield* get$2(rlRef);
1541
- const queue = yield* make$24();
1531
+ const queue = yield* make$23();
1542
1532
  const handleKeypress = (s, k) => {
1543
1533
  const userInput = {
1544
1534
  input: s,
@@ -1569,7 +1559,7 @@ const make$15 = /* @__PURE__ */ fnUntraced(function* (shouldQuit = defaultShould
1569
1559
  cause: err
1570
1560
  }))));
1571
1561
  }));
1572
- return make$16({
1562
+ return make$15({
1573
1563
  columns,
1574
1564
  readInput,
1575
1565
  readLine,
@@ -1580,7 +1570,7 @@ const make$15 = /* @__PURE__ */ fnUntraced(function* (shouldQuit = defaultShould
1580
1570
  * @since 1.0.0
1581
1571
  * @category layers
1582
1572
  */
1583
- const layer$4 = /* @__PURE__ */ effect(Terminal, /* @__PURE__ */ make$15(defaultShouldQuit));
1573
+ const layer$4 = /* @__PURE__ */ effect(Terminal, /* @__PURE__ */ make$14(defaultShouldQuit));
1584
1574
  function defaultShouldQuit(input) {
1585
1575
  return input.key.ctrl && (input.key.name === "c" || input.key.name === "d");
1586
1576
  }
@@ -1591,11 +1581,6 @@ function defaultShouldQuit(input) {
1591
1581
  */
1592
1582
  /**
1593
1583
  * @since 1.0.0
1594
- * @category constructors
1595
- */
1596
- const make$14 = make$15;
1597
- /**
1598
- * @since 1.0.0
1599
1584
  * @category layers
1600
1585
  */
1601
1586
  const layer$3 = layer$4;
@@ -1675,7 +1660,7 @@ const TypeId$13 = "~effect/Cache";
1675
1660
  const makeWith$1 = (options) => servicesWith((services) => {
1676
1661
  const self = Object.create(Proto$9);
1677
1662
  self.lookup = (key) => updateServices(options.lookup(key), (input) => merge$2(services, input));
1678
- self.map = make$25();
1663
+ self.map = make$24();
1679
1664
  self.capacity = options.capacity;
1680
1665
  self.timeToLive = options.timeToLive ? (exit, key) => fromInputUnsafe(options.timeToLive(exit, key)) : defaultTimeToLive;
1681
1666
  return succeed$3(self);
@@ -2408,45 +2393,6 @@ const isLogger = (u) => hasProperty(u, TypeId$12);
2408
2393
  */
2409
2394
  const CurrentLoggers = CurrentLoggers$1;
2410
2395
  /**
2411
- * @since 4.0.0
2412
- * @category references
2413
- */
2414
- const LogToStderr = LogToStderr$1;
2415
- /**
2416
- * Transforms the output of a `Logger` using the provided function.
2417
- *
2418
- * This allows you to modify, enhance, or completely change the output format
2419
- * of an existing logger without recreating the entire logging logic.
2420
- *
2421
- * @example
2422
- * ```ts
2423
- * import { Logger } from "effect"
2424
- *
2425
- * // Create a logger that outputs objects
2426
- * const structuredLogger = Logger.make((options) => ({
2427
- * level: options.logLevel,
2428
- * message: options.message,
2429
- * timestamp: options.date.toISOString()
2430
- * }))
2431
- *
2432
- * // Transform the output to JSON strings
2433
- * const jsonStringLogger = Logger.map(
2434
- * structuredLogger,
2435
- * (output) => JSON.stringify(output)
2436
- * )
2437
- *
2438
- * // Transform to uppercase messages
2439
- * const uppercaseLogger = Logger.map(
2440
- * structuredLogger,
2441
- * (output) => ({ ...output, message: String(output.message).toUpperCase() })
2442
- * )
2443
- * ```
2444
- *
2445
- * @since 2.0.0
2446
- * @category utils
2447
- */
2448
- const map$2 = /* @__PURE__ */ dual(2, (self, f) => loggerMake((options) => f(self.log(options))));
2449
- /**
2450
2396
  * Match strings that do not contain any whitespace characters, double quotes,
2451
2397
  * or equal signs.
2452
2398
  */
@@ -2587,114 +2533,6 @@ const defaultLogger = defaultLogger$1;
2587
2533
  */
2588
2534
  const formatSimple = /* @__PURE__ */ loggerMake(/* @__PURE__ */ format(escapeDoubleQuotes));
2589
2535
  /**
2590
- * A `Logger` which outputs logs using a structured format.
2591
- *
2592
- * For example:
2593
- * ```
2594
- * {
2595
- * message: [ 'hello' ],
2596
- * level: 'INFO',
2597
- * timestamp: '2025-01-03T14:25:39.666Z',
2598
- * annotations: { key: 'value' },
2599
- * spans: { label: 0 },
2600
- * fiberId: '#1'
2601
- * }
2602
- * ```
2603
- *
2604
- * @example
2605
- * ```ts
2606
- * import { Effect, Logger } from "effect"
2607
- *
2608
- * // Use the structured format logger
2609
- * const structuredLoggerProgram = Effect.log("Hello Structured Format").pipe(
2610
- * Effect.provide(Logger.layer([Logger.formatStructured]))
2611
- * )
2612
- *
2613
- * // Perfect for JSON processing and analytics
2614
- * const analyticsProgram = Effect.gen(function*() {
2615
- * yield* Effect.log("User action", { action: "click", element: "button" })
2616
- * yield* Effect.logInfo("API call", { endpoint: "/users", duration: 150 })
2617
- * }).pipe(
2618
- * Effect.annotateLogs("sessionId", "abc123"),
2619
- * Effect.withLogSpan("request"),
2620
- * Effect.provide(Logger.layer([Logger.formatStructured]))
2621
- * )
2622
- *
2623
- * // Process structured output
2624
- * const processingLogger = Logger.map(Logger.formatStructured, (output) => {
2625
- * // Process the structured object
2626
- * const enhanced = { ...output, processed: true }
2627
- * return enhanced
2628
- * })
2629
- * ```
2630
- *
2631
- * @since 4.0.0
2632
- * @category constructors
2633
- */
2634
- const formatStructured = /* @__PURE__ */ loggerMake(({ cause, date, fiber, logLevel, message }) => {
2635
- const annotationsObj = {};
2636
- const spansObj = {};
2637
- const annotations = fiber.getRef(CurrentLogAnnotations);
2638
- for (const [key, value] of Object.entries(annotations)) annotationsObj[key] = structuredMessage(value);
2639
- const now = date.getTime();
2640
- const spans = fiber.getRef(CurrentLogSpans);
2641
- for (const [label, timestamp] of spans) spansObj[label] = now - timestamp;
2642
- const messageArr = ensure(message);
2643
- return {
2644
- message: messageArr.length === 1 ? structuredMessage(messageArr[0]) : messageArr.map(structuredMessage),
2645
- level: logLevel.toUpperCase(),
2646
- timestamp: date.toISOString(),
2647
- cause: cause.reasons.length > 0 ? causePretty(cause) : void 0,
2648
- annotations: annotationsObj,
2649
- spans: spansObj,
2650
- fiberId: formatFiberId(fiber.id)
2651
- };
2652
- });
2653
- /**
2654
- * A `Logger` which outputs logs using a structured format serialized as JSON
2655
- * on a single line.
2656
- *
2657
- * For example:
2658
- * ```
2659
- * {"message":["hello"],"level":"INFO","timestamp":"2025-01-03T14:28:57.508Z","annotations":{"key":"value"},"spans":{"label":0},"fiberId":"#1"}
2660
- * ```
2661
- *
2662
- * @example
2663
- * ```ts
2664
- * import { Effect, Logger } from "effect"
2665
- *
2666
- * // Use the JSON format logger
2667
- * const jsonLoggerProgram = Effect.log("Hello JSON Format").pipe(
2668
- * Effect.provide(Logger.layer([Logger.formatJson]))
2669
- * )
2670
- *
2671
- * // Perfect for log aggregation and processing systems
2672
- * const productionProgram = Effect.gen(function*() {
2673
- * yield* Effect.log("Server started", { port: 3000, env: "production" })
2674
- * yield* Effect.logInfo("Request received", {
2675
- * method: "GET",
2676
- * path: "/api/users"
2677
- * })
2678
- * yield* Effect.logError("Database error", { error: "Connection timeout" })
2679
- * }).pipe(
2680
- * Effect.annotateLogs("service", "api-server"),
2681
- * Effect.withLogSpan("request-processing"),
2682
- * Effect.provide(Logger.layer([Logger.formatJson]))
2683
- * )
2684
- *
2685
- * // Send to external logging service
2686
- * const externalLogger = Logger.map(Logger.formatJson, (jsonString) => {
2687
- * // Send to Elasticsearch, CloudWatch, etc.
2688
- * console.log("Sending to external service:", jsonString)
2689
- * return jsonString
2690
- * })
2691
- * ```
2692
- *
2693
- * @since 4.0.0
2694
- * @category constructors
2695
- */
2696
- const formatJson = /* @__PURE__ */ map$2(formatStructured, formatJson$1);
2697
- /**
2698
2536
  * Returns a new `Logger` which will aggregate logs output by the specified
2699
2537
  * `Logger` over the provided `window`. After the `window` has elapsed, the
2700
2538
  * provided `flush` function will be called with the logs aggregated during
@@ -2759,104 +2597,6 @@ const batched = /* @__PURE__ */ dual(2, (self, options) => flatMap$1(scope, (sco
2759
2597
  }))));
2760
2598
  }));
2761
2599
  /**
2762
- * A `Logger` which outputs logs in a "pretty" format and writes them to the
2763
- * console.
2764
- *
2765
- * For example:
2766
- * ```
2767
- * [09:37:17.579] INFO (#1) label=0ms: hello
2768
- * key: value
2769
- * ```
2770
- *
2771
- * @example
2772
- * ```ts
2773
- * import { Effect, Logger } from "effect"
2774
- *
2775
- * // Use the pretty console logger with default settings
2776
- * const basicPretty = Effect.log("Hello Pretty Format").pipe(
2777
- * Effect.provide(Logger.layer([Logger.consolePretty()]))
2778
- * )
2779
- *
2780
- * // Configure pretty logger options
2781
- * const customPretty = Logger.consolePretty({
2782
- * colors: true,
2783
- * stderr: false,
2784
- * mode: "tty",
2785
- * formatDate: (date) => date.toLocaleTimeString()
2786
- * })
2787
- *
2788
- * // Perfect for development environment
2789
- * const developmentProgram = Effect.gen(function*() {
2790
- * yield* Effect.log("Application starting")
2791
- * yield* Effect.logInfo("Database connected")
2792
- * yield* Effect.logWarning("High memory usage detected")
2793
- * }).pipe(
2794
- * Effect.annotateLogs("environment", "development"),
2795
- * Effect.withLogSpan("startup"),
2796
- * Effect.provide(Logger.layer([customPretty]))
2797
- * )
2798
- *
2799
- * // Disable colors for CI/CD environments
2800
- * const ciLogger = Logger.consolePretty({ colors: false })
2801
- * ```
2802
- *
2803
- * @since 4.0.0
2804
- * @category constructors
2805
- */
2806
- const consolePretty = consolePretty$1;
2807
- /**
2808
- * A `Logger` which includes log messages as tracer span events.
2809
- *
2810
- * This logger integrates logging with distributed tracing by recording
2811
- * all log messages as events on the current trace span, making them visible
2812
- * in tracing tools like OpenTelemetry, Jaeger, or Zipkin.
2813
- *
2814
- * **Note**: This logger is included in the default set of loggers for all
2815
- * Effect programs, so log messages automatically appear as span events unless
2816
- * you override the default loggers.
2817
- *
2818
- * @example
2819
- * ```ts
2820
- * import { Effect, Logger } from "effect"
2821
- *
2822
- * // Tracer logger is included by default - logs automatically become span events
2823
- * const defaultProgram = Effect.gen(function*() {
2824
- * yield* Effect.log("This automatically becomes a span event")
2825
- * yield* Effect.logInfo("Processing data")
2826
- * })
2827
- *
2828
- * // Explicitly combine tracer logger with other loggers
2829
- * const observabilityProgram = Effect.gen(function*() {
2830
- * yield* Effect.log("Operation started")
2831
- * yield* Effect.logInfo("Processing data")
2832
- * yield* Effect.logError("Error occurred")
2833
- * }).pipe(
2834
- * Effect.withLogSpan("data-processing"),
2835
- * Effect.provide(Logger.layer([
2836
- * Logger.tracerLogger,
2837
- * Logger.consoleJson
2838
- * ]))
2839
- * )
2840
- *
2841
- * // Perfect for correlating logs with traces in distributed systems
2842
- * const distributedProgram = Effect.gen(function*() {
2843
- * yield* Effect.log("Step 1: Fetching user data")
2844
- * yield* Effect.sleep("100 millis")
2845
- * yield* Effect.log("Step 2: Processing payment")
2846
- * yield* Effect.sleep("200 millis")
2847
- * yield* Effect.log("Step 3: Sending confirmation")
2848
- * }).pipe(
2849
- * Effect.withLogSpan("payment-workflow"),
2850
- * Effect.annotateLogs("userId", "user-123"),
2851
- * Effect.provide(Logger.layer([Logger.tracerLogger]))
2852
- * )
2853
- * ```
2854
- *
2855
- * @since 4.0.0
2856
- * @category constructors
2857
- */
2858
- const tracerLogger = tracerLogger$1;
2859
- /**
2860
2600
  * Creates a `Layer` which will overwrite the current set of loggers with the
2861
2601
  * specified array of `loggers`.
2862
2602
  *
@@ -3065,7 +2805,7 @@ const RefProto = {
3065
2805
  */
3066
2806
  const makeUnsafe = (value) => {
3067
2807
  const self = Object.create(RefProto);
3068
- self.ref = make$21(value);
2808
+ self.ref = make$20(value);
3069
2809
  return self;
3070
2810
  };
3071
2811
  /**
@@ -11465,6 +11205,7 @@ var require_resolve_block_scalar = /* @__PURE__ */ __commonJSMin(((exports) => {
11465
11205
  onError(token, "UNEXPECTED_TOKEN", token.message);
11466
11206
  length += token.source.length;
11467
11207
  break;
11208
+ /* istanbul ignore next should not happen */
11468
11209
  default: {
11469
11210
  onError(token, "UNEXPECTED_TOKEN", `Unexpected token in block scalar header: ${token.type}`);
11470
11211
  const ts = token.source;
@@ -11514,6 +11255,7 @@ var require_resolve_flow_scalar = /* @__PURE__ */ __commonJSMin(((exports) => {
11514
11255
  _type = Scalar.Scalar.QUOTE_DOUBLE;
11515
11256
  value = doubleQuotedValue(source, _onError);
11516
11257
  break;
11258
+ /* istanbul ignore next should not happen */
11517
11259
  default:
11518
11260
  onError(scalar, "UNEXPECTED_TOKEN", `Expected a flow scalar value, but found: ${type}`);
11519
11261
  return {
@@ -11543,6 +11285,7 @@ var require_resolve_flow_scalar = /* @__PURE__ */ __commonJSMin(((exports) => {
11543
11285
  function plainValue(source, onError) {
11544
11286
  let badChar = "";
11545
11287
  switch (source[0]) {
11288
+ /* istanbul ignore next should not happen */
11546
11289
  case " ":
11547
11290
  badChar = "a tab character";
11548
11291
  break;
@@ -13199,6 +12942,7 @@ var require_parser$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
13199
12942
  return it.sep ?? it.start;
13200
12943
  }
13201
12944
  case "block-seq": return parent.items[parent.items.length - 1].start;
12945
+ /* istanbul ignore next should not happen */
13202
12946
  default: return [];
13203
12947
  }
13204
12948
  }
@@ -13451,6 +13195,7 @@ var require_parser$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
13451
13195
  });
13452
13196
  return;
13453
13197
  }
13198
+ /* istanbul ignore next should not happen */
13454
13199
  default:
13455
13200
  yield* this.pop();
13456
13201
  yield* this.pop(token);
@@ -13568,6 +13313,7 @@ var require_parser$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
13568
13313
  }
13569
13314
  yield* this.pop();
13570
13315
  break;
13316
+ /* istanbul ignore next should not happen */
13571
13317
  default:
13572
13318
  yield* this.pop();
13573
13319
  yield* this.step();
@@ -14205,30 +13951,6 @@ const makeSchemaPrimitive = (tag, schema) => {
14205
13951
  */
14206
13952
  const boolean$2 = /* @__PURE__ */ makeSchemaPrimitive("Boolean", Boolean$1);
14207
13953
  /**
14208
- * Creates a primitive that parses floating-point numbers from string input.
14209
- *
14210
- * @example
14211
- * ```ts
14212
- * import { Effect } from "effect"
14213
- * import { Primitive } from "effect/unstable/cli"
14214
- *
14215
- * const parseFloat = Effect.gen(function*() {
14216
- * const result1 = yield* Primitive.float.parse("3.14")
14217
- * console.log(result1) // 3.14
14218
- *
14219
- * const result2 = yield* Primitive.float.parse("-42.5")
14220
- * console.log(result2) // -42.5
14221
- *
14222
- * const result3 = yield* Primitive.float.parse("0")
14223
- * console.log(result3) // 0
14224
- * })
14225
- * ```
14226
- *
14227
- * @since 4.0.0
14228
- * @category constructors
14229
- */
14230
- const float = /* @__PURE__ */ makeSchemaPrimitive("Float", Finite);
14231
- /**
14232
13954
  * Creates a primitive that parses integer numbers from string input.
14233
13955
  *
14234
13956
  * @example
@@ -14253,30 +13975,6 @@ const float = /* @__PURE__ */ makeSchemaPrimitive("Float", Finite);
14253
13975
  */
14254
13976
  const integer$2 = /* @__PURE__ */ makeSchemaPrimitive("Integer", Int);
14255
13977
  /**
14256
- * Creates a primitive that parses Date objects from string input.
14257
- *
14258
- * @example
14259
- * ```ts
14260
- * import { Effect } from "effect"
14261
- * import { Primitive } from "effect/unstable/cli"
14262
- *
14263
- * const parseDate = Effect.gen(function*() {
14264
- * const result1 = yield* Primitive.date.parse("2023-12-25")
14265
- * console.log(result1) // Date object for December 25, 2023
14266
- *
14267
- * const result2 = yield* Primitive.date.parse("2023-12-25T10:30:00Z")
14268
- * console.log(result2) // Date object with time
14269
- *
14270
- * const result3 = yield* Primitive.date.parse("Dec 25, 2023")
14271
- * console.log(result3) // Date object parsed from natural format
14272
- * })
14273
- * ```
14274
- *
14275
- * @since 4.0.0
14276
- * @category constructors
14277
- */
14278
- const date = /* @__PURE__ */ makeSchemaPrimitive("Date", DateValid);
14279
- /**
14280
13978
  * Creates a primitive that accepts any string value without validation.
14281
13979
  *
14282
13980
  * @example
@@ -14339,28 +14037,6 @@ const choice$2 = (choices) => {
14339
14037
  return Object.assign(primitive, { choiceKeys: choices.map(([key]) => key) });
14340
14038
  };
14341
14039
  /**
14342
- * A sentinel primitive that always fails to parse a value.
14343
- *
14344
- * Used for flags that don't accept values.
14345
- *
14346
- * @example
14347
- * ```ts
14348
- * import { Effect } from "effect"
14349
- * import { Primitive } from "effect/unstable/cli"
14350
- *
14351
- * const program = Effect.gen(function*() {
14352
- * // This will always fail - useful for boolean flags
14353
- * const result = yield* Primitive.none.parse("any-value")
14354
- * })
14355
- *
14356
- * // The above effect will fail with "This option does not accept values"
14357
- * ```
14358
- *
14359
- * @since 4.0.0
14360
- * @category constructors
14361
- */
14362
- const none$2 = /* @__PURE__ */ makePrimitive("None", () => fail$1("This option does not accept values"));
14363
- /**
14364
14040
  * Gets a human-readable type name for a primitive.
14365
14041
  *
14366
14042
  * Used for generating help documentation.
@@ -14605,34 +14281,6 @@ const choiceWithValue$1 = (kind, name, choices) => makeSingle({
14605
14281
  const choice$1 = (kind, name, choices) => {
14606
14282
  return choiceWithValue$1(kind, name, choices.map((value) => [value, value]));
14607
14283
  };
14608
- /**
14609
- * Creates an empty sentinel parameter that always fails to parse.
14610
- *
14611
- * This is useful for creating placeholder parameters or for combinators.
14612
- *
14613
- * @example
14614
- * ```ts
14615
- * import * as Param from "effect/unstable/cli/Param"
14616
- *
14617
- * // @internal - this module is not exported publicly
14618
- *
14619
- * // Create a none parameter for composition
14620
- * const noneParam = Param.none(Param.flagKind)
14621
- *
14622
- * // Often used in conditional parameter creation
14623
- * const conditionalParam = process.env.NODE_ENV === "production"
14624
- * ? Param.string(Param.flagKind, "my-dev-flag")
14625
- * : Param.none(Param.flagKind)
14626
- * ```
14627
- *
14628
- * @since 4.0.0
14629
- * @category constructors
14630
- */
14631
- const none$1 = (kind) => makeSingle({
14632
- name: "__none__",
14633
- primitiveType: none$2,
14634
- kind
14635
- });
14636
14284
  const FLAG_DASH_REGEXP = /^-+/;
14637
14285
  /**
14638
14286
  * Adds an alias to an option.
@@ -14715,7 +14363,7 @@ const withDescription$2 = /* @__PURE__ */ dual(2, (self, description) => {
14715
14363
  * @category combinators
14716
14364
  */
14717
14365
  const map$1 = /* @__PURE__ */ dual(2, (self, f) => {
14718
- const parse = (args) => map$3(self.parse(args), ([operands, value]) => [operands, f(value)]);
14366
+ const parse = (args) => map$2(self.parse(args), ([operands, value]) => [operands, f(value)]);
14719
14367
  return Object.assign(Object.create(Proto$7), {
14720
14368
  _tag: "Map",
14721
14369
  kind: self.kind,
@@ -14761,7 +14409,7 @@ const transform = (self, f) => Object.assign(Object.create(Proto$7), {
14761
14409
  * @since 4.0.0
14762
14410
  * @category combinators
14763
14411
  */
14764
- const mapEffect = /* @__PURE__ */ dual(2, (self, f) => transform(self, (parse) => (args) => flatMap(parse(args), ([leftover, a]) => f(a).pipe(map$3((b) => [leftover, b])))));
14412
+ const mapEffect = /* @__PURE__ */ dual(2, (self, f) => transform(self, (parse) => (args) => flatMap(parse(args), ([leftover, a]) => f(a).pipe(map$2((b) => [leftover, b])))));
14765
14413
  /**
14766
14414
  * Creates an optional option that returns None when not provided.
14767
14415
  *
@@ -14784,7 +14432,7 @@ const mapEffect = /* @__PURE__ */ dual(2, (self, f) => transform(self, (parse) =
14784
14432
  * @category combinators
14785
14433
  */
14786
14434
  const optional$1 = (param) => {
14787
- const parse = (args) => param.parse(args).pipe(map$3(([leftover, value]) => [leftover, some(value)]), catchTag("MissingOption", () => succeed([args.arguments, none$3()])), catchTag("MissingArgument", () => succeed([args.arguments, none$3()])));
14435
+ const parse = (args) => param.parse(args).pipe(map$2(([leftover, value]) => [leftover, some(value)]), catchTag("MissingOption", () => succeed([args.arguments, none()])), catchTag("MissingArgument", () => succeed([args.arguments, none()])));
14788
14436
  return Object.assign(Object.create(Proto$7), {
14789
14437
  _tag: "Optional",
14790
14438
  kind: param.kind,
@@ -14793,42 +14441,6 @@ const optional$1 = (param) => {
14793
14441
  });
14794
14442
  };
14795
14443
  /**
14796
- * Makes an option optional by providing a default value.
14797
- *
14798
- * This combinator is useful when you want to make an existing option optional
14799
- * by providing a fallback value that will be used when the option is not
14800
- * provided on the command line.
14801
- *
14802
- * @example
14803
- * ```ts
14804
- * import * as Param from "effect/unstable/cli/Param"
14805
- *
14806
- * // @internal - this module is not exported publicly
14807
- *
14808
- * // Using the pipe operator to make an option optional
14809
- * const port = Param.integer(Param.flagKind, "port").pipe(
14810
- * Param.withDefault(8080)
14811
- * )
14812
- *
14813
- * // Can also be used with other combinators
14814
- * const verbose = Param.boolean(Param.flagKind, "verbose").pipe(
14815
- * Param.withAlias("-v"),
14816
- * Param.withDescription("Enable verbose output"),
14817
- * Param.withDefault(false)
14818
- * )
14819
- * ```
14820
- *
14821
- * @since 4.0.0
14822
- * @category combinators
14823
- */
14824
- const withDefault$1 = /* @__PURE__ */ dual(2, (self, defaultValue) => {
14825
- if (!isEffect(defaultValue)) return map$1(optional$1(self), getOrElse(() => defaultValue));
14826
- return mapEffect(optional$1(self), match({
14827
- onNone: () => defaultValue,
14828
- onSome: succeed
14829
- }));
14830
- });
14831
- /**
14832
14444
  * Creates a variadic parameter that can be specified multiple times.
14833
14445
  *
14834
14446
  * This is the base combinator for creating parameters that accept multiple values.
@@ -15383,22 +14995,6 @@ const choiceWithValue = (name, choices) => choiceWithValue$1(flagKind, name, cho
15383
14995
  */
15384
14996
  const choice = (name, choices) => choice$1(flagKind, name, choices);
15385
14997
  /**
15386
- * Creates an empty sentinel flag that always fails to parse.
15387
- * This is useful for creating placeholder flags or for combinators.
15388
- *
15389
- * @example
15390
- * ```ts
15391
- * import { Flag } from "effect/unstable/cli"
15392
- *
15393
- * // Used as a placeholder in flag combinators
15394
- * const conditionalFlag = true ? Flag.string("value") : Flag.none
15395
- * ```
15396
- *
15397
- * @since 4.0.0
15398
- * @category constructors
15399
- */
15400
- const none = /* @__PURE__ */ none$1(flagKind);
15401
- /**
15402
14998
  * Adds an alias to a flag, allowing it to be referenced by multiple names.
15403
14999
  *
15404
15000
  * @example
@@ -15469,28 +15065,6 @@ const withDescription$1 = /* @__PURE__ */ dual(2, (self, description) => withDes
15469
15065
  */
15470
15066
  const optional = (param) => optional$1(param);
15471
15067
  /**
15472
- * Provides a default value for a flag when it's not specified.
15473
- *
15474
- * @example
15475
- * ```ts
15476
- * import { Flag } from "effect/unstable/cli"
15477
- *
15478
- * const portFlag = Flag.integer("port").pipe(
15479
- * Flag.withDefault(8080)
15480
- * )
15481
- * // If --port is not provided, defaults to 8080
15482
- *
15483
- * const hostFlag = Flag.string("host").pipe(
15484
- * Flag.withDefault("localhost")
15485
- * )
15486
- * // If --host is not provided, defaults to "localhost"
15487
- * ```
15488
- *
15489
- * @since 4.0.0
15490
- * @category optionality
15491
- */
15492
- const withDefault = withDefault$1;
15493
- /**
15494
15068
  * Transforms the parsed value of a flag using a mapping function.
15495
15069
  *
15496
15070
  * @example
@@ -15696,7 +15270,7 @@ const makeCommand = (options) => {
15696
15270
  const subcommandDocs = [];
15697
15271
  for (const group of subcommands) subcommandDocs.push({
15698
15272
  group: group.group,
15699
- commands: map$4(group.commands, (subcommand) => ({
15273
+ commands: map$3(group.commands, (subcommand) => ({
15700
15274
  name: subcommand.name,
15701
15275
  alias: subcommand.alias,
15702
15276
  shortDescription: subcommand.shortDescription,
@@ -16437,7 +16011,7 @@ const Completions = /* @__PURE__ */ action({
16437
16011
  "zsh",
16438
16012
  "fish",
16439
16013
  "sh"
16440
- ]).pipe(optional, /* @__PURE__ */ map((v) => map$5(v, (s) => s === "sh" ? "bash" : s)), /* @__PURE__ */ withDescription$1("Print shell completion script")),
16014
+ ]).pipe(optional, /* @__PURE__ */ map((v) => map$4(v, (s) => s === "sh" ? "bash" : s)), /* @__PURE__ */ withDescription$1("Print shell completion script")),
16441
16015
  run: (shell, { command }) => gen(function* () {
16442
16016
  if (isNone(shell)) return;
16443
16017
  const descriptor = fromCommand(command);
@@ -17115,7 +16689,7 @@ const runWith = (command, config) => {
17115
16689
  program = provideService(program, LogLevel, logLevel);
17116
16690
  const services = match(logLevel, {
17117
16691
  onNone: () => empty$5(),
17118
- onSome: (level) => make$26(MinimumLogLevel, level)
16692
+ onSome: (level) => make$25(MinimumLogLevel, level)
17119
16693
  });
17120
16694
  yield* provideServices(program, services);
17121
16695
  }, catchFilter((error) => isCliError(error) && error._tag === "ShowHelp" ? succeed$4(error) : fail$3(error), (error) => showHelp(command, error.commandPath)), catchFilter((e) => isQuitError(e) ? succeed$4(e) : fail$3(e), (_) => interrupt));
@@ -20163,7 +19737,7 @@ const make$8 = ({ dumpSchema = () => void_$1 }) => ({ loader, schemaDirectory, t
20163
19737
  migration_id,
20164
19738
  name
20165
19739
  })))}`.withoutTransform;
20166
- const latestMigration = map$3(sql`SELECT migration_id, name, created_at FROM ${sql(table)} ORDER BY migration_id DESC`.withoutTransform, (_) => map$5(fromNullishOr(_[0]), ({ created_at, migration_id, name }) => ({
19740
+ const latestMigration = map$2(sql`SELECT migration_id, name, created_at FROM ${sql(table)} ORDER BY migration_id DESC`.withoutTransform, (_) => map$4(fromNullishOr(_[0]), ({ created_at, migration_id, name }) => ({
20167
19741
  id: migration_id,
20168
19742
  name,
20169
19743
  createdAt: created_at
@@ -20188,7 +19762,7 @@ const make$8 = ({ dumpSchema = () => void_$1 }) => ({ loader, schemaDirectory, t
20188
19762
  pg: () => sql`LOCK TABLE ${sql(table)} IN ACCESS EXCLUSIVE MODE`,
20189
19763
  orElse: () => void_$1
20190
19764
  });
20191
- const [latestMigrationId, current] = yield* all([map$3(latestMigration, match({
19765
+ const [latestMigrationId, current] = yield* all([map$2(latestMigration, match({
20192
19766
  onNone: () => 0,
20193
19767
  onSome: (_) => _.id
20194
19768
  })), loader]);
@@ -20222,12 +19796,12 @@ const make$8 = ({ dumpSchema = () => void_$1 }) => ({ loader, schemaDirectory, t
20222
19796
  if (schemaDirectory && completed.length > 0) yield* dumpSchema(`${schemaDirectory}/_schema.sql`, table).pipe(catchCause((cause) => logInfo$1("Could not dump schema", cause)));
20223
19797
  return completed;
20224
19798
  });
20225
- const migrationOrder = /* @__PURE__ */ make$27(([a], [b]) => Number$2(a, b));
19799
+ const migrationOrder = /* @__PURE__ */ make$26(([a], [b]) => Number$2(a, b));
20226
19800
  /**
20227
19801
  * @since 4.0.0
20228
19802
  * @category loaders
20229
19803
  */
20230
- const fromRecord = (migrations) => pipe(Object.keys(migrations), flatMapNullishOr((_) => _.match(/^(\d+)_(.+)$/)), map$4(([key, id, name]) => [
19804
+ const fromRecord = (migrations) => pipe(Object.keys(migrations), flatMapNullishOr((_) => _.match(/^(\d+)_(.+)$/)), map$3(([key, id, name]) => [
20231
19805
  Number(id),
20232
19806
  name,
20233
19807
  succeed(migrations[key])
@@ -20924,8 +20498,8 @@ const runMigrations = gen(function* () {
20924
20498
  //#endregion
20925
20499
  //#region src/persistence/Layers/Sqlite.ts
20926
20500
  const defaultSqliteClientLoaders = {
20927
- bun: () => import("./SqliteClient-DBy8Gtib.mjs"),
20928
- node: () => import("./NodeSqliteClient-BXfshIvF.mjs")
20501
+ bun: () => import("./SqliteClient-9lnXlJby.mjs"),
20502
+ node: () => import("./NodeSqliteClient-BPNNnMBz.mjs")
20929
20503
  };
20930
20504
  const makeRuntimeSqliteLayer = (config) => gen(function* () {
20931
20505
  const loader = defaultSqliteClientLoaders[process.versions.bun !== void 0 ? "bun" : "node"];
@@ -21130,7 +20704,7 @@ const make$7 = gen(function* () {
21130
20704
  threadId: input.threadId,
21131
20705
  fromTurnCount: 0,
21132
20706
  toTurnCount: input.toTurnCount
21133
- }).pipe(map$3((result) => result));
20707
+ }).pipe(map$2((result) => result));
21134
20708
  return {
21135
20709
  getTurnDiff,
21136
20710
  getFullThreadDiff
@@ -21254,14 +20828,14 @@ const makeGitService = gen(function* () {
21254
20828
  const timeoutMs = input.timeoutMs ?? DEFAULT_TIMEOUT_MS$2;
21255
20829
  const maxOutputBytes = input.maxOutputBytes ?? DEFAULT_MAX_OUTPUT_BYTES;
21256
20830
  return yield* gen(function* () {
21257
- const child = yield* commandSpawner.spawn(make$19("git", commandInput.args, {
20831
+ const child = yield* commandSpawner.spawn(make$18("git", commandInput.args, {
21258
20832
  cwd: commandInput.cwd,
21259
20833
  ...input.env ? { env: input.env } : {}
21260
20834
  })).pipe(mapError(toGitCommandError(commandInput, "failed to spawn.")));
21261
20835
  const [stdout, stderr, exitCode] = yield* all([
21262
20836
  collectOutput(commandInput, child.stdout, maxOutputBytes),
21263
20837
  collectOutput(commandInput, child.stderr, maxOutputBytes),
21264
- child.exitCode.pipe(map$3((value) => Number(value)), mapError(toGitCommandError(commandInput, "failed to report exit code.")))
20838
+ child.exitCode.pipe(map$2((value) => Number(value)), mapError(toGitCommandError(commandInput, "failed to report exit code.")))
21265
20839
  ], { concurrency: "unbounded" });
21266
20840
  if (!input.allowNonZeroExit && exitCode !== 0) {
21267
20841
  const trimmedStderr = stderr.trim();
@@ -21333,7 +20907,7 @@ const makeCheckpointStore = gen(function* () {
21333
20907
  "HEAD^{commit}"
21334
20908
  ],
21335
20909
  allowNonZeroExit: true
21336
- }).pipe(map$3((result) => {
20910
+ }).pipe(map$2((result) => {
21337
20911
  if (result.code !== 0) return null;
21338
20912
  const commit = result.stdout.trim();
21339
20913
  return commit.length > 0 ? commit : null;
@@ -21347,7 +20921,7 @@ const makeCheckpointStore = gen(function* () {
21347
20921
  "HEAD"
21348
20922
  ],
21349
20923
  allowNonZeroExit: true
21350
- }).pipe(map$3((result) => result.code === 0));
20924
+ }).pipe(map$2((result) => result.code === 0));
21351
20925
  const resolveCheckpointCommit = (cwd, checkpointRef) => git.execute({
21352
20926
  operation: "CheckpointStore.resolveCheckpointCommit",
21353
20927
  cwd,
@@ -21358,7 +20932,7 @@ const makeCheckpointStore = gen(function* () {
21358
20932
  `${checkpointRef}^{commit}`
21359
20933
  ],
21360
20934
  allowNonZeroExit: true
21361
- }).pipe(map$3((result) => {
20935
+ }).pipe(map$2((result) => {
21362
20936
  if (result.code !== 0) return null;
21363
20937
  const commit = result.stdout.trim();
21364
20938
  return commit.length > 0 ? commit : null;
@@ -21386,7 +20960,7 @@ const makeCheckpointStore = gen(function* () {
21386
20960
  cwd,
21387
20961
  args: ["rev-parse", "--is-inside-work-tree"],
21388
20962
  allowNonZeroExit: true
21389
- }).pipe(map$3((result) => result.code === 0 && result.stdout.trim() === "true"), catch_(() => succeed(false)));
20963
+ }).pipe(map$2((result) => result.code === 0 && result.stdout.trim() === "true"), catch_(() => succeed(false)));
21390
20964
  const captureCheckpoint = (input) => gen(function* () {
21391
20965
  const operation = "CheckpointStore.captureCheckpoint";
21392
20966
  yield* acquireUseRelease(fs.makeTempDirectory({ prefix: "t3-fs-checkpoint-" }), (tempDir) => gen(function* () {
@@ -21461,7 +21035,7 @@ const makeCheckpointStore = gen(function* () {
21461
21035
  cause: error
21462
21036
  })) }));
21463
21037
  });
21464
- const hasCheckpointRef = (input) => resolveCheckpointCommit(input.cwd, input.checkpointRef).pipe(map$3((commit) => commit !== null));
21038
+ const hasCheckpointRef = (input) => resolveCheckpointCommit(input.cwd, input.checkpointRef).pipe(map$2((commit) => commit !== null));
21465
21039
  const restoreCheckpoint = (input) => gen(function* () {
21466
21040
  const operation = "CheckpointStore.restoreCheckpoint";
21467
21041
  let commitOid = yield* resolveCheckpointCommit(input.cwd, input.checkpointRef);
@@ -21788,9 +21362,9 @@ const makeProjectionCheckpointRepository = gen(function* () {
21788
21362
  checkpointTurnCount: row.checkpointTurnCount
21789
21363
  }).pipe(flatMap(() => upsertProjectionCheckpointRow(row))));
21790
21364
  const upsert = (row) => upsertCheckpointRow(row).pipe(mapError(toPersistenceSqlOrDecodeError$6("ProjectionCheckpointRepository.upsert:query", "ProjectionCheckpointRepository.upsert:encodeRequest")));
21791
- const listByThreadId = (input) => listProjectionCheckpointRows(input).pipe(mapError(toPersistenceSqlOrDecodeError$6("ProjectionCheckpointRepository.listByThreadId:query", "ProjectionCheckpointRepository.listByThreadId:decodeRows")), map$3((rows) => rows));
21365
+ const listByThreadId = (input) => listProjectionCheckpointRows(input).pipe(mapError(toPersistenceSqlOrDecodeError$6("ProjectionCheckpointRepository.listByThreadId:query", "ProjectionCheckpointRepository.listByThreadId:decodeRows")), map$2((rows) => rows));
21792
21366
  const getByThreadAndTurnCount = (input) => getProjectionCheckpointRow(input).pipe(mapError(toPersistenceSqlOrDecodeError$6("ProjectionCheckpointRepository.getByThreadAndTurnCount:query", "ProjectionCheckpointRepository.getByThreadAndTurnCount:decodeRow")), flatMap((rowOption) => match(rowOption, {
21793
- onNone: () => succeed(none$3()),
21367
+ onNone: () => succeed(none()),
21794
21368
  onSome: (row) => succeed(some(row))
21795
21369
  })));
21796
21370
  const deleteByThreadId = (input) => deleteProjectionCheckpointRows(input).pipe(mapError(toPersistenceSqlError("ProjectionCheckpointRepository.deleteByThreadId:query")));
@@ -22175,10 +21749,10 @@ const makeProjectionProjectRepository = gen(function* () {
22175
21749
  });
22176
21750
  const upsert = (row) => upsertProjectionProjectRow(row).pipe(mapError(toPersistenceSqlOrDecodeError$4("ProjectionProjectRepository.upsert:query", "ProjectionProjectRepository.upsert:encodeRequest")));
22177
21751
  const getById = (input) => getProjectionProjectRow(input).pipe(mapError(toPersistenceSqlOrDecodeError$4("ProjectionProjectRepository.getById:query", "ProjectionProjectRepository.getById:decodeRow")), flatMap((rowOption) => match(rowOption, {
22178
- onNone: () => succeed(none$3()),
21752
+ onNone: () => succeed(none()),
22179
21753
  onSome: (row) => succeed(some(row))
22180
21754
  })));
22181
- const listAll = () => listProjectionProjectRows().pipe(mapError(toPersistenceSqlOrDecodeError$4("ProjectionProjectRepository.listAll:query", "ProjectionProjectRepository.listAll:decodeRows")), map$3((rows) => rows));
21755
+ const listAll = () => listProjectionProjectRows().pipe(mapError(toPersistenceSqlOrDecodeError$4("ProjectionProjectRepository.listAll:query", "ProjectionProjectRepository.listAll:decodeRows")), map$2((rows) => rows));
22182
21756
  const deleteById = (input) => deleteProjectionProjectRow(input).pipe(mapError(toPersistenceSqlError("ProjectionProjectRepository.deleteById:query")));
22183
21757
  return {
22184
21758
  upsert,
@@ -22268,7 +21842,7 @@ const makeProjectionStateRepository = gen(function* () {
22268
21842
  const upsert = (row) => upsertProjectionStateRow(row).pipe(mapError(toPersistenceSqlError("ProjectionStateRepository.upsert:query")));
22269
21843
  const getByProjector = (input) => getProjectionStateRow(input).pipe(mapError(toPersistenceSqlError("ProjectionStateRepository.getByProjector:query")));
22270
21844
  const listAll = () => listProjectionStateRows(void 0).pipe(mapError(toPersistenceSqlError("ProjectionStateRepository.listAll:query")));
22271
- const minLastAppliedSequence = () => readMinLastAppliedSequence(void 0).pipe(mapError(toPersistenceSqlError("ProjectionStateRepository.minLastAppliedSequence:query")), map$3((row) => row.minLastAppliedSequence));
21845
+ const minLastAppliedSequence = () => readMinLastAppliedSequence(void 0).pipe(mapError(toPersistenceSqlError("ProjectionStateRepository.minLastAppliedSequence:query")), map$2((row) => row.minLastAppliedSequence));
22272
21846
  return {
22273
21847
  upsert,
22274
21848
  getByProjector,
@@ -22383,7 +21957,7 @@ const makeProjectionThreadActivityRepository = gen(function* () {
22383
21957
  `
22384
21958
  });
22385
21959
  const upsert = (row) => upsertProjectionThreadActivityRow(row).pipe(mapError(toPersistenceSqlOrDecodeError$3("ProjectionThreadActivityRepository.upsert:query", "ProjectionThreadActivityRepository.upsert:encodeRequest")));
22386
- const listByThreadId = (input) => listProjectionThreadActivityRows(input).pipe(mapError(toPersistenceSqlOrDecodeError$3("ProjectionThreadActivityRepository.listByThreadId:query", "ProjectionThreadActivityRepository.listByThreadId:decodeRows")), map$3((rows) => rows.map((row) => ({
21960
+ const listByThreadId = (input) => listProjectionThreadActivityRows(input).pipe(mapError(toPersistenceSqlOrDecodeError$3("ProjectionThreadActivityRepository.listByThreadId:query", "ProjectionThreadActivityRepository.listByThreadId:decodeRows")), map$2((rows) => rows.map((row) => ({
22387
21961
  activityId: row.activityId,
22388
21962
  threadId: row.threadId,
22389
21963
  turnId: row.turnId,
@@ -22514,7 +22088,7 @@ const makeProjectionThreadMessageRepository = gen(function* () {
22514
22088
  `
22515
22089
  });
22516
22090
  const upsert = (row) => upsertProjectionThreadMessageRow(row).pipe(mapError(toPersistenceSqlError("ProjectionThreadMessageRepository.upsert:query")));
22517
- const listByThreadId = (input) => listProjectionThreadMessageRows(input).pipe(mapError(toPersistenceSqlError("ProjectionThreadMessageRepository.listByThreadId:query")), map$3((rows) => rows.map((row) => ({
22091
+ const listByThreadId = (input) => listProjectionThreadMessageRows(input).pipe(mapError(toPersistenceSqlError("ProjectionThreadMessageRepository.listByThreadId:query")), map$2((rows) => rows.map((row) => ({
22518
22092
  messageId: row.messageId,
22519
22093
  threadId: row.threadId,
22520
22094
  turnId: row.turnId,
@@ -23200,10 +22774,10 @@ const makeProjectionTurnRepository = gen(function* () {
23200
22774
  const replacePendingTurnStart = (row) => sql.withTransaction(clearPendingProjectionTurnsByThread({ threadId: row.threadId }).pipe(flatMap(() => insertPendingProjectionTurn(row)))).pipe(mapError(toPersistenceSqlOrDecodeError$1("ProjectionTurnRepository.replacePendingTurnStart:query", "ProjectionTurnRepository.replacePendingTurnStart:encodeRequest")));
23201
22775
  const getPendingTurnStartByThreadId = (input) => getPendingProjectionTurn(input).pipe(mapError(toPersistenceSqlError("ProjectionTurnRepository.getPendingTurnStartByThreadId:query")));
23202
22776
  const deletePendingTurnStartByThreadId = (input) => clearPendingProjectionTurnsByThread(input).pipe(mapError(toPersistenceSqlError("ProjectionTurnRepository.deletePendingTurnStartByThreadId:query")));
23203
- const listByThreadId = (input) => listProjectionTurnsByThread(input).pipe(mapError(toPersistenceSqlOrDecodeError$1("ProjectionTurnRepository.listByThreadId:query", "ProjectionTurnRepository.listByThreadId:decodeRows")), map$3((rows) => rows));
23204
- const listAll = () => listAllProjectionTurns(void 0).pipe(mapError(toPersistenceSqlOrDecodeError$1("ProjectionTurnRepository.listAll:query", "ProjectionTurnRepository.listAll:decodeRows")), map$3((rows) => rows));
22777
+ const listByThreadId = (input) => listProjectionTurnsByThread(input).pipe(mapError(toPersistenceSqlOrDecodeError$1("ProjectionTurnRepository.listByThreadId:query", "ProjectionTurnRepository.listByThreadId:decodeRows")), map$2((rows) => rows));
22778
+ const listAll = () => listAllProjectionTurns(void 0).pipe(mapError(toPersistenceSqlOrDecodeError$1("ProjectionTurnRepository.listAll:query", "ProjectionTurnRepository.listAll:decodeRows")), map$2((rows) => rows));
23205
22779
  const getByTurnId = (input) => getProjectionTurnByTurnId(input).pipe(mapError(toPersistenceSqlOrDecodeError$1("ProjectionTurnRepository.getByTurnId:query", "ProjectionTurnRepository.getByTurnId:decodeRow")), flatMap((rowOption) => match(rowOption, {
23206
- onNone: () => succeed(none$3()),
22780
+ onNone: () => succeed(none()),
23207
22781
  onSome: (row) => succeed(some(row))
23208
22782
  })));
23209
22783
  const clearCheckpointTurnConflict = (input) => clearCheckpointTurnConflictRow(input).pipe(mapError(toPersistenceSqlError("ProjectionTurnRepository.clearCheckpointTurnConflict:query")));
@@ -23337,8 +22911,8 @@ const makeProviderSessionRuntimeRepository = gen(function* () {
23337
22911
  });
23338
22912
  const upsert = (runtime) => upsertRuntimeRow(runtime).pipe(mapError(toPersistenceSqlOrDecodeError("ProviderSessionRuntimeRepository.upsert:query", "ProviderSessionRuntimeRepository.upsert:encodeRequest")));
23339
22913
  const getByThreadId = (input) => getRuntimeRowByThreadId(input).pipe(mapError(toPersistenceSqlOrDecodeError("ProviderSessionRuntimeRepository.getByThreadId:query", "ProviderSessionRuntimeRepository.getByThreadId:decodeRow")), flatMap((runtimeRowOption) => match(runtimeRowOption, {
23340
- onNone: () => succeed(none$3()),
23341
- onSome: (row) => decodeRuntime(row).pipe(mapError(toPersistenceDecodeError("ProviderSessionRuntimeRepository.getByThreadId:rowToRuntime")), map$3((runtime) => some(runtime)))
22914
+ onNone: () => succeed(none()),
22915
+ onSome: (row) => decodeRuntime(row).pipe(mapError(toPersistenceDecodeError("ProviderSessionRuntimeRepository.getByThreadId:rowToRuntime")), map$2((runtime) => some(runtime)))
23342
22916
  })));
23343
22917
  const list = () => listRuntimeRows(void 0).pipe(mapError(toPersistenceSqlOrDecodeError("ProviderSessionRuntimeRepository.list:query", "ProviderSessionRuntimeRepository.list:decodeRows")), flatMap((rows) => forEach(rows, (row) => decodeRuntime(row).pipe(mapError(toPersistenceDecodeError("ProviderSessionRuntimeRepository.list:rowToRuntime"))), { concurrency: "unbounded" })));
23344
22918
  const deleteByThreadId = (input) => deleteRuntimeByThreadId(input).pipe(mapError(toPersistenceSqlError("ProviderSessionRuntimeRepository.deleteByThreadId:query")));
@@ -24197,7 +23771,7 @@ function projectEvent(model, event) {
24197
23771
  updatedAt: event.occurredAt
24198
23772
  };
24199
23773
  switch (event.type) {
24200
- case "project.created": return decodeForEvent(ProjectCreatedPayload, event.payload, event.type, "payload").pipe(map$3((payload) => {
23774
+ case "project.created": return decodeForEvent(ProjectCreatedPayload, event.payload, event.type, "payload").pipe(map$2((payload) => {
24201
23775
  const existing = nextBase.projects.find((entry) => entry.id === payload.projectId);
24202
23776
  const nextProject = {
24203
23777
  id: payload.projectId,
@@ -24214,7 +23788,7 @@ function projectEvent(model, event) {
24214
23788
  projects: existing ? nextBase.projects.map((entry) => entry.id === payload.projectId ? nextProject : entry) : [...nextBase.projects, nextProject]
24215
23789
  };
24216
23790
  }));
24217
- case "project.meta-updated": return decodeForEvent(ProjectMetaUpdatedPayload, event.payload, event.type, "payload").pipe(map$3((payload) => ({
23791
+ case "project.meta-updated": return decodeForEvent(ProjectMetaUpdatedPayload, event.payload, event.type, "payload").pipe(map$2((payload) => ({
24218
23792
  ...nextBase,
24219
23793
  projects: nextBase.projects.map((project) => project.id === payload.projectId ? {
24220
23794
  ...project,
@@ -24225,7 +23799,7 @@ function projectEvent(model, event) {
24225
23799
  updatedAt: payload.updatedAt
24226
23800
  } : project)
24227
23801
  })));
24228
- case "project.deleted": return decodeForEvent(ProjectDeletedPayload, event.payload, event.type, "payload").pipe(map$3((payload) => ({
23802
+ case "project.deleted": return decodeForEvent(ProjectDeletedPayload, event.payload, event.type, "payload").pipe(map$2((payload) => ({
24229
23803
  ...nextBase,
24230
23804
  projects: nextBase.projects.map((project) => project.id === payload.projectId ? {
24231
23805
  ...project,
@@ -24262,28 +23836,28 @@ function projectEvent(model, event) {
24262
23836
  threads: existing ? nextBase.threads.map((entry) => entry.id === thread.id ? thread : entry) : [...nextBase.threads, thread]
24263
23837
  };
24264
23838
  });
24265
- case "thread.archived": return decodeForEvent(ThreadArchivedPayload, event.payload, event.type, "payload").pipe(map$3((payload) => ({
23839
+ case "thread.archived": return decodeForEvent(ThreadArchivedPayload, event.payload, event.type, "payload").pipe(map$2((payload) => ({
24266
23840
  ...nextBase,
24267
23841
  threads: updateThread(nextBase.threads, payload.threadId, {
24268
23842
  archivedAt: payload.archivedAt,
24269
23843
  updatedAt: payload.updatedAt
24270
23844
  })
24271
23845
  })));
24272
- case "thread.unarchived": return decodeForEvent(ThreadUnarchivedPayload, event.payload, event.type, "payload").pipe(map$3((payload) => ({
23846
+ case "thread.unarchived": return decodeForEvent(ThreadUnarchivedPayload, event.payload, event.type, "payload").pipe(map$2((payload) => ({
24273
23847
  ...nextBase,
24274
23848
  threads: updateThread(nextBase.threads, payload.threadId, {
24275
23849
  archivedAt: null,
24276
23850
  updatedAt: payload.updatedAt
24277
23851
  })
24278
23852
  })));
24279
- case "thread.deleted": return decodeForEvent(ThreadDeletedPayload, event.payload, event.type, "payload").pipe(map$3((payload) => ({
23853
+ case "thread.deleted": return decodeForEvent(ThreadDeletedPayload, event.payload, event.type, "payload").pipe(map$2((payload) => ({
24280
23854
  ...nextBase,
24281
23855
  threads: updateThread(nextBase.threads, payload.threadId, {
24282
23856
  deletedAt: payload.deletedAt,
24283
23857
  updatedAt: payload.deletedAt
24284
23858
  })
24285
23859
  })));
24286
- case "thread.meta-updated": return decodeForEvent(ThreadMetaUpdatedPayload, event.payload, event.type, "payload").pipe(map$3((payload) => ({
23860
+ case "thread.meta-updated": return decodeForEvent(ThreadMetaUpdatedPayload, event.payload, event.type, "payload").pipe(map$2((payload) => ({
24287
23861
  ...nextBase,
24288
23862
  threads: updateThread(nextBase.threads, payload.threadId, {
24289
23863
  ...payload.projectId !== void 0 ? { projectId: payload.projectId } : {},
@@ -24298,14 +23872,14 @@ function projectEvent(model, event) {
24298
23872
  updatedAt: payload.updatedAt
24299
23873
  })
24300
23874
  })));
24301
- case "thread.runtime-mode-set": return decodeForEvent(ThreadRuntimeModeSetPayload, event.payload, event.type, "payload").pipe(map$3((payload) => ({
23875
+ case "thread.runtime-mode-set": return decodeForEvent(ThreadRuntimeModeSetPayload, event.payload, event.type, "payload").pipe(map$2((payload) => ({
24302
23876
  ...nextBase,
24303
23877
  threads: updateThread(nextBase.threads, payload.threadId, {
24304
23878
  runtimeMode: payload.runtimeMode,
24305
23879
  updatedAt: payload.updatedAt
24306
23880
  })
24307
23881
  })));
24308
- case "thread.interaction-mode-set": return decodeForEvent(ThreadInteractionModeSetPayload, event.payload, event.type, "payload").pipe(map$3((payload) => ({
23882
+ case "thread.interaction-mode-set": return decodeForEvent(ThreadInteractionModeSetPayload, event.payload, event.type, "payload").pipe(map$2((payload) => ({
24309
23883
  ...nextBase,
24310
23884
  threads: updateThread(nextBase.threads, payload.threadId, {
24311
23885
  interactionMode: payload.interactionMode,
@@ -24410,7 +23984,7 @@ function projectEvent(model, event) {
24410
23984
  })
24411
23985
  };
24412
23986
  });
24413
- case "thread.reverted": return decodeForEvent(ThreadRevertedPayload, event.payload, event.type, "payload").pipe(map$3((payload) => {
23987
+ case "thread.reverted": return decodeForEvent(ThreadRevertedPayload, event.payload, event.type, "payload").pipe(map$2((payload) => {
24414
23988
  const thread = nextBase.threads.find((entry) => entry.id === payload.threadId);
24415
23989
  if (!thread) return nextBase;
24416
23990
  const checkpoints = thread.checkpoints.filter((entry) => entry.checkpointTurnCount <= payload.turnCount).toSorted((left, right) => left.checkpointTurnCount - right.checkpointTurnCount).slice(-MAX_THREAD_CHECKPOINTS);
@@ -24439,7 +24013,7 @@ function projectEvent(model, event) {
24439
24013
  })
24440
24014
  };
24441
24015
  }));
24442
- case "thread.activity-appended": return decodeForEvent(ThreadActivityAppendedPayload, event.payload, event.type, "payload").pipe(map$3((payload) => {
24016
+ case "thread.activity-appended": return decodeForEvent(ThreadActivityAppendedPayload, event.payload, event.type, "payload").pipe(map$2((payload) => {
24443
24017
  const thread = nextBase.threads.find((entry) => entry.id === payload.threadId);
24444
24018
  if (!thread) return nextBase;
24445
24019
  const activities = [...thread.activities.filter((entry) => entry.id !== payload.activity.id), payload.activity].toSorted(compareThreadActivities).slice(-500);
@@ -24766,7 +24340,7 @@ const makeOrchestrationEngine = gen(function* () {
24766
24340
  const processEnvelope = (envelope) => {
24767
24341
  const dispatchStartSequence = readModel.snapshotSequence;
24768
24342
  const reconcileReadModelAfterDispatchFailure = gen(function* () {
24769
- const persistedEvents = yield* runCollect(eventStore.readFromSequence(dispatchStartSequence)).pipe(map$3((chunk) => Array.from(chunk)));
24343
+ const persistedEvents = yield* runCollect(eventStore.readFromSequence(dispatchStartSequence)).pipe(map$2((chunk) => Array.from(chunk)));
24770
24344
  if (persistedEvents.length === 0) return;
24771
24345
  let nextReadModel = readModel;
24772
24346
  for (const persistedEvent of persistedEvents) nextReadModel = yield* projectEvent(nextReadModel, persistedEvent);
@@ -24867,7 +24441,7 @@ const makeOrchestrationEngine = gen(function* () {
24867
24441
  const getReadModel = () => sync(() => readModel);
24868
24442
  const readEvents = (fromSequenceExclusive) => eventStore.readFromSequence(fromSequenceExclusive);
24869
24443
  const dispatch = (command) => gen(function* () {
24870
- const result = yield* make$28();
24444
+ const result = yield* make$27();
24871
24445
  yield* offer$1(commandQueue, {
24872
24446
  command,
24873
24447
  result
@@ -24907,7 +24481,7 @@ const OrchestrationEngineLive = effect(OrchestrationEngineService, makeOrchestra
24907
24481
  */
24908
24482
  const makeDrainableWorker = (process) => gen(function* () {
24909
24483
  const queue = yield* unbounded();
24910
- const initialIdle = yield* make$28();
24484
+ const initialIdle = yield* make$27();
24911
24485
  yield* succeed$5(initialIdle, void 0).pipe(orDie);
24912
24486
  const state = yield* make$11({
24913
24487
  outstanding: 0,
@@ -24923,7 +24497,7 @@ const makeDrainableWorker = (process) => gen(function* () {
24923
24497
  }).pipe(flatMap((idle) => idle === null ? void_$1 : succeed$5(idle, void 0).pipe(orDie)));
24924
24498
  yield* forkScoped(forever(take(queue).pipe(flatMap((item) => process(item).pipe(ensuring(finishOne))))));
24925
24499
  const enqueue = (item) => gen(function* () {
24926
- const nextIdle = yield* make$28();
24500
+ const nextIdle = yield* make$27();
24927
24501
  yield* update(state, (current) => current.outstanding === 0 ? {
24928
24502
  outstanding: 1,
24929
24503
  idle: nextIdle
@@ -25575,7 +25149,7 @@ const make$6 = gen(function* () {
25575
25149
  const thread = (yield* orchestrationEngine.getReadModel()).threads.find((entry) => entry.id === threadId);
25576
25150
  const sessions = yield* providerService.listSessions();
25577
25151
  const findSessionWithCwd = (session) => {
25578
- if (!session?.cwd) return none$3();
25152
+ if (!session?.cwd) return none();
25579
25153
  return some({
25580
25154
  threadId: session.threadId,
25581
25155
  cwd: session.cwd
@@ -25585,7 +25159,7 @@ const make$6 = gen(function* () {
25585
25159
  const fromProjected = findSessionWithCwd(sessions.find((session) => session.threadId === thread.id));
25586
25160
  if (isSome(fromProjected)) return fromProjected;
25587
25161
  }
25588
- return none$3();
25162
+ return none();
25589
25163
  });
25590
25164
  const isGitWorkspace = (cwd) => isGitRepository(cwd);
25591
25165
  const resolveCheckpointCwd = fnUntraced(function* (input) {
@@ -25627,7 +25201,7 @@ const make$6 = gen(function* () {
25627
25201
  fromCheckpointRef,
25628
25202
  toCheckpointRef: targetCheckpointRef,
25629
25203
  fallbackFromToHead: false
25630
- }).pipe(map$3((summary) => summary.map((file) => ({
25204
+ }).pipe(map$2((summary) => summary.map((file) => ({
25631
25205
  path: file.path,
25632
25206
  kind: "modified",
25633
25207
  additions: file.additions,
@@ -26279,7 +25853,7 @@ const make$5 = gen(function* () {
26279
25853
  projects: readModel.projects
26280
25854
  });
26281
25855
  const importedThreadResumeCursor = thread.origin === "external-import" && hasImportedThreadLineage(thread) && preferredProvider === "codex" ? { threadId } : void 0;
26282
- const resolveActiveSession = (threadId) => providerService.listSessions().pipe(map$3((sessions) => sessions.find((session) => session.threadId === threadId)));
25856
+ const resolveActiveSession = (threadId) => providerService.listSessions().pipe(map$2((sessions) => sessions.find((session) => session.threadId === threadId)));
26283
25857
  const startProviderSession = (input) => providerService.startSession(threadId, {
26284
25858
  threadId,
26285
25859
  ...preferredProvider ? { provider: preferredProvider } : {},
@@ -26355,7 +25929,7 @@ const make$5 = gen(function* () {
26355
25929
  });
26356
25930
  const normalizedInput = toNonEmptyProviderInput(input.messageText);
26357
25931
  const normalizedAttachments = input.attachments ?? [];
26358
- const activeSession = yield* providerService.listSessions().pipe(map$3((sessions) => sessions.find((session) => session.threadId === input.threadId)));
25932
+ const activeSession = yield* providerService.listSessions().pipe(map$2((sessions) => sessions.find((session) => session.threadId === input.threadId)));
26359
25933
  const sessionModelSwitch = activeSession === void 0 ? "in-session" : (yield* providerService.getCapabilities(activeSession.provider)).sessionModelSwitch;
26360
25934
  const requestedModelSelection = input.modelSelection ?? threadModelSelections.get(input.threadId) ?? thread.modelSelection;
26361
25935
  const modelForTurn = sessionModelSwitch === "unsupported" ? activeSession?.model !== void 0 ? {
@@ -30217,6 +29791,24 @@ const ENV_HINTS = [
30217
29791
  "CODEX_PATH"
30218
29792
  ];
30219
29793
  let cachedStatus = null;
29794
+ function getPathHintEntries() {
29795
+ const homeDir = process.env.HOME ?? process.env.USERPROFILE ?? "";
29796
+ const homeEntries = homeDir ? [
29797
+ path.join(homeDir, ".local", "bin"),
29798
+ path.join(homeDir, ".fnm", "aliases", "default", "bin"),
29799
+ path.join(homeDir, ".fnm", "current", "bin"),
29800
+ path.join(homeDir, ".volta", "bin"),
29801
+ path.join(homeDir, ".asdf", "shims"),
29802
+ path.join(homeDir, ".bun", "bin")
29803
+ ] : [];
29804
+ const configuredHints = (process.env.CODEX_PATH_HINTS ?? "").split(path.delimiter).map((entry) => entry.trim()).filter(Boolean);
29805
+ return [
29806
+ "/opt/homebrew/bin",
29807
+ "/usr/local/bin",
29808
+ ...homeEntries,
29809
+ ...configuredHints
29810
+ ];
29811
+ }
30220
29812
  function fileExists$1(candidate) {
30221
29813
  if (!candidate) return null;
30222
29814
  const normalized = path.resolve(candidate);
@@ -30236,8 +29828,7 @@ function resolveCodexFromEnv() {
30236
29828
  }
30237
29829
  function resolveCodexFromPath() {
30238
29830
  const pathValue = process.env.PATH ?? "";
30239
- if (!pathValue) return null;
30240
- const entries = pathValue.split(path.delimiter).map((entry) => entry.trim()).filter(Boolean);
29831
+ const entries = Array.from(new Set([...getPathHintEntries(), ...pathValue.split(path.delimiter).map((entry) => entry.trim()).filter(Boolean)].filter(Boolean)));
30241
29832
  const names = process.platform === "win32" ? [
30242
29833
  "codex.exe",
30243
29834
  "codex.cmd",
@@ -33416,7 +33007,7 @@ const makeThreadSnapshotPreparation = gen(function* () {
33416
33007
  importStateRepositories.messageRepository.listByThreadId({ threadId }),
33417
33008
  importStateRepositories.activityRepository.listByThreadId({ threadId }),
33418
33009
  importStateRepositories.proposedPlanRepository.listByThreadId({ threadId })
33419
- ], { concurrency: "inherit" }).pipe(map$3(([messages, activities, proposedPlans]) => {
33010
+ ], { concurrency: "inherit" }).pipe(map$2(([messages, activities, proposedPlans]) => {
33420
33011
  const importedIdPrefix = `${threadId}:`;
33421
33012
  return {
33422
33013
  hasArtifacts: messages.length > 0 || activities.length > 0 || proposedPlans.length > 0,
@@ -33889,7 +33480,7 @@ const make$4 = gen(function* () {
33889
33480
  return set$2(turnMessageIdsByTurnKey, providerTurnKey(threadId, turnId), nextIds);
33890
33481
  }
33891
33482
  })));
33892
- const getAssistantMessageIdsForTurn = (threadId, turnId) => getOption(turnMessageIdsByTurnKey, providerTurnKey(threadId, turnId)).pipe(map$3((existingIds) => getOrElse(existingIds, () => /* @__PURE__ */ new Set())));
33483
+ const getAssistantMessageIdsForTurn = (threadId, turnId) => getOption(turnMessageIdsByTurnKey, providerTurnKey(threadId, turnId)).pipe(map$2((existingIds) => getOrElse(existingIds, () => /* @__PURE__ */ new Set())));
33893
33484
  const clearAssistantMessageIdsForTurn = (threadId, turnId) => invalidate(turnMessageIdsByTurnKey, providerTurnKey(threadId, turnId));
33894
33485
  const appendBufferedAssistantText = (messageId, delta) => getOption(bufferedAssistantTextByMessageId, messageId).pipe(flatMap((existingText) => gen(function* () {
33895
33486
  const nextText = match(existingText, {
@@ -35754,7 +35345,7 @@ function makeThreadWriter(input) {
35754
35345
  return;
35755
35346
  }
35756
35347
  const sink = sinkResult.sink;
35757
- const scope = yield* make$29();
35348
+ const scope = yield* make$28();
35758
35349
  const loggerLayer = layer$1([yield* batched(makeLineLogger(input.streamLabel), {
35759
35350
  window: input.batchWindowMs,
35760
35351
  flush: (messages) => gen(function* () {
@@ -36631,7 +36222,7 @@ const makeCodexAdapter = (options) => gen(function* () {
36631
36222
  detail: toMessage(cause, "Failed to start Codex adapter session."),
36632
36223
  cause
36633
36224
  })
36634
- }).pipe(map$3((session) => session));
36225
+ }).pipe(map$2((session) => session));
36635
36226
  };
36636
36227
  const sendTurn = (input) => gen(function* () {
36637
36228
  const codexAttachments = yield* forEach(input.attachments ?? [], (attachment) => gen(function* () {
@@ -36665,7 +36256,7 @@ const makeCodexAdapter = (options) => gen(function* () {
36665
36256
  return manager.sendTurn(managerInput);
36666
36257
  },
36667
36258
  catch: (cause) => toRequestError(input.threadId, "turn/start", cause)
36668
- }).pipe(map$3((result) => ({
36259
+ }).pipe(map$2((result) => ({
36669
36260
  ...result,
36670
36261
  threadId: input.threadId
36671
36262
  })));
@@ -36677,7 +36268,7 @@ const makeCodexAdapter = (options) => gen(function* () {
36677
36268
  const readThread = (threadId) => tryPromise({
36678
36269
  try: () => manager.readThread(threadId),
36679
36270
  catch: (cause) => toRequestError(threadId, "thread/read", cause)
36680
- }).pipe(map$3((snapshot) => ({
36271
+ }).pipe(map$2((snapshot) => ({
36681
36272
  threadId,
36682
36273
  turns: snapshot.turns
36683
36274
  })));
@@ -36690,7 +36281,7 @@ const makeCodexAdapter = (options) => gen(function* () {
36690
36281
  return tryPromise({
36691
36282
  try: () => manager.rollbackThread(threadId, numTurns),
36692
36283
  catch: (cause) => toRequestError(threadId, "thread/rollback", cause)
36693
- }).pipe(map$3((snapshot) => ({
36284
+ }).pipe(map$2((snapshot) => ({
36694
36285
  threadId,
36695
36286
  turns: snapshot.turns
36696
36287
  })));
@@ -37064,7 +36655,7 @@ const makeProviderService = (options) => gen(function* () {
37064
36655
  });
37065
36656
  const listSessions = () => gen(function* () {
37066
36657
  const activeSessions = (yield* forEach(adapters, (adapter) => adapter.listSessions())).flatMap((sessions) => sessions);
37067
- const persistedBindings = yield* directory.listThreadIds().pipe(flatMap((threadIds) => forEach(threadIds, (threadId) => directory.getBinding(threadId).pipe(orElseSucceed(() => none$3())), { concurrency: "unbounded" })), orElseSucceed(() => []));
36658
+ const persistedBindings = yield* directory.listThreadIds().pipe(flatMap((threadIds) => forEach(threadIds, (threadId) => directory.getBinding(threadId).pipe(orElseSucceed(() => none())), { concurrency: "unbounded" })), orElseSucceed(() => []));
37068
36659
  const bindingsByThreadId = /* @__PURE__ */ new Map();
37069
36660
  for (const bindingOption of persistedBindings) {
37070
36661
  const binding = getOrUndefined(bindingOption);
@@ -37079,7 +36670,7 @@ const makeProviderService = (options) => gen(function* () {
37079
36670
  return Object.assign({}, session, overrides);
37080
36671
  });
37081
36672
  });
37082
- const getCapabilities = (provider) => registry.getByProvider(provider).pipe(map$3((adapter) => adapter.capabilities));
36673
+ const getCapabilities = (provider) => registry.getByProvider(provider).pipe(map$2((adapter) => adapter.capabilities));
37083
36674
  const rollbackConversation = (rawInput) => gen(function* () {
37084
36675
  const input = yield* decodeInputOrValidationError({
37085
36676
  operation: "ProviderService.rollbackConversation",
@@ -37157,8 +36748,8 @@ function mergeRuntimePayload(existing, next) {
37157
36748
  const makeProviderSessionDirectory = gen(function* () {
37158
36749
  const repository = yield* ProviderSessionRuntimeRepository;
37159
36750
  const getBinding = (threadId) => repository.getByThreadId({ threadId }).pipe(mapError(toPersistenceError("ProviderSessionDirectory.getBinding:getByThreadId")), flatMap((runtime) => match(runtime, {
37160
- onNone: () => succeed(none$3()),
37161
- onSome: (value) => decodeProviderKind(value.providerName, "ProviderSessionDirectory.getBinding").pipe(map$3((provider) => some({
36751
+ onNone: () => succeed(none()),
36752
+ onSome: (value) => decodeProviderKind(value.providerName, "ProviderSessionDirectory.getBinding").pipe(map$2((provider) => some({
37162
36753
  threadId: value.threadId,
37163
36754
  provider,
37164
36755
  adapterKey: value.adapterKey,
@@ -37196,7 +36787,7 @@ const makeProviderSessionDirectory = gen(function* () {
37196
36787
  }))
37197
36788
  })));
37198
36789
  const remove = (threadId) => repository.deleteByThreadId({ threadId }).pipe(mapError(toPersistenceError("ProviderSessionDirectory.remove:deleteByThreadId")));
37199
- const listThreadIds = () => repository.list().pipe(mapError(toPersistenceError("ProviderSessionDirectory.listThreadIds:list")), map$3((rows) => rows.map((row) => row.threadId)));
36790
+ const listThreadIds = () => repository.list().pipe(mapError(toPersistenceError("ProviderSessionDirectory.listThreadIds:list")), map$2((rows) => rows.map((row) => row.threadId)));
37200
36791
  return {
37201
36792
  upsert,
37202
36793
  getProvider,
@@ -38500,7 +38091,7 @@ function compileResolvedKeybindingsConfig(config) {
38500
38091
  return compiled;
38501
38092
  }
38502
38093
  const ResolvedKeybindingFromConfig = KeybindingRule.pipe(decodeTo(toType(ResolvedKeybindingRule), transformOrFail({
38503
- decode: (rule) => succeed(compileResolvedKeybindingRule(rule)).pipe(filterOrFail(isNotNull, () => new InvalidValue$1(some(rule), { title: "Invalid keybinding rule" })), map$3((resolved) => resolved)),
38094
+ decode: (rule) => succeed(compileResolvedKeybindingRule(rule)).pipe(filterOrFail(isNotNull, () => new InvalidValue$1(some(rule), { title: "Invalid keybinding rule" })), map$2((resolved) => resolved)),
38504
38095
  encode: (resolved) => gen(function* () {
38505
38096
  const key = encodeShortcut(resolved.shortcut);
38506
38097
  if (!key) return yield* fail$1(new InvalidValue$1(some(resolved), { title: "Resolved shortcut cannot be encoded to key string" }));
@@ -38588,11 +38179,11 @@ const makeKeybindings = gen(function* () {
38588
38179
  const { keybindingsConfigPath, stateDir } = yield* ServerConfig$1;
38589
38180
  const fs = yield* FileSystem;
38590
38181
  const path = yield* Path$1;
38591
- const upsertSemaphore = yield* make$30(1);
38182
+ const upsertSemaphore = yield* make$29(1);
38592
38183
  const resolvedConfigCacheKey = "resolved";
38593
38184
  const changesPubSub = yield* unbounded$1();
38594
38185
  const startedRef = yield* make$11(false);
38595
- const startedDeferred = yield* make$28();
38186
+ const startedDeferred = yield* make$27();
38596
38187
  const keybindingsDbPath = path.join(stateDir, SQLITE_DB_FILE);
38597
38188
  const emitChange = (configState) => publish(changesPubSub, configState).pipe(asVoid);
38598
38189
  const readStoredRawConfig = tryPromise({
@@ -38628,7 +38219,7 @@ const makeKeybindings = gen(function* () {
38628
38219
  yield* fs.remove(keybindingsConfigPath).pipe(orElseSucceed(() => void 0));
38629
38220
  return rawConfig;
38630
38221
  });
38631
- const readRawConfig = importLegacyRawConfigOnce().pipe(map$3((rawConfig) => rawConfig ?? "[]"), mapError((cause) => new KeybindingsConfigError({
38222
+ const readRawConfig = importLegacyRawConfigOnce().pipe(map$2((rawConfig) => rawConfig ?? "[]"), mapError((cause) => new KeybindingsConfigError({
38632
38223
  configPath: keybindingsConfigPath,
38633
38224
  detail: "failed to read keybindings config",
38634
38225
  cause
@@ -38658,7 +38249,7 @@ const makeKeybindings = gen(function* () {
38658
38249
  return null;
38659
38250
  }
38660
38251
  return decodedRule.value;
38661
- })).pipe(map$3(filter(isNotNull)));
38252
+ })).pipe(map$2(filter(isNotNull)));
38662
38253
  });
38663
38254
  const loadRuntimeCustomKeybindingsConfig = fn(function* () {
38664
38255
  const rawConfig = yield* readRawConfig;
@@ -38702,13 +38293,13 @@ const makeKeybindings = gen(function* () {
38702
38293
  };
38703
38294
  });
38704
38295
  const writeConfigAtomically = (rules) => {
38705
- return encodeEffect(KeybindingsConfigPrettyJson)(rules).pipe(map$3((encoded) => `${encoded}\n`), flatMap((encoded) => writeStoredRawConfig(encoded)), mapError((cause) => new KeybindingsConfigError({
38296
+ return encodeEffect(KeybindingsConfigPrettyJson)(rules).pipe(map$2((encoded) => `${encoded}\n`), flatMap((encoded) => writeStoredRawConfig(encoded)), mapError((cause) => new KeybindingsConfigError({
38706
38297
  configPath: keybindingsConfigPath,
38707
38298
  detail: "failed to write keybindings config",
38708
38299
  cause
38709
38300
  })));
38710
38301
  };
38711
- const loadConfigStateFromDisk = loadRuntimeCustomKeybindingsConfig().pipe(map$3(({ keybindings, issues }) => ({
38302
+ const loadConfigStateFromDisk = loadRuntimeCustomKeybindingsConfig().pipe(map$2(({ keybindings, issues }) => ({
38712
38303
  keybindings: mergeWithDefaultKeybindings(compileResolvedKeybindingsConfig(keybindings)),
38713
38304
  issues
38714
38305
  })));
@@ -39226,7 +38817,7 @@ const makeGitManager = gen(function* () {
39226
38817
  "--json",
39227
38818
  "number,title,url,baseRefName,headRefName,state,mergedAt,updatedAt"
39228
38819
  ]
39229
- }).pipe(map$3((result) => result.stdout))).trim();
38820
+ }).pipe(map$2((result) => result.stdout))).trim();
39230
38821
  if (raw.length === 0) continue;
39231
38822
  const parsedJson = yield* try_({
39232
38823
  try: () => JSON.parse(raw),
@@ -39274,7 +38865,7 @@ const makeGitManager = gen(function* () {
39274
38865
  stagedPatch: limitContext(context.stagedPatch, 5e4),
39275
38866
  ...input.includeBranch ? { includeBranch: true } : {},
39276
38867
  ...input.model ? { model: input.model } : {}
39277
- }).pipe(map$3((result) => sanitizeCommitMessage(result)), catch_((error) => logWarning$1(`GitManager.resolveCommitAndBranchSuggestion: falling back to a generic commit message for ${input.cwd}: ${error instanceof Error ? error.message : String(error)}`).pipe(as(buildFallbackCommitAndBranchSuggestion({
38868
+ }).pipe(map$2((result) => sanitizeCommitMessage(result)), catch_((error) => logWarning$1(`GitManager.resolveCommitAndBranchSuggestion: falling back to a generic commit message for ${input.cwd}: ${error instanceof Error ? error.message : String(error)}`).pipe(as(buildFallbackCommitAndBranchSuggestion({
39278
38869
  stagedSummary: context.stagedSummary,
39279
38870
  includeBranch: input.includeBranch
39280
38871
  })))));
@@ -39381,7 +38972,7 @@ const makeGitManager = gen(function* () {
39381
38972
  const pr = details.branch !== null ? yield* findLatestPr(input.cwd, {
39382
38973
  branch: details.branch,
39383
38974
  upstreamRef: details.upstreamRef
39384
- }).pipe(map$3((latest) => latest ? toStatusPr(latest) : null), catch_(() => succeed(null))) : null;
38975
+ }).pipe(map$2((latest) => latest ? toStatusPr(latest) : null), catch_(() => succeed(null))) : null;
39385
38976
  return {
39386
38977
  branch: details.branch,
39387
38978
  hasWorkingTreeChanges: details.hasWorkingTreeChanges,
@@ -39396,7 +38987,7 @@ const makeGitManager = gen(function* () {
39396
38987
  return { pullRequest: yield* gitHubCli.getPullRequest({
39397
38988
  cwd: input.cwd,
39398
38989
  reference: normalizePullRequestReference(input.reference)
39399
- }).pipe(map$3((resolved) => toResolvedPullRequest(resolved))) };
38990
+ }).pipe(map$2((resolved) => toResolvedPullRequest(resolved))) };
39400
38991
  });
39401
38992
  const preparePullRequestThread = fnUntraced(function* (input) {
39402
38993
  const normalizedReference = normalizePullRequestReference(input.reference);
@@ -39435,7 +39026,7 @@ const makeGitManager = gen(function* () {
39435
39026
  ...toPullRequestHeadRemoteInfo(pullRequestSummary)
39436
39027
  };
39437
39028
  const localPullRequestBranch = resolvePullRequestWorktreeLocalBranchName(pullRequestWithRemoteInfo);
39438
- const findLocalHeadBranch = (cwd) => gitCore.listBranches({ cwd }).pipe(map$3((result) => {
39029
+ const findLocalHeadBranch = (cwd) => gitCore.listBranches({ cwd }).pipe(map$2((result) => {
39439
39030
  const localBranch = result.branches.find((branch) => !branch.isRemote && branch.name === localPullRequestBranch);
39440
39031
  if (localBranch) return localBranch;
39441
39032
  if (localPullRequestBranch === pullRequest.headBranch) return null;
@@ -39742,7 +39333,7 @@ const makeGitCore = gen(function* () {
39742
39333
  return fail$1(createGitCommandError(operation, cwd, args, `${commandLabel(args)} failed: code=${result.code ?? "null"}`));
39743
39334
  }));
39744
39335
  const runGit = (operation, cwd, args, allowNonZeroExit = false) => executeGit(operation, cwd, args, { allowNonZeroExit }).pipe(asVoid);
39745
- const runGitStdout = (operation, cwd, args, allowNonZeroExit = false) => executeGit(operation, cwd, args, { allowNonZeroExit }).pipe(map$3((result) => result.stdout));
39336
+ const runGitStdout = (operation, cwd, args, allowNonZeroExit = false) => executeGit(operation, cwd, args, { allowNonZeroExit }).pipe(map$2((result) => result.stdout));
39746
39337
  const branchExists = (cwd, branch) => executeGit("GitCore.branchExists", cwd, [
39747
39338
  "show-ref",
39748
39339
  "--verify",
@@ -39751,7 +39342,7 @@ const makeGitCore = gen(function* () {
39751
39342
  ], {
39752
39343
  allowNonZeroExit: true,
39753
39344
  timeoutMs: 5e3
39754
- }).pipe(map$3((result) => result.code === 0));
39345
+ }).pipe(map$2((result) => result.code === 0));
39755
39346
  const resolveAvailableBranchName = (cwd, desiredBranch) => gen(function* () {
39756
39347
  if (!(yield* branchExists(cwd, desiredBranch))) return desiredBranch;
39757
39348
  for (let suffix = 1; suffix <= 100; suffix += 1) {
@@ -39771,7 +39362,7 @@ const makeGitCore = gen(function* () {
39771
39362
  "--abbrev-ref",
39772
39363
  "--symbolic-full-name",
39773
39364
  "@{upstream}"
39774
- ], true).pipe(map$3((stdout) => stdout.trim()));
39365
+ ], true).pipe(map$2((stdout) => stdout.trim()));
39775
39366
  if (upstreamRef.length === 0 || upstreamRef === "@{upstream}") return null;
39776
39367
  const separatorIndex = upstreamRef.indexOf("/");
39777
39368
  if (separatorIndex <= 0) return null;
@@ -39834,7 +39425,7 @@ const makeGitCore = gen(function* () {
39834
39425
  if (!upstream) return;
39835
39426
  yield* fetchUpstreamRef(cwd, upstream);
39836
39427
  });
39837
- const resolveDefaultBranchName = (cwd, remoteName) => executeGit("GitCore.resolveDefaultBranchName", cwd, ["symbolic-ref", `refs/remotes/${remoteName}/HEAD`], { allowNonZeroExit: true }).pipe(map$3((result) => {
39428
+ const resolveDefaultBranchName = (cwd, remoteName) => executeGit("GitCore.resolveDefaultBranchName", cwd, ["symbolic-ref", `refs/remotes/${remoteName}/HEAD`], { allowNonZeroExit: true }).pipe(map$2((result) => {
39838
39429
  if (result.code !== 0) return null;
39839
39430
  return parseDefaultBranchFromRemoteHeadRef(result.stdout, remoteName);
39840
39431
  }));
@@ -39843,13 +39434,13 @@ const makeGitCore = gen(function* () {
39843
39434
  "--verify",
39844
39435
  "--quiet",
39845
39436
  `refs/remotes/${remoteName}/${branch}`
39846
- ], { allowNonZeroExit: true }).pipe(map$3((result) => result.code === 0));
39437
+ ], { allowNonZeroExit: true }).pipe(map$2((result) => result.code === 0));
39847
39438
  const originRemoteExists = (cwd) => executeGit("GitCore.originRemoteExists", cwd, [
39848
39439
  "remote",
39849
39440
  "get-url",
39850
39441
  "origin"
39851
- ], { allowNonZeroExit: true }).pipe(map$3((result) => result.code === 0));
39852
- const listRemoteNames = (cwd) => runGitStdout("GitCore.listRemoteNames", cwd, ["remote"]).pipe(map$3((stdout) => parseRemoteNames(stdout).toReversed()));
39442
+ ], { allowNonZeroExit: true }).pipe(map$2((result) => result.code === 0));
39443
+ const listRemoteNames = (cwd) => runGitStdout("GitCore.listRemoteNames", cwd, ["remote"]).pipe(map$2((stdout) => parseRemoteNames(stdout).toReversed()));
39853
39444
  const resolvePrimaryRemoteName = (cwd) => gen(function* () {
39854
39445
  if (yield* originRemoteExists(cwd)) return "origin";
39855
39446
  const [firstRemote] = yield* listRemoteNames(cwd);
@@ -39861,20 +39452,20 @@ const makeGitCore = gen(function* () {
39861
39452
  "config",
39862
39453
  "--get",
39863
39454
  `branch.${branch}.pushRemote`
39864
- ], true).pipe(map$3((stdout) => stdout.trim()));
39455
+ ], true).pipe(map$2((stdout) => stdout.trim()));
39865
39456
  if (branchPushRemote.length > 0) return branchPushRemote;
39866
39457
  const pushDefaultRemote = yield* runGitStdout("GitCore.resolvePushRemoteName.remotePushDefault", cwd, [
39867
39458
  "config",
39868
39459
  "--get",
39869
39460
  "remote.pushDefault"
39870
- ], true).pipe(map$3((stdout) => stdout.trim()));
39461
+ ], true).pipe(map$2((stdout) => stdout.trim()));
39871
39462
  if (pushDefaultRemote.length > 0) return pushDefaultRemote;
39872
39463
  return yield* resolvePrimaryRemoteName(cwd).pipe(catch_(() => succeed(null)));
39873
39464
  });
39874
39465
  const ensureRemote = (input) => gen(function* () {
39875
39466
  const preferredName = sanitizeRemoteName(input.preferredName);
39876
39467
  const normalizedTargetUrl = normalizeRemoteUrl(input.url);
39877
- const remoteFetchUrls = yield* runGitStdout("GitCore.ensureRemote.listRemoteUrls", input.cwd, ["remote", "-v"]).pipe(map$3((stdout) => parseRemoteFetchUrls(stdout)));
39468
+ const remoteFetchUrls = yield* runGitStdout("GitCore.ensureRemote.listRemoteUrls", input.cwd, ["remote", "-v"]).pipe(map$2((stdout) => parseRemoteFetchUrls(stdout)));
39878
39469
  for (const [remoteName, remoteUrl] of remoteFetchUrls.entries()) if (normalizeRemoteUrl(remoteUrl) === normalizedTargetUrl) return remoteName;
39879
39470
  let remoteName = preferredName;
39880
39471
  let suffix = 1;
@@ -39895,7 +39486,7 @@ const makeGitCore = gen(function* () {
39895
39486
  "config",
39896
39487
  "--get",
39897
39488
  `branch.${branch}.gh-merge-base`
39898
- ], true).pipe(map$3((stdout) => stdout.trim()));
39489
+ ], true).pipe(map$2((stdout) => stdout.trim()));
39899
39490
  const primaryRemoteName = yield* resolvePrimaryRemoteName(cwd).pipe(catch_(() => succeed(null)));
39900
39491
  const defaultBranch = primaryRemoteName === null ? null : yield* resolveDefaultBranchName(cwd, primaryRemoteName);
39901
39492
  const candidates = [
@@ -40040,7 +39631,7 @@ const makeGitCore = gen(function* () {
40040
39631
  behindCount
40041
39632
  };
40042
39633
  });
40043
- const status = (input) => statusDetails(input.cwd).pipe(map$3((details) => ({
39634
+ const status = (input) => statusDetails(input.cwd).pipe(map$2((details) => ({
40044
39635
  branch: details.branch,
40045
39636
  hasWorkingTreeChanges: details.hasWorkingTreeChanges,
40046
39637
  workingTree: details.workingTree,
@@ -40063,7 +39654,7 @@ const makeGitCore = gen(function* () {
40063
39654
  "diff",
40064
39655
  "--cached",
40065
39656
  "--name-status"
40066
- ]).pipe(map$3((stdout) => stdout.trim()));
39657
+ ]).pipe(map$2((stdout) => stdout.trim()));
40067
39658
  if (stagedSummary.length === 0) return null;
40068
39659
  const changedFileCount = stagedSummary.split(/\r?\n/g).filter((line) => line.trim().length > 0).length;
40069
39660
  if (changedFileCount > LARGE_COMMIT_PATCH_MAX_FILES) return {
@@ -40091,7 +39682,7 @@ const makeGitCore = gen(function* () {
40091
39682
  const trimmedBody = body.trim();
40092
39683
  if (trimmedBody.length > 0) args.push("-m", trimmedBody);
40093
39684
  yield* runGit("GitCore.commit.commit", cwd, args);
40094
- return { commitSha: yield* runGitStdout("GitCore.commit.revParseHead", cwd, ["rev-parse", "HEAD"]).pipe(map$3((stdout) => stdout.trim())) };
39685
+ return { commitSha: yield* runGitStdout("GitCore.commit.revParseHead", cwd, ["rev-parse", "HEAD"]).pipe(map$2((stdout) => stdout.trim())) };
40095
39686
  });
40096
39687
  const pushCurrentBranch = (cwd, fallbackBranch) => gen(function* () {
40097
39688
  const details = yield* statusDetails(cwd);
@@ -40158,12 +39749,12 @@ const makeGitCore = gen(function* () {
40158
39749
  const branch = details.branch;
40159
39750
  if (!branch) return yield* createGitCommandError("GitCore.pullCurrentBranch", cwd, ["pull", "--ff-only"], "Cannot pull from detached HEAD.");
40160
39751
  if (!details.hasUpstream) return yield* createGitCommandError("GitCore.pullCurrentBranch", cwd, ["pull", "--ff-only"], "Current branch has no upstream configured. Push with upstream first.");
40161
- const beforeSha = yield* runGitStdout("GitCore.pullCurrentBranch.beforeSha", cwd, ["rev-parse", "HEAD"], true).pipe(map$3((stdout) => stdout.trim()));
39752
+ const beforeSha = yield* runGitStdout("GitCore.pullCurrentBranch.beforeSha", cwd, ["rev-parse", "HEAD"], true).pipe(map$2((stdout) => stdout.trim()));
40162
39753
  yield* executeGit("GitCore.pullCurrentBranch.pull", cwd, ["pull", "--ff-only"], {
40163
39754
  timeoutMs: 3e4,
40164
39755
  fallbackErrorMessage: "git pull failed"
40165
39756
  });
40166
- const afterSha = yield* runGitStdout("GitCore.pullCurrentBranch.afterSha", cwd, ["rev-parse", "HEAD"], true).pipe(map$3((stdout) => stdout.trim()));
39757
+ const afterSha = yield* runGitStdout("GitCore.pullCurrentBranch.afterSha", cwd, ["rev-parse", "HEAD"], true).pipe(map$2((stdout) => stdout.trim()));
40167
39758
  const refreshed = yield* statusDetails(cwd);
40168
39759
  return {
40169
39760
  status: beforeSha.length > 0 && beforeSha === afterSha ? "skipped_up_to_date" : "pulled",
@@ -40201,7 +39792,7 @@ const makeGitCore = gen(function* () {
40201
39792
  "config",
40202
39793
  "--get",
40203
39794
  key
40204
- ], true).pipe(map$3((stdout) => stdout.trim()), map$3((trimmed) => trimmed.length > 0 ? trimmed : null));
39795
+ ], true).pipe(map$2((stdout) => stdout.trim()), map$2((trimmed) => trimmed.length > 0 ? trimmed : null));
40205
39796
  const listBranches = (input) => gen(function* () {
40206
39797
  const branchRecencyPromise = readBranchRecency(input.cwd).pipe(catch_(() => succeed(/* @__PURE__ */ new Map())));
40207
39798
  const localBranchResult = yield* executeGit("GitCore.listBranches.branchNoColor", input.cwd, ["branch", "--no-color"], {
@@ -40263,7 +39854,7 @@ const makeGitCore = gen(function* () {
40263
39854
  let currentPath = null;
40264
39855
  for (const line of worktreeList.stdout.split("\n")) if (line.startsWith("worktree ")) {
40265
39856
  const candidatePath = line.slice(9);
40266
- currentPath = (yield* fileSystem.stat(candidatePath).pipe(map$3(() => true), catch_(() => succeed(false)))) ? candidatePath : null;
39857
+ currentPath = (yield* fileSystem.stat(candidatePath).pipe(map$2(() => true), catch_(() => succeed(false)))) ? candidatePath : null;
40267
39858
  } else if (line.startsWith("branch refs/heads/") && currentPath) worktreeMap.set(line.slice(18), currentPath);
40268
39859
  else if (line === "") currentPath = null;
40269
39860
  }
@@ -40404,7 +39995,7 @@ const makeGitCore = gen(function* () {
40404
39995
  ], {
40405
39996
  timeoutMs: 5e3,
40406
39997
  allowNonZeroExit: true
40407
- }).pipe(map$3((result) => result.code === 0)), executeGit("GitCore.checkoutBranch.remoteExists", input.cwd, [
39998
+ }).pipe(map$2((result) => result.code === 0)), executeGit("GitCore.checkoutBranch.remoteExists", input.cwd, [
40408
39999
  "show-ref",
40409
40000
  "--verify",
40410
40001
  "--quiet",
@@ -40412,7 +40003,7 @@ const makeGitCore = gen(function* () {
40412
40003
  ], {
40413
40004
  timeoutMs: 5e3,
40414
40005
  allowNonZeroExit: true
40415
- }).pipe(map$3((result) => result.code === 0))], { concurrency: "unbounded" });
40006
+ }).pipe(map$2((result) => result.code === 0))], { concurrency: "unbounded" });
40416
40007
  const localTrackingBranch = remoteExists ? yield* executeGit("GitCore.checkoutBranch.localTrackingBranch", input.cwd, [
40417
40008
  "for-each-ref",
40418
40009
  "--format=%(refname:short) %(upstream:short)",
@@ -40420,7 +40011,7 @@ const makeGitCore = gen(function* () {
40420
40011
  ], {
40421
40012
  timeoutMs: 5e3,
40422
40013
  allowNonZeroExit: true
40423
- }).pipe(map$3((result) => result.code === 0 ? parseTrackingBranchByUpstreamRef(result.stdout, input.branch) : null)) : null;
40014
+ }).pipe(map$2((result) => result.code === 0 ? parseTrackingBranchByUpstreamRef(result.stdout, input.branch) : null)) : null;
40424
40015
  const localTrackedBranchCandidate = deriveLocalBranchNameFromRemoteRef(input.branch);
40425
40016
  const localTrackedBranchTargetExists = remoteExists && localTrackedBranchCandidate ? yield* executeGit("GitCore.checkoutBranch.localTrackedBranchTargetExists", input.cwd, [
40426
40017
  "show-ref",
@@ -40430,7 +40021,7 @@ const makeGitCore = gen(function* () {
40430
40021
  ], {
40431
40022
  timeoutMs: 5e3,
40432
40023
  allowNonZeroExit: true
40433
- }).pipe(map$3((result) => result.code === 0)) : false;
40024
+ }).pipe(map$2((result) => result.code === 0)) : false;
40434
40025
  const checkoutArgs = localInputExists ? ["checkout", input.branch] : remoteExists && !localTrackingBranch && localTrackedBranchTargetExists ? ["checkout", input.branch] : remoteExists && !localTrackingBranch ? [
40435
40026
  "checkout",
40436
40027
  "--track",
@@ -40450,7 +40041,7 @@ const makeGitCore = gen(function* () {
40450
40041
  "branch",
40451
40042
  "--list",
40452
40043
  "--format=%(refname:short)"
40453
- ]).pipe(map$3((stdout) => stdout.split("\n").map((line) => line.trim()).filter((line) => line.length > 0)));
40044
+ ]).pipe(map$2((stdout) => stdout.split("\n").map((line) => line.trim()).filter((line) => line.length > 0)));
40454
40045
  return {
40455
40046
  status,
40456
40047
  statusDetails,
@@ -40585,7 +40176,7 @@ const makeGitHubCli = sync(() => {
40585
40176
  "--json",
40586
40177
  "number,title,url,baseRefName,headRefName"
40587
40178
  ]
40588
- }).pipe(map$3((result) => result.stdout.trim()), flatMap((raw) => raw.length === 0 ? succeed([]) : decodeGitHubJson(raw, Array$1(RawGitHubPullRequestSchema), "listOpenPullRequests", "GitHub CLI returned invalid PR list JSON.")), map$3((pullRequests) => pullRequests.map(normalizePullRequestSummary))),
40179
+ }).pipe(map$2((result) => result.stdout.trim()), flatMap((raw) => raw.length === 0 ? succeed([]) : decodeGitHubJson(raw, Array$1(RawGitHubPullRequestSchema), "listOpenPullRequests", "GitHub CLI returned invalid PR list JSON.")), map$2((pullRequests) => pullRequests.map(normalizePullRequestSummary))),
40589
40180
  getPullRequest: (input) => execute({
40590
40181
  cwd: input.cwd,
40591
40182
  args: [
@@ -40595,7 +40186,7 @@ const makeGitHubCli = sync(() => {
40595
40186
  "--json",
40596
40187
  "number,title,url,baseRefName,headRefName,state,mergedAt,isCrossRepository,headRepository,headRepositoryOwner"
40597
40188
  ]
40598
- }).pipe(map$3((result) => result.stdout.trim()), flatMap((raw) => decodeGitHubJson(raw, RawGitHubPullRequestSchema, "getPullRequest", "GitHub CLI returned invalid pull request JSON.")), map$3(normalizePullRequestSummary)),
40189
+ }).pipe(map$2((result) => result.stdout.trim()), flatMap((raw) => decodeGitHubJson(raw, RawGitHubPullRequestSchema, "getPullRequest", "GitHub CLI returned invalid pull request JSON.")), map$2(normalizePullRequestSummary)),
40599
40190
  getRepositoryCloneUrls: (input) => execute({
40600
40191
  cwd: input.cwd,
40601
40192
  args: [
@@ -40605,7 +40196,7 @@ const makeGitHubCli = sync(() => {
40605
40196
  "--json",
40606
40197
  "nameWithOwner,url,sshUrl"
40607
40198
  ]
40608
- }).pipe(map$3((result) => result.stdout.trim()), flatMap((raw) => decodeGitHubJson(raw, RawGitHubRepositoryCloneUrlsSchema, "getRepositoryCloneUrls", "GitHub CLI returned invalid repository JSON.")), map$3(normalizeRepositoryCloneUrls)),
40199
+ }).pipe(map$2((result) => result.stdout.trim()), flatMap((raw) => decodeGitHubJson(raw, RawGitHubRepositoryCloneUrlsSchema, "getRepositoryCloneUrls", "GitHub CLI returned invalid repository JSON.")), map$2(normalizeRepositoryCloneUrls)),
40609
40200
  createPullRequest: (input) => execute({
40610
40201
  cwd: input.cwd,
40611
40202
  args: [
@@ -40631,7 +40222,7 @@ const makeGitHubCli = sync(() => {
40631
40222
  "--jq",
40632
40223
  ".defaultBranchRef.name"
40633
40224
  ]
40634
- }).pipe(map$3((value) => {
40225
+ }).pipe(map$2((value) => {
40635
40226
  const trimmed = value.stdout.trim();
40636
40227
  return trimmed.length > 0 ? trimmed : null;
40637
40228
  })),
@@ -40743,7 +40334,7 @@ const makeCodexTextGeneration = gen(function* () {
40743
40334
  const schemaPath = yield* writeTempFile(operation, "codex-schema", JSON.stringify(toCodexOutputJsonSchema(outputSchemaJson)));
40744
40335
  const outputPath = yield* writeTempFile(operation, "codex-output", "");
40745
40336
  const runCodexCommand = gen(function* () {
40746
- const command = make$19("codex", [
40337
+ const command = make$18("codex", [
40747
40338
  "exec",
40748
40339
  "--ephemeral",
40749
40340
  "-s",
@@ -40761,13 +40352,13 @@ const makeCodexTextGeneration = gen(function* () {
40761
40352
  ], {
40762
40353
  cwd,
40763
40354
  shell: process.platform === "win32",
40764
- stdin: { stream: make$31(new TextEncoder().encode(prompt)) }
40355
+ stdin: { stream: make$30(new TextEncoder().encode(prompt)) }
40765
40356
  });
40766
40357
  const child = yield* commandSpawner.spawn(command).pipe(mapError((cause) => normalizeCodexError(operation, cause, "Failed to spawn Codex CLI process")));
40767
40358
  const [stdout, stderr, exitCode] = yield* all([
40768
40359
  readStreamAsString(operation, child.stdout),
40769
40360
  readStreamAsString(operation, child.stderr),
40770
- child.exitCode.pipe(map$3((value) => Number(value)), mapError((cause) => normalizeCodexError(operation, cause, "Failed to read Codex CLI exit code")))
40361
+ child.exitCode.pipe(map$2((value) => Number(value)), mapError((cause) => normalizeCodexError(operation, cause, "Failed to read Codex CLI exit code")))
40771
40362
  ], { concurrency: "unbounded" });
40772
40363
  if (exitCode !== 0) {
40773
40364
  const stderrDetail = stderr.trim();
@@ -40836,7 +40427,7 @@ const makeCodexTextGeneration = gen(function* () {
40836
40427
  prompt,
40837
40428
  outputSchemaJson,
40838
40429
  ...input.model ? { model: input.model } : {}
40839
- }).pipe(map$3((generated) => ({
40430
+ }).pipe(map$2((generated) => ({
40840
40431
  subject: sanitizeCommitSubject(generated.subject),
40841
40432
  body: generated.body.trim(),
40842
40433
  ..."branch" in generated && typeof generated.branch === "string" ? { branch: sanitizeFeatureBranchName(generated.branch) } : {}
@@ -40873,7 +40464,7 @@ const makeCodexTextGeneration = gen(function* () {
40873
40464
  body: String$1
40874
40465
  }),
40875
40466
  ...input.model ? { model: input.model } : {}
40876
- }).pipe(map$3((generated) => ({
40467
+ }).pipe(map$2((generated) => ({
40877
40468
  title: sanitizePrTitle(generated.title),
40878
40469
  body: generated.body.trim()
40879
40470
  })));
@@ -41287,11 +40878,11 @@ const readCodexConfigModelProvider = gen(function* () {
41287
40878
  * required because authentication is handled through provider-specific
41288
40879
  * environment variables.
41289
40880
  */
41290
- const hasCustomModelProvider = map$3(readCodexConfigModelProvider, (provider) => provider !== void 0 && !OPENAI_AUTH_PROVIDERS.has(provider));
40881
+ const hasCustomModelProvider = map$2(readCodexConfigModelProvider, (provider) => provider !== void 0 && !OPENAI_AUTH_PROVIDERS.has(provider));
41291
40882
  const collectStreamAsString = (stream) => runFold(stream, () => "", (acc, chunk) => acc + new TextDecoder().decode(chunk));
41292
40883
  const runCodexCommand$1 = (args, env) => gen(function* () {
41293
40884
  const spawner = yield* ChildProcessSpawner;
41294
- const command = make$19("codex", [...args], {
40885
+ const command = make$18("codex", [...args], {
41295
40886
  shell: process.platform === "win32",
41296
40887
  ...env ? { env } : {}
41297
40888
  });
@@ -41299,7 +40890,7 @@ const runCodexCommand$1 = (args, env) => gen(function* () {
41299
40890
  const [stdout, stderr, exitCode] = yield* all([
41300
40891
  collectStreamAsString(child.stdout),
41301
40892
  collectStreamAsString(child.stderr),
41302
- child.exitCode.pipe(map$3(Number))
40893
+ child.exitCode.pipe(map$2(Number))
41303
40894
  ], { concurrency: "unbounded" });
41304
40895
  return {
41305
40896
  stdout,
@@ -41401,7 +40992,7 @@ const ProviderHealthLive = effect(ProviderHealth, gen(function* () {
41401
40992
  const fileSystem = yield* FileSystem;
41402
40993
  const path = yield* Path$1;
41403
40994
  const childProcessSpawner = yield* ChildProcessSpawner;
41404
- const loadStatuses = checkCodexProviderStatus.pipe(map$3(of), provideService(FileSystem, fileSystem), provideService(Path$1, path), provideService(ChildProcessSpawner, childProcessSpawner));
40995
+ const loadStatuses = checkCodexProviderStatus.pipe(map$2(of), provideService(FileSystem, fileSystem), provideService(Path$1, path), provideService(ChildProcessSpawner, childProcessSpawner));
41405
40996
  const statusesRef = yield* make$11(yield* loadStatuses);
41406
40997
  return {
41407
40998
  getStatuses: get(statusesRef),
@@ -41925,7 +41516,9 @@ var require_toml_parser = /* @__PURE__ */ __commonJSMin(((exports, module) => {
41925
41516
  if (_type in value) switch (value[_type]) {
41926
41517
  case INLINE_TABLE: return "inline-table";
41927
41518
  case INLINE_LIST: return "inline-list";
41519
+ /* istanbul ignore next */
41928
41520
  case TABLE: return "table";
41521
+ /* istanbul ignore next */
41929
41522
  case LIST: return "list";
41930
41523
  case FLOAT: return "float";
41931
41524
  case INTEGER: return "integer";
@@ -42864,6 +42457,7 @@ var require_stringify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
42864
42457
  case "datetime": return true;
42865
42458
  case "array": return value.length === 0 || tomlType(value[0]) !== "table";
42866
42459
  case "table": return Object.keys(value).length === 0;
42460
+ /* istanbul ignore next */
42867
42461
  default: return false;
42868
42462
  }
42869
42463
  }
@@ -42924,6 +42518,7 @@ var require_stringify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
42924
42518
  case "datetime": return stringifyDatetime(value);
42925
42519
  case "array": return stringifyInlineArray(value.filter((_) => tomlType(_) !== "null" && tomlType(_) !== "undefined" && tomlType(_) !== "nan"));
42926
42520
  case "table": return stringifyInlineTable(value);
42521
+ /* istanbul ignore next */
42927
42522
  default: throw typeError(type);
42928
42523
  }
42929
42524
  }
@@ -44240,7 +43835,8 @@ function resolveFallbackAccountKey(profileName) {
44240
43835
  }
44241
43836
  var ProfileManager = class {
44242
43837
  constructor() {
44243
- this.codexDir = join$1(process.env.HOME || process.env.USERPROFILE || "", ".codex");
43838
+ const homeDir = process.env.HOME || process.env.USERPROFILE || "";
43839
+ this.codexDir = join$1(homeDir, ".codex");
44244
43840
  this.profileHomesRoot = join$1(getUserDataDir(), "profile-homes");
44245
43841
  this.activeAuth = join$1(this.codexDir, "auth.json");
44246
43842
  this.activeAuthBackup = `${this.activeAuth}.swap`;
@@ -48443,7 +48039,7 @@ const makeServerPushBus = (input) => gen(function* () {
48443
48039
  data: job.data
48444
48040
  };
48445
48041
  const recipients = job.target.kind === "all" ? yield* get(input.clients) : new Set([job.target.client]);
48446
- return yield* encodePush(push).pipe(map$3((message) => {
48042
+ return yield* encodePush(push).pipe(map$2((message) => {
48447
48043
  let recipientCount = 0;
48448
48044
  for (const client of recipients) {
48449
48045
  if (client.readyState !== client.OPEN) continue;
@@ -48464,7 +48060,7 @@ const makeServerPushBus = (input) => gen(function* () {
48464
48060
  return {
48465
48061
  publishAll: publish({ kind: "all" }),
48466
48062
  publishClient: (client, channel, data) => gen(function* () {
48467
- const delivered = yield* make$28();
48063
+ const delivered = yield* make$27();
48468
48064
  yield* offer$1(queue, {
48469
48065
  channel,
48470
48066
  data,
@@ -48481,11 +48077,11 @@ const makeServerPushBus = (input) => gen(function* () {
48481
48077
  //#endregion
48482
48078
  //#region src/wsServer/readiness.ts
48483
48079
  const makeServerReadiness = gen(function* () {
48484
- const httpListening = yield* make$28();
48485
- const pushBusReady = yield* make$28();
48486
- const keybindingsReady = yield* make$28();
48487
- const terminalSubscriptionsReady = yield* make$28();
48488
- const orchestrationSubscriptionsReady = yield* make$28();
48080
+ const httpListening = yield* make$27();
48081
+ const pushBusReady = yield* make$27();
48082
+ const keybindingsReady = yield* make$27();
48083
+ const terminalSubscriptionsReady = yield* make$27();
48084
+ const orchestrationSubscriptionsReady = yield* make$27();
48489
48085
  const complete = (deferred) => succeed$5(deferred, void 0).pipe(orDie);
48490
48086
  return {
48491
48087
  awaitServerReady: all([
@@ -48532,7 +48128,7 @@ const handleOrchestrationRequest = fnUntraced(function* (body, context) {
48532
48128
  case ORCHESTRATION_WS_METHODS.replayEvents: return yield* runCollect(context.orchestrationEngine.readEvents(clamp(body.fromSequenceExclusive, {
48533
48129
  maximum: Number.MAX_SAFE_INTEGER,
48534
48130
  minimum: 0
48535
- }))).pipe(map$3((events) => Array.from(events)));
48131
+ }))).pipe(map$2((events) => Array.from(events)));
48536
48132
  default: return unhandledRequest;
48537
48133
  }
48538
48134
  });
@@ -53362,7 +52958,7 @@ const createServer = fn(function* () {
53362
52958
  const checkpointDiffQuery = yield* CheckpointDiffQuery;
53363
52959
  const orchestrationReactor = yield* OrchestrationReactor;
53364
52960
  const { openInEditor } = yield* Open;
53365
- const subscriptionsScope = yield* make$29("sequential");
52961
+ const subscriptionsScope = yield* make$28("sequential");
53366
52962
  yield* addFinalizer$1(() => close(subscriptionsScope, void_$3));
53367
52963
  yield* runForEach(orchestrationEngine.streamDomainEvents, (event) => gen(function* () {
53368
52964
  yield* pushBus.publishAll(ORCHESTRATION_WS_CHANNELS.domainEvent, event);
@@ -54348,18 +53944,18 @@ var CliConfig = class CliConfig extends Service()("t3/main/CliConfig") {
54348
53944
  }
54349
53945
  };
54350
53946
  const CliEnvConfig = all$1({
54351
- mode: string$3("T3CODE_MODE").pipe(option, map$6(match({
53947
+ mode: string$3("T3CODE_MODE").pipe(option, map$5(match({
54352
53948
  onNone: () => "web",
54353
53949
  onSome: (value) => value === "desktop" ? "desktop" : "web"
54354
53950
  }))),
54355
- port: port("T3CODE_PORT").pipe(option, map$6(getOrUndefined)),
54356
- host: string$3("T3CODE_HOST").pipe(option, map$6(getOrUndefined)),
54357
- stateDir: string$3("T3CODE_STATE_DIR").pipe(option, map$6(getOrUndefined)),
54358
- devUrl: url("VITE_DEV_SERVER_URL").pipe(option, map$6(getOrUndefined)),
54359
- noBrowser: boolean$3("T3CODE_NO_BROWSER").pipe(option, map$6(getOrUndefined)),
54360
- authToken: string$3("T3CODE_AUTH_TOKEN").pipe(option, map$6(getOrUndefined)),
54361
- autoBootstrapProjectFromCwd: boolean$3("T3CODE_AUTO_BOOTSTRAP_PROJECT_FROM_CWD").pipe(option, map$6(getOrUndefined)),
54362
- logWebSocketEvents: boolean$3("T3CODE_LOG_WS_EVENTS").pipe(option, map$6(getOrUndefined))
53951
+ port: port("T3CODE_PORT").pipe(option, map$5(getOrUndefined)),
53952
+ host: string$3("T3CODE_HOST").pipe(option, map$5(getOrUndefined)),
53953
+ stateDir: string$3("T3CODE_STATE_DIR").pipe(option, map$5(getOrUndefined)),
53954
+ devUrl: url("VITE_DEV_SERVER_URL").pipe(option, map$5(getOrUndefined)),
53955
+ noBrowser: boolean$3("T3CODE_NO_BROWSER").pipe(option, map$5(getOrUndefined)),
53956
+ authToken: string$3("T3CODE_AUTH_TOKEN").pipe(option, map$5(getOrUndefined)),
53957
+ autoBootstrapProjectFromCwd: boolean$3("T3CODE_AUTO_BOOTSTRAP_PROJECT_FROM_CWD").pipe(option, map$5(getOrUndefined)),
53958
+ logWebSocketEvents: boolean$3("T3CODE_LOG_WS_EVENTS").pipe(option, map$5(getOrUndefined))
54363
53959
  });
54364
53960
  const resolveBooleanFlag = (flag, envValue) => getOrElse(filter$1(flag, Boolean), () => envValue);
54365
53961
  const ServerConfigLive = (input) => effect(ServerConfig$1, gen(function* () {
@@ -54529,52 +54125,7 @@ var version = "0.0.10";
54529
54125
  * @since 4.0.0
54530
54126
  */
54531
54127
  const TypeId$8 = "~effect/http/Cookies";
54532
- /**
54533
- * @since 4.0.0
54534
- * @category refinements
54535
- */
54536
- const isCookies = (u) => hasProperty(u, TypeId$8);
54537
- /**
54538
- * @since 4.0.0
54539
- * @category Schemas
54540
- */
54541
- const CookiesSchema = /* @__PURE__ */ declare(isCookies, {
54542
- typeConstructor: { _tag: "effect/http/Cookies" },
54543
- generation: {
54544
- runtime: `Cookies.CookiesSchema`,
54545
- Type: `Cookies.Cookies`,
54546
- Encoded: `typeof Cookies.CookiesSchema["Encoded"]`,
54547
- importDeclaration: `import * as Cookies from "effect/unstable/http/Cookies"`
54548
- },
54549
- expected: "Cookies",
54550
- toCodecJson: () => link$1()(Array$1(String$1), transform$1({
54551
- decode: (input) => fromSetCookie(input),
54552
- encode: (cookies) => toSetCookieHeaders(cookies)
54553
- })),
54554
- toCodecIso: () => link$1()(Record(String$1, CookieSchema), transform$1({
54555
- decode: (input) => fromReadonlyRecord(input),
54556
- encode: (cookies) => cookies.cookies
54557
- }))
54558
- });
54559
54128
  const CookieTypeId = "~effect/http/Cookies/Cookie";
54560
- /**
54561
- * @since 4.0.0
54562
- * @category Guards
54563
- */
54564
- const isCookie = (u) => hasProperty(u, CookieTypeId);
54565
- /**
54566
- * @since 4.0.0
54567
- * @category Schemas
54568
- */
54569
- const CookieSchema = /* @__PURE__ */ declare(isCookie, {
54570
- typeConstructor: { _tag: "effect/http/Cookie" },
54571
- generation: {
54572
- runtime: `Cookies.CookieSchema`,
54573
- Type: `Cookies.Cookie`,
54574
- importDeclaration: `import * as Cookie from "effect/unstable/http/Cookies"`
54575
- },
54576
- expected: "Cookie"
54577
- });
54578
54129
  const CookieErrorTypeId = "~effect/http/Cookies/CookieError";
54579
54130
  /**
54580
54131
  * @since 4.0.0
@@ -54612,7 +54163,7 @@ const Proto$5 = {
54612
54163
  toJSON() {
54613
54164
  return {
54614
54165
  _id: "effect/Cookies",
54615
- cookies: map$7(this.cookies, (cookie) => cookie.toJSON())
54166
+ cookies: map$6(this.cookies, (cookie) => cookie.toJSON())
54616
54167
  };
54617
54168
  },
54618
54169
  pipe() {
@@ -54758,109 +54309,6 @@ const CookieProto = {
54758
54309
  };
54759
54310
  }
54760
54311
  };
54761
- /**
54762
- * Create a new cookie
54763
- *
54764
- * @since 4.0.0
54765
- * @category constructors
54766
- */
54767
- function makeCookie(name, value, options) {
54768
- if (!fieldContentRegExp.test(name)) return fail$3(CookiesError.fromReason("InvalidCookieName"));
54769
- const encodedValue = encodeURIComponent(value);
54770
- if (encodedValue && !fieldContentRegExp.test(encodedValue)) return fail$3(CookiesError.fromReason("InvalidCookieValue"));
54771
- if (options !== void 0) {
54772
- if (options.domain !== void 0 && !fieldContentRegExp.test(options.domain)) return fail$3(CookiesError.fromReason("InvalidCookieDomain"));
54773
- if (options.path !== void 0 && !fieldContentRegExp.test(options.path)) return fail$3(CookiesError.fromReason("InvalidCookiePath"));
54774
- if (options.maxAge !== void 0 && !isFinite$1(fromInputUnsafe(options.maxAge))) return fail$3(CookiesError.fromReason("CookieInfinityMaxAge"));
54775
- }
54776
- return succeed$4(Object.assign(Object.create(CookieProto), {
54777
- name,
54778
- value,
54779
- valueEncoded: encodedValue,
54780
- options
54781
- }));
54782
- }
54783
- /**
54784
- * Create a new cookie, throwing an error if invalid
54785
- *
54786
- * @since 4.0.0
54787
- * @category constructors
54788
- */
54789
- const makeCookieUnsafe = (name, value, options) => getOrThrow(makeCookie(name, value, options));
54790
- /**
54791
- * Serialize a cookie into a string
54792
- *
54793
- * Adapted from https://github.com/fastify/fastify-cookie under MIT License
54794
- *
54795
- * @since 4.0.0
54796
- * @category encoding
54797
- */
54798
- function serializeCookie(self) {
54799
- let str = self.name + "=" + self.valueEncoded;
54800
- if (self.options === void 0) return str;
54801
- const options = self.options;
54802
- if (options.maxAge !== void 0) {
54803
- const maxAge = toSeconds(fromInputUnsafe(options.maxAge));
54804
- str += "; Max-Age=" + Math.trunc(maxAge);
54805
- }
54806
- if (options.domain !== void 0) str += "; Domain=" + options.domain;
54807
- if (options.path !== void 0) str += "; Path=" + options.path;
54808
- if (options.priority !== void 0) switch (options.priority) {
54809
- case "low":
54810
- str += "; Priority=Low";
54811
- break;
54812
- case "medium":
54813
- str += "; Priority=Medium";
54814
- break;
54815
- case "high":
54816
- str += "; Priority=High";
54817
- break;
54818
- }
54819
- if (options.expires !== void 0) str += "; Expires=" + options.expires.toUTCString();
54820
- if (options.httpOnly) str += "; HttpOnly";
54821
- if (options.secure) str += "; Secure";
54822
- if (options.partitioned) str += "; Partitioned";
54823
- if (options.sameSite !== void 0) switch (options.sameSite) {
54824
- case "lax":
54825
- str += "; SameSite=Lax";
54826
- break;
54827
- case "strict":
54828
- str += "; SameSite=Strict";
54829
- break;
54830
- case "none":
54831
- str += "; SameSite=None";
54832
- break;
54833
- }
54834
- return str;
54835
- }
54836
- /**
54837
- * @since 4.0.0
54838
- * @category encoding
54839
- */
54840
- const toRecord$1 = (self) => {
54841
- const record = {};
54842
- const cookies = Object.values(self.cookies);
54843
- for (let index = 0; index < cookies.length; index++) {
54844
- const cookie = cookies[index];
54845
- record[cookie.name] = cookie.value;
54846
- }
54847
- return record;
54848
- };
54849
- /**
54850
- * @since 4.0.0
54851
- * @category Schemas
54852
- */
54853
- const schemaRecord$1 = /* @__PURE__ */ CookiesSchema.pipe(/* @__PURE__ */ decodeTo(/* @__PURE__ */ Record(String$1, String$1), /* @__PURE__ */ transform$1({
54854
- decode: toRecord$1,
54855
- encode: (self) => fromIterable(Object.entries(self).map(([name, value]) => makeCookieUnsafe(name, value)))
54856
- })));
54857
- /**
54858
- * Serialize a Cookies object into Headers object containing one or more Set-Cookie headers
54859
- *
54860
- * @since 4.0.0
54861
- * @category encoding
54862
- */
54863
- const toSetCookieHeaders = (self) => Object.values(self.cookies).map(serializeCookie);
54864
54312
  const tryDecodeURIComponent = (str) => {
54865
54313
  try {
54866
54314
  return decodeURIComponent(str);
@@ -54974,8 +54422,8 @@ const redact = /* @__PURE__ */ dual(2, (self, key) => {
54974
54422
  const modify = (key) => {
54975
54423
  if (typeof key === "string") {
54976
54424
  const k = key.toLowerCase();
54977
- if (k in self) out[k] = make$32(self[k]);
54978
- } else for (const name in self) if (key.test(name)) out[name] = make$32(self[name]);
54425
+ if (k in self) out[k] = make$31(self[k]);
54426
+ } else for (const name in self) if (key.test(name)) out[name] = make$31(self[name]);
54979
54427
  };
54980
54428
  if (Array.isArray(key)) for (let i = 0; i < key.length; i++) modify(key[i]);
54981
54429
  else modify(key);
@@ -55236,7 +54684,7 @@ const fromInputNested = (input) => {
55236
54684
  * @since 4.0.0
55237
54685
  * @category Equivalence
55238
54686
  */
55239
- const Equivalence = /* @__PURE__ */ make$33((a, b) => arrayEquivalence(a.params, b.params));
54687
+ const Equivalence = /* @__PURE__ */ make$32((a, b) => arrayEquivalence(a.params, b.params));
55240
54688
  const arrayEquivalence = /* @__PURE__ */ makeEquivalence$1(/* @__PURE__ */ makeEquivalence$2([/* @__PURE__ */ strictEqual(), /* @__PURE__ */ strictEqual()]));
55241
54689
  /**
55242
54690
  * @since 4.0.0
@@ -55590,15 +55038,6 @@ const TypeId$1 = "~effect/http/HttpClientResponse";
55590
55038
  * @category constructors
55591
55039
  */
55592
55040
  const fromWeb = (request, source) => new WebHttpClientResponse(request, source);
55593
- /**
55594
- * @since 4.0.0
55595
- * @category filters
55596
- */
55597
- const filterStatusOk$1 = (self) => self.status >= 200 && self.status < 300 ? succeed(self) : fail$1(new HttpClientError({ reason: new StatusCodeError({
55598
- response: self,
55599
- request: self.request,
55600
- description: "non 2xx status code"
55601
- }) }));
55602
55041
  var WebHttpClientResponse = class extends Class$1 {
55603
55042
  [TypeId$2];
55604
55043
  [TypeId$1];
@@ -55737,13 +55176,6 @@ const HttpClient = /* @__PURE__ */ Service("effect/HttpClient");
55737
55176
  */
55738
55177
  const transformResponse = /* @__PURE__ */ dual(2, (self, f) => makeWith((request) => f(self.postprocess(request)), self.preprocess));
55739
55178
  /**
55740
- * Filters responses that return a 2xx status code.
55741
- *
55742
- * @since 4.0.0
55743
- * @category filters
55744
- */
55745
- const filterStatusOk = /* @__PURE__ */ transformResponse(/* @__PURE__ */ flatMap(filterStatusOk$1));
55746
- /**
55747
55179
  * @since 4.0.0
55748
55180
  * @category constructors
55749
55181
  */
@@ -55843,7 +55275,7 @@ const SpanNameGenerator = /* @__PURE__ */ Reference("effect/http/HttpClient/Span
55843
55275
  /**
55844
55276
  * @since 4.0.0
55845
55277
  */
55846
- const layerMergedServices = (effect$1) => effect(HttpClient)(servicesWith$1((services) => map$3(effect$1, (client) => transformResponse(client, updateServices$1((input) => merge$2(services, input))))));
55278
+ const layerMergedServices = (effect$1) => effect(HttpClient)(servicesWith$1((services) => map$2(effect$1, (client) => transformResponse(client, updateServices$1((input) => merge$2(services, input))))));
55847
55279
  const responseRegistry = /* @__PURE__ */ (() => {
55848
55280
  if ("FinalizationRegistry" in globalThis && globalThis.FinalizationRegistry) {
55849
55281
  const registry = /* @__PURE__ */ new FinalizationRegistry((controller) => {
@@ -55954,7 +55386,7 @@ const fetch$1 = /* @__PURE__ */ make((request, url, signal, fiber) => {
55954
55386
  const fetch = fiber.getRef(Fetch);
55955
55387
  const options = fiber.services.mapUnsafe.get(RequestInit.key) ?? {};
55956
55388
  const headers = options.headers ? merge(fromInput$1(options.headers), request.headers) : request.headers;
55957
- const send = (body) => map$3(tryPromise({
55389
+ const send = (body) => map$2(tryPromise({
55958
55390
  try: () => fetch(url, {
55959
55391
  ...options,
55960
55392
  method: request.method,