codexuse-cli 3.6.3 → 3.6.5

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,7 @@
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 encodeUnknownEffect, $i as isFailure, $n as asSome, $o as BaseProto, $r as scoped, $t as runFold, A as NullOr, Aa as gen$1, An as make$20, Ao as getOrThrow, Ar as log$1, At as Size, B as Union, 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, Er as ignore, Et as TypeId$16, 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, Gi as fail$4, Gn as encodeBase64Url, Go as make$25, 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, Ii as sync$2, In as systemError, Io as getOrNull, Ir as mapError, J as decodeUnknownEffect, Ja as CurrentLogSpans, Ji as make$26, 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$31, 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$3, Mr as logError$1, Mt as make$21, N as String$1, 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$27, Vn as stringifyJson, Vo as match, Vr as orDie, Vt as fromEffect, W as declare, Wa as uninterruptibleMask, Wi as doneUnsafe, Wn as make$30, Wo as Number$2, Wr as provide, Wt as fromQueue, X as decodeUnknownSync, Xa as DisablePropagation, Xi as succeed$4, Xn as andThen, Xr as runPromiseWith, Xt as onExit, 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, _o as fromIterable$2, _r as fn, _s as constVoid, _t as tag, aa as UnknownError, ai as succeedNone, 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, 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, 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, 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, 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$2, jo as isFailure$1, jr as logDebug, jt as WatchBackend, k as Null, ka as formatLogSpan, ki as effectDiscard, kn as unbounded$1, 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, 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$1, or as catchTag, os as symbol, ot as isMaxLength, p as option, pa as ConsoleRef, pi as try_, pn as make$28, 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$29, ra as Done, ri as servicesWith, rn as toReadableStreamEffect, ro as make$24, rr as catchCause, rs as formatJson$1, rt as isGreaterThan, s as Boolean$1, sa as fail$2, si as sync, sn as make$22, 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$2, 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, 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$23, xo as map$4, xr as forkChild, xs as pipeArguments, xt as withConstructorDefault, y as Boolean$2, yi as withFiber$1, yn as endUnsafe, yo as isReadonlyArrayNonEmpty, yr as forEach, ys as identity, yt as toJsonSchemaDocument, z as URLFromString, zi as addFinalizer, zn as transformOrFail, zo as isSome, zr as never, zt as flatMap$2 } from "./SqlClient-DSf3-WP1.mjs";
4
+ import { a as make$32, i as keys, n as getOption, o as makeWith$1, r as invalidate, s as set$3, t as get$3 } from "./Cache-Ctxz7HFI.mjs";
4
5
  import { createRequire } from "node:module";
5
6
  import * as NodeChildProcess from "node:child_process";
6
7
  import { execFileSync, spawn, spawnSync } from "node:child_process";
@@ -294,7 +295,7 @@ const makeHandle = (params) => Object.assign(Object.create(HandleProto), params)
294
295
  * @since 4.0.0
295
296
  * @category Models
296
297
  */
297
- const make$20 = (spawn) => {
298
+ const make$19 = (spawn) => {
298
299
  const streamString = (command, options) => spawn(command).pipe(map$3((handle) => decodeText(options?.includeStderr === true ? handle.all : handle.stdout)), unwrap);
299
300
  const streamLines = (command, options) => splitLines(streamString(command, options));
300
301
  return ChildProcessSpawner.of({
@@ -315,16 +316,16 @@ const make$20 = (spawn) => {
315
316
  var ChildProcessSpawner = class extends Service()("effect/process/ChildProcessSpawner") {};
316
317
  //#endregion
317
318
  //#region ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect-smol+effect@8881a9b/node_modules/effect/dist/unstable/process/ChildProcess.js
318
- const TypeId$16 = "~effect/unstable/process/ChildProcess";
319
- const Proto$10 = {
319
+ const TypeId$15 = "~effect/unstable/process/ChildProcess";
320
+ const Proto$9 = {
320
321
  ...PipeInspectableProto,
321
322
  ...YieldableProto,
322
- [TypeId$16]: TypeId$16,
323
+ [TypeId$15]: TypeId$15,
323
324
  asEffect() {
324
325
  return ChildProcessSpawner.use((_) => _.spawn(this));
325
326
  }
326
327
  };
327
- const makeStandardCommand = (command, args, options) => Object.assign(Object.create(Proto$10), {
328
+ const makeStandardCommand = (command, args, options) => Object.assign(Object.create(Proto$9), {
328
329
  _tag: "StandardCommand",
329
330
  command,
330
331
  args,
@@ -358,7 +359,7 @@ const makeStandardCommand = (command, args, options) => Object.assign(Object.cre
358
359
  * @since 4.0.0
359
360
  * @category Constructors
360
361
  */
361
- const make$19 = function make(...args) {
362
+ const make$18 = function make(...args) {
362
363
  if (isTemplateString(args[0])) {
363
364
  const [templates, ...expressions] = args;
364
365
  const tokens = parseTemplates(templates, expressions);
@@ -604,7 +605,7 @@ const readableToPullUnsafe = (options) => {
604
605
  const readable = options.readable;
605
606
  if (readable.readableEnded) return succeed(done());
606
607
  const closeOnDone = options.closeOnDone ?? true;
607
- const exit = options.exit ?? make$21(void 0);
608
+ const exit = options.exit ?? make$20(void 0);
608
609
  const latch = makeUnsafe$1(false);
609
610
  function onReadable() {
610
611
  latch.openUnsafe();
@@ -654,7 +655,7 @@ const toPlatformError = (method, error, command) => {
654
655
  }, "");
655
656
  return handleErrnoException("ChildProcess", method)(error, [commandStr]);
656
657
  };
657
- const make$18 = /* @__PURE__ */ gen(function* () {
658
+ const make$17 = /* @__PURE__ */ gen(function* () {
658
659
  const fs = yield* FileSystem;
659
660
  const path = yield* Path$1;
660
661
  const resolveWorkingDirectory = fnUntraced(function* (options) {
@@ -904,7 +905,7 @@ const make$18 = /* @__PURE__ */ gen(function* () {
904
905
  const stdinConfig = resolveStdinOption(command.options);
905
906
  const sourceStream = unwrap(map$3(handle, (h) => getSourceStream(h, options.from)));
906
907
  const toOption = options.to ?? "stdin";
907
- if (toOption === "stdin") handle = spawnCommand(make$19(command.command, command.args, {
908
+ if (toOption === "stdin") handle = spawnCommand(make$18(command.command, command.args, {
908
909
  ...command.options,
909
910
  stdin: {
910
911
  ...stdinConfig,
@@ -916,7 +917,7 @@ const make$18 = /* @__PURE__ */ gen(function* () {
916
917
  if (isNotUndefined(fd)) {
917
918
  const fdName$1 = fdName(fd);
918
919
  const existingFds = command.options.additionalFds ?? {};
919
- handle = spawnCommand(make$19(command.command, command.args, {
920
+ handle = spawnCommand(make$18(command.command, command.args, {
920
921
  ...command.options,
921
922
  additionalFds: {
922
923
  ...existingFds,
@@ -926,7 +927,7 @@ const make$18 = /* @__PURE__ */ gen(function* () {
926
927
  }
927
928
  }
928
929
  }));
929
- } else handle = spawnCommand(make$19(command.command, command.args, {
930
+ } else handle = spawnCommand(make$18(command.command, command.args, {
930
931
  ...command.options,
931
932
  stdin: {
932
933
  ...stdinConfig,
@@ -939,7 +940,7 @@ const make$18 = /* @__PURE__ */ gen(function* () {
939
940
  }
940
941
  }
941
942
  });
942
- return make$20(spawnCommand);
943
+ return make$19(spawnCommand);
943
944
  });
944
945
  /**
945
946
  * Layer providing the `NodeChildProcessSpawner` implementation.
@@ -947,7 +948,7 @@ const make$18 = /* @__PURE__ */ gen(function* () {
947
948
  * @since 4.0.0
948
949
  * @category Layers
949
950
  */
950
- const layer$11 = /* @__PURE__ */ effect(ChildProcessSpawner, make$18);
951
+ const layer$11 = /* @__PURE__ */ effect(ChildProcessSpawner, make$17);
951
952
  /**
952
953
  * Flattens a `Command` into an array of `StandardCommand`s along with pipe
953
954
  * options for each connection.
@@ -1294,7 +1295,7 @@ const writeFile$1 = (path, data, options) => callback((resume, signal) => {
1294
1295
  resume(fail$1(handleBadArgument("writeFile")(err)));
1295
1296
  }
1296
1297
  });
1297
- const makeFileSystem = /* @__PURE__ */ map$3(/* @__PURE__ */ serviceOption(WatchBackend), (backend) => make$22({
1298
+ const makeFileSystem = /* @__PURE__ */ map$3(/* @__PURE__ */ serviceOption(WatchBackend), (backend) => make$21({
1298
1299
  access,
1299
1300
  chmod,
1300
1301
  chown,
@@ -1363,7 +1364,7 @@ const toFileUrl = (path) => try_({
1363
1364
  * @category Layers
1364
1365
  */
1365
1366
  const layerPosix$1 = /* @__PURE__ */ succeed$2(Path$1)({
1366
- [TypeId$17]: TypeId$17,
1367
+ [TypeId$16]: TypeId$16,
1367
1368
  ...Path.posix,
1368
1369
  fromFileUrl,
1369
1370
  toFileUrl
@@ -1373,7 +1374,7 @@ const layerPosix$1 = /* @__PURE__ */ succeed$2(Path$1)({
1373
1374
  * @category Layers
1374
1375
  */
1375
1376
  const layerWin32$1 = /* @__PURE__ */ succeed$2(Path$1)({
1376
- [TypeId$17]: TypeId$17,
1377
+ [TypeId$16]: TypeId$16,
1377
1378
  ...Path.win32,
1378
1379
  fromFileUrl,
1379
1380
  toFileUrl
@@ -1383,7 +1384,7 @@ const layerWin32$1 = /* @__PURE__ */ succeed$2(Path$1)({
1383
1384
  * @category Layers
1384
1385
  */
1385
1386
  const layer$8 = /* @__PURE__ */ succeed$2(Path$1)({
1386
- [TypeId$17]: TypeId$17,
1387
+ [TypeId$16]: TypeId$16,
1387
1388
  ...Path,
1388
1389
  fromFileUrl,
1389
1390
  toFileUrl
@@ -1414,18 +1415,18 @@ const layerWin32 = layerWin32$1;
1414
1415
  * @since 4.0.0
1415
1416
  * @category Type IDs
1416
1417
  */
1417
- const TypeId$15 = "~effect/Stdio";
1418
+ const TypeId$14 = "~effect/Stdio";
1418
1419
  /**
1419
1420
  * @since 4.0.0
1420
1421
  * @category Services
1421
1422
  */
1422
- const Stdio = /* @__PURE__ */ Service(TypeId$15);
1423
+ const Stdio = /* @__PURE__ */ Service(TypeId$14);
1423
1424
  /**
1424
1425
  * @since 4.0.0
1425
1426
  * @category Constructors
1426
1427
  */
1427
- const make$17 = (options) => ({
1428
- [TypeId$15]: TypeId$15,
1428
+ const make$16 = (options) => ({
1429
+ [TypeId$14]: TypeId$14,
1429
1430
  ...options
1430
1431
  });
1431
1432
  //#endregion
@@ -1437,7 +1438,7 @@ const make$17 = (options) => ({
1437
1438
  * @category Layers
1438
1439
  * @since 1.0.0
1439
1440
  */
1440
- const layer$6 = /* @__PURE__ */ succeed$2(Stdio, /* @__PURE__ */ make$17({
1441
+ const layer$6 = /* @__PURE__ */ succeed$2(Stdio, /* @__PURE__ */ make$16({
1441
1442
  stdout: /* @__PURE__ */ fromWritable({
1442
1443
  evaluate: () => process.stdout,
1443
1444
  onError: (cause) => systemError({
@@ -1479,7 +1480,7 @@ const layer$6 = /* @__PURE__ */ succeed$2(Stdio, /* @__PURE__ */ make$17({
1479
1480
  const layer$5 = layer$6;
1480
1481
  //#endregion
1481
1482
  //#region ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect-smol+effect@8881a9b/node_modules/effect/dist/Terminal.js
1482
- const TypeId$14 = "~effect/platform/Terminal";
1483
+ const TypeId$13 = "~effect/platform/Terminal";
1483
1484
  const QuitErrorTypeId = "effect/platform/Terminal/QuitError";
1484
1485
  /**
1485
1486
  * A `QuitError` represents an error that occurs when a user attempts to
@@ -1510,9 +1511,9 @@ const Terminal = /* @__PURE__ */ Service("effect/platform/Terminal");
1510
1511
  * @since 4.0.0
1511
1512
  * @category Constructors
1512
1513
  */
1513
- const make$16 = (impl) => Terminal.of({
1514
+ const make$15 = (impl) => Terminal.of({
1514
1515
  ...impl,
1515
- [TypeId$14]: TypeId$14
1516
+ [TypeId$13]: TypeId$13
1516
1517
  });
1517
1518
  //#endregion
1518
1519
  //#region ../../node_modules/.bun/@effect+platform-node-shared@https+++pkg.pr.new+Effect-TS+effect-smol+@effect+platform-node-shared@8881a9b606d84a6f5eb6615279138322984f5368+eecd35a1726d7096/node_modules/@effect/platform-node-shared/dist/NodeTerminal.js
@@ -1520,10 +1521,10 @@ const make$16 = (impl) => Terminal.of({
1520
1521
  * @since 1.0.0
1521
1522
  * @category constructors
1522
1523
  */
1523
- const make$15 = /* @__PURE__ */ fnUntraced(function* (shouldQuit = defaultShouldQuit) {
1524
+ const make$14 = /* @__PURE__ */ fnUntraced(function* (shouldQuit = defaultShouldQuit) {
1524
1525
  const stdin = process.stdin;
1525
1526
  const stdout = process.stdout;
1526
- const rlRef = yield* make$23({ acquire: acquireRelease(sync(() => {
1527
+ const rlRef = yield* make$22({ acquire: acquireRelease(sync(() => {
1527
1528
  const rl = readline$1.createInterface({
1528
1529
  input: stdin,
1529
1530
  escapeCodeTimeout: 50
@@ -1537,8 +1538,8 @@ const make$15 = /* @__PURE__ */ fnUntraced(function* (shouldQuit = defaultShould
1537
1538
  })) });
1538
1539
  const columns = sync(() => stdout.columns ?? 0);
1539
1540
  const readInput = gen(function* () {
1540
- yield* get$2(rlRef);
1541
- const queue = yield* make$24();
1541
+ yield* get$1(rlRef);
1542
+ const queue = yield* make$23();
1542
1543
  const handleKeypress = (s, k) => {
1543
1544
  const userInput = {
1544
1545
  input: s,
@@ -1556,7 +1557,7 @@ const make$15 = /* @__PURE__ */ fnUntraced(function* (shouldQuit = defaultShould
1556
1557
  stdin.on("keypress", handleKeypress);
1557
1558
  return queue;
1558
1559
  });
1559
- const readLine = scoped(flatMap(get$2(rlRef), (readlineInterface) => callback((resume) => {
1560
+ const readLine = scoped(flatMap(get$1(rlRef), (readlineInterface) => callback((resume) => {
1560
1561
  const onLine = (line) => resume(succeed(line));
1561
1562
  readlineInterface.once("line", onLine);
1562
1563
  return sync(() => readlineInterface.off("line", onLine));
@@ -1569,7 +1570,7 @@ const make$15 = /* @__PURE__ */ fnUntraced(function* (shouldQuit = defaultShould
1569
1570
  cause: err
1570
1571
  }))));
1571
1572
  }));
1572
- return make$16({
1573
+ return make$15({
1573
1574
  columns,
1574
1575
  readInput,
1575
1576
  readLine,
@@ -1580,7 +1581,7 @@ const make$15 = /* @__PURE__ */ fnUntraced(function* (shouldQuit = defaultShould
1580
1581
  * @since 1.0.0
1581
1582
  * @category layers
1582
1583
  */
1583
- const layer$4 = /* @__PURE__ */ effect(Terminal, /* @__PURE__ */ make$15(defaultShouldQuit));
1584
+ const layer$4 = /* @__PURE__ */ effect(Terminal, /* @__PURE__ */ make$14(defaultShouldQuit));
1584
1585
  function defaultShouldQuit(input) {
1585
1586
  return input.key.ctrl && (input.key.name === "c" || input.key.name === "d");
1586
1587
  }
@@ -1593,7 +1594,7 @@ function defaultShouldQuit(input) {
1593
1594
  * @since 1.0.0
1594
1595
  * @category constructors
1595
1596
  */
1596
- const make$14 = make$15;
1597
+ const make$13 = make$14;
1597
1598
  /**
1598
1599
  * @since 1.0.0
1599
1600
  * @category layers
@@ -1607,567 +1608,6 @@ const layer$3 = layer$4;
1607
1608
  */
1608
1609
  const layer$2 = /* @__PURE__ */ provideMerge(layer$11, /* @__PURE__ */ mergeAll(layer$9, layer$7, layer$5, layer$3));
1609
1610
  //#endregion
1610
- //#region ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect-smol+effect@8881a9b/node_modules/effect/dist/Cache.js
1611
- /**
1612
- * @since 4.0.0
1613
- */
1614
- const TypeId$13 = "~effect/Cache";
1615
- /**
1616
- * Creates a cache with dynamic time-to-live based on the result and key.
1617
- *
1618
- * The timeToLive function receives both the exit result and the key, allowing
1619
- * for flexible TTL policies based on success/failure state and key characteristics.
1620
- *
1621
- * @example
1622
- * ```ts
1623
- * import { Cache, Effect, Exit } from "effect"
1624
- *
1625
- * // Cache with different TTL for success vs failure
1626
- * const program = Effect.gen(function*() {
1627
- * const cache = yield* Cache.makeWith<string, number, string>({
1628
- * capacity: 100,
1629
- * lookup: (key) =>
1630
- * key === "fail"
1631
- * ? Effect.fail("error")
1632
- * : Effect.succeed(key.length),
1633
- * timeToLive: (exit, key) => {
1634
- * if (Exit.isFailure(exit)) return "1 minute" // Short TTL for errors
1635
- * return key.startsWith("temp") ? "5 minutes" : "1 hour"
1636
- * }
1637
- * })
1638
- *
1639
- * // Get values with different TTL policies
1640
- * const result1 = yield* Cache.get(cache, "hello")
1641
- * const result2 = yield* Cache.get(cache, "temp_data")
1642
- * console.log({ result1, result2 }) // { result1: 5, result2: 9 }
1643
- * })
1644
- * ```
1645
- *
1646
- * @example
1647
- * ```ts
1648
- * import { Cache, Effect, Exit } from "effect"
1649
- *
1650
- * // Cache with TTL based on computed value
1651
- * const userCache = Effect.gen(function*() {
1652
- * const cache = yield* Cache.makeWith<
1653
- * number,
1654
- * { id: number; active: boolean },
1655
- * never
1656
- * >({
1657
- * capacity: 1000,
1658
- * lookup: (id) => Effect.succeed({ id, active: id % 2 === 0 }),
1659
- * timeToLive: (exit) => {
1660
- * if (Exit.isSuccess(exit)) {
1661
- * const user = exit.value
1662
- * return user.active ? "1 hour" : "5 minutes"
1663
- * }
1664
- * return "30 seconds"
1665
- * }
1666
- * })
1667
- *
1668
- * return cache
1669
- * })
1670
- * ```
1671
- *
1672
- * @since 4.0.0
1673
- * @category Constructors
1674
- */
1675
- const makeWith$1 = (options) => servicesWith((services) => {
1676
- const self = Object.create(Proto$9);
1677
- self.lookup = (key) => updateServices(options.lookup(key), (input) => merge$2(services, input));
1678
- self.map = make$25();
1679
- self.capacity = options.capacity;
1680
- self.timeToLive = options.timeToLive ? (exit, key) => fromInputUnsafe(options.timeToLive(exit, key)) : defaultTimeToLive;
1681
- return succeed$3(self);
1682
- });
1683
- /**
1684
- * Creates a cache with a fixed time-to-live for all entries.
1685
- *
1686
- * This is the basic cache constructor where all entries share the same TTL.
1687
- * The lookup function will be called when a key is not found or has expired.
1688
- *
1689
- * @example
1690
- * ```ts
1691
- * import { Cache, Effect } from "effect"
1692
- *
1693
- * // Basic cache with string keys
1694
- * const program = Effect.gen(function*() {
1695
- * const cache = yield* Cache.make<string, number>({
1696
- * capacity: 100,
1697
- * lookup: (key) => Effect.succeed(key.length)
1698
- * })
1699
- *
1700
- * const result1 = yield* Cache.get(cache, "hello")
1701
- * const result2 = yield* Cache.get(cache, "world")
1702
- * console.log({ result1, result2 }) // { result1: 5, result2: 5 }
1703
- * })
1704
- * ```
1705
- *
1706
- * @example
1707
- * ```ts
1708
- * import { Cache, Effect } from "effect"
1709
- *
1710
- * // Cache with TTL and async lookup
1711
- * const fetchUserCache = Effect.gen(function*() {
1712
- * const cache = yield* Cache.make<
1713
- * number,
1714
- * { name: string; email: string },
1715
- * string
1716
- * >({
1717
- * capacity: 500,
1718
- * lookup: (userId) =>
1719
- * Effect.tryPromise({
1720
- * try: () => fetch(`/api/users/${userId}`).then((r) => r.json()),
1721
- * catch: () => "Failed to fetch user"
1722
- * }),
1723
- * timeToLive: "15 minutes"
1724
- * })
1725
- *
1726
- * // First call fetches from API, second call returns cached result
1727
- * const user1 = yield* Cache.get(cache, 123)
1728
- * const user2 = yield* Cache.get(cache, 123) // From cache
1729
- * return { user1, user2 }
1730
- * })
1731
- * ```
1732
- *
1733
- * @since 4.0.0
1734
- * @category Constructors
1735
- */
1736
- const make$13 = (options) => makeWith$1({
1737
- ...options,
1738
- timeToLive: options.timeToLive ? () => options.timeToLive : defaultTimeToLive
1739
- });
1740
- const Proto$9 = {
1741
- ...PipeInspectableProto,
1742
- [TypeId$13]: TypeId$13,
1743
- toJSON() {
1744
- return {
1745
- _id: "Cache",
1746
- capacity: this.capacity,
1747
- map: this.map
1748
- };
1749
- }
1750
- };
1751
- const defaultTimeToLive = (_, _key) => infinity;
1752
- /**
1753
- * Retrieves the value associated with the specified key from the cache.
1754
- *
1755
- * If the key is not present or has expired, it will invoke the lookup function
1756
- * to construct the value, store it in the cache, and return it.
1757
- *
1758
- * @example
1759
- * ```ts
1760
- * import { Cache, Effect } from "effect"
1761
- *
1762
- * const program = Effect.gen(function*() {
1763
- * const cache = yield* Cache.make({
1764
- * capacity: 10,
1765
- * lookup: (key: string) => Effect.succeed(key.length)
1766
- * })
1767
- *
1768
- * // Cache miss - triggers lookup function
1769
- * const result1 = yield* Cache.get(cache, "hello")
1770
- * console.log(result1) // 5
1771
- *
1772
- * // Cache hit - returns cached value without lookup
1773
- * const result2 = yield* Cache.get(cache, "hello")
1774
- * console.log(result2) // 5 (from cache)
1775
- *
1776
- * return { result1, result2 }
1777
- * })
1778
- * ```
1779
- *
1780
- * @example
1781
- * ```ts
1782
- * import { Cache, Effect } from "effect"
1783
- *
1784
- * // Error handling when lookup fails
1785
- * const program = Effect.gen(function*() {
1786
- * const cache = yield* Cache.make<string, number, string>({
1787
- * capacity: 10,
1788
- * lookup: (key: string) =>
1789
- * key === "error"
1790
- * ? Effect.fail("Lookup failed")
1791
- * : Effect.succeed(key.length)
1792
- * })
1793
- *
1794
- * // Successful lookup
1795
- * const success = yield* Cache.get(cache, "hello")
1796
- * console.log(success) // 5
1797
- *
1798
- * // Failed lookup - returns error
1799
- * const failure = yield* Effect.exit(Cache.get(cache, "error"))
1800
- * console.log(failure) // Exit.fail("Lookup failed")
1801
- * })
1802
- * ```
1803
- *
1804
- * @example
1805
- * ```ts
1806
- * import { Cache, Effect } from "effect"
1807
- *
1808
- * // Concurrent access - multiple gets of same key only invoke lookup once
1809
- * const program = Effect.gen(function*() {
1810
- * let lookupCount = 0
1811
- * const cache = yield* Cache.make({
1812
- * capacity: 10,
1813
- * lookup: (key: string) =>
1814
- * Effect.sync(() => {
1815
- * lookupCount++
1816
- * return key.length
1817
- * })
1818
- * })
1819
- *
1820
- * // Multiple concurrent gets
1821
- * const results = yield* Effect.all([
1822
- * Cache.get(cache, "hello"),
1823
- * Cache.get(cache, "hello"),
1824
- * Cache.get(cache, "hello")
1825
- * ], { concurrency: "unbounded" })
1826
- *
1827
- * console.log(results) // [5, 5, 5]
1828
- * console.log(lookupCount) // 1 (lookup called only once)
1829
- * })
1830
- * ```
1831
- *
1832
- * @since 4.0.0
1833
- * @category Combinators
1834
- */
1835
- const get$1 = /* @__PURE__ */ dual(2, (self, key) => withFiber((fiber) => {
1836
- const oentry = get$3(self.map, key);
1837
- if (isSome(oentry) && !hasExpired(oentry.value, fiber)) {
1838
- remove$2(self.map, key);
1839
- set$3(self.map, key, oentry.value);
1840
- return _await(oentry.value.deferred);
1841
- }
1842
- const deferred = makeUnsafe$2();
1843
- const entry = {
1844
- expiresAt: void 0,
1845
- deferred
1846
- };
1847
- set$3(self.map, key, entry);
1848
- if (Number.isFinite(self.capacity)) checkCapacity(self);
1849
- return onExit(self.lookup(key), (exit) => {
1850
- doneUnsafe(deferred, exit);
1851
- const ttl = self.timeToLive(exit, key);
1852
- if (isFinite$1(ttl)) entry.expiresAt = fiber.getRef(ClockRef).currentTimeMillisUnsafe() + toMillis(ttl);
1853
- else if (isZero(ttl)) remove$2(self.map, key);
1854
- return void_$2;
1855
- });
1856
- }));
1857
- const hasExpired = (entry, fiber) => {
1858
- if (entry.expiresAt === void 0) return false;
1859
- return fiber.getRef(ClockRef).currentTimeMillisUnsafe() >= entry.expiresAt;
1860
- };
1861
- const checkCapacity = (self) => {
1862
- let diff = size(self.map) - self.capacity;
1863
- if (diff <= 0) return;
1864
- for (const [key] of self.map) {
1865
- remove$2(self.map, key);
1866
- diff--;
1867
- if (diff === 0) return;
1868
- }
1869
- };
1870
- /**
1871
- * Retrieves the value associated with the specified key from the cache,
1872
- * returning an `Option` that is `Some` if the key exists and has not expired,
1873
- * or `None` if the key does not exist or has expired.
1874
- *
1875
- * Unlike `get`, this function will not invoke the lookup function if the key
1876
- * is missing or expired.
1877
- *
1878
- * @example
1879
- * ```ts
1880
- * import { Cache, Effect } from "effect"
1881
- *
1882
- * const program = Effect.gen(function*() {
1883
- * const cache = yield* Cache.make({
1884
- * capacity: 10,
1885
- * lookup: (key: string) => Effect.succeed(key.length)
1886
- * })
1887
- *
1888
- * // No value in cache yet - returns None without lookup
1889
- * const empty = yield* Cache.getOption(cache, "hello")
1890
- * console.log(empty) // Option.none()
1891
- *
1892
- * // Populate cache using get
1893
- * yield* Cache.get(cache, "hello")
1894
- *
1895
- * // Now getOption returns the cached value
1896
- * const cached = yield* Cache.getOption(cache, "hello")
1897
- * console.log(cached) // Option.some(5)
1898
- *
1899
- * return { empty, cached }
1900
- * })
1901
- * ```
1902
- *
1903
- * @example
1904
- * ```ts
1905
- * import { Cache, Effect } from "effect"
1906
- * import { TestClock } from "effect/testing"
1907
- *
1908
- * // Expired entries return None
1909
- * const program = Effect.gen(function*() {
1910
- * const cache = yield* Cache.make({
1911
- * capacity: 10,
1912
- * lookup: (key: string) => Effect.succeed(key.length),
1913
- * timeToLive: "1 hour"
1914
- * })
1915
- *
1916
- * // Add value to cache
1917
- * yield* Cache.get(cache, "hello")
1918
- *
1919
- * // Value exists before expiration
1920
- * const beforeExpiry = yield* Cache.getOption(cache, "hello")
1921
- * console.log(beforeExpiry) // Option.some(5)
1922
- *
1923
- * // Simulate time passing
1924
- * yield* TestClock.adjust("2 hours")
1925
- *
1926
- * // Value expired - returns None
1927
- * const afterExpiry = yield* Cache.getOption(cache, "hello")
1928
- * console.log(afterExpiry) // Option.none()
1929
- * })
1930
- * ```
1931
- *
1932
- * @example
1933
- * ```ts
1934
- * import { Cache, Deferred, Effect, Fiber } from "effect"
1935
- *
1936
- * // Waits for ongoing computation to complete
1937
- * const program = Effect.gen(function*() {
1938
- * const deferred = yield* Deferred.make<void>()
1939
- * const cache = yield* Cache.make({
1940
- * capacity: 10,
1941
- * lookup: (_key: string) => Deferred.await(deferred).pipe(Effect.as(42))
1942
- * })
1943
- *
1944
- * // Start lookup in background
1945
- * const getFiber = yield* Effect.forkChild(Cache.get(cache, "key"))
1946
- *
1947
- * // getOption waits for ongoing computation
1948
- * const optionFiber = yield* Effect.forkChild(Cache.getOption(cache, "key"))
1949
- *
1950
- * // Complete the computation
1951
- * yield* Deferred.succeed(deferred, void 0)
1952
- *
1953
- * const result = yield* Fiber.join(optionFiber)
1954
- * console.log(result) // Option.some(42)
1955
- * })
1956
- * ```
1957
- *
1958
- * @since 4.0.0
1959
- * @category Combinators
1960
- */
1961
- const getOption = /* @__PURE__ */ dual(2, (self, key) => withFiber((fiber) => {
1962
- const entry = getImpl(self, key, fiber);
1963
- return entry ? asSome(_await(entry.deferred)) : succeedNone;
1964
- }));
1965
- const getImpl = (self, key, fiber, isRead = true) => {
1966
- const oentry = get$3(self.map, key);
1967
- if (isNone(oentry)) return;
1968
- else if (hasExpired(oentry.value, fiber)) {
1969
- remove$2(self.map, key);
1970
- return;
1971
- } else if (isRead) {
1972
- remove$2(self.map, key);
1973
- set$3(self.map, key, oentry.value);
1974
- }
1975
- return oentry.value;
1976
- };
1977
- /**
1978
- * Sets the value associated with the specified key in the cache. This will
1979
- * overwrite any existing value for that key, skipping the lookup function.
1980
- *
1981
- * @example
1982
- * ```ts
1983
- * import { Cache, Effect } from "effect"
1984
- *
1985
- * const program = Effect.gen(function*() {
1986
- * const cache = yield* Cache.make({
1987
- * capacity: 100,
1988
- * lookup: (key: string) => Effect.succeed(key.length)
1989
- * })
1990
- *
1991
- * // Set a value directly without invoking lookup
1992
- * yield* Cache.set(cache, "hello", 42)
1993
- * const result = yield* Cache.get(cache, "hello")
1994
- * console.log(result) // 42 (not 5 from lookup)
1995
- * })
1996
- * ```
1997
- *
1998
- * @example
1999
- * ```ts
2000
- * import { Cache, Effect } from "effect"
2001
- *
2002
- * // Overwriting existing cached values
2003
- * const program = Effect.gen(function*() {
2004
- * const cache = yield* Cache.make({
2005
- * capacity: 100,
2006
- * lookup: (key: string) => Effect.succeed(key.length)
2007
- * })
2008
- *
2009
- * // First get populates via lookup
2010
- * const original = yield* Cache.get(cache, "test") // 4
2011
- *
2012
- * // Set overwrites the cached value
2013
- * yield* Cache.set(cache, "test", 999)
2014
- * const updated = yield* Cache.get(cache, "test") // 999
2015
- *
2016
- * console.log({ original, updated })
2017
- * })
2018
- * ```
2019
- *
2020
- * @example
2021
- * ```ts
2022
- * import { Cache, Effect } from "effect"
2023
- * import { TestClock } from "effect/testing"
2024
- *
2025
- * // TTL behavior with set operations
2026
- * const program = Effect.gen(function*() {
2027
- * const cache = yield* Cache.make({
2028
- * capacity: 100,
2029
- * lookup: (key: string) => Effect.succeed(key.length),
2030
- * timeToLive: "1 hour"
2031
- * })
2032
- *
2033
- * // Set value with TTL applied
2034
- * yield* Cache.set(cache, "temporary", 123)
2035
- * console.log(yield* Cache.has(cache, "temporary")) // true
2036
- *
2037
- * // Advance time past TTL
2038
- * yield* TestClock.adjust("2 hours")
2039
- * console.log(yield* Cache.has(cache, "temporary")) // false
2040
- * })
2041
- * ```
2042
- *
2043
- * @example
2044
- * ```ts
2045
- * import { Cache, Effect } from "effect"
2046
- *
2047
- * // Capacity enforcement with set operations
2048
- * const program = Effect.gen(function*() {
2049
- * const cache = yield* Cache.make({
2050
- * capacity: 2,
2051
- * lookup: (key: string) => Effect.succeed(key.length)
2052
- * })
2053
- *
2054
- * // Fill cache to capacity
2055
- * yield* Cache.set(cache, "a", 1)
2056
- * yield* Cache.set(cache, "b", 2)
2057
- * console.log(yield* Cache.size(cache)) // 2
2058
- *
2059
- * // Adding another entry evicts oldest
2060
- * yield* Cache.set(cache, "c", 3)
2061
- * console.log(yield* Cache.size(cache)) // 2
2062
- * console.log(yield* Cache.has(cache, "a")) // false (evicted)
2063
- * console.log(yield* Cache.has(cache, "c")) // true
2064
- * })
2065
- * ```
2066
- *
2067
- * @since 4.0.0
2068
- * @category Combinators
2069
- */
2070
- const set$2 = /* @__PURE__ */ dual(3, (self, key, value) => withFiber((fiber) => {
2071
- const exit = exitSucceed(value);
2072
- const deferred = makeUnsafe$2();
2073
- doneUnsafe(deferred, exit);
2074
- const ttl = self.timeToLive(exit, key);
2075
- if (isZero(ttl)) {
2076
- remove$2(self.map, key);
2077
- return void_$2;
2078
- }
2079
- set$3(self.map, key, {
2080
- deferred,
2081
- expiresAt: isFinite$1(ttl) ? fiber.getRef(ClockRef).currentTimeMillisUnsafe() + toMillis(ttl) : void 0
2082
- });
2083
- checkCapacity(self);
2084
- return void_$2;
2085
- }));
2086
- /**
2087
- * Invalidates the entry associated with the specified key in the cache.
2088
- *
2089
- * @example
2090
- * ```ts
2091
- * import { Cache, Effect } from "effect"
2092
- *
2093
- * const program = Effect.gen(function*() {
2094
- * const cache = yield* Cache.make({
2095
- * capacity: 10,
2096
- * lookup: (key: string) => Effect.succeed(key.length)
2097
- * })
2098
- *
2099
- * // Add a value to the cache
2100
- * yield* Cache.get(cache, "hello")
2101
- * console.log(yield* Cache.has(cache, "hello")) // true
2102
- *
2103
- * // Invalidate the entry
2104
- * yield* Cache.invalidate(cache, "hello")
2105
- * console.log(yield* Cache.has(cache, "hello")) // false
2106
- *
2107
- * // Invalidating non-existent keys doesn't error
2108
- * yield* Cache.invalidate(cache, "nonexistent")
2109
- *
2110
- * // Get after invalidation will invoke lookup again
2111
- * let lookupCount = 0
2112
- * const cache2 = yield* Cache.make({
2113
- * capacity: 10,
2114
- * lookup: (key: string) =>
2115
- * Effect.sync(() => {
2116
- * lookupCount++
2117
- * return key.length
2118
- * })
2119
- * })
2120
- *
2121
- * yield* Cache.get(cache2, "test") // lookupCount = 1
2122
- * yield* Cache.invalidate(cache2, "test")
2123
- * yield* Cache.get(cache2, "test") // lookupCount = 2 (lookup called again)
2124
- * })
2125
- * ```
2126
- *
2127
- * @since 4.0.0
2128
- * @category Combinators
2129
- */
2130
- const invalidate = /* @__PURE__ */ dual(2, (self, key) => sync$1(() => {
2131
- remove$2(self.map, key);
2132
- }));
2133
- /**
2134
- * Retrieves all active keys from the cache, automatically filtering out expired entries.
2135
- *
2136
- * @example
2137
- * ```ts
2138
- * import { Cache, Effect } from "effect"
2139
- *
2140
- * // Basic key enumeration
2141
- * const program = Effect.gen(function*() {
2142
- * const cache = yield* Cache.make({
2143
- * capacity: 10,
2144
- * lookup: (key: string) => Effect.succeed(key.length)
2145
- * })
2146
- *
2147
- * // Add some entries to the cache
2148
- * yield* Cache.get(cache, "hello")
2149
- * yield* Cache.get(cache, "world")
2150
- * yield* Cache.get(cache, "cache")
2151
- *
2152
- * // Retrieve all active keys
2153
- * const keys = yield* Cache.keys(cache)
2154
- *
2155
- * console.log(Array.from(keys)) // ["hello", "world", "cache"]
2156
- * })
2157
- * ```
2158
- *
2159
- * @since 4.0.0
2160
- * @category Combinators
2161
- */
2162
- const keys = (self) => withFiber((fiber) => {
2163
- const now = fiber.getRef(ClockRef).currentTimeMillisUnsafe();
2164
- return succeed$3(filterMap(self.map, ([key, entry]) => {
2165
- if (entry.expiresAt === void 0 || entry.expiresAt > now) return succeed$4(key);
2166
- remove$2(self.map, key);
2167
- return failVoid;
2168
- }));
2169
- });
2170
- //#endregion
2171
1611
  //#region ../../node_modules/.bun/effect@https+++pkg.pr.new+Effect-TS+effect-smol+effect@8881a9b/node_modules/effect/dist/Console.js
2172
1612
  /**
2173
1613
  * A reference to the current console service in the Effect system.
@@ -3065,7 +2505,7 @@ const RefProto = {
3065
2505
  */
3066
2506
  const makeUnsafe = (value) => {
3067
2507
  const self = Object.create(RefProto);
3068
- self.ref = make$21(value);
2508
+ self.ref = make$20(value);
3069
2509
  return self;
3070
2510
  };
3071
2511
  /**
@@ -3133,7 +2573,7 @@ const get = (self) => sync(() => self.ref.current);
3133
2573
  * @since 2.0.0
3134
2574
  * @category setters
3135
2575
  */
3136
- const set$1 = /* @__PURE__ */ dual(2, (self, value) => sync(() => set$4(self.ref, value)));
2576
+ const set$1 = /* @__PURE__ */ dual(2, (self, value) => sync(() => set$2(self.ref, value)));
3137
2577
  /**
3138
2578
  * Atomically modifies the value of the Ref using the given function.
3139
2579
  *
@@ -11465,6 +10905,7 @@ var require_resolve_block_scalar = /* @__PURE__ */ __commonJSMin(((exports) => {
11465
10905
  onError(token, "UNEXPECTED_TOKEN", token.message);
11466
10906
  length += token.source.length;
11467
10907
  break;
10908
+ /* istanbul ignore next should not happen */
11468
10909
  default: {
11469
10910
  onError(token, "UNEXPECTED_TOKEN", `Unexpected token in block scalar header: ${token.type}`);
11470
10911
  const ts = token.source;
@@ -11514,6 +10955,7 @@ var require_resolve_flow_scalar = /* @__PURE__ */ __commonJSMin(((exports) => {
11514
10955
  _type = Scalar.Scalar.QUOTE_DOUBLE;
11515
10956
  value = doubleQuotedValue(source, _onError);
11516
10957
  break;
10958
+ /* istanbul ignore next should not happen */
11517
10959
  default:
11518
10960
  onError(scalar, "UNEXPECTED_TOKEN", `Expected a flow scalar value, but found: ${type}`);
11519
10961
  return {
@@ -11543,6 +10985,7 @@ var require_resolve_flow_scalar = /* @__PURE__ */ __commonJSMin(((exports) => {
11543
10985
  function plainValue(source, onError) {
11544
10986
  let badChar = "";
11545
10987
  switch (source[0]) {
10988
+ /* istanbul ignore next should not happen */
11546
10989
  case " ":
11547
10990
  badChar = "a tab character";
11548
10991
  break;
@@ -13199,6 +12642,7 @@ var require_parser$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
13199
12642
  return it.sep ?? it.start;
13200
12643
  }
13201
12644
  case "block-seq": return parent.items[parent.items.length - 1].start;
12645
+ /* istanbul ignore next should not happen */
13202
12646
  default: return [];
13203
12647
  }
13204
12648
  }
@@ -13451,6 +12895,7 @@ var require_parser$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
13451
12895
  });
13452
12896
  return;
13453
12897
  }
12898
+ /* istanbul ignore next should not happen */
13454
12899
  default:
13455
12900
  yield* this.pop();
13456
12901
  yield* this.pop(token);
@@ -13568,6 +13013,7 @@ var require_parser$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
13568
13013
  }
13569
13014
  yield* this.pop();
13570
13015
  break;
13016
+ /* istanbul ignore next should not happen */
13571
13017
  default:
13572
13018
  yield* this.pop();
13573
13019
  yield* this.step();
@@ -17115,10 +16561,10 @@ const runWith = (command, config) => {
17115
16561
  program = provideService(program, LogLevel, logLevel);
17116
16562
  const services = match(logLevel, {
17117
16563
  onNone: () => empty$5(),
17118
- onSome: (level) => make$26(MinimumLogLevel, level)
16564
+ onSome: (level) => make$24(MinimumLogLevel, level)
17119
16565
  });
17120
16566
  yield* provideServices(program, services);
17121
- }, 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));
16567
+ }, catchFilter((error) => isCliError(error) && error._tag === "ShowHelp" ? succeed$3(error) : fail$3(error), (error) => showHelp(command, error.commandPath)), catchFilter((e) => isQuitError(e) ? succeed$3(e) : fail$3(e), (_) => interrupt));
17122
16568
  };
17123
16569
  //#endregion
17124
16570
  //#region ../../packages/t3-shared/src/Net.ts
@@ -19432,6 +18878,22 @@ const MAX_KEYBINDING_VALUE_LENGTH = 64;
19432
18878
  const MAX_KEYBINDING_WHEN_LENGTH = 256;
19433
18879
  const MAX_SCRIPT_ID_LENGTH = 24;
19434
18880
  const MAX_KEYBINDINGS_COUNT = 256;
18881
+ const THREAD_JUMP_KEYBINDING_COMMANDS = [
18882
+ "thread.jump.1",
18883
+ "thread.jump.2",
18884
+ "thread.jump.3",
18885
+ "thread.jump.4",
18886
+ "thread.jump.5",
18887
+ "thread.jump.6",
18888
+ "thread.jump.7",
18889
+ "thread.jump.8",
18890
+ "thread.jump.9"
18891
+ ];
18892
+ const THREAD_KEYBINDING_COMMANDS = [
18893
+ "thread.previous",
18894
+ "thread.next",
18895
+ ...THREAD_JUMP_KEYBINDING_COMMANDS
18896
+ ];
19435
18897
  const STATIC_KEYBINDING_COMMANDS = [
19436
18898
  "terminal.toggle",
19437
18899
  "terminal.split",
@@ -19440,7 +18902,8 @@ const STATIC_KEYBINDING_COMMANDS = [
19440
18902
  "diff.toggle",
19441
18903
  "chat.new",
19442
18904
  "chat.newLocal",
19443
- "editor.openFavorite"
18905
+ "editor.openFavorite",
18906
+ ...THREAD_KEYBINDING_COMMANDS
19444
18907
  ];
19445
18908
  const SCRIPT_RUN_COMMAND_PATTERN = TemplateLiteral([
19446
18909
  Literal("script."),
@@ -20078,7 +19541,7 @@ const launchDetached = (launch) => gen(function* () {
20078
19541
  });
20079
19542
  const make$9 = gen(function* () {
20080
19543
  const open = yield* tryPromise({
20081
- try: () => import("./open-BM96ykXl.mjs"),
19544
+ try: () => import("./open-Cm7F9p66.mjs"),
20082
19545
  catch: (cause) => new OpenError({
20083
19546
  message: "failed to load browser opener",
20084
19547
  cause
@@ -20205,7 +19668,7 @@ const make$8 = ({ dumpSchema = () => void_$1 }) => ({ loader, schemaDirectory, t
20205
19668
  if (schemaDirectory && completed.length > 0) yield* dumpSchema(`${schemaDirectory}/_schema.sql`, table).pipe(catchCause((cause) => logInfo$1("Could not dump schema", cause)));
20206
19669
  return completed;
20207
19670
  });
20208
- const migrationOrder = /* @__PURE__ */ make$27(([a], [b]) => Number$2(a, b));
19671
+ const migrationOrder = /* @__PURE__ */ make$25(([a], [b]) => Number$2(a, b));
20209
19672
  /**
20210
19673
  * @since 4.0.0
20211
19674
  * @category loaders
@@ -20907,8 +20370,8 @@ const runMigrations = gen(function* () {
20907
20370
  //#endregion
20908
20371
  //#region src/persistence/Layers/Sqlite.ts
20909
20372
  const defaultSqliteClientLoaders = {
20910
- bun: () => import("./SqliteClient-DBy8Gtib.mjs"),
20911
- node: () => import("./NodeSqliteClient-BXfshIvF.mjs")
20373
+ bun: () => import("./SqliteClient-BBxZHTRF.mjs"),
20374
+ node: () => import("./NodeSqliteClient-BPzkJKIG.mjs")
20912
20375
  };
20913
20376
  const makeRuntimeSqliteLayer = (config) => gen(function* () {
20914
20377
  const loader = defaultSqliteClientLoaders[process.versions.bun !== void 0 ? "bun" : "node"];
@@ -21237,7 +20700,7 @@ const makeGitService = gen(function* () {
21237
20700
  const timeoutMs = input.timeoutMs ?? DEFAULT_TIMEOUT_MS$2;
21238
20701
  const maxOutputBytes = input.maxOutputBytes ?? DEFAULT_MAX_OUTPUT_BYTES;
21239
20702
  return yield* gen(function* () {
21240
- const child = yield* commandSpawner.spawn(make$19("git", commandInput.args, {
20703
+ const child = yield* commandSpawner.spawn(make$18("git", commandInput.args, {
21241
20704
  cwd: commandInput.cwd,
21242
20705
  ...input.env ? { env: input.env } : {}
21243
20706
  })).pipe(mapError(toGitCommandError(commandInput, "failed to spawn.")));
@@ -21587,7 +21050,7 @@ const findOne = (options) => {
21587
21050
  const findOneOption = (options) => {
21588
21051
  const encodeRequest = encodeEffect(options.Request);
21589
21052
  const decode = decodeUnknownEffect(options.Result);
21590
- return (request) => flatMap(flatMap(encodeRequest(request), options.execute), (arr) => isReadonlyArrayNonEmpty(arr) ? asSome$1(decode(arr[0])) : succeedNone$1);
21053
+ return (request) => flatMap(flatMap(encodeRequest(request), options.execute), (arr) => isReadonlyArrayNonEmpty(arr) ? asSome(decode(arr[0])) : succeedNone);
21591
21054
  };
21592
21055
  //#endregion
21593
21056
  //#region src/persistence/Errors.ts
@@ -24760,7 +24223,7 @@ const makeOrchestrationEngine = gen(function* () {
24760
24223
  const existingReceipt = yield* commandReceiptRepository.getByCommandId({ commandId: envelope.command.commandId });
24761
24224
  if (isSome(existingReceipt)) {
24762
24225
  if (existingReceipt.value.status === "accepted") {
24763
- yield* succeed$5(envelope.result, { sequence: existingReceipt.value.resultSequence });
24226
+ yield* succeed$4(envelope.result, { sequence: existingReceipt.value.resultSequence });
24764
24227
  return;
24765
24228
  }
24766
24229
  yield* fail$4(envelope.result, new OrchestrationCommandPreviouslyRejectedError({
@@ -24805,7 +24268,7 @@ const makeOrchestrationEngine = gen(function* () {
24805
24268
  })).pipe(catchTag("SqlError", (sqlError) => fail$1(toPersistenceSqlError("OrchestrationEngine.processEnvelope:transaction")(sqlError))));
24806
24269
  readModel = committedCommand.nextReadModel;
24807
24270
  for (const event of committedCommand.committedEvents) yield* publish(eventPubSub, event);
24808
- yield* succeed$5(envelope.result, { sequence: committedCommand.lastSequence });
24271
+ yield* succeed$4(envelope.result, { sequence: committedCommand.lastSequence });
24809
24272
  }).pipe(catch_((error) => gen(function* () {
24810
24273
  yield* reconcileReadModelAfterDispatchFailure.pipe(catch_(() => logWarning$1("failed to reconcile orchestration read model after dispatch failure").pipe(annotateLogs({
24811
24274
  commandId: envelope.command.commandId,
@@ -24850,7 +24313,7 @@ const makeOrchestrationEngine = gen(function* () {
24850
24313
  const getReadModel = () => sync(() => readModel);
24851
24314
  const readEvents = (fromSequenceExclusive) => eventStore.readFromSequence(fromSequenceExclusive);
24852
24315
  const dispatch = (command) => gen(function* () {
24853
- const result = yield* make$28();
24316
+ const result = yield* make$26();
24854
24317
  yield* offer$1(commandQueue, {
24855
24318
  command,
24856
24319
  result
@@ -24890,8 +24353,8 @@ const OrchestrationEngineLive = effect(OrchestrationEngineService, makeOrchestra
24890
24353
  */
24891
24354
  const makeDrainableWorker = (process) => gen(function* () {
24892
24355
  const queue = yield* unbounded();
24893
- const initialIdle = yield* make$28();
24894
- yield* succeed$5(initialIdle, void 0).pipe(orDie);
24356
+ const initialIdle = yield* make$26();
24357
+ yield* succeed$4(initialIdle, void 0).pipe(orDie);
24895
24358
  const state = yield* make$11({
24896
24359
  outstanding: 0,
24897
24360
  idle: initialIdle
@@ -24903,10 +24366,10 @@ const makeDrainableWorker = (process) => gen(function* () {
24903
24366
  outstanding: remaining,
24904
24367
  idle: current.idle
24905
24368
  }];
24906
- }).pipe(flatMap((idle) => idle === null ? void_$1 : succeed$5(idle, void 0).pipe(orDie)));
24369
+ }).pipe(flatMap((idle) => idle === null ? void_$1 : succeed$4(idle, void 0).pipe(orDie)));
24907
24370
  yield* forkScoped(forever(take(queue).pipe(flatMap((item) => process(item).pipe(ensuring(finishOne))))));
24908
24371
  const enqueue = (item) => gen(function* () {
24909
- const nextIdle = yield* make$28();
24372
+ const nextIdle = yield* make$26();
24910
24373
  yield* update(state, (current) => current.outstanding === 0 ? {
24911
24374
  outstanding: 1,
24912
24375
  idle: nextIdle
@@ -26206,12 +25669,12 @@ const make$5 = gen(function* () {
26206
25669
  const providerService = yield* ProviderService;
26207
25670
  const git = yield* GitCore;
26208
25671
  const textGeneration = yield* TextGeneration;
26209
- const handledTurnStartKeys = yield* make$13({
25672
+ const handledTurnStartKeys = yield* make$32({
26210
25673
  capacity: HANDLED_TURN_START_KEY_MAX,
26211
25674
  timeToLive: HANDLED_TURN_START_KEY_TTL,
26212
25675
  lookup: () => succeed(true)
26213
25676
  });
26214
- const hasHandledTurnStartRecently = (key) => getOption(handledTurnStartKeys, key).pipe(flatMap((cached) => set$2(handledTurnStartKeys, key, true).pipe(as(isSome(cached)))));
25677
+ const hasHandledTurnStartRecently = (key) => getOption(handledTurnStartKeys, key).pipe(flatMap((cached) => set$3(handledTurnStartKeys, key, true).pipe(as(isSome(cached)))));
26215
25678
  const threadProviderOptions = /* @__PURE__ */ new Map();
26216
25679
  const threadModelSelections = /* @__PURE__ */ new Map();
26217
25680
  const appendProviderFailureActivity = (input) => orchestrationEngine.dispatch({
@@ -29876,10 +29339,15 @@ var LicenseService = class {
29876
29339
  this.verificationPromise = null;
29877
29340
  }
29878
29341
  async getCachedStatus() {
29879
- return this.getStatus();
29342
+ return this.getStatus({
29343
+ allowStale: true,
29344
+ refreshInBackground: true
29345
+ });
29880
29346
  }
29881
29347
  async getStatus(options = {}) {
29882
29348
  const forceRefresh = Boolean(options.forceRefresh);
29349
+ const allowStale = Boolean(options.allowStale);
29350
+ const refreshInBackground = Boolean(options.refreshInBackground);
29883
29351
  const secret = await getLicenseSecret();
29884
29352
  const stored = await getStoredLicense();
29885
29353
  if (!stored?.licenseKey) return toLicenseStatus(null);
@@ -29905,7 +29373,11 @@ var LicenseService = class {
29905
29373
  message: "License data changed, rechecking.",
29906
29374
  error: "Untrusted license data."
29907
29375
  }) : toLicenseStatus(workingStored);
29908
- if (!(forceRefresh || graceStale || tampered || cappedNextCheckTs === null || cappedNextCheckTs <= now)) return cached;
29376
+ const shouldRefresh = forceRefresh || graceStale || tampered || cappedNextCheckTs === null || cappedNextCheckTs <= now;
29377
+ if (!shouldRefresh || allowStale) {
29378
+ if (allowStale && shouldRefresh && refreshInBackground) this.refreshStatusInBackground({ force: forceRefresh });
29379
+ return cached;
29380
+ }
29909
29381
  if (this.verificationPromise && !forceRefresh) return this.verificationPromise;
29910
29382
  const verify = async () => {
29911
29383
  try {
@@ -33817,17 +33289,17 @@ const make$4 = gen(function* () {
33817
33289
  const assistantDeliveryModeRef = yield* make$11(DEFAULT_ASSISTANT_DELIVERY_MODE);
33818
33290
  const passiveImportedThreadRecoveryLastStartedAtMs = /* @__PURE__ */ new Map();
33819
33291
  const passiveImportedThreadRecoveryInFlight = /* @__PURE__ */ new Map();
33820
- const turnMessageIdsByTurnKey = yield* make$13({
33292
+ const turnMessageIdsByTurnKey = yield* make$32({
33821
33293
  capacity: TURN_MESSAGE_IDS_BY_TURN_CACHE_CAPACITY,
33822
33294
  timeToLive: TURN_MESSAGE_IDS_BY_TURN_TTL,
33823
33295
  lookup: () => succeed(/* @__PURE__ */ new Set())
33824
33296
  });
33825
- const bufferedAssistantTextByMessageId = yield* make$13({
33297
+ const bufferedAssistantTextByMessageId = yield* make$32({
33826
33298
  capacity: BUFFERED_MESSAGE_TEXT_BY_MESSAGE_ID_CACHE_CAPACITY,
33827
33299
  timeToLive: BUFFERED_MESSAGE_TEXT_BY_MESSAGE_ID_TTL,
33828
33300
  lookup: () => succeed("")
33829
33301
  });
33830
- const bufferedProposedPlanById = yield* make$13({
33302
+ const bufferedProposedPlanById = yield* make$32({
33831
33303
  capacity: BUFFERED_PROPOSED_PLAN_BY_ID_CACHE_CAPACITY,
33832
33304
  timeToLive: BUFFERED_PROPOSED_PLAN_BY_ID_TTL,
33833
33305
  lookup: () => succeed({
@@ -33846,7 +33318,7 @@ const make$4 = gen(function* () {
33846
33318
  if (!workspaceCwd) return false;
33847
33319
  return isGitRepository(workspaceCwd);
33848
33320
  });
33849
- const rememberAssistantMessageId = (threadId, turnId, messageId) => getOption(turnMessageIdsByTurnKey, providerTurnKey(threadId, turnId)).pipe(flatMap((existingIds) => set$2(turnMessageIdsByTurnKey, providerTurnKey(threadId, turnId), match(existingIds, {
33321
+ const rememberAssistantMessageId = (threadId, turnId, messageId) => getOption(turnMessageIdsByTurnKey, providerTurnKey(threadId, turnId)).pipe(flatMap((existingIds) => set$3(turnMessageIdsByTurnKey, providerTurnKey(threadId, turnId), match(existingIds, {
33850
33322
  onNone: () => new Set([messageId]),
33851
33323
  onSome: (ids) => {
33852
33324
  const nextIds = new Set(ids);
@@ -33860,7 +33332,7 @@ const make$4 = gen(function* () {
33860
33332
  const nextIds = new Set(ids);
33861
33333
  nextIds.delete(messageId);
33862
33334
  if (nextIds.size === 0) return invalidate(turnMessageIdsByTurnKey, providerTurnKey(threadId, turnId));
33863
- return set$2(turnMessageIdsByTurnKey, providerTurnKey(threadId, turnId), nextIds);
33335
+ return set$3(turnMessageIdsByTurnKey, providerTurnKey(threadId, turnId), nextIds);
33864
33336
  }
33865
33337
  })));
33866
33338
  const getAssistantMessageIdsForTurn = (threadId, turnId) => getOption(turnMessageIdsByTurnKey, providerTurnKey(threadId, turnId)).pipe(map$3((existingIds) => getOrElse(existingIds, () => /* @__PURE__ */ new Set())));
@@ -33871,7 +33343,7 @@ const make$4 = gen(function* () {
33871
33343
  onSome: (text) => `${text}${delta}`
33872
33344
  });
33873
33345
  if (nextText.length <= MAX_BUFFERED_ASSISTANT_CHARS) {
33874
- yield* set$2(bufferedAssistantTextByMessageId, messageId, nextText);
33346
+ yield* set$3(bufferedAssistantTextByMessageId, messageId, nextText);
33875
33347
  return "";
33876
33348
  }
33877
33349
  yield* invalidate(bufferedAssistantTextByMessageId, messageId);
@@ -33881,7 +33353,7 @@ const make$4 = gen(function* () {
33881
33353
  const clearBufferedAssistantText = (messageId) => invalidate(bufferedAssistantTextByMessageId, messageId);
33882
33354
  const appendBufferedProposedPlan = (planId, delta, createdAt) => getOption(bufferedProposedPlanById, planId).pipe(flatMap((existingEntry) => {
33883
33355
  const existing = getOrUndefined(existingEntry);
33884
- return set$2(bufferedProposedPlanById, planId, {
33356
+ return set$3(bufferedProposedPlanById, planId, {
33885
33357
  text: `${existing?.text ?? ""}${delta}`,
33886
33358
  createdAt: existing?.createdAt && existing.createdAt.length > 0 ? existing.createdAt : createdAt
33887
33359
  });
@@ -35728,7 +35200,7 @@ function makeThreadWriter(input) {
35728
35200
  return;
35729
35201
  }
35730
35202
  const sink = sinkResult.sink;
35731
- const scope = yield* make$29();
35203
+ const scope = yield* make$27();
35732
35204
  const loggerLayer = layer$1([yield* batched(makeLineLogger(input.streamLabel), {
35733
35205
  window: input.batchWindowMs,
35734
35206
  flush: (messages) => gen(function* () {
@@ -38258,7 +37730,19 @@ const DEFAULT_KEYBINDINGS = [
38258
37730
  {
38259
37731
  key: "mod+o",
38260
37732
  command: "editor.openFavorite"
38261
- }
37733
+ },
37734
+ {
37735
+ key: "mod+shift+[",
37736
+ command: "thread.previous"
37737
+ },
37738
+ {
37739
+ key: "mod+shift+]",
37740
+ command: "thread.next"
37741
+ },
37742
+ ...THREAD_JUMP_KEYBINDING_COMMANDS.map((command, index) => ({
37743
+ key: `mod+${index + 1}`,
37744
+ command
37745
+ }))
38262
37746
  ];
38263
37747
  function normalizeKeyToken(token) {
38264
37748
  if (token === "space") return " ";
@@ -38550,11 +38034,11 @@ const makeKeybindings = gen(function* () {
38550
38034
  const { keybindingsConfigPath, stateDir } = yield* ServerConfig$1;
38551
38035
  const fs = yield* FileSystem;
38552
38036
  const path = yield* Path$1;
38553
- const upsertSemaphore = yield* make$30(1);
38037
+ const upsertSemaphore = yield* make$28(1);
38554
38038
  const resolvedConfigCacheKey = "resolved";
38555
38039
  const changesPubSub = yield* unbounded$1();
38556
38040
  const startedRef = yield* make$11(false);
38557
- const startedDeferred = yield* make$28();
38041
+ const startedDeferred = yield* make$26();
38558
38042
  const keybindingsDbPath = path.join(stateDir, SQLITE_DB_FILE);
38559
38043
  const emitChange = (configState) => publish(changesPubSub, configState).pipe(asVoid);
38560
38044
  const readStoredRawConfig = tryPromise({
@@ -38674,11 +38158,11 @@ const makeKeybindings = gen(function* () {
38674
38158
  keybindings: mergeWithDefaultKeybindings(compileResolvedKeybindingsConfig(keybindings)),
38675
38159
  issues
38676
38160
  })));
38677
- const resolvedConfigCache = yield* make$13({
38161
+ const resolvedConfigCache = yield* make$32({
38678
38162
  capacity: 1,
38679
38163
  lookup: () => loadConfigStateFromDisk
38680
38164
  });
38681
- const loadConfigStateFromCacheOrDisk = get$1(resolvedConfigCache, resolvedConfigCacheKey);
38165
+ const loadConfigStateFromCacheOrDisk = get$3(resolvedConfigCache, resolvedConfigCacheKey);
38682
38166
  upsertSemaphore.withPermits(1)(gen(function* () {
38683
38167
  yield* invalidate(resolvedConfigCache, resolvedConfigCacheKey);
38684
38168
  yield* emitChange(yield* loadConfigStateFromCacheOrDisk);
@@ -38739,7 +38223,7 @@ const makeKeybindings = gen(function* () {
38739
38223
  yield* failCause$1(startedDeferred, startupExit.cause).pipe(orDie);
38740
38224
  return yield* failCause(startupExit.cause);
38741
38225
  }
38742
- yield* succeed$5(startedDeferred, void 0).pipe(orDie);
38226
+ yield* succeed$4(startedDeferred, void 0).pipe(orDie);
38743
38227
  }),
38744
38228
  ready: _await(startedDeferred),
38745
38229
  syncDefaultKeybindingsOnStartup,
@@ -38757,7 +38241,7 @@ const makeKeybindings = gen(function* () {
38757
38241
  });
38758
38242
  yield* writeConfigAtomically(cappedConfig);
38759
38243
  const nextResolved = mergeWithDefaultKeybindings(compileResolvedKeybindingsConfig(cappedConfig));
38760
- yield* set$2(resolvedConfigCache, resolvedConfigCacheKey, {
38244
+ yield* set$3(resolvedConfigCache, resolvedConfigCacheKey, {
38761
38245
  keybindings: nextResolved,
38762
38246
  issues: []
38763
38247
  });
@@ -39784,7 +39268,7 @@ const makeGitCore = gen(function* () {
39784
39268
  const refreshStatusUpstreamIfStale = (cwd) => gen(function* () {
39785
39269
  const upstream = yield* resolveCurrentUpstream(cwd);
39786
39270
  if (!upstream) return;
39787
- yield* get$1(statusUpstreamRefreshCache, new StatusUpstreamRefreshCacheKey({
39271
+ yield* get$3(statusUpstreamRefreshCache, new StatusUpstreamRefreshCacheKey({
39788
39272
  cwd,
39789
39273
  upstreamRef: upstream.upstreamRef,
39790
39274
  remoteName: upstream.remoteName,
@@ -40705,7 +40189,7 @@ const makeCodexTextGeneration = gen(function* () {
40705
40189
  const schemaPath = yield* writeTempFile(operation, "codex-schema", JSON.stringify(toCodexOutputJsonSchema(outputSchemaJson)));
40706
40190
  const outputPath = yield* writeTempFile(operation, "codex-output", "");
40707
40191
  const runCodexCommand = gen(function* () {
40708
- const command = make$19("codex", [
40192
+ const command = make$18("codex", [
40709
40193
  "exec",
40710
40194
  "--ephemeral",
40711
40195
  "-s",
@@ -40723,7 +40207,7 @@ const makeCodexTextGeneration = gen(function* () {
40723
40207
  ], {
40724
40208
  cwd,
40725
40209
  shell: process.platform === "win32",
40726
- stdin: { stream: make$31(new TextEncoder().encode(prompt)) }
40210
+ stdin: { stream: make$29(new TextEncoder().encode(prompt)) }
40727
40211
  });
40728
40212
  const child = yield* commandSpawner.spawn(command).pipe(mapError((cause) => normalizeCodexError(operation, cause, "Failed to spawn Codex CLI process")));
40729
40213
  const [stdout, stderr, exitCode] = yield* all([
@@ -41253,7 +40737,7 @@ const hasCustomModelProvider = map$3(readCodexConfigModelProvider, (provider) =>
41253
40737
  const collectStreamAsString = (stream) => runFold(stream, () => "", (acc, chunk) => acc + new TextDecoder().decode(chunk));
41254
40738
  const runCodexCommand$1 = (args, env) => gen(function* () {
41255
40739
  const spawner = yield* ChildProcessSpawner;
41256
- const command = make$19("codex", [...args], {
40740
+ const command = make$18("codex", [...args], {
41257
40741
  shell: process.platform === "win32",
41258
40742
  ...env ? { env } : {}
41259
40743
  });
@@ -41887,7 +41371,9 @@ var require_toml_parser = /* @__PURE__ */ __commonJSMin(((exports, module) => {
41887
41371
  if (_type in value) switch (value[_type]) {
41888
41372
  case INLINE_TABLE: return "inline-table";
41889
41373
  case INLINE_LIST: return "inline-list";
41374
+ /* istanbul ignore next */
41890
41375
  case TABLE: return "table";
41376
+ /* istanbul ignore next */
41891
41377
  case LIST: return "list";
41892
41378
  case FLOAT: return "float";
41893
41379
  case INTEGER: return "integer";
@@ -42826,6 +42312,7 @@ var require_stringify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
42826
42312
  case "datetime": return true;
42827
42313
  case "array": return value.length === 0 || tomlType(value[0]) !== "table";
42828
42314
  case "table": return Object.keys(value).length === 0;
42315
+ /* istanbul ignore next */
42829
42316
  default: return false;
42830
42317
  }
42831
42318
  }
@@ -42886,6 +42373,7 @@ var require_stringify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
42886
42373
  case "datetime": return stringifyDatetime(value);
42887
42374
  case "array": return stringifyInlineArray(value.filter((_) => tomlType(_) !== "null" && tomlType(_) !== "undefined" && tomlType(_) !== "nan"));
42888
42375
  case "table": return stringifyInlineTable(value);
42376
+ /* istanbul ignore next */
42889
42377
  default: throw typeError(type);
42890
42378
  }
42891
42379
  }
@@ -48396,7 +47884,7 @@ const makeServerPushBus = (input) => gen(function* () {
48396
47884
  const nextSequence = yield* make$11(0);
48397
47885
  const queue = yield* unbounded();
48398
47886
  const encodePush = encodeUnknownEffect(fromJsonString(WsPush));
48399
- const settleDelivery = (job, delivered) => job.delivered === null ? void_$1 : succeed$5(job.delivered, delivered).pipe(orDie);
47887
+ const settleDelivery = (job, delivered) => job.delivered === null ? void_$1 : succeed$4(job.delivered, delivered).pipe(orDie);
48400
47888
  const send = fnUntraced(function* (job) {
48401
47889
  const push = {
48402
47890
  type: "push",
@@ -48426,7 +47914,7 @@ const makeServerPushBus = (input) => gen(function* () {
48426
47914
  return {
48427
47915
  publishAll: publish({ kind: "all" }),
48428
47916
  publishClient: (client, channel, data) => gen(function* () {
48429
- const delivered = yield* make$28();
47917
+ const delivered = yield* make$26();
48430
47918
  yield* offer$1(queue, {
48431
47919
  channel,
48432
47920
  data,
@@ -48443,12 +47931,12 @@ const makeServerPushBus = (input) => gen(function* () {
48443
47931
  //#endregion
48444
47932
  //#region src/wsServer/readiness.ts
48445
47933
  const makeServerReadiness = gen(function* () {
48446
- const httpListening = yield* make$28();
48447
- const pushBusReady = yield* make$28();
48448
- const keybindingsReady = yield* make$28();
48449
- const terminalSubscriptionsReady = yield* make$28();
48450
- const orchestrationSubscriptionsReady = yield* make$28();
48451
- const complete = (deferred) => succeed$5(deferred, void 0).pipe(orDie);
47934
+ const httpListening = yield* make$26();
47935
+ const pushBusReady = yield* make$26();
47936
+ const keybindingsReady = yield* make$26();
47937
+ const terminalSubscriptionsReady = yield* make$26();
47938
+ const orchestrationSubscriptionsReady = yield* make$26();
47939
+ const complete = (deferred) => succeed$4(deferred, void 0).pipe(orDie);
48452
47940
  return {
48453
47941
  awaitServerReady: all([
48454
47942
  _await(httpListening),
@@ -48505,7 +47993,7 @@ const decodeJsonResult = (schema) => {
48505
47993
  return (input) => {
48506
47994
  const result = decode(input);
48507
47995
  if (isFailure(result)) return fail$3(result.cause);
48508
- return succeed$4(result.value);
47996
+ return succeed$3(result.value);
48509
47997
  };
48510
47998
  };
48511
47999
  const formatSchemaError = (cause) => {
@@ -53324,7 +52812,7 @@ const createServer = fn(function* () {
53324
52812
  const checkpointDiffQuery = yield* CheckpointDiffQuery;
53325
52813
  const orchestrationReactor = yield* OrchestrationReactor;
53326
52814
  const { openInEditor } = yield* Open;
53327
- const subscriptionsScope = yield* make$29("sequential");
52815
+ const subscriptionsScope = yield* make$27("sequential");
53328
52816
  yield* addFinalizer$1(() => close(subscriptionsScope, void_$3));
53329
52817
  yield* runForEach(orchestrationEngine.streamDomainEvents, (event) => gen(function* () {
53330
52818
  yield* pushBus.publishAll(ORCHESTRATION_WS_CHANNELS.domainEvent, event);
@@ -54735,7 +54223,7 @@ function makeCookie(name, value, options) {
54735
54223
  if (options.path !== void 0 && !fieldContentRegExp.test(options.path)) return fail$3(CookiesError.fromReason("InvalidCookiePath"));
54736
54224
  if (options.maxAge !== void 0 && !isFinite$1(fromInputUnsafe(options.maxAge))) return fail$3(CookiesError.fromReason("CookieInfinityMaxAge"));
54737
54225
  }
54738
- return succeed$4(Object.assign(Object.create(CookieProto), {
54226
+ return succeed$3(Object.assign(Object.create(CookieProto), {
54739
54227
  name,
54740
54228
  value,
54741
54229
  valueEncoded: encodedValue,
@@ -54846,7 +54334,7 @@ const Proto$4 = /* @__PURE__ */ Object.create(null);
54846
54334
  Object.defineProperties(Proto$4, {
54847
54335
  [TypeId$7]: { value: TypeId$7 },
54848
54336
  [symbolRedactable]: { value(context) {
54849
- return redact(this, get$4(context, CurrentRedactedNames));
54337
+ return redact(this, get$2(context, CurrentRedactedNames));
54850
54338
  } },
54851
54339
  toJSON: { value() {
54852
54340
  return redact$1(this);
@@ -54936,8 +54424,8 @@ const redact = /* @__PURE__ */ dual(2, (self, key) => {
54936
54424
  const modify = (key) => {
54937
54425
  if (typeof key === "string") {
54938
54426
  const k = key.toLowerCase();
54939
- if (k in self) out[k] = make$32(self[k]);
54940
- } else for (const name in self) if (key.test(name)) out[name] = make$32(self[name]);
54427
+ if (k in self) out[k] = make$30(self[k]);
54428
+ } else for (const name in self) if (key.test(name)) out[name] = make$30(self[name]);
54941
54429
  };
54942
54430
  if (Array.isArray(key)) for (let i = 0; i < key.length; i++) modify(key[i]);
54943
54431
  else modify(key);
@@ -55198,7 +54686,7 @@ const fromInputNested = (input) => {
55198
54686
  * @since 4.0.0
55199
54687
  * @category Equivalence
55200
54688
  */
55201
- const Equivalence = /* @__PURE__ */ make$33((a, b) => arrayEquivalence(a.params, b.params));
54689
+ const Equivalence = /* @__PURE__ */ make$31((a, b) => arrayEquivalence(a.params, b.params));
55202
54690
  const arrayEquivalence = /* @__PURE__ */ makeEquivalence$1(/* @__PURE__ */ makeEquivalence$2([/* @__PURE__ */ strictEqual(), /* @__PURE__ */ strictEqual()]));
55203
54691
  /**
55204
54692
  * @since 4.0.0
@@ -55256,7 +54744,7 @@ const makeUrl = (url, params, hash) => {
55256
54744
  if (value !== void 0) urlInstance.searchParams.append(key, value);
55257
54745
  }
55258
54746
  if (hash !== void 0) urlInstance.hash = hash;
55259
- return succeed$4(urlInstance);
54747
+ return succeed$3(urlInstance);
55260
54748
  } catch (e) {
55261
54749
  return fail$3(new UrlParamsError({ cause: e }));
55262
54750
  }
@@ -55805,7 +55293,7 @@ const SpanNameGenerator = /* @__PURE__ */ Reference("effect/http/HttpClient/Span
55805
55293
  /**
55806
55294
  * @since 4.0.0
55807
55295
  */
55808
- const layerMergedServices = (effect$1) => effect(HttpClient)(servicesWith$1((services) => map$3(effect$1, (client) => transformResponse(client, updateServices$1((input) => merge$2(services, input))))));
55296
+ const layerMergedServices = (effect$1) => effect(HttpClient)(servicesWith((services) => map$3(effect$1, (client) => transformResponse(client, updateServices((input) => merge$2(services, input))))));
55809
55297
  const responseRegistry = /* @__PURE__ */ (() => {
55810
55298
  if ("FinalizationRegistry" in globalThis && globalThis.FinalizationRegistry) {
55811
55299
  const registry = /* @__PURE__ */ new FinalizationRegistry((controller) => {
@@ -55884,7 +55372,7 @@ var InterruptibleResponse = class {
55884
55372
  get stream() {
55885
55373
  return suspend$3(() => {
55886
55374
  responseRegistry.unregister(this.original);
55887
- return onExit$1(this.original.stream, (exit) => {
55375
+ return onExit(this.original.stream, (exit) => {
55888
55376
  if (hasInterrupts$1(exit)) this.controller.abort();
55889
55377
  return void_$1;
55890
55378
  });
@@ -55948,6 +55436,6 @@ const layer = /* @__PURE__ */ layerMergedServices(/* @__PURE__ */ succeed(fetch$
55948
55436
  const RuntimeLayer = empty$6.pipe(provideMerge(CliConfig.layer), provideMerge(ServerLive), provideMerge(OpenLive), provideMerge(NetService.layer), provideMerge(layer$2), provideMerge(layer));
55949
55437
  run$1(t3Cli, { version }).pipe(provide(RuntimeLayer), runMain);
55950
55438
  //#endregion
55951
- export { make$13 as n, get$1 as t };
55439
+ export {};
55952
55440
 
55953
55441
  //# sourceMappingURL=index.mjs.map