clanka 0.24.2 → 0.24.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/Agent.d.ts.map +1 -1
  2. package/dist/Agent.js +23 -10
  3. package/dist/Agent.js.map +1 -1
  4. package/dist/Agent.test.js +137 -0
  5. package/dist/Agent.test.js.map +1 -1
  6. package/dist/ClaudeAgent.d.ts.map +1 -1
  7. package/dist/ClaudeAgent.js +5 -1
  8. package/dist/ClaudeAgent.js.map +1 -1
  9. package/dist/ClaudeAgent.test.js +45 -0
  10. package/dist/ClaudeAgent.test.js.map +1 -1
  11. package/dist/OutputFormatter.d.ts +1 -1
  12. package/dist/OutputFormatter.d.ts.map +1 -1
  13. package/dist/OutputFormatter.js +42 -2
  14. package/dist/OutputFormatter.js.map +1 -1
  15. package/dist/OutputFormatter.test.d.ts +2 -0
  16. package/dist/OutputFormatter.test.d.ts.map +1 -0
  17. package/dist/OutputFormatter.test.js +93 -0
  18. package/dist/OutputFormatter.test.js.map +1 -0
  19. package/dist/bin/{Stream-C51usiew.mjs → AiError-fiHIiGOy.mjs} +469 -34
  20. package/dist/bin/{Latch-BnrpWMd1.mjs → Latch-D1909CI6.mjs} +1 -1
  21. package/dist/bin/{McpClient-DoPNaNzW.mjs → McpClient-CXwyRd_3.mjs} +2 -3
  22. package/dist/bin/{OutputFormatter-U02YKTfy.mjs → OutputFormatter-B8yF7iiq.mjs} +40 -4
  23. package/dist/bin/{Schema-Box_9VZG.mjs → Schema-D629S5yu.mjs} +5459 -278
  24. package/dist/bin/{SemanticSearch-CH125AHH.mjs → SemanticSearch-BlcfFvPr.mjs} +14 -15
  25. package/dist/bin/cli.mjs +393 -819
  26. package/dist/bin/{upgrade-HMRGSqq8.mjs → upgrade-E_f-q2h8.mjs} +3 -4
  27. package/package.json +1 -1
  28. package/src/Agent.test.ts +198 -0
  29. package/src/Agent.ts +27 -10
  30. package/src/ClaudeAgent.test.ts +62 -0
  31. package/src/ClaudeAgent.ts +7 -1
  32. package/src/OutputFormatter.test.ts +158 -0
  33. package/src/OutputFormatter.ts +56 -1
  34. package/dist/bin/Effect-5XYMLOiB.mjs +0 -5183
package/dist/bin/cli.mjs CHANGED
@@ -1,9 +1,8 @@
1
1
  #!/usr/bin/env -S node --optimize-for-size
2
2
  import { i as __toESM, r as __require, t as __commonJSMin } from "./rolldown-runtime-5zChB7MF.mjs";
3
- import { $ as ignoreCause, $a as succeed$2, $n as TimeoutError, $o as orElseSome, $r as TracerTimingEnabled, A as ensuring, Aa as isCanonicalArrayIndex, Ac as constVoid, Ao as merge$1, Ar as empty$7, As as assignProperty, At as raceFirst, B as fn, Ba as sort, Bc as pipeArguments, Bo as fromUndefinedOr, Br as suspend$1, Bt as scope, C as catchTags, Ca as findFirstIndex, Cc as isTagged, Ci as LogToStderr$1, Co as get$2, Cr as reasonAnnotations, Ct as option$1, Da as headNonEmpty, Dc as constFalse, Do as getUnsafe, Dr as effect, Dt as provide$1, E as contextWith, Ea as fromIterable, Ec as or, Eo as getOrUndefinedUnsafe, Er as buildWithScope, Et as promise, F as failSync, Fc as memoize, Fn as jittered, Fo as flatMap$2, Fr as orDie$1, Fs as NodeInspectSymbol, Ft as runFork, G as forkChild, Ga as failVoid, Go as isNone, Gr as close, Gt as sleep, Ha as empty$6, Hn as isDoneCause, Ho as getOrNull, Hr as Scope, I as filterOrFail, Ia as map$7, In as min, Io as flatMapNullishOr, Ir as provide$3, It as runForkWith, J as forkScoped, Ja as getOrUndefined$2, Jn as round, Jr as make$43, K as forkDetach, Kn as parse$1, Kr as fork, Kt as succeed$1, L as flatMap$1, La as match$3, Lc as pipe, Ln as spaced, Lr as provideMerge, Ls as format, M as fail$1, Ma as join$2, Mc as dual, Mn as forever$1, Mo as all$1, Mr as merge$2, Ms as setStackTraceLimit, Mt as request, N as failCause, Na as last$1, Nc as flow, Nn as fromStep, No as exists, Nr as mergeAll, Ns as BaseProto, Nt as result, O as die, Oa as isArray, Oc as constTrue, Oo as make$41, Or as effectContext, Os as withFiber$1, Ot as provideContext, Pc as identity, Pn as isSchedule, Po as filter$1, Pr as mock, Ps as Class, Pt as retry, Q as ignore, Qn as StackTrace, Qo as orElse$1, Qr as MinimumLogLevel, Qt as tapCause, R as flatMapEager, Ra as of, Rn as toStep, Rr as succeed$4, Rt as runSync, S as catchTag, Sa as findFirst, Si as ConsoleRef, Sn as TaggedClass, So as empty$5, Sr as pretty, St as onInterrupt, T as context, To as getOrUndefined$1, Tr as build, Tt as orElseSucceed, U as forEach$1, Ua as headUnsafe, Ui as forkUnsafe, Uo as getOrThrow$1, Ur as addFinalizer$1, Us as redact, Ut as service, V as fnUntraced, Va as span, Vo as getOrElse, Vr as unwrap$3, Vt as scoped, W as forever, Wa as fail$2, Wn as Random$1, Wo as getOrUndefined, Wr as addFinalizerExit, Wt as serviceOption, X as fromResult, Xa as isSuccess$1, Xn as IllegalArgumentError, Xo as match$2, Xr as provide$2, Xt as sync, Y as fromOption, Ya as isFailure$1, Yn as Done, Yo as map$8, Yr as makeUnsafe$2, Yt as suspend, Z as gen, Za as map$6, Zo as none, Zr as CurrentLogAnnotations, Zt as tap, _ as catchEager, _i as isFailure, _n as withSpan$1, _r as isTimeoutError, _t as matchEffect, a as andThen, ac as hasProperty, ai as isDone, an as undefined_, ao as hours, ar as fail$5, as as String$6, at as logFatal, ba as empty$4, bi as void_$1, bn as equalBatchKeys, bo as Service, bt as onExit, c as as, ci as makeUnsafe$1, cn as updateContext, co as isFinite, cr as fromReasons, ct as makeSpanScoped, d as cached, da as ParentSpan, di as die$1, dn as void_, do as millis, dr as interruptors, ds as mapInput, dt as mapEager, ei as _await, en as timeout, eo as try_$1, er as UnknownError$1, es as some, et as interrupt, f as cachedWithTTL, fc as isNotNull, fi as fail$3, fo as minutes, ft as mapError, ga as Array$1, gc as isNullish, gn as withParentSpan, go as toMillis, gt as matchCauseEffect, h as catchCauseIf, ha as toPredicate, hc as isNull, hi as interrupt$1, ho as seconds, hr as isFailReason, hs as Prototype, i as all, ii as into, in as try_, io as fromInputUnsafe$1, ir as done, it as logError, j as exit, ja as isReadonlyArrayNonEmpty, jn as exponential, jr as fresh, js as getStackTraceLimit, jt as repeat, k as effectify, ka as isArrayNonEmpty, kc as constUndefined, ko as makeUnsafe$3, kt as provideService, l as asSome, li as succeed$5, ln as updateService, lr as hasInterrupts, lt as map$5, m as catchCause, ma as has, mc as isNotUndefined, mi as findErrorOption$1, mn as withFiber, mt as match$4, ni as fail$4, nn as timeoutOrElse, no as normalizeNonEmpty, nt as isEffect, o as annotateCurrentSpan, oa as sync$1, oi as isDoneUnsafe, on as uninterruptible, oo as infinity, or as filterInterruptors, ot as logInfo, p as callback, pa as compose, pc as isNotNullish, pi as failCause$1, pn as whileLoop, pr as isDieReason, q as forkIn, qa as getOrThrow, qo as isSome, qt as succeedNone, r as addFinalizer, rn as tryPromise, ro as format$1, rt as logDebug, s as annotateLogs, si as make$42, sn as uninterruptibleMask, sr as findErrorOption, st as logWarning, t as acquireRelease, ti as doneUnsafe, tn as timeoutOption, tr as annotate$1, ts as toArray, tt as interruptible, u as asVoid, ua as DisablePropagation, uc as isIterable, un as useSpan, uo as max, ur as hasInterruptsOnly, ut as mapBothEager, v as catchFilter, va as appendAll, vc as isObject$1, vi as isSuccess, vn as yieldNow, vo as zero, vr as makeDieReason, vs as PipeInspectableProto, vt as never$1, w as catch_, wa as findLast, wc as isUndefined, wo as getOption, wr as squash, wt as orDie, x as catchReason, xc as isString, xo as add, xr as map$9, y as catchIf, yc as isObjectKeyword, yi as succeed$3, yn as zipWith, yo as Reference, yr as makeFailReason, yt as onError, za as reduce, zn as catchDone, zo as fromNullishOr, zr as succeedContext } from "./Effect-5XYMLOiB.mjs";
4
- import { $ as URLFromString, $n as optionalKey$1, $r as make$44, $t as isPattern, A as Null, An as escapeToken, Ar as fromBody, At as isGreaterThan, B as String$7, Bn as Objects, Br as retryAfterDelay, Bt as isLessThanDate, C as Literal, Cr as jsonSchemaAnnotationKeys, Ct as isBetweenCodePoints, D as Never, Dn as fromSchemaDraft07, Dr as redactUrl, Dt as isBetweenSize, E as Natural, En as errorWithPath, Er as fromInput, Et as isBetweenProperties, F as OptionFromOptional, Fn as encodeEffect, Fr as fromRecordUnsafe, Ft as isGreaterThanOrEqualToDate, G as TaggedClass$2, Gn as decodeTo, Gr as formatIso, Gt as isMaxLength, H as Struct, Hn as Suspend, Hr as setAll, Ht as isLessThanOrEqualToBigInt, I as Record, In as Arrays, Ir as isRedactedName, It as isIncluding, J as TaggedUnion, Jn as isJson, Jt as isMinCodePoints, K as TaggedError$1, Kn as defaultParseOptions, Kt as isMaxProperties, L as Redacted$4, Ln as Filter, Lr as merge$3, Lt as isInt, M as Number$2, Mn as getSubschemaKind, Mr as CurrentRedactedNames, Mt as isGreaterThanDate, N as Option, Nn as decodeEffect$1, Nr as empty$9, Nt as isGreaterThanOrEqualTo, O as NonEmptyArray, On as fromSchemaDraft2020_12, Or as setAll$1, Ot as isEndingWith, Pn as decodeUnknownEffect, Pr as fromInput$1, Pt as isGreaterThanOrEqualToBigInt, Q as URL$1, Qn as null_, Qr as isRedacted, Qt as isMultipleOf, R as RedactedFromValue, Rn as FilterGroup, Rr as parseRetryAfter$1, Rt as isLessThan, S as JsonObject$1, Sn as withDecodingDefaultKey, Sr as annotationExcludedKeys, St as isBetweenBigInt, T as MutableJson, Tn as pick, Tr as empty$8, Tt as isBetweenLength, U as StructWithRest, Un as Union$1, Ur as empty$10, Ut as isLessThanOrEqualToDate, V as StringForLiteralAutocomplete, Vn as PropertySignature, Vr as set, Vt as isLessThanOrEqualTo, W as Symbol$1, Wn as applyToSelfOrLastLinkEncoding, Wr as fromSetCookie, Wt as isMaxCodePoints, X as Tuple, Xn as isOptional, Xr as decode$3, Xt as isMinProperties, Y as TrueLiterals, Yn as isNever, Yt as isMinLength, Z as TupleWithRest, Zn as mapOrSame, Zr as encode, Zt as isMinSize, _ as Exit, _n as toEncoded$1, _r as transform$4, _t as encodeUnknownEffect, ai as EncodingError, an as isUnique, ar as toEncoded, at as Void, b as Int$5, bn as withConstructorDefault, br as InvalidValue$1, bt as is, c as Date$2, ci as TaggedError, cn as makeFilter$1, cr as Transformation, ct as declare, di as map$10, dn as optional$2, dr as transformEffect$1, dt as decodeTo$1, ei as value, en as isPropertyNames, er as replaceChecks, et as Uint8Array$2, f as DateTimeUtcFromString, fn as optionalKey, fr as transformOptional$1, ft as decodeUnknownEffect$1, g as Error$2, gn as toCodecStringTree, gr as passthroughSubtype, gt as encodeTo, h as DurationFromMillis, hn as toCodecJson, hr as passthrough, ht as encodeEffect$1, i as Boolean$4, in as isUUID, ir as string$1, it as Unknown, j as NullOr, jn as parseUriFragment, jr as unwrap$4, jt as isGreaterThanBigInt, k as NonEmptyString$1, kn as getReferenceKey, kr as toString, kt as isFinite$1, l as DateTimeUtc, li as taggedEnum, ln as makeFilterGroup, lr as passthrough$1, lt as decodeEffect, m as Duration, mn as tag, mt as decodeUnknownSync, n as ArraySchema, ni as Clock, nn as isSchemaError, nr as resolveDescription, nt as UndefinedOr, o as BooleanLiterals, oi as Error$1, on as link$1, or as toType$1, p as Defect, pn as suspend$2, pt as decodeUnknownOption, q as TaggedStruct, qn as getIndexSignatureKeys, qr as fromDateUnsafe, qt as isMaxSize, r as BigInt$2, ri as currentTimeMillis, rn as isStartingWith, rr as resolveIdentifier, rt as Union, s as Class$1, si as TaggedClass$1, sn as make$45, sr as unknown$1, st as check, t as Any, ti as stringOrRedacted, tn as isSchema, tr as resolveAt, tt as Uint8ArrayFromBase64, ui as assignProperty$1, un as mutable, ur as transform$3, ut as decodeSync, v as FalseLiterals, vn as toJsonSchemaDocument, vr as transformEffect, vt as fromJsonString, w as Literals$2, wn as omit, wr as CurrentRedactedNames$1, wt as isBetweenDate, x as Json, xn as withDecodingDefault, xr as Pointer, xt as isBetween, y as Finite, yn as toType, yr as transformOptional, yt as instanceOf, z as SchemaError, zn as Literal$1, zr as remove$1, zt as isLessThanBigInt } from "./Schema-Box_9VZG.mjs";
5
- import { $ as runLast, A as fromQueue, At as shutdownUnsafe, B as mkString, Bt as interrupt$2, C as fromArray, Ct as failCauseUnsafe, D as fromEffect, Dt as offerAllUnsafe, E as fromChannel$1, Et as offerAll, F as mapArrayEffect, Ft as make$46, G as provideService$1, Gt as camelToSnake, H as orDie$2, Ht as interruptAllAs, I as mapEffect$1, It as set$1, J as runDrain, K as run$4, Kt as toLowerCase, L as mapError$1, Lt as update, M as isStream, Mt as take, N as map$11, Nt as unbounded, Ot as offerUnsafe, P as mapArray, R as merge$4, Rt as await_, S as flattenIterable, St as failCause$2, T as fromAsyncIterable, Tt as offer, U as pipeThroughChannel, Ut as join$3, V as onExit$1, Vt as interruptAll, W as provideContext$1, Wt as runIn, X as runForEach, Y as runFold, Z as runForEachArray, _ as filter$2, _t as makeUnsafe$4, a as catchReason$1, at as takeUntil, b as flatten, bt as endUnsafe, c as concat$1, ct as tapError, d as drainFork, dt as unwrap$6, et as scoped$1, f as drop, ft as fromTransform$1, g as failCause$3, gt as make$48, h as fail$6, ht as unwrap$5, it as take$1, j as fromReadableStream, jt as sliding, k as fromPull, kt as poll, l as decodeText, lt as toAsyncIterable, m as ensuring$1, mt as toTransform, n as callback$1, nt as succeed$6, o as catchTags$1, ot as takeWhile, p as empty$11, pt as mapDone, q as runCollect, r as catchCause$1, rt as suspend$3, s as catch_$1, st as tap$1, t as broadcast, tt as splitLines, u as die$2, ut as transduce, v as filterMap, vt as bounded, wt as make$47, x as flattenArray, xt as fail$7, yt as end, z as mergeAll$1, zt as getCurrent } from "./Stream-C51usiew.mjs";
6
- import { n as makeUnsafe$5 } from "./Latch-BnrpWMd1.mjs";
3
+ import { $ as URLFromString, $a as timeoutOrElse, $i as interrupt, $n as optionalKey$1, $o as UnknownError, $r as make$40, $s as fail$4, $t as isPattern, A as Null, Aa as request, Ad as constFalse, Ai as effectify, Al as reduce, An as escapeToken, Ao as fromStep, Ar as fromBody, As as mergeAll, At as isGreaterThan, Au as getOrUndefined, B as String$7, Ba as service, Bd as pipeArguments, Bi as fn, Bl as getOrUndefined$2, Bn as Objects, Br as retryAfterDelay, Bs as addFinalizer$1, Bt as isLessThanDate, C as Literal, Ca as orElseSucceed, Cd as isNullish, Ci as catchTag, Cl as isReadonlyArrayNonEmpty, Cr as jsonSchemaAnnotationKeys, Cs as buildWithScope, Ct as isBetweenCodePoints, Cu as flatMapNullishOr, D as Never, Da as provideService, Dd as isTagged, Di as contextWith, Dl as map$7, Dn as fromSchemaDraft07, Dr as redactUrl, Ds as empty$10, Dt as isBetweenSize, Du as getOrElse, E as Natural, Ea as provideContext, Ed as isString, Ei as context, En as errorWithPath, Er as fromInput, Et as isBetweenProperties, Eu as fromUndefinedOr, F as OptionFromOptional, Fd as dual, Fi as failSync, Fl as empty$9, Fn as encodeEffect, Fo as toStep, Fr as fromRecordUnsafe, Fs as succeed$4, Ft as isGreaterThanOrEqualToDate, Fu as none, G as TaggedClass$1, Gi as forkDetach, Gl as try_$1, Gn as decodeTo, Go as Clock, Gr as formatIso, Gs as make$44, Gt as isMaxLength, H as Struct, Ha as sleep, Hi as forEach$1, Hl as isSuccess$1, Hn as Suspend, Hr as setAll, Hs as close, Ht as isLessThanOrEqualToBigInt, I as Record, Ia as runSync, Id as flow, Ii as filterOrFail, Il as headUnsafe, In as Arrays, Io as catchDone, Ir as isRedactedName, Is as succeedContext, It as isIncluding, Iu as orElse$1, J as TaggedUnion, Ja as tap, Ji as fromOption, Jl as format$1, Jn as isJson, Jo as Done, Js as CurrentLogAnnotations, Jt as isMinCodePoints, K as TaggedError$1, Ka as suspend, Ki as forkIn, Kn as defaultParseOptions, Ko as currentTimeMillis, Ks as makeUnsafe$2, Kt as isMaxProperties, Ku as PipeInspectableProto, L as Redacted$4, La as scope, Ld as identity, Li as flatMap$1, Ll as fail$2, Ln as Filter, Lr as merge$3, Ls as suspend$2, Lt as isInt, Lu as orElseSome, M as Number$2, Ma as retry, Md as constUndefined, Mi as exit, Ml as span, Mn as getSubschemaKind, Mo as jittered, Mr as CurrentRedactedNames, Ms as orDie$1, Mt as isGreaterThanDate, Mu as isSome, N as Option, Na as runFork, Nd as constVoid, Ni as fail$1, Nl as assignProperty$1, Nn as decodeEffect$1, No as min, Nr as empty$6, Ns as provide$3, Nt as isGreaterThanOrEqualTo, Nu as map$8, O as NonEmptyArray, Oa as raceFirst, Od as isUndefined, Ol as match$3, On as fromSchemaDraft2020_12, Oo as exponential, Or as setAll$1, Os as fresh, Ot as isEndingWith, Ou as getOrNull, Pa as runForkWith, Pi as failCause, Pl as map$10, Pn as decodeUnknownEffect, Po as spaced, Pr as fromInput$1, Ps as provideMerge, Pt as isGreaterThanOrEqualToBigInt, Pu as match$2, Q as URL$1, Qa as timeoutOption, Qi as ignoreCause, Ql as isFinite, Qn as null_, Qo as TimeoutError, Qr as isRedacted, Qs as doneUnsafe, Qt as isMultipleOf, R as RedactedFromValue, Ra as scoped, Rc as forkUnsafe, Rd as memoize, Ri as flatMapEager, Rl as failVoid, Rn as FilterGroup, Rr as parseRetryAfter$1, Rs as unwrap$4, Rt as isLessThan, Ru as some, S as JsonObject$1, Sa as orDie, Sd as isNull, Si as catchReason, Sl as isCanonicalArrayIndex, Sn as withDecodingDefaultKey, Sr as annotationExcludedKeys, Ss as build, St as isBetweenBigInt, Su as flatMap$2, Ta as provide$1, Td as isObjectKeyword, Ti as catch_, Tl as last$1, Tn as pick, Tr as empty$5, Ts as effectContext, Tt as isBetweenLength, Tu as fromNullishOr, U as StructWithRest, Ua as succeed$1, Ui as forever, Ul as map$6, Un as Union$1, Uo as parse$1, Ur as empty$7, Us as fork, Ut as isLessThanOrEqualToDate, Uu as mapInput, V as StringForLiteralAutocomplete, Va as serviceOption, Vi as fnUntraced, Vl as isFailure$1, Vn as PropertySignature, Vo as Random$1, Vr as set, Vs as addFinalizerExit, Vt as isLessThanOrEqualTo, Vu as String$6, W as Symbol$1, Wa as succeedNone, Wi as forkChild, Wl as succeed$2, Wn as applyToSelfOrLastLinkEncoding, Wo as round, Wr as fromSetCookie, Wt as isMaxCodePoints, Wu as Prototype, X as Tuple, Xc as sync$1, Xi as gen, Xl as hours, Xn as isOptional, Xr as decode$3, Xs as TracerTimingEnabled, Xt as isMinProperties, Y as TrueLiterals, Ya as tapCause, Yi as fromResult, Yl as fromInputUnsafe$1, Yn as isNever, Yo as IllegalArgumentError, Ys as MinimumLogLevel, Yt as isMinLength, Z as TupleWithRest, Za as timeout, Zi as ignore, Zl as infinity, Zn as mapOrSame, Zo as StackTrace, Zr as encode, Zs as _await, Zt as isMinSize, _ as Exit, _a as onError, _c as void_$1, _d as hasProperty, _n as toEncoded$1, _o as equalBatchKeys, _r as transform$4, _s as makeFailReason, _t as encodeUnknownEffect, _u as merge$1, aa as logInfo, ac as makeUnsafe$1, ad as BaseProto, ai as all, al as TaggedError, an as isUnique, ao as updateContext, ar as toEncoded, as as filterInterruptors, at as Void, au as zero, b as Int$5, ba as onInterrupt, bc as LogToStderr$1, bd as isNotNullish, bi as catchIf, bl as isArray, bn as withConstructorDefault, br as InvalidValue$1, bs as reasonAnnotations, bt as is, bu as exists, c as Date$2, ca as map$5, cc as die$1, ci as annotateLogs, cl as has, cn as makeFilter$1, co as void_, cr as Transformation, cs as hasInterrupts, ct as declare, cu as add, da as mapError, dc as findErrorOption$1, di as asVoid, dl as appendAll, dn as optional$2, do as withFiber, dr as transformEffect$1, dt as decodeTo$1, du as getOption, ea as interruptible, ei as value, el as DisablePropagation, en as isPropertyNames, eo as tryPromise, er as replaceChecks, es as annotate$1, et as Uint8Array$2, eu as max, f as DateTimeUtcFromString, fa as match$4, fc as interrupt$1, fi as cached, fl as empty$4, fn as optionalKey, fr as transformOptional$1, fs as isDieReason, ft as decodeUnknownEffect$1, fu as getOrUndefined$1, g as Error$2, ga as never$1, gc as succeed$3, gi as catchCauseIf, gl as findLast, gn as toCodecStringTree, go as zipWith, gr as passthroughSubtype, gs as makeDieReason, gt as encodeTo, gu as makeUnsafe$3, h as DurationFromMillis, ha as matchEffect, hc as isSuccess, hi as catchCause, hl as findFirstIndex, hn as toCodecJson, ho as yieldNow, hr as passthrough, hs as isTimeoutError, ht as encodeEffect$1, hu as make$42, i as Boolean$4, ia as logFatal, ic as make$43, id as setStackTraceLimit, ii as addFinalizer, il as TaggedClass, in as isUUID, io as uninterruptibleMask, ir as string$1, is as fail$5, it as Unknown, iu as toMillis, j as NullOr, ja as result, jd as constTrue, ji as ensuring, jl as sort, jn as parseUriFragment, jo as isSchedule, jr as unwrap$3, js as mock, jt as isGreaterThanBigInt, ju as isNone, k as NonEmptyString$1, ka as repeat, kd as or, ki as die, kl as of, kn as getReferenceKey, ko as forever$1, kr as toString, ks as merge$2, kt as isFinite$1, ku as getOrThrow$1, la as mapBothEager, lc as fail$3, ld as format, li as as, ll as toPredicate, ln as makeFilterGroup, lr as passthrough$1, ls as hasInterruptsOnly, lt as decodeEffect, lu as empty$8, m as Duration, ma as matchCauseEffect, mc as isFailure, mi as callback, ml as findFirst, mn as tag, mo as withSpan$1, ms as isFailReason, mt as decodeUnknownSync, mu as getUnsafe, n as ArraySchema, na as logDebug, nc as isDone, nd as assignProperty, ni as acquireRelease, nl as EncodingError, nn as isSchemaError, no as undefined_, nr as resolveDescription, nt as UndefinedOr, nu as minutes, o as BooleanLiterals, oa as logWarning, oc as succeed$5, od as Class, oi as andThen, ol as taggedEnum, on as link$1, oo as updateService, or as toType$1, os as findErrorOption, ou as Reference, p as Defect, pi as cachedWithTTL, pn as suspend$1, po as withParentSpan, pt as decodeUnknownOption, pu as getOrUndefinedUnsafe, q as TaggedStruct, qa as sync, qi as forkScoped, ql as normalizeNonEmpty, qn as getIndexSignatureKeys, qr as fromDateUnsafe, qs as provide$2, qt as isMaxSize, r as BigInt$2, ra as logError, rc as isDoneUnsafe, rd as getStackTraceLimit, rl as Error$1, rn as isStartingWith, ro as uninterruptible, rr as resolveIdentifier, rs as done, rt as Union, ru as seconds, s as Class$1, sa as makeSpanScoped, sd as NodeInspectSymbol, si as annotateCurrentSpan, sl as compose, sn as make$41, so as useSpan, sr as unknown$1, ss as fromReasons, st as check, su as Service, t as Any, ta as isEffect, tc as into, td as withFiber$1, ti as stringOrRedacted, tl as ParentSpan, tn as isSchema, to as try_, tr as resolveAt, tt as Uint8ArrayFromBase64, tu as millis, ua as mapEager, uc as failCause$1, ud as redact, ui as asSome, ul as Array$1, un as mutable, uo as whileLoop, ur as transform$3, us as interruptors, ut as decodeSync, uu as get$2, v as FalseLiterals, va as onExit, vd as isIterable, vi as catchEager, vl as fromIterable, vn as toJsonSchemaDocument, vr as transformEffect, vs as map$9, vt as fromJsonString, w as Literals$2, wa as promise, wd as isObject$1, wi as catchTags, wl as join$2, wn as omit, wr as CurrentRedactedNames$1, ws as effect, wt as isBetweenDate, x as Json, xa as option$1, xd as isNotUndefined, xl as isArrayNonEmpty, xn as withDecodingDefault, xr as Pointer, xs as squash, xt as isBetween, xu as filter$1, y as Finite, yc as ConsoleRef, yd as isNotNull, yi as catchFilter, yl as headNonEmpty, yn as toType, yo as TaggedClass$2, yr as transformOptional, ys as pretty, yt as instanceOf, yu as all$1, z as SchemaError, zd as pipe, zl as getOrThrow, zn as Literal$1, zo as isDoneCause, zr as remove$1, zs as Scope, zt as isLessThanBigInt, zu as toArray } from "./Schema-D629S5yu.mjs";
4
+ import { $t as offerUnsafe, A as catchTags$1, At as takeUntil, B as failCause$3, Bt as unwrap$5, C as make$47, D as catchCause$1, Dt as succeed$6, E as callback$1, Et as splitLines, F as drainFork, Ft as transduce, G as flattenArray, Gt as endUnsafe, H as filterMap, Ht as makeUnsafe$4, I as drop, It as unwrap$6, Jt as failCauseUnsafe, K as flattenIterable, Kt as fail$7, L as empty$11, Lt as fromTransform$1, M as concat$1, Mt as tap$1, N as decodeText, Nt as tapError, Ot as suspend$3, P as die$2, Pt as toAsyncIterable, Qt as offerAllUnsafe, R as ensuring$1, Rt as mapDone, S as isAiErrorReason, St as runForEachArray, T as broadcast, Tt as scoped$1, Ut as bounded, V as filter$2, Vt as make$48, W as flatten, Wt as end, X as fromChannel$1, Xt as offer, Y as fromAsyncIterable, Yt as make$46, Z as fromEffect, Zt as offerAll, _ as ToolkitRequiredError, _n as toLowerCase, _t as run$4, a as InvalidOutputError, at as mapArray, b as buildErrorDescription, bt as runFold, c as InvalidToolResultError, cn as update, ct as mapError$1, d as RateLimitError, dn as interrupt$2, dt as mkString, en as poll, et as fromPull, f as StructuredOutputError, fn as interruptAll, ft as onExit$1, g as ToolResultEncodingError, gn as camelToSnake, gt as provideService$1, h as ToolParameterValidationError, hn as runIn, ht as provideContext$1, i as InternalProviderError, in as unbounded, it as map$11, j as catch_$1, jt as takeWhile, k as catchReason$1, kt as take$1, l as NetworkError, ln as await_, lt as merge$4, m as ToolNotFoundError, mn as join$3, mt as pipeThroughChannel, n as AuthenticationError, nn as sliding, nt as fromReadableStream, o as InvalidRequestError$1, on as make$45, ot as mapArrayEffect, p as ToolConfigurationError, pn as interruptAllAs, pt as orDie$2, q as fromArray, qt as failCause$2, r as HttpResponseDetails$1, rn as take, rt as isStream, s as InvalidResponseError, sn as set$1, st as mapEffect$1, t as AiError, tn as shutdownUnsafe, tt as fromQueue, u as QuotaExhaustedError, un as getCurrent, ut as mergeAll$1, v as UnknownError$1, vt as runCollect, w as reasonFromHttpStatus, wt as runLast, x as isAiError, xt as runForEach, y as UnsupportedSchemaError, yt as runDrain, z as fail$6, zt as toTransform } from "./AiError-fiHIiGOy.mjs";
5
+ import { n as makeUnsafe$5 } from "./Latch-D1909CI6.mjs";
7
6
  import { a as mergeCapabilities, c as safeParse, i as Protocol$1, n as assertToolsCallTaskCapability, o as getLiteralValue, r as AjvJsonSchemaValidator, s as getObjectShape, t as assertClientRequestTaskCapability } from "./helpers-CljL9OKa.mjs";
8
7
  import { $ as array, B as SUPPORTED_PROTOCOL_VERSIONS, C as LATEST_PROTOCOL_VERSION, D as ListResourcesResultSchema, E as ListResourceTemplatesResultSchema, I as PromptListChangedNotificationSchema, J as isJSONRPCResultResponse, N as McpError, Q as any, R as ReadResourceResultSchema, S as JSONRPCMessageSchema, T as ListPromptsResultSchema, U as ToolListChangedNotificationSchema, W as isInitializedNotification, Z as ZodNumber, at as string$2, b as InitializeResultSchema, c as CreateMessageResultSchema, d as ElicitRequestSchema, et as boolean, f as ElicitResultSchema, h as GetPromptResultSchema, it as object, j as ListToolsResultSchema, l as CreateMessageResultWithToolsSchema, lt as NEVER, m as ErrorCode, n as CallToolResultSchema, nt as looseObject, o as CompleteResultSchema, ot as url, p as EmptyResultSchema, q as isJSONRPCRequest, rt as number$1, s as CreateMessageRequestSchema, st as _coercedNumber, tt as literal, u as CreateTaskResultSchema, w as ListChangedOptionsBaseSchema, z as ResourceListChangedNotificationSchema } from "./types-LcwjLVkt.mjs";
9
8
  import { createRequire } from "node:module";
@@ -210,13 +209,13 @@ const binaryUnits = [
210
209
  ];
211
210
  const allUnits = [...decimalUnits, ...binaryUnits.slice(1)];
212
211
  const unitsByName = new Map(allUnits.flatMap((unit) => unit.names.map((name) => [name, unit])));
213
- const make$40 = (value) => value;
212
+ const make$39 = (value) => value;
214
213
  const invalid = (message) => {
215
214
  throw new Error(`Invalid ByteSize: ${message}`);
216
215
  };
217
216
  const fromNumber = (input) => {
218
217
  if (!Number.isSafeInteger(input) || input < 0) return invalid(`expected a non-negative safe integer, received ${input}`);
219
- return make$40(BigInt(input));
218
+ return make$39(BigInt(input));
220
219
  };
221
220
  const fromStringUnsafe = (input) => {
222
221
  const match = /^\s*(\d+)(?:\.(\d+))?\s*([A-Za-z]+)\s*$/.exec(input);
@@ -227,13 +226,13 @@ const fromStringUnsafe = (input) => {
227
226
  const scale = BigInt(10) ** BigInt(fraction.length);
228
227
  const numerator = BigInt(match[1] + fraction) * unit.factor;
229
228
  if (numerator % scale !== bigint0) return invalid(`${JSON.stringify(input)} does not represent an integral number of bytes`);
230
- return make$40(numerator / scale);
229
+ return make$39(numerator / scale);
231
230
  };
232
231
  const fromInputUnsafe = (input) => {
233
232
  switch (typeof input) {
234
233
  case "bigint":
235
234
  if (input < bigint0) return invalid(`expected a non-negative bigint, received ${input}`);
236
- return make$40(input);
235
+ return make$39(input);
237
236
  case "number": return fromNumber(input);
238
237
  case "string": return fromStringUnsafe(input);
239
238
  }
@@ -686,7 +685,7 @@ const isIgnorable = (error) => isMissing(error) || error.reason._tag === "Permis
686
685
  const isNotLink = (error) => isIgnorable(error) || error.reason._tag === "Unknown";
687
686
  const DIRECTORY_CONCURRENCY = 16;
688
687
  const byName = mapInput(String$6, (entry) => entry.name);
689
- const make$39 = (fs) => (pattern, options) => walk(fs, compile([pattern], options?.dot ?? false), options);
688
+ const make$38 = (fs) => (pattern, options) => walk(fs, compile([pattern], options?.dot ?? false), options);
690
689
  const walk = fnUntraced(function* (fs, compiled, options) {
691
690
  if (compiled.initial.size === 0) return [];
692
691
  const root = options?.root ?? "";
@@ -788,7 +787,7 @@ const walk = fnUntraced(function* (fs, compiled, options) {
788
787
  })), _await(failed));
789
788
  });
790
789
  // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/PlatformError.js
791
- const TypeId$31 = "~effect/PlatformError";
790
+ const TypeId$30 = "~effect/PlatformError";
792
791
  var BadArgument = class extends TaggedError("BadArgument") {
793
792
  get message() {
794
793
  return `${this.module}.${this.method}${this.description ? `: ${this.description}` : ""}`;
@@ -807,7 +806,7 @@ var PlatformError = class extends TaggedError("PlatformError") {
807
806
  });
808
807
  else super({ reason });
809
808
  }
810
- [TypeId$31] = TypeId$31;
809
+ [TypeId$30] = TypeId$30;
811
810
  get message() {
812
811
  return this.reason.message;
813
812
  }
@@ -815,7 +814,7 @@ var PlatformError = class extends TaggedError("PlatformError") {
815
814
  const systemError = (options) => new PlatformError(new SystemError(options));
816
815
  const badArgument = (options) => new PlatformError(new BadArgument(options));
817
816
  // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Sink.js
818
- const TypeId$30 = "~effect/Sink";
817
+ const TypeId$29 = "~effect/Sink";
819
818
  const endVoid = succeed$1([void 0]);
820
819
  const sinkVariance = {
821
820
  _A: identity,
@@ -825,12 +824,12 @@ const sinkVariance = {
825
824
  _R: identity
826
825
  };
827
826
  const SinkProto = {
828
- [TypeId$30]: sinkVariance,
827
+ [TypeId$29]: sinkVariance,
829
828
  pipe() {
830
829
  return pipeArguments(this, arguments);
831
830
  }
832
831
  };
833
- const isSink = (u) => hasProperty(u, TypeId$30);
832
+ const isSink = (u) => hasProperty(u, TypeId$29);
834
833
  const fromChannel = (channel) => fromTransform((upstream, scope) => toTransform(channel)(upstream, scope).pipe(flatMap$1(forever({ disableYield: true })), catchDone(succeed$1)));
835
834
  const fromTransform = (transform) => {
836
835
  const self = Object.create(SinkProto);
@@ -852,7 +851,7 @@ const forEach = (f) => forEachArray(forEach$1((_) => f(_), { discard: true }));
852
851
  const forEachArray = (f) => fromTransform((upstream) => upstream.pipe(flatMap$1(f), forever({ disableYield: true }), catchDone(() => endVoid)));
853
852
  const unwrap$2 = (effect) => fromChannel(unwrap$5(map$5(effect, toChannel)));
854
853
  // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/internal/rcRef.js
855
- const TypeId$29 = "~effect/RcRef";
854
+ const TypeId$28 = "~effect/RcRef";
856
855
  const stateEmpty = { _tag: "Empty" };
857
856
  const stateClosed = { _tag: "Closed" };
858
857
  const variance = {
@@ -860,7 +859,7 @@ const variance = {
860
859
  _E: identity
861
860
  };
862
861
  var RcRefImpl = class {
863
- [TypeId$29] = variance;
862
+ [TypeId$28] = variance;
864
863
  pipe() {
865
864
  return pipeArguments(this, arguments);
866
865
  }
@@ -876,7 +875,7 @@ var RcRefImpl = class {
876
875
  this.idleTimeToLive = idleTimeToLive;
877
876
  }
878
877
  };
879
- const make$38 = (options) => withFiber((fiber) => {
878
+ const make$37 = (options) => withFiber((fiber) => {
880
879
  const context = fiber.context;
881
880
  const scope = get$2(context, Scope);
882
881
  const ref = new RcRefImpl(options.acquire, context, scope, options.idleTimeToLive !== void 0 ? fromInputUnsafe$1(options.idleTimeToLive) : void 0);
@@ -979,16 +978,16 @@ const invalidate$1 = (self_) => {
979
978
  }));
980
979
  };
981
980
  // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/RcRef.js
982
- const make$37 = make$38;
981
+ const make$36 = make$37;
983
982
  const get = get$1;
984
983
  const invalidate = invalidate$1;
985
984
  // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/FileSystem.js
986
- const TypeId$28 = "~effect/FileSystem";
985
+ const TypeId$27 = "~effect/FileSystem";
987
986
  const FileSystem = Service("effect/FileSystem");
988
- const make$36 = (impl) => FileSystem.of({
987
+ const make$35 = (impl) => FileSystem.of({
989
988
  ...impl,
990
- [TypeId$28]: TypeId$28,
991
- glob: make$39(impl),
989
+ [TypeId$27]: TypeId$27,
990
+ glob: make$38(impl),
992
991
  exists: (path) => pipe(impl.access(path), as(true), catchTag("PlatformError", (e) => e.reason._tag === "NotFound" ? succeed$1(false) : fail$1(e))),
993
992
  readFileString: (path, encoding) => flatMap$1(impl.readFile(path), (_) => try_({
994
993
  try: () => new TextDecoder(encoding).decode(_),
@@ -1035,11 +1034,11 @@ const make$36 = (impl) => FileSystem.of({
1035
1034
  const FileTypeId = "~effect/FileSystem/File";
1036
1035
  var WatchBackend = class extends Service()("effect/FileSystem/WatchBackend") {};
1037
1036
  // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Path.js
1038
- const TypeId$27 = "~effect/Path";
1037
+ const TypeId$26 = "~effect/Path";
1039
1038
  const Path$3 = Service("effect/Path");
1040
- const make$35 = (impl) => Path$3.of({
1039
+ const make$34 = (impl) => Path$3.of({
1041
1040
  ...impl,
1042
- [TypeId$27]: TypeId$27,
1041
+ [TypeId$26]: TypeId$26,
1043
1042
  resolveWithin(root, input) {
1044
1043
  if (impl.parse(input).root !== "") return none();
1045
1044
  const base = impl.resolve(root);
@@ -1092,16 +1091,16 @@ for (let i = 0; i < 64; i++) codes[alphabet.charCodeAt(i)] = i;
1092
1091
  const decodeString = (str) => map$6(decode$2(str), (_) => decoder.decode(_));
1093
1092
  const decoder = new TextDecoder();
1094
1093
  // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Terminal.js
1095
- const TypeId$26 = "~effect/Terminal";
1094
+ const TypeId$25 = "~effect/Terminal";
1096
1095
  const QuitErrorTypeId = "~effect/Terminal/QuitError";
1097
1096
  var QuitError = class extends Error$2("QuitError")({ _tag: tag("QuitError") }) {
1098
1097
  [QuitErrorTypeId] = QuitErrorTypeId;
1099
1098
  };
1100
1099
  const isQuitError = (u) => hasProperty(u, QuitErrorTypeId);
1101
1100
  const Terminal = Service("effect/Terminal");
1102
- const make$34 = (impl) => Terminal.of({
1101
+ const make$33 = (impl) => Terminal.of({
1103
1102
  ...impl,
1104
- [TypeId$26]: TypeId$26
1103
+ [TypeId$25]: TypeId$25
1105
1104
  });
1106
1105
  // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/cli/internal/ansi.js
1107
1106
  const ESC = "\x1B[";
@@ -1156,8 +1155,8 @@ const eraseLines = (rows) => {
1156
1155
  return command;
1157
1156
  };
1158
1157
  // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/cli/Prompt.js
1159
- const TypeId$25 = "~effect/cli/Prompt";
1160
- const isPrompt$1 = (u) => hasProperty(u, TypeId$25);
1158
+ const TypeId$24 = "~effect/cli/Prompt";
1159
+ const isPrompt$1 = (u) => hasProperty(u, TypeId$24);
1161
1160
  const defaultTheme = {
1162
1161
  prefix: "?",
1163
1162
  arrowUp: "\u2191",
@@ -1324,7 +1323,7 @@ const Int$4 = (options) => {
1324
1323
  });
1325
1324
  };
1326
1325
  const map$4 = dual(2, (self, f) => flatMap(self, (a) => succeed(f(a))));
1327
- const Password = (options) => basePrompt(options, "password").pipe(map$4(make$44));
1326
+ const Password = (options) => basePrompt(options, "password").pipe(map$4(make$40));
1328
1327
  const run$3 = fnUntraced(function* (self) {
1329
1328
  const terminal = yield* Terminal;
1330
1329
  const input = yield* cached(terminal.readInput);
@@ -1400,7 +1399,7 @@ const proto = {
1400
1399
  return run$3(this);
1401
1400
  }
1402
1401
  }),
1403
- [TypeId$25]: { _Output: (_) => _ }
1402
+ [TypeId$24]: { _Output: (_) => _ }
1404
1403
  };
1405
1404
  const runWithInput = (prompt, terminal, input) => suspend(() => {
1406
1405
  const op = prompt;
@@ -2613,11 +2612,11 @@ const entriesToDisplay = (cursor, total, maxVisible) => {
2613
2612
  };
2614
2613
  };
2615
2614
  // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/http/HttpBody.js
2616
- const TypeId$24 = "~effect/http/HttpBody";
2615
+ const TypeId$23 = "~effect/http/HttpBody";
2617
2616
  var Proto$14 = class {
2618
- [TypeId$24];
2617
+ [TypeId$23];
2619
2618
  constructor() {
2620
- this[TypeId$24] = TypeId$24;
2619
+ this[TypeId$23] = TypeId$23;
2621
2620
  }
2622
2621
  [NodeInspectSymbol]() {
2623
2622
  return this.toJSON();
@@ -2674,8 +2673,8 @@ const text = (body, contentType) => {
2674
2673
  const jsonUnsafe = (body, contentType) => text(JSON.stringify(body), contentType ?? "application/json");
2675
2674
  const urlParams = (urlParams, contentType) => text(toString(fromInput(urlParams)), contentType ?? "application/x-www-form-urlencoded");
2676
2675
  // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/http/HttpClientError.js
2677
- const TypeId$23 = "~effect/http/HttpClientError";
2678
- const isHttpClientError = (u) => hasProperty(u, TypeId$23);
2676
+ const TypeId$22 = "~effect/http/HttpClientError";
2677
+ const isHttpClientError = (u) => hasProperty(u, TypeId$22);
2679
2678
  var HttpClientError = class extends TaggedError("HttpClientError") {
2680
2679
  constructor(props) {
2681
2680
  if ("cause" in props.reason) super({
@@ -2684,7 +2683,7 @@ var HttpClientError = class extends TaggedError("HttpClientError") {
2684
2683
  });
2685
2684
  else super(props);
2686
2685
  }
2687
- [TypeId$23] = TypeId$23;
2686
+ [TypeId$22] = TypeId$22;
2688
2687
  get request() {
2689
2688
  return this.reason.request;
2690
2689
  }
@@ -2803,12 +2802,12 @@ const updateContentLength = (headers, body) => {
2803
2802
  };
2804
2803
  // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/http/Url.js
2805
2804
  var UrlError = class extends TaggedError("UrlError") {};
2806
- const make$33 = (url, params, hash) => try_$1({
2805
+ const make$32 = (url, params, hash) => try_$1({
2807
2806
  try: () => {
2808
2807
  const urlInstance = new URL(url, baseUrl());
2809
2808
  for (let i = 0; i < params.params.length; i++) {
2810
2809
  const [key, value] = params.params[i];
2811
- if (value !== void 0) urlInstance.searchParams.append(key, unwrap$4(value));
2810
+ if (value !== void 0) urlInstance.searchParams.append(key, unwrap$3(value));
2812
2811
  }
2813
2812
  if (hash !== void 0) urlInstance.hash = hash;
2814
2813
  return urlInstance;
@@ -2830,9 +2829,9 @@ const fromString = (url, base) => try_$1({
2830
2829
  catch: () => new IllegalArgumentError(`Invalid URL: "${url}"${base !== void 0 ? ` with base "${base}"` : ""}`)
2831
2830
  });
2832
2831
  // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/http/HttpClientRequest.js
2833
- const TypeId$22 = "~effect/http/HttpClientRequest";
2832
+ const TypeId$21 = "~effect/http/HttpClientRequest";
2834
2833
  const Proto$13 = {
2835
- [TypeId$22]: TypeId$22,
2834
+ [TypeId$21]: TypeId$21,
2836
2835
  ...BaseProto,
2837
2836
  toJSON() {
2838
2837
  return {
@@ -2859,13 +2858,13 @@ function makeWith$3(method, url, urlParams, hash, headers, body) {
2859
2858
  self.body = body;
2860
2859
  return self;
2861
2860
  }
2862
- const empty$2 = makeWith$3("GET", "", empty$8, none(), empty$9, empty$3);
2863
- const make$32 = (method) => (url, options) => modify(empty$2, {
2861
+ const empty$2 = makeWith$3("GET", "", empty$5, none(), empty$6, empty$3);
2862
+ const make$31 = (method) => (url, options) => modify(empty$2, {
2864
2863
  method,
2865
2864
  url,
2866
2865
  ...options ?? void 0
2867
2866
  });
2868
- const post = make$32("POST");
2867
+ const post = make$31("POST");
2869
2868
  const modify = dual(2, (self, options) => {
2870
2869
  let result = self;
2871
2870
  if (options.method) result = setMethod(result, options.method);
@@ -2912,12 +2911,12 @@ const setBody = dual(2, (self, body) => {
2912
2911
  const bodyJsonUnsafe = dual(2, (self, body) => setBody(self, jsonUnsafe(body)));
2913
2912
  const bodyUrlParams = dual(2, (self, input) => setBody(self, urlParams(fromInput(input))));
2914
2913
  function toUrl(self) {
2915
- const r = make$33(self.url, self.urlParams, getOrUndefined(self.hash));
2914
+ const r = make$32(self.url, self.urlParams, getOrUndefined(self.hash));
2916
2915
  if (isSuccess$1(r)) return some(r.success);
2917
2916
  return none();
2918
2917
  }
2919
2918
  // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/http/HttpIncomingMessage.js
2920
- const TypeId$21 = "~effect/http/HttpIncomingMessage";
2919
+ const TypeId$20 = "~effect/http/HttpIncomingMessage";
2921
2920
  const schemaBodyJson = (schema, options) => {
2922
2921
  const decode = decodeEffect(toCodecJson(schema));
2923
2922
  const decodeJson = options?.reviver === void 0 ? void 0 : decodeEffect(fromJsonString(toCodecJson(schema), options));
@@ -2935,7 +2934,7 @@ const inspect = (self, that) => {
2935
2934
  const WebSourceSymbol = "~effect/http/HttpClientResponse/WebSource";
2936
2935
  const getWebSource = (self) => self[WebSourceSymbol]?.();
2937
2936
  // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/http/HttpClientResponse.js
2938
- const TypeId$20 = "~effect/http/HttpClientResponse";
2937
+ const TypeId$19 = "~effect/http/HttpClientResponse";
2939
2938
  const fromWeb = (request, source) => new WebHttpClientResponse(request, source);
2940
2939
  const filterStatusOk$1 = (self) => self.status >= 200 && self.status < 300 ? succeed$1(self) : fail$1(new HttpClientError({ reason: new StatusCodeError({
2941
2940
  response: self,
@@ -2943,16 +2942,16 @@ const filterStatusOk$1 = (self) => self.status >= 200 && self.status < 300 ? suc
2943
2942
  description: "non 2xx status code"
2944
2943
  }) }));
2945
2944
  var WebHttpClientResponse = class extends Class {
2946
- [TypeId$21];
2947
2945
  [TypeId$20];
2946
+ [TypeId$19];
2948
2947
  request;
2949
2948
  source;
2950
2949
  constructor(request, source) {
2951
2950
  super();
2952
2951
  this.request = request;
2953
2952
  this.source = source;
2954
- this[TypeId$21] = TypeId$21;
2955
2953
  this[TypeId$20] = TypeId$20;
2954
+ this[TypeId$19] = TypeId$19;
2956
2955
  }
2957
2956
  toJSON() {
2958
2957
  return inspect(this, {
@@ -3096,8 +3095,8 @@ const addHeaderAttributes = (span, phase, headers, filter, redactedNames) => {
3096
3095
  }
3097
3096
  };
3098
3097
  // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/http/HttpClient.js
3099
- const TypeId$19 = "~effect/http/HttpClient";
3100
- const isHttpClient = (u) => hasProperty(u, TypeId$19);
3098
+ const TypeId$18 = "~effect/http/HttpClient";
3099
+ const isHttpClient = (u) => hasProperty(u, TypeId$18);
3101
3100
  const HttpClient = Service("effect/HttpClient");
3102
3101
  const transform$2 = dual(2, (self, f) => makeWith$2(flatMap$1((request) => f(self.postprocess(succeed$1(request)), request)), self.preprocess));
3103
3102
  const transformResponse = dual(2, (self, f) => makeWith$2((request) => f(self.postprocess(request)), self.preprocess));
@@ -3112,7 +3111,7 @@ const makeWith$2 = (postprocess, preprocess) => {
3112
3111
  return self;
3113
3112
  };
3114
3113
  const Proto$12 = {
3115
- [TypeId$19]: TypeId$19,
3114
+ [TypeId$18]: TypeId$18,
3116
3115
  pipe() {
3117
3116
  return pipeArguments(this, arguments);
3118
3117
  },
@@ -3121,13 +3120,13 @@ const Proto$12 = {
3121
3120
  return { _id: "effect/HttpClient" };
3122
3121
  },
3123
3122
  ...Object.fromEntries(allShort.map(([fullMethod, method]) => [method, function(url, options) {
3124
- return this.execute(make$32(fullMethod)(url, options));
3123
+ return this.execute(make$31(fullMethod)(url, options));
3125
3124
  }]))
3126
3125
  };
3127
- const make$31 = (f) => makeWith$2((effect) => flatMap$1(effect, (request) => withFiber((fiber) => {
3126
+ const make$30 = (f) => makeWith$2((effect) => flatMap$1(effect, (request) => withFiber((fiber) => {
3128
3127
  const scopedController = scopedRequests.get(request);
3129
3128
  const controller = scopedController ?? new AbortController();
3130
- const urlResult = make$33(request.url, request.urlParams, getOrUndefined(request.hash));
3129
+ const urlResult = make$32(request.url, request.urlParams, getOrUndefined(request.hash));
3131
3130
  if (isFailure$1(urlResult)) return fail$1(new HttpClientError({ reason: new InvalidUrlError({
3132
3131
  request,
3133
3132
  cause: urlResult.failure
@@ -3238,7 +3237,7 @@ const followRedirects = dual((args) => isHttpClient(args[0]), (self, maxRedirect
3238
3237
  }
3239
3238
  const hash = url.hash === "" ? none() : some(url.hash.slice(1));
3240
3239
  url.hash = "";
3241
- nextRequest = makeWith$3(nextRequest.method, url.href, empty$8, hash, nextRequest.headers, nextRequest.body);
3240
+ nextRequest = makeWith$3(nextRequest.method, url.href, empty$5, hash, nextRequest.headers, nextRequest.body);
3242
3241
  return andThen(sync(() => responseControllers.get(response)?.abort()), loop(succeed$1(nextRequest), redirects + 1));
3243
3242
  });
3244
3243
  });
@@ -3295,8 +3294,8 @@ var InterruptibleResponse = class {
3295
3294
  this.original = original;
3296
3295
  this.controller = controller;
3297
3296
  }
3297
+ [TypeId$19] = TypeId$19;
3298
3298
  [TypeId$20] = TypeId$20;
3299
- [TypeId$21] = TypeId$21;
3300
3299
  applyInterrupt(effect) {
3301
3300
  return suspend(() => {
3302
3301
  responseRegistry.unregister(this.original);
@@ -3557,7 +3556,7 @@ const readableToPullUnsafe = (options) => {
3557
3556
  const readable = options.readable;
3558
3557
  const chunkSize = options.chunkSize ?? 4096;
3559
3558
  const closeOnDone = options.closeOnDone ?? true;
3560
- const exit = options.exit ?? make$46(void 0);
3559
+ const exit = options.exit ?? make$45(void 0);
3561
3560
  const latch = options.latch ?? makeUnsafe$5(false);
3562
3561
  function onReadable() {
3563
3562
  latch.openUnsafe();
@@ -3592,13 +3591,13 @@ const readableToPullUnsafe = (options) => {
3592
3591
  else cleanup();
3593
3592
  })), pull);
3594
3593
  };
3595
- const defaultOnError = (error) => new UnknownError$1(error);
3594
+ const defaultOnError = (error) => new UnknownError(error);
3596
3595
  const toMaxBytes = (maxBytes) => maxBytes === void 0 || maxBytes === Infinity ? void 0 : Number(fromInputUnsafe(maxBytes));
3597
3596
  // node_modules/.pnpm/@effect+platform-node@4.1.1_effect@4.1.1_redis@6.2.1_@opentelemetry+api@1.10.0_/node_modules/@effect/platform-node/dist/NodeHttpIncomingMessage.js
3598
3597
  const textDecoder = new TextDecoder();
3599
3598
  const formDecoder$1 = new TextDecoder("utf-8", { ignoreBOM: true });
3600
3599
  var NodeHttpIncomingMessage = class extends Class {
3601
- [TypeId$21];
3600
+ [TypeId$20];
3602
3601
  source;
3603
3602
  onError;
3604
3603
  remoteAddressOverride;
@@ -3606,7 +3605,7 @@ var NodeHttpIncomingMessage = class extends Class {
3606
3605
  closeOnDone = true;
3607
3606
  constructor(source, onError, remoteAddressOverride) {
3608
3607
  super();
3609
- this[TypeId$21] = TypeId$21;
3608
+ this[TypeId$20] = TypeId$20;
3610
3609
  this.source = source;
3611
3610
  this.onError = onError;
3612
3611
  this.remoteAddressOverride = remoteAddressOverride;
@@ -3667,15 +3666,15 @@ var NodeHttpIncomingMessage = class extends Class {
3667
3666
  function noopErrorHandler(_) {}
3668
3667
  const formDecoder = new TextDecoder("utf-8", { ignoreBOM: true });
3669
3668
  var UndiciResponse = class extends Class {
3670
- [TypeId$21];
3671
3669
  [TypeId$20];
3670
+ [TypeId$19];
3672
3671
  request;
3673
3672
  source;
3674
3673
  url;
3675
3674
  constructor(request, source, url) {
3676
3675
  super();
3677
- this[TypeId$21] = TypeId$21;
3678
3676
  this[TypeId$20] = TypeId$20;
3677
+ this[TypeId$19] = TypeId$19;
3679
3678
  this.request = request;
3680
3679
  this.source = source;
3681
3680
  this.url = url;
@@ -3692,7 +3691,7 @@ var UndiciResponse = class extends Class {
3692
3691
  get cookies() {
3693
3692
  if (this.cachedCookies !== void 0) return this.cachedCookies;
3694
3693
  const header = this.source.headers["set-cookie"];
3695
- return this.cachedCookies = header ? fromSetCookie(header) : empty$10;
3694
+ return this.cachedCookies = header ? fromSetCookie(header) : empty$7;
3696
3695
  }
3697
3696
  get remoteAddress() {
3698
3697
  return none();
@@ -3772,7 +3771,7 @@ var UndiciResponse = class extends Class {
3772
3771
  return pipeArguments(this, arguments);
3773
3772
  }
3774
3773
  };
3775
- const loadUpgrade = promise(() => import("./upgrade-HMRGSqq8.mjs"));
3774
+ const loadUpgrade = promise(() => import("./upgrade-E_f-q2h8.mjs"));
3776
3775
  const takeOver = (conn, head, signal) => {
3777
3776
  if (head !== void 0 && head.length > 0) conn.unshift(head);
3778
3777
  conn.on("error", constVoid);
@@ -3803,7 +3802,7 @@ const makeAgent = (options) => zipWith(acquireRelease(sync(() => new http.Agent(
3803
3802
  const layerAgentOptions = flow(makeAgent, effect(HttpAgent));
3804
3803
  const makeNodeHttp = gen(function* () {
3805
3804
  const agent = yield* HttpAgent;
3806
- return make$31((request, url, signal) => {
3805
+ return make$30((request, url, signal) => {
3807
3806
  const nodeRequest = url.protocol === "https:" ? https.request(url, {
3808
3807
  agent: agent.https,
3809
3808
  method: request.method,
@@ -3936,7 +3935,7 @@ const waitForFinish = (nodeRequest, request) => callback((resume) => {
3936
3935
  });
3937
3936
  });
3938
3937
  var NodeHttpResponse = class extends NodeHttpIncomingMessage {
3939
- [TypeId$20];
3938
+ [TypeId$19];
3940
3939
  request;
3941
3940
  url;
3942
3941
  upgraded;
@@ -3946,7 +3945,7 @@ var NodeHttpResponse = class extends NodeHttpIncomingMessage {
3946
3945
  response: this,
3947
3946
  cause
3948
3947
  }) }));
3949
- this[TypeId$20] = TypeId$20;
3948
+ this[TypeId$19] = TypeId$19;
3950
3949
  this.request = request;
3951
3950
  this.url = url;
3952
3951
  this.upgraded = upgraded;
@@ -3961,7 +3960,7 @@ var NodeHttpResponse = class extends NodeHttpIncomingMessage {
3961
3960
  get cookies() {
3962
3961
  if (this.cachedCookies !== void 0) return this.cachedCookies;
3963
3962
  const header = this.source.headers["set-cookie"];
3964
- return this.cachedCookies = header ? fromSetCookie(header) : empty$10;
3963
+ return this.cachedCookies = header ? fromSetCookie(header) : empty$7;
3965
3964
  }
3966
3965
  get formData() {
3967
3966
  return tryPromise({
@@ -4038,10 +4037,10 @@ const getErrorReported = (u) => {
4038
4037
  return true;
4039
4038
  };
4040
4039
  // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Stdio.js
4041
- const TypeId$18 = "~effect/Stdio";
4042
- const Stdio = Service(TypeId$18);
4043
- const make$30 = (options) => ({
4044
- [TypeId$18]: TypeId$18,
4040
+ const TypeId$17 = "~effect/Stdio";
4041
+ const Stdio = Service(TypeId$17);
4042
+ const make$29 = (options) => ({
4043
+ [TypeId$17]: TypeId$17,
4045
4044
  stdinIsTerminal: succeed$1(false),
4046
4045
  stdoutIsTerminal: succeed$1(false),
4047
4046
  stderrIsTerminal: succeed$1(false),
@@ -4085,7 +4084,7 @@ function makeProvider(load, mapInput) {
4085
4084
  function makeSource(get, transform) {
4086
4085
  return makeProvider((path) => get(transform(path)), (f) => makeSource(get, (path) => f(transform(path))));
4087
4086
  }
4088
- function make$29(get) {
4087
+ function make$28(get) {
4089
4088
  return makeSource(get, identityPath);
4090
4089
  }
4091
4090
  function emptyStringAsMissing(value, preserveEmptyStrings) {
@@ -4094,7 +4093,7 @@ function emptyStringAsMissing(value, preserveEmptyStrings) {
4094
4093
  function fromEnvRecord(env, options) {
4095
4094
  const preserveEmptyStrings = options?.preserveEmptyStrings === true;
4096
4095
  const trie = buildEnvTrie(env);
4097
- return make$29((path) => succeed$1(nodeAtEnv(trie, env, path, preserveEmptyStrings)));
4096
+ return make$28((path) => succeed$1(nodeAtEnv(trie, env, path, preserveEmptyStrings)));
4098
4097
  }
4099
4098
  function fromEnv(options) {
4100
4099
  return fromEnvRecord(options?.env ?? {
@@ -4134,7 +4133,7 @@ function trieNodeAt(root, path) {
4134
4133
  return node;
4135
4134
  }
4136
4135
  // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Config.js
4137
- const TypeId$17 = "~effect/Config";
4136
+ const TypeId$16 = "~effect/Config";
4138
4137
  var ConfigError = class {
4139
4138
  _tag = "ConfigError";
4140
4139
  name = "ConfigError";
@@ -4156,12 +4155,12 @@ const Proto$10 = {
4156
4155
  return this.parse(fiber.getRef(ConfigProvider));
4157
4156
  }
4158
4157
  }),
4159
- [TypeId$17]: TypeId$17,
4158
+ [TypeId$16]: TypeId$16,
4160
4159
  toJSON() {
4161
4160
  return { _id: "Config" };
4162
4161
  }
4163
4162
  };
4164
- function make$28(evaluator) {
4163
+ function make$27(evaluator) {
4165
4164
  const self = Object.create(Proto$10);
4166
4165
  self.evaluator = evaluator;
4167
4166
  self.parse = (provider) => flatMapEager(evaluator(provider, []), fromResult);
@@ -4169,10 +4168,10 @@ function make$28(evaluator) {
4169
4168
  }
4170
4169
  const evaluateAt = (self, provider, pathPrefix) => self.evaluator(provider, pathPrefix);
4171
4170
  const map$3 = dual(2, (self, f) => {
4172
- return make$28((provider, pathPrefix) => map$5(evaluateAt(self, provider, pathPrefix), map$6(f)));
4171
+ return make$27((provider, pathPrefix) => map$5(evaluateAt(self, provider, pathPrefix), map$6(f)));
4173
4172
  });
4174
4173
  const orElse = dual(2, (self, that) => {
4175
- return make$28((provider, pathPrefix) => matchCauseEffect(evaluateAt(self, provider, pathPrefix), {
4174
+ return make$27((provider, pathPrefix) => matchCauseEffect(evaluateAt(self, provider, pathPrefix), {
4176
4175
  onFailure: (cause) => {
4177
4176
  const error = findErrorOption(cause);
4178
4177
  return isSome(error) && cause.reasons.every(isFailReason) ? evaluateAt(that(error.value), provider, pathPrefix) : failCause(cause);
@@ -4181,7 +4180,7 @@ const orElse = dual(2, (self, that) => {
4181
4180
  }));
4182
4181
  });
4183
4182
  const withDefault$2 = dual(2, (self, defaultValue) => {
4184
- return make$28((provider, pathPrefix) => mapEager(evaluateAt(self, provider, pathPrefix), (resolution) => isFailure$1(resolution) ? succeed$2(defaultValue) : resolution));
4183
+ return make$27((provider, pathPrefix) => mapEager(evaluateAt(self, provider, pathPrefix), (resolution) => isFailure$1(resolution) ? succeed$2(defaultValue) : resolution));
4185
4184
  });
4186
4185
  const option = (self) => self.pipe(map$3(some), withDefault$2(none()));
4187
4186
  const isSourceError = (u) => isTagged(u, "SourceError");
@@ -4266,9 +4265,9 @@ const toConfigCursorAST = memoize((root) => {
4266
4265
  function schema$1(codec, path) {
4267
4266
  const codecStringTree = toCodecStringTree(codec);
4268
4267
  const encodedAst = toEncoded(codecStringTree.ast);
4269
- const decodeCursor = decodeUnknownEffect(make$45(toConfigCursorAST(codecStringTree.ast)));
4268
+ const decodeCursor = decodeUnknownEffect(make$41(toConfigCursorAST(codecStringTree.ast)));
4270
4269
  const localPath = typeof path === "string" ? [path] : path ?? [];
4271
- return make$28((provider, pathPrefix) => {
4270
+ return make$27((provider, pathPrefix) => {
4272
4271
  const fullPath = [...pathPrefix, ...localPath];
4273
4272
  return loadCursor(provider, fullPath).pipe(flatMapEager((cursor) => decodeCursor(cursor).pipe(mapEager(succeed$2), catchEager((issue) => {
4274
4273
  const error = new ConfigError(new SchemaError(fullPath.length > 0 ? new Pointer(fullPath, issue) : issue));
@@ -4501,56 +4500,56 @@ const formatHelpDocImpl = (doc, colors, options) => {
4501
4500
  return sections.join("\n");
4502
4501
  };
4503
4502
  // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/cli/CliError.js
4504
- const TypeId$16 = "~effect/cli/CliError";
4505
- const isCliError = (u) => hasProperty(u, TypeId$16);
4503
+ const TypeId$15 = "~effect/cli/CliError";
4504
+ const isCliError = (u) => hasProperty(u, TypeId$15);
4506
4505
  const userMessage$2 = "~effect/cli/CliError/userMessage";
4507
4506
  const getUserMessage = (error) => "~effect/cli/CliError/userMessage" in error && typeof error["~effect/cli/CliError/userMessage"] === "string" ? error[userMessage$2] : void 0;
4508
- var UnrecognizedOption = class extends TaggedError$1(`${TypeId$16}/UnrecognizedOption`)("UnrecognizedOption", {
4507
+ var UnrecognizedOption = class extends TaggedError$1(`${TypeId$15}/UnrecognizedOption`)("UnrecognizedOption", {
4509
4508
  option: String$7,
4510
4509
  command: optional$2(ArraySchema(String$7)),
4511
4510
  suggestions: ArraySchema(String$7)
4512
4511
  }) {
4513
- [TypeId$16] = TypeId$16;
4512
+ [TypeId$15] = TypeId$15;
4514
4513
  get message() {
4515
4514
  const suggestionText = this.suggestions.length > 0 ? `\n\n Did you mean this?\n ${this.suggestions.join("\n ")}` : "";
4516
4515
  return (this.command ? `Unrecognized flag: ${this.option} in command ${this.command.join(" ")}` : `Unrecognized flag: ${this.option}`) + suggestionText;
4517
4516
  }
4518
4517
  };
4519
- var DuplicateOption = class extends TaggedError$1(`${TypeId$16}/DuplicateOption`)("DuplicateOption", {
4518
+ var DuplicateOption = class extends TaggedError$1(`${TypeId$15}/DuplicateOption`)("DuplicateOption", {
4520
4519
  option: String$7,
4521
4520
  parentCommand: String$7,
4522
4521
  childCommand: String$7
4523
4522
  }) {
4524
- [TypeId$16] = TypeId$16;
4523
+ [TypeId$15] = TypeId$15;
4525
4524
  get message() {
4526
4525
  return `Duplicate flag name "${this.option}" in parent command "${this.parentCommand}" and subcommand "${this.childCommand}". Parent will always claim this flag (Mode A semantics). Consider renaming one of them to avoid confusion.`;
4527
4526
  }
4528
4527
  };
4529
- var MissingOption = class extends TaggedError$1(`${TypeId$16}/MissingOption`)("MissingOption", { option: String$7 }) {
4530
- [TypeId$16] = TypeId$16;
4528
+ var MissingOption = class extends TaggedError$1(`${TypeId$15}/MissingOption`)("MissingOption", { option: String$7 }) {
4529
+ [TypeId$15] = TypeId$15;
4531
4530
  get message() {
4532
4531
  return `Missing required flag: --${this.option}`;
4533
4532
  }
4534
4533
  };
4535
- var MissingArgument = class extends TaggedError$1(`${TypeId$16}/MissingArgument`)("MissingArgument", { argument: String$7 }) {
4536
- [TypeId$16] = TypeId$16;
4534
+ var MissingArgument = class extends TaggedError$1(`${TypeId$15}/MissingArgument`)("MissingArgument", { argument: String$7 }) {
4535
+ [TypeId$15] = TypeId$15;
4537
4536
  get message() {
4538
4537
  return `Missing required argument: ${this.argument}`;
4539
4538
  }
4540
4539
  };
4541
- var UnexpectedArgument = class extends TaggedError$1(`${TypeId$16}/UnexpectedArgument`)("UnexpectedArgument", { arguments: ArraySchema(String$7) }) {
4542
- [TypeId$16] = TypeId$16;
4540
+ var UnexpectedArgument = class extends TaggedError$1(`${TypeId$15}/UnexpectedArgument`)("UnexpectedArgument", { arguments: ArraySchema(String$7) }) {
4541
+ [TypeId$15] = TypeId$15;
4543
4542
  get message() {
4544
4543
  return `Unexpected positional ${this.arguments.length === 1 ? "argument" : "arguments"}: ${this.arguments.map((value) => JSON.stringify(value)).join(", ")}`;
4545
4544
  }
4546
4545
  };
4547
- var InvalidValue = class extends TaggedError$1(`${TypeId$16}/InvalidValue`)("InvalidValue", {
4546
+ var InvalidValue = class extends TaggedError$1(`${TypeId$15}/InvalidValue`)("InvalidValue", {
4548
4547
  option: String$7,
4549
4548
  value: String$7,
4550
4549
  expected: String$7,
4551
4550
  kind: Union([Literal("flag"), Literal("argument")])
4552
4551
  }) {
4553
- [TypeId$16] = TypeId$16;
4552
+ [TypeId$15] = TypeId$15;
4554
4553
  get message() {
4555
4554
  const expectation = this.expected.startsWith("Expected ") || this.expected.startsWith("Expected:") ? this.expected : `Expected: ${this.expected}`;
4556
4555
  if (this.kind === "argument") return `Invalid value for argument <${this.option}>: "${this.value}". ${expectation}`;
@@ -4558,25 +4557,25 @@ var InvalidValue = class extends TaggedError$1(`${TypeId$16}/InvalidValue`)("Inv
4558
4557
  return `Invalid value for flag --${this.option}: "${this.value}". ${expectation}`;
4559
4558
  }
4560
4559
  };
4561
- var UnknownSubcommand = class extends TaggedError$1(`${TypeId$16}/UnknownSubcommand`)("UnknownSubcommand", {
4560
+ var UnknownSubcommand = class extends TaggedError$1(`${TypeId$15}/UnknownSubcommand`)("UnknownSubcommand", {
4562
4561
  subcommand: String$7,
4563
4562
  parent: optional$2(ArraySchema(String$7)),
4564
4563
  suggestions: ArraySchema(String$7)
4565
4564
  }) {
4566
- [TypeId$16] = TypeId$16;
4565
+ [TypeId$15] = TypeId$15;
4567
4566
  get message() {
4568
4567
  const suggestionText = this.suggestions.length > 0 ? `\n\n Did you mean this?\n ${this.suggestions.join("\n ")}` : "";
4569
4568
  return this.parent ? `Unknown subcommand "${this.subcommand}" for "${this.parent.join(" ")}"${suggestionText}` : `Unknown subcommand "${this.subcommand}"${suggestionText}`;
4570
4569
  }
4571
4570
  };
4572
- var ValidationError = class extends TaggedError$1(`${TypeId$16}/ValidationError`)("ValidationError", { message: String$7 }) {
4573
- [TypeId$16] = TypeId$16;
4571
+ var ValidationError = class extends TaggedError$1(`${TypeId$15}/ValidationError`)("ValidationError", { message: String$7 }) {
4572
+ [TypeId$15] = TypeId$15;
4574
4573
  };
4575
- var UserError = class extends TaggedError$1(`${TypeId$16}/UserError`)("UserError", {
4574
+ var UserError = class extends TaggedError$1(`${TypeId$15}/UserError`)("UserError", {
4576
4575
  cause: Defect(),
4577
4576
  userMessage: optionalKey(String$7)
4578
4577
  }) {
4579
- [TypeId$16] = TypeId$16;
4578
+ [TypeId$15] = TypeId$15;
4580
4579
  [errorReported] = true;
4581
4580
  get message() {
4582
4581
  if (this.userMessage) return this.userMessage;
@@ -4599,11 +4598,11 @@ const NonShowHelpErrors = Union([
4599
4598
  ValidationError,
4600
4599
  UserError
4601
4600
  ]);
4602
- var ShowHelp = class extends TaggedError$1(`${TypeId$16}/ShowHelp`)("ShowHelp", {
4601
+ var ShowHelp = class extends TaggedError$1(`${TypeId$15}/ShowHelp`)("ShowHelp", {
4603
4602
  commandPath: ArraySchema(String$7),
4604
4603
  errors: ArraySchema(NonShowHelpErrors)
4605
4604
  }) {
4606
- [TypeId$16] = TypeId$16;
4605
+ [TypeId$15] = TypeId$15;
4607
4606
  [errorExitCode] = this.errors.length ? 1 : 0;
4608
4607
  [errorReported] = false;
4609
4608
  get message() {
@@ -5186,7 +5185,7 @@ const Path$2 = (pathType, mustExist) => {
5186
5185
  }));
5187
5186
  return Object.assign(primitive, { pathType });
5188
5187
  };
5189
- const Redacted$2 = makePrimitive("Redacted", (value) => succeed$1(make$44(value)));
5188
+ const Redacted$2 = makePrimitive("Redacted", (value) => succeed$1(make$40(value)));
5190
5189
  const getTypeName = (primitive) => {
5191
5190
  switch (primitive._tag) {
5192
5191
  case "Boolean": return "boolean";
@@ -5208,16 +5207,16 @@ const getTypeName = (primitive) => {
5208
5207
  const getChoiceKeys = (primitive) => primitive._tag === "Choice" ? primitive.choiceKeys : void 0;
5209
5208
  const getPathType = (primitive) => primitive._tag === "Path" ? primitive.pathType : void 0;
5210
5209
  // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/cli/Param.js
5211
- const TypeId$15 = "~effect/cli/Param";
5210
+ const TypeId$14 = "~effect/cli/Param";
5212
5211
  const argumentKind = "argument";
5213
5212
  const flagKind = "flag";
5214
5213
  const Proto$8 = {
5215
- [TypeId$15]: { _A: identity },
5214
+ [TypeId$14]: { _A: identity },
5216
5215
  pipe() {
5217
5216
  return pipeArguments(this, arguments);
5218
5217
  }
5219
5218
  };
5220
- const isParam = (u) => hasProperty(u, TypeId$15);
5219
+ const isParam = (u) => hasProperty(u, TypeId$14);
5221
5220
  const isFlagParam = (single) => single.kind === "flag";
5222
5221
  const makeSingle = (params) => {
5223
5222
  const parse = (args) => params.kind === "argument" ? parsePositional(params.name, params.primitiveType, args) : parseFlag(params.name, params.primitiveType, args);
@@ -5570,7 +5569,7 @@ const reconstructTree = (tree, results) => {
5570
5569
  }
5571
5570
  };
5572
5571
  // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/cli/internal/command.js
5573
- const TypeId$14 = "~effect/cli/Command";
5572
+ const TypeId$13 = "~effect/cli/Command";
5574
5573
  const toImpl = (self) => self;
5575
5574
  const Proto$7 = { ...Prototype({
5576
5575
  label: "Command",
@@ -5582,7 +5581,7 @@ const makeCommand = (options) => {
5582
5581
  const config = options.config;
5583
5582
  const contextConfig = options.contextConfig ?? emptyConfig;
5584
5583
  const service = options.service ?? Service(`${"~effect/cli/Command"}/${options.name}`);
5585
- const annotations = options.annotations ?? empty$5();
5584
+ const annotations = options.annotations ?? empty$8();
5586
5585
  const globalFlags = options.globalFlags ?? [];
5587
5586
  const subcommands = options.subcommands ?? [];
5588
5587
  const resolveExamples = options.resolveExamples ?? noExamples;
@@ -5647,7 +5646,7 @@ const makeCommand = (options) => {
5647
5646
  };
5648
5647
  };
5649
5648
  return Object.assign(Object.create(Proto$7), {
5650
- [TypeId$14]: TypeId$14,
5649
+ [TypeId$13]: TypeId$13,
5651
5650
  name: options.name,
5652
5651
  examples: resolveExamples([options.name]),
5653
5652
  resolveExamples,
@@ -7569,8 +7568,8 @@ const wrapCommand = (commandLine) => {
7569
7568
  };
7570
7569
  const formatShellArg = (arg) => /^[A-Za-z0-9_./:@%+=,-]+$/.test(arg) ? arg : `'${arg.replaceAll("'", `'"'"'`)}'`;
7571
7570
  // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/cli/Command.js
7572
- const isCommand = (u) => hasProperty(u, TypeId$14);
7573
- const make$27 = (name, config, handler) => {
7571
+ const isCommand = (u) => hasProperty(u, TypeId$13);
7572
+ const make$26 = (name, config, handler) => {
7574
7573
  const parsedConfig = parseConfig(config ?? {});
7575
7574
  return makeCommand({
7576
7575
  name,
@@ -7824,8 +7823,8 @@ const runWith = (command, config) => {
7824
7823
  program = provideService(program, flag, value);
7825
7824
  }
7826
7825
  const services = match$2(logLevel, {
7827
- onNone: () => empty$5(),
7828
- onSome: (level) => make$41(MinimumLogLevel, level)
7826
+ onNone: () => empty$8(),
7827
+ onSome: (level) => make$42(MinimumLogLevel, level)
7829
7828
  });
7830
7829
  yield* provideContext(program, services);
7831
7830
  }, catchFilter((error) => isCliError(error) && error._tag === "ShowHelp" ? succeed$2(error) : fail$2(error), (error) => andThen(showHelp(command, error, config.renderErrors !== false), fail$1(error))), catchFilter((error) => {
@@ -7860,7 +7859,7 @@ const HandleProto = {
7860
7859
  }
7861
7860
  };
7862
7861
  const makeHandle = (params) => Object.setPrototypeOf({ ...params }, HandleProto);
7863
- const make$26 = (spawn) => {
7862
+ const make$25 = (spawn) => {
7864
7863
  const streamString = (command, options) => spawn(command).pipe(map$5((handle) => decodeText(options?.includeStderr === true ? handle.all : drainFork(handle.stdout, handle.stderr))), unwrap$6);
7865
7864
  const streamLines = (command, options) => splitLines(streamString(command, options));
7866
7865
  return ChildProcessSpawner.of({
@@ -7986,7 +7985,7 @@ const parseTemplate$1 = (texts, values) => {
7986
7985
  const endWord = () => {
7987
7986
  if (word.length === 0) return;
7988
7987
  const value = word.map(unwrap$1).join("");
7989
- words.push(word.length === 1 && isRedacted(word[0]) ? word[0] : word.some(isRedacted) ? make$44(value) : value);
7988
+ words.push(word.length === 1 && isRedacted(word[0]) ? word[0] : word.some(isRedacted) ? make$40(value) : value);
7990
7989
  word = [];
7991
7990
  plain = true;
7992
7991
  braceDepth = 0;
@@ -8050,7 +8049,7 @@ const parseTemplate$1 = (texts, values) => {
8050
8049
  return succeed$2(words);
8051
8050
  };
8052
8051
  // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/process/ChildProcess.js
8053
- const TypeId$13 = "~effect/process/ChildProcess";
8052
+ const TypeId$12 = "~effect/process/ChildProcess";
8054
8053
  const Proto$6 = {
8055
8054
  ...Prototype({
8056
8055
  label: "Command",
@@ -8058,7 +8057,7 @@ const Proto$6 = {
8058
8057
  return getUnsafe(fiber.context, ChildProcessSpawner).spawn(this);
8059
8058
  }
8060
8059
  }),
8061
- [TypeId$13]: TypeId$13
8060
+ [TypeId$12]: TypeId$12
8062
8061
  };
8063
8062
  const makeStandardCommand = (command, args, options) => Object.assign(Object.create(Proto$6), {
8064
8063
  _tag: "StandardCommand",
@@ -8066,7 +8065,7 @@ const makeStandardCommand = (command, args, options) => Object.assign(Object.cre
8066
8065
  args,
8067
8066
  options
8068
8067
  });
8069
- const make$25 = function make(...args) {
8068
+ const make$24 = function make(...args) {
8070
8069
  if (isTemplateString(args[0])) {
8071
8070
  const [templates, ...expressions] = args;
8072
8071
  const [command, cmdArgs] = parseTemplate(templates, expressions);
@@ -8206,7 +8205,7 @@ const taskkill = (childProcess, onExit = () => {}) => {
8206
8205
  "/F"
8207
8206
  ], { windowsHide: true }, onExit);
8208
8207
  };
8209
- const make$24 = gen(function* () {
8208
+ const make$23 = gen(function* () {
8210
8209
  const fs = yield* FileSystem;
8211
8210
  const path = yield* Path$3;
8212
8211
  const resolveWorkingDirectory = fnUntraced(function* (options) {
@@ -8563,7 +8562,7 @@ const make$24 = gen(function* () {
8563
8562
  const stdinConfig = resolveStdinOption(command.options);
8564
8563
  const sourceStream = unwrap$6(succeed$1(getSourceStream(handles[handles.length - 1], options.from)));
8565
8564
  const toOption = options.to ?? "stdin";
8566
- if (toOption === "stdin") handles.push(yield* spawnCommand(make$25(command.command, command.args, {
8565
+ if (toOption === "stdin") handles.push(yield* spawnCommand(make$24(command.command, command.args, {
8567
8566
  ...command.options,
8568
8567
  stdin: {
8569
8568
  ...stdinConfig,
@@ -8583,14 +8582,14 @@ const make$24 = gen(function* () {
8583
8582
  type: "input",
8584
8583
  stream: sourceStream
8585
8584
  };
8586
- handles.push(yield* spawnCommand(make$25(command.command, command.args, {
8585
+ handles.push(yield* spawnCommand(make$24(command.command, command.args, {
8587
8586
  ...command.options,
8588
8587
  additionalFds: {
8589
8588
  ...existingFds,
8590
8589
  [fdName$1]: fdConfig
8591
8590
  }
8592
8591
  })));
8593
- } else handles.push(yield* spawnCommand(make$25(command.command, command.args, {
8592
+ } else handles.push(yield* spawnCommand(make$24(command.command, command.args, {
8594
8593
  ...command.options,
8595
8594
  stdin: {
8596
8595
  ...stdinConfig,
@@ -8622,9 +8621,9 @@ const make$24 = gen(function* () {
8622
8621
  }
8623
8622
  }
8624
8623
  });
8625
- return make$26(spawnCommand);
8624
+ return make$25(spawnCommand);
8626
8625
  });
8627
- const layer$18 = effect(ChildProcessSpawner, make$24);
8626
+ const layer$18 = effect(ChildProcessSpawner, make$23);
8628
8627
  const flattenCommand = (command) => {
8629
8628
  const commands = [];
8630
8629
  const pipeOptions = [];
@@ -9027,7 +9026,7 @@ const writeFile = (path, data, options) => callback((resume, signal) => {
9027
9026
  resume(fail$1(handleBadArgument("writeFile")(err)));
9028
9027
  }
9029
9028
  });
9030
- const makeFileSystem = map$5(serviceOption(WatchBackend), (backend) => make$36({
9029
+ const makeFileSystem = map$5(serviceOption(WatchBackend), (backend) => make$35({
9031
9030
  access,
9032
9031
  chmod,
9033
9032
  chown,
@@ -9079,22 +9078,22 @@ const fileUrlOps = (windows) => ({
9079
9078
  })
9080
9079
  })
9081
9080
  });
9082
- const layerPosix = succeed$4(Path$3)(make$35({
9081
+ const layerPosix = succeed$4(Path$3)(make$34({
9083
9082
  ...Path.posix,
9084
9083
  ...fileUrlOps(false)
9085
9084
  }));
9086
- const layerWin32 = succeed$4(Path$3)(make$35({
9085
+ const layerWin32 = succeed$4(Path$3)(make$34({
9087
9086
  ...Path.win32,
9088
9087
  ...fileUrlOps(true)
9089
9088
  }));
9090
- const layer$15 = succeed$4(Path$3)(make$35({
9089
+ const layer$15 = succeed$4(Path$3)(make$34({
9091
9090
  ...Path,
9092
9091
  ...fileUrlOps(void 0)
9093
9092
  }));
9094
9093
  // node_modules/.pnpm/@effect+platform-node@4.1.1_effect@4.1.1_redis@6.2.1_@opentelemetry+api@1.10.0_/node_modules/@effect/platform-node/dist/NodePath.js
9095
9094
  const layer$14 = layer$15;
9096
9095
  // node_modules/.pnpm/@effect+platform-node-shared@4.1.1_effect@4.1.1/node_modules/@effect/platform-node-shared/dist/NodeStdio.js
9097
- const layer$13 = succeed$4(Stdio, make$30({
9096
+ const layer$13 = succeed$4(Stdio, make$29({
9098
9097
  args: sync(() => process.argv.slice(2)),
9099
9098
  stdinIsTerminal: sync(() => process.stdin.isTTY === true),
9100
9099
  stdoutIsTerminal: sync(() => process.stdout.isTTY === true),
@@ -9133,10 +9132,10 @@ const layer$13 = succeed$4(Stdio, make$30({
9133
9132
  // node_modules/.pnpm/@effect+platform-node@4.1.1_effect@4.1.1_redis@6.2.1_@opentelemetry+api@1.10.0_/node_modules/@effect/platform-node/dist/NodeStdio.js
9134
9133
  const layer$12 = layer$13;
9135
9134
  // node_modules/.pnpm/@effect+platform-node-shared@4.1.1_effect@4.1.1/node_modules/@effect/platform-node-shared/dist/NodeTerminal.js
9136
- const make$23 = fnUntraced(function* (shouldQuit = defaultShouldQuit) {
9135
+ const make$22 = fnUntraced(function* (shouldQuit = defaultShouldQuit) {
9137
9136
  const stdin = process.stdin;
9138
9137
  const stdout = process.stdout;
9139
- const lines = yield* make$47();
9138
+ const lines = yield* make$46();
9140
9139
  let inputEnded = stdin.readableEnded;
9141
9140
  let readlineActive = false;
9142
9141
  const onStdinEnd = () => {
@@ -9145,7 +9144,7 @@ const make$23 = fnUntraced(function* (shouldQuit = defaultShouldQuit) {
9145
9144
  };
9146
9145
  stdin.once("end", onStdinEnd);
9147
9146
  yield* addFinalizer(() => sync(() => stdin.off("end", onStdinEnd)));
9148
- const rlRef = yield* make$37({
9147
+ const rlRef = yield* make$36({
9149
9148
  acquire: acquireRelease(sync(() => {
9150
9149
  const rl = readline.createInterface({
9151
9150
  input: stdin,
@@ -9177,7 +9176,7 @@ const make$23 = fnUntraced(function* (shouldQuit = defaultShouldQuit) {
9177
9176
  const setRawMode = (enabled) => sync(() => {
9178
9177
  if (stdin.isTTY) stdin.setRawMode(enabled);
9179
9178
  });
9180
- const rawModeRef = yield* make$37({
9179
+ const rawModeRef = yield* make$36({
9181
9180
  acquire: acquireRelease(setRawMode(true), () => setRawMode(false)),
9182
9181
  idleTimeToLive: "10 millis"
9183
9182
  });
@@ -9198,7 +9197,7 @@ const make$23 = fnUntraced(function* (shouldQuit = defaultShouldQuit) {
9198
9197
  return queue;
9199
9198
  });
9200
9199
  const readInput = gen(function* () {
9201
- const queue = yield* make$47();
9200
+ const queue = yield* make$46();
9202
9201
  const handleKeypress = (s, k) => {
9203
9202
  const userInput = {
9204
9203
  input: fromUndefinedOr(s),
@@ -9243,7 +9242,7 @@ const make$23 = fnUntraced(function* (shouldQuit = defaultShouldQuit) {
9243
9242
  cause: err
9244
9243
  }))));
9245
9244
  }));
9246
- return make$34({
9245
+ return make$33({
9247
9246
  columns,
9248
9247
  rows,
9249
9248
  size,
@@ -9252,7 +9251,7 @@ const make$23 = fnUntraced(function* (shouldQuit = defaultShouldQuit) {
9252
9251
  display
9253
9252
  });
9254
9253
  });
9255
- const layer$11 = effect(Terminal, make$23(defaultShouldQuit));
9254
+ const layer$11 = effect(Terminal, make$22(defaultShouldQuit));
9256
9255
  function defaultShouldQuit(input) {
9257
9256
  const key = input.key;
9258
9257
  return key.name === "escape" || key.ctrl && (key.name === "c" || key.name === "d");
@@ -9281,10 +9280,10 @@ const runMain$1 = makeRunMain(({ fiber, teardown }) => {
9281
9280
  // node_modules/.pnpm/@effect+platform-node@4.1.1_effect@4.1.1_redis@6.2.1_@opentelemetry+api@1.10.0_/node_modules/@effect/platform-node/dist/NodeRuntime.js
9282
9281
  const runMain = runMain$1;
9283
9282
  // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/socket/Socket.js
9284
- const TypeId$12 = "~effect/socket/Socket";
9283
+ const TypeId$11 = "~effect/socket/Socket";
9285
9284
  const Socket = Service("effect/socket/Socket");
9286
- const make$22 = (options) => Socket.of({
9287
- [TypeId$12]: TypeId$12,
9285
+ const make$21 = (options) => Socket.of({
9286
+ [TypeId$11]: TypeId$11,
9288
9287
  reader: options.reader,
9289
9288
  writer: options.writer
9290
9289
  });
@@ -9530,7 +9529,7 @@ const fromWebSocket = (acquire, options) => withFiber((fiber) => {
9530
9529
  write,
9531
9530
  writeAll
9532
9531
  });
9533
- return succeed$1(make$22({
9532
+ return succeed$1(make$21({
9534
9533
  reader,
9535
9534
  writer
9536
9535
  }));
@@ -9673,8 +9672,8 @@ const Message = Union([
9673
9672
  AssistantMessage,
9674
9673
  ToolMessage
9675
9674
  ]);
9676
- const TypeId$11 = "~effect/ai/Prompt";
9677
- const isPrompt = (u) => hasProperty(u, TypeId$11);
9675
+ const TypeId$10 = "~effect/ai/Prompt";
9676
+ const isPrompt = (u) => hasProperty(u, TypeId$10);
9678
9677
  const $Prompt = declare((u) => isPrompt(u), { identifier: "Prompt" });
9679
9678
  const Prompt = Struct({ content: ArraySchema(toEncoded$1(Message)) }).pipe(decodeTo$1($Prompt, transformEffect$1({
9680
9679
  decode: (input, options) => mapBothEager(decodeEffect$1(ArraySchema(Message))(input.content), {
@@ -9687,7 +9686,7 @@ const Prompt = Struct({ content: ArraySchema(toEncoded$1(Message)) }).pipe(decod
9687
9686
  })
9688
9687
  })));
9689
9688
  const Proto$5 = {
9690
- [TypeId$11]: TypeId$11,
9689
+ [TypeId$10]: TypeId$10,
9691
9690
  pipe() {
9692
9691
  return pipeArguments(this, arguments);
9693
9692
  }
@@ -9695,7 +9694,7 @@ const Proto$5 = {
9695
9694
  const makePrompt = (content) => Object.assign(Object.create(Proto$5), { content });
9696
9695
  const decodeMessagesSync = decodeSync(ArraySchema(Message));
9697
9696
  const empty$1 = makePrompt([]);
9698
- const make$21 = (input) => {
9697
+ const make$20 = (input) => {
9699
9698
  if (typeof input === "string") {
9700
9699
  const part = makePart$1("text", { text: input });
9701
9700
  const message = makeMessage("user", { content: [part] });
@@ -9828,7 +9827,7 @@ const fromResponseParts = (parts) => {
9828
9827
  return makePrompt(messages);
9829
9828
  };
9830
9829
  const concat = dual(2, (self, input) => {
9831
- const other = make$21(input);
9830
+ const other = make$20(input);
9832
9831
  if (self.content.length === 0) return other;
9833
9832
  if (other.content.length === 0) return self;
9834
9833
  return fromMessages([...self.content, ...other.content]);
@@ -9842,14 +9841,14 @@ const setSystem = dual(2, (self, content) => {
9842
9841
  const map = dual(2, (self, f) => self === void 0 ? void 0 : f(self));
9843
9842
  const match$1 = dual(2, (self, { onDefined, onUndefined }) => self === void 0 ? onUndefined() : onDefined(self));
9844
9843
  // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/persistence/KeyValueStore.js
9845
- const TypeId$10 = "~effect/persistence/KeyValueStore";
9844
+ const TypeId$9 = "~effect/persistence/KeyValueStore";
9846
9845
  const ErrorTypeId = "~effect/persistence/KeyValueStore/KeyValueStoreError";
9847
9846
  var KeyValueStoreError = class extends TaggedError("KeyValueStoreError") {
9848
9847
  [ErrorTypeId] = ErrorTypeId;
9849
9848
  };
9850
9849
  const KeyValueStore = Service("effect/persistence/KeyValueStore");
9851
- const make$20 = (options) => KeyValueStore.of({
9852
- [TypeId$10]: TypeId$10,
9850
+ const make$19 = (options) => KeyValueStore.of({
9851
+ [TypeId$9]: TypeId$9,
9853
9852
  has: (key) => map$5(options.get(key), isNotUndefined),
9854
9853
  isEmpty: map$5(options.size, (size) => size === 0),
9855
9854
  clearPrefix: (prefix) => prefix.length === 0 ? options.clear : flatMap$1(options.keys, (keys) => forEach$1(keys, (key) => key.startsWith(prefix) ? options.remove(key) : void_, { discard: true })),
@@ -9892,7 +9891,7 @@ const layerFileSystem = (directory) => effect(KeyValueStore)(gen(function* () {
9892
9891
  message: `Invalid key ${key}`
9893
9892
  })) : f(path.join(directory, encodeURIComponent(key)));
9894
9893
  if (!(yield* fs.exists(directory))) yield* fs.makeDirectory(directory, { recursive: true });
9895
- return make$20({
9894
+ return make$19({
9896
9895
  get: (key) => withKeyPath("get", key, (path) => catchTag(fs.readFileString(path), "PlatformError", (cause) => cause.reason._tag === "NotFound" ? undefined_ : fail$1(new KeyValueStoreError({
9897
9896
  method: "get",
9898
9897
  key,
@@ -9986,11 +9985,11 @@ const toSchemaStore = (self, schema) => {
9986
9985
  };
9987
9986
  };
9988
9987
  // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/ai/Model.js
9989
- const TypeId$9 = "~effect/ai/Model";
9988
+ const TypeId$8 = "~effect/ai/Model";
9990
9989
  var ProviderName = class extends Service()("effect/ai/Model/ProviderName") {};
9991
9990
  var ModelName = class extends Service()("effect/ai/Model/ModelName") {};
9992
9991
  const Proto$4 = {
9993
- [TypeId$9]: TypeId$9,
9992
+ [TypeId$8]: TypeId$8,
9994
9993
  ["~effect/Layer"]: {
9995
9994
  _ROut: identity,
9996
9995
  _E: identity,
@@ -10008,7 +10007,7 @@ const Proto$4 = {
10008
10007
  };
10009
10008
  }
10010
10009
  };
10011
- const make$19 = (provider, modelName, layer) => Object.assign(Object.create(Proto$4), { provider }, merge$2(layer, succeedContext(ProviderName.context(provider).pipe(add(ModelName, modelName)))));
10010
+ const make$18 = (provider, modelName, layer) => Object.assign(Object.create(Proto$4), { provider }, merge$2(layer, succeedContext(ProviderName.context(provider).pipe(add(ModelName, modelName)))));
10012
10011
  // src/ApplyPatch.ts
10013
10012
  const BEGIN = "*** Begin Patch";
10014
10013
  const END = "*** End Patch";
@@ -10352,7 +10351,7 @@ var ExaError = class extends TaggedError$1()("ExaError", { cause: Defect() }) {}
10352
10351
  const layer$8 = effect(ExaSearch, gen(function* () {
10353
10352
  const scope$5 = yield* scope;
10354
10353
  const getClient = yield* cachedWithTTL(gen(function* () {
10355
- const McpClient = yield* tryPromise(() => import("./McpClient-DoPNaNzW.mjs"));
10354
+ const McpClient = yield* tryPromise(() => import("./McpClient-CXwyRd_3.mjs"));
10356
10355
  const context = yield* buildWithScope(McpClient.layer, scope$5);
10357
10356
  return get$2(context, McpClient.McpClient);
10358
10357
  }), (exit) => isSuccess(exit) ? infinity : zero);
@@ -10423,441 +10422,6 @@ const layer$7 = effect(WebToMarkdown, gen(function* () {
10423
10422
  })
10424
10423
  });
10425
10424
  }));
10426
- // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/ai/AiError.js
10427
- const HttpResponseDetails$1 = Struct({
10428
- status: Int$5,
10429
- headers: Record(String$7, Union([String$7, Redacted$4(String$7)]))
10430
- }).annotate({ identifier: "HttpResponseDetails" });
10431
- const ReasonTypeId = "~effect/ai/AiError/Reason";
10432
- const providerMetadataWithDefaults = () => ProviderMetadata$1.pipe(withConstructorDefault(succeed$1({})), withDecodingDefault(succeed$1({})));
10433
- var NetworkError = class NetworkError extends Error$2("effect/ai/AiError/NetworkError")({
10434
- _tag: tag("NetworkError"),
10435
- reason: Literals$2([
10436
- "TransportError",
10437
- "EncodeError",
10438
- "InvalidUrlError"
10439
- ]),
10440
- method: String$7,
10441
- url: String$7,
10442
- description: optional$2(String$7),
10443
- cause: optional$2(Defect())
10444
- }) {
10445
- [ReasonTypeId] = ReasonTypeId;
10446
- get isRetryable() {
10447
- return this.reason === "TransportError";
10448
- }
10449
- static fromRequestError(error) {
10450
- return new NetworkError({
10451
- description: error.description,
10452
- reason: error._tag,
10453
- method: error.request.method,
10454
- url: error.request.url
10455
- });
10456
- }
10457
- static fromHttpClientError(error) {
10458
- return new NetworkError({
10459
- description: error.reason.description,
10460
- reason: error.reason._tag,
10461
- method: error.reason.request.method,
10462
- url: error.reason.request.url,
10463
- cause: error
10464
- });
10465
- }
10466
- get message() {
10467
- const methodAndUrl = `${this.method} ${this.url}`;
10468
- let baseMessage = this.description ? `${this.reason}: ${this.description}` : `${this.reason}: A network error occurred.`;
10469
- baseMessage += ` (${methodAndUrl})`;
10470
- let suggestion = "";
10471
- switch (this.reason) {
10472
- case "EncodeError":
10473
- suggestion += "Check that the request body data is properly formatted and matches the expected content type.";
10474
- break;
10475
- case "InvalidUrlError":
10476
- suggestion += "Verify that the URL format is correct and that all required parameters have been provided.";
10477
- suggestion += " Check for any special characters that may need encoding.";
10478
- break;
10479
- case "TransportError": suggestion += "Check your network connection and verify that the requested URL is accessible.";
10480
- }
10481
- baseMessage += `\n\n${suggestion}`;
10482
- return baseMessage;
10483
- }
10484
- };
10485
- const ProviderMetadata$1 = Record(String$7, NullOr(MutableJson));
10486
- const UsageInfo = Struct({
10487
- promptTokens: optional$2(Int$5),
10488
- completionTokens: optional$2(Int$5),
10489
- totalTokens: optional$2(Int$5)
10490
- }).annotate({ identifier: "UsageInfo" });
10491
- const HttpContext = Struct({
10492
- response: optional$2(HttpResponseDetails$1),
10493
- body: optional$2(String$7)
10494
- }).annotate({ identifier: "HttpContext" });
10495
- const buildErrorDescription = (params) => {
10496
- const parts = [];
10497
- if (params.message) parts.push(params.message);
10498
- else parts.push(`HTTP ${params.status}`);
10499
- parts.push(`(${params.method} ${params.url})`);
10500
- if (params.errorCode) parts.push(`[code: ${params.errorCode}]`);
10501
- else if (params.errorType) parts.push(`[type: ${params.errorType}]`);
10502
- if (params.requestId) parts.push(`[requestId: ${params.requestId}]`);
10503
- if (!params.message && params.body) {
10504
- const truncated = params.body.length > 200 ? params.body.slice(0, 200) + "..." : params.body;
10505
- parts.push(`Response: ${truncated}`);
10506
- }
10507
- return parts.join(" ");
10508
- };
10509
- var RateLimitError = class extends Error$2("effect/ai/AiError/RateLimitError")({
10510
- _tag: tag("RateLimitError"),
10511
- retryAfter: optional$2(Duration),
10512
- metadata: providerMetadataWithDefaults(),
10513
- http: optional$2(HttpContext)
10514
- }) {
10515
- [ReasonTypeId] = ReasonTypeId;
10516
- get isRetryable() {
10517
- return true;
10518
- }
10519
- get message() {
10520
- let msg = "Rate limit exceeded";
10521
- if (this.retryAfter) msg += `. Retry after ${format$1(this.retryAfter)}`;
10522
- return msg;
10523
- }
10524
- };
10525
- var QuotaExhaustedError = class extends Error$2("effect/ai/AiError/QuotaExhaustedError")({
10526
- _tag: tag("QuotaExhaustedError"),
10527
- resetAt: optional$2(DateTimeUtc),
10528
- metadata: providerMetadataWithDefaults(),
10529
- http: optional$2(HttpContext)
10530
- }) {
10531
- [ReasonTypeId] = ReasonTypeId;
10532
- get isRetryable() {
10533
- return false;
10534
- }
10535
- get message() {
10536
- let msg = "Quota exhausted";
10537
- if (this.resetAt) msg += `. Resets at ${this.resetAt}`;
10538
- return `${msg}. Check your account billing and usage limits.`;
10539
- }
10540
- };
10541
- var AuthenticationError = class extends Error$2("effect/ai/AiError/AuthenticationError")({
10542
- _tag: tag("AuthenticationError"),
10543
- kind: Literals$2([
10544
- "InvalidKey",
10545
- "ExpiredKey",
10546
- "MissingKey",
10547
- "InsufficientPermissions",
10548
- "Unknown"
10549
- ]),
10550
- description: optional$2(String$7),
10551
- metadata: providerMetadataWithDefaults(),
10552
- http: optional$2(HttpContext)
10553
- }) {
10554
- [ReasonTypeId] = ReasonTypeId;
10555
- get isRetryable() {
10556
- return false;
10557
- }
10558
- get message() {
10559
- let msg = `${this.kind}: ${{
10560
- InvalidKey: "Verify your API key is correct",
10561
- ExpiredKey: "Your API key has expired. Generate a new one",
10562
- MissingKey: "No API key provided. Set the appropriate environment variable",
10563
- InsufficientPermissions: "Your API key lacks required permissions",
10564
- Unknown: "Authentication failed. Check your credentials"
10565
- }[this.kind]}`;
10566
- if (this.description) msg += `. ${this.description}`;
10567
- return msg;
10568
- }
10569
- };
10570
- var ContentPolicyError = class extends Error$2("effect/ai/AiError/ContentPolicyError")({
10571
- _tag: tag("ContentPolicyError"),
10572
- description: String$7,
10573
- metadata: providerMetadataWithDefaults(),
10574
- http: optional$2(HttpContext)
10575
- }) {
10576
- [ReasonTypeId] = ReasonTypeId;
10577
- get isRetryable() {
10578
- return false;
10579
- }
10580
- get message() {
10581
- return `Content policy violation: ${this.description}`;
10582
- }
10583
- };
10584
- var InvalidRequestError$1 = class extends Error$2("effect/ai/AiError/InvalidRequestError")({
10585
- _tag: tag("InvalidRequestError"),
10586
- parameter: optional$2(String$7),
10587
- constraint: optional$2(String$7),
10588
- description: optional$2(String$7),
10589
- metadata: providerMetadataWithDefaults(),
10590
- http: optional$2(HttpContext)
10591
- }) {
10592
- [ReasonTypeId] = ReasonTypeId;
10593
- get isRetryable() {
10594
- return false;
10595
- }
10596
- get message() {
10597
- let msg = "Invalid request";
10598
- if (this.parameter) msg += `: parameter '${this.parameter}'`;
10599
- if (this.constraint) msg += ` ${this.constraint}`;
10600
- if (this.description) msg += `. ${this.description}`;
10601
- return msg;
10602
- }
10603
- };
10604
- var InternalProviderError = class extends Error$2("effect/ai/AiError/InternalProviderError")({
10605
- _tag: tag("InternalProviderError"),
10606
- description: String$7,
10607
- metadata: providerMetadataWithDefaults(),
10608
- http: optional$2(HttpContext)
10609
- }) {
10610
- [ReasonTypeId] = ReasonTypeId;
10611
- get isRetryable() {
10612
- return true;
10613
- }
10614
- get message() {
10615
- return `Internal provider error: ${this.description}`;
10616
- }
10617
- };
10618
- var InvalidResponseError = class InvalidResponseError extends Error$2("effect/ai/AiError/InvalidResponseError")({
10619
- _tag: tag("InvalidResponseError"),
10620
- description: String$7,
10621
- metadata: providerMetadataWithDefaults(),
10622
- http: optional$2(HttpContext)
10623
- }) {
10624
- [ReasonTypeId] = ReasonTypeId;
10625
- get isRetryable() {
10626
- return false;
10627
- }
10628
- static fromSchemaError(error) {
10629
- return new InvalidResponseError({ description: error.message });
10630
- }
10631
- get message() {
10632
- return `Invalid response: ${this.description}`;
10633
- }
10634
- };
10635
- var InvalidOutputError = class InvalidOutputError extends Error$2("effect/ai/AiError/InvalidOutputError")({
10636
- _tag: tag("InvalidOutputError"),
10637
- description: String$7,
10638
- metadata: providerMetadataWithDefaults(),
10639
- usage: optional$2(UsageInfo)
10640
- }) {
10641
- [ReasonTypeId] = ReasonTypeId;
10642
- get isRetryable() {
10643
- return true;
10644
- }
10645
- static fromSchemaError(error) {
10646
- return new InvalidOutputError({ description: error.message });
10647
- }
10648
- get message() {
10649
- return `Invalid output: ${this.description}`;
10650
- }
10651
- };
10652
- var StructuredOutputError = class StructuredOutputError extends Error$2("effect/ai/AiError/StructuredOutputError")({
10653
- _tag: tag("StructuredOutputError"),
10654
- description: String$7,
10655
- responseText: String$7,
10656
- metadata: providerMetadataWithDefaults(),
10657
- usage: optional$2(UsageInfo)
10658
- }) {
10659
- [ReasonTypeId] = ReasonTypeId;
10660
- get isRetryable() {
10661
- return true;
10662
- }
10663
- static fromSchemaError(error, responseText) {
10664
- return new StructuredOutputError({
10665
- description: error.message,
10666
- responseText
10667
- });
10668
- }
10669
- get message() {
10670
- return `Structured output validation failed: ${this.description}`;
10671
- }
10672
- };
10673
- var UnsupportedSchemaError = class extends Error$2("effect/ai/AiError/UnsupportedSchemaError")({
10674
- _tag: tag("UnsupportedSchemaError"),
10675
- description: String$7,
10676
- metadata: providerMetadataWithDefaults()
10677
- }) {
10678
- [ReasonTypeId] = ReasonTypeId;
10679
- get isRetryable() {
10680
- return false;
10681
- }
10682
- get message() {
10683
- return `Unsupported schema: ${this.description}`;
10684
- }
10685
- };
10686
- var UnknownError = class extends Error$2("effect/ai/AiError/UnknownError")({
10687
- _tag: tag("UnknownError"),
10688
- description: optional$2(String$7),
10689
- metadata: providerMetadataWithDefaults(),
10690
- http: optional$2(HttpContext)
10691
- }) {
10692
- [ReasonTypeId] = ReasonTypeId;
10693
- get isRetryable() {
10694
- return false;
10695
- }
10696
- get message() {
10697
- return this.description ?? "Unknown error";
10698
- }
10699
- };
10700
- var ToolNotFoundError = class extends Error$2("effect/ai/AiError/ToolNotFoundError")({
10701
- _tag: tag("ToolNotFoundError"),
10702
- toolName: String$7,
10703
- availableTools: ArraySchema(String$7)
10704
- }) {
10705
- [ReasonTypeId] = ReasonTypeId;
10706
- get isRetryable() {
10707
- return true;
10708
- }
10709
- get message() {
10710
- const availableTools = this.availableTools.length > 0 ? this.availableTools.join(", ") : "none";
10711
- return `Tool '${this.toolName}' not found. Available tools: ${availableTools}`;
10712
- }
10713
- };
10714
- var ToolParameterValidationError = class extends Error$2("effect/ai/AiError/ToolParameterValidationError")({
10715
- _tag: tag("ToolParameterValidationError"),
10716
- toolName: String$7,
10717
- description: String$7
10718
- }) {
10719
- [ReasonTypeId] = ReasonTypeId;
10720
- get isRetryable() {
10721
- return true;
10722
- }
10723
- get message() {
10724
- return `Invalid parameters for tool '${this.toolName}': ${this.description}`;
10725
- }
10726
- };
10727
- var InvalidToolResultError = class extends Error$2("effect/ai/AiError/InvalidToolResultError")({
10728
- _tag: tag("InvalidToolResultError"),
10729
- toolName: String$7,
10730
- description: String$7
10731
- }) {
10732
- [ReasonTypeId] = ReasonTypeId;
10733
- get isRetryable() {
10734
- return false;
10735
- }
10736
- get message() {
10737
- return `Tool '${this.toolName}' returned invalid result: ${this.description}`;
10738
- }
10739
- };
10740
- var ToolResultEncodingError = class extends Error$2("effect/ai/AiError/ToolResultEncodingError")({
10741
- _tag: tag("ToolResultEncodingError"),
10742
- toolName: String$7,
10743
- toolResult: Unknown,
10744
- description: String$7
10745
- }) {
10746
- [ReasonTypeId] = ReasonTypeId;
10747
- get isRetryable() {
10748
- return false;
10749
- }
10750
- get message() {
10751
- return `Failed to encode result for tool '${this.toolName}': ${this.description}`;
10752
- }
10753
- };
10754
- var ToolConfigurationError = class extends Error$2("effect/ai/AiError/ToolConfigurationError")({
10755
- _tag: tag("ToolConfigurationError"),
10756
- toolName: String$7,
10757
- description: String$7
10758
- }) {
10759
- [ReasonTypeId] = ReasonTypeId;
10760
- get isRetryable() {
10761
- return false;
10762
- }
10763
- get message() {
10764
- return `Invalid configuration for tool '${this.toolName}': ${this.description}`;
10765
- }
10766
- };
10767
- var ToolkitRequiredError = class extends Error$2("effect/ai/AiError/ToolkitRequiredError")({
10768
- _tag: tag("ToolkitRequiredError"),
10769
- pendingApprovals: ArraySchema(String$7),
10770
- description: optional$2(String$7)
10771
- }) {
10772
- [ReasonTypeId] = ReasonTypeId;
10773
- get isRetryable() {
10774
- return false;
10775
- }
10776
- get message() {
10777
- return `Toolkit required to resolve pending tool approvals: ${this.pendingApprovals.join(", ")}`;
10778
- }
10779
- };
10780
- var InvalidUserInputError = class extends Error$2("effect/ai/AiError/InvalidUserInputError")({
10781
- _tag: tag("InvalidUserInputError"),
10782
- description: String$7
10783
- }) {
10784
- [ReasonTypeId] = ReasonTypeId;
10785
- get isRetryable() {
10786
- return false;
10787
- }
10788
- get message() {
10789
- return `Invalid user input: ${this.description}`;
10790
- }
10791
- };
10792
- const AiErrorReason = Union([
10793
- RateLimitError,
10794
- QuotaExhaustedError,
10795
- AuthenticationError,
10796
- ContentPolicyError,
10797
- InvalidRequestError$1,
10798
- InvalidResponseError,
10799
- InternalProviderError,
10800
- NetworkError,
10801
- InvalidOutputError,
10802
- StructuredOutputError,
10803
- UnsupportedSchemaError,
10804
- UnknownError,
10805
- ToolNotFoundError,
10806
- ToolParameterValidationError,
10807
- InvalidToolResultError,
10808
- ToolResultEncodingError,
10809
- ToolConfigurationError,
10810
- ToolkitRequiredError,
10811
- InvalidUserInputError
10812
- ]);
10813
- const TypeId$8 = "~effect/ai/AiError";
10814
- var AiError = class extends Error$2("effect/ai/AiError/AiError")({
10815
- _tag: tag("AiError"),
10816
- module: String$7,
10817
- method: String$7,
10818
- reason: AiErrorReason
10819
- }) {
10820
- [TypeId$8] = TypeId$8;
10821
- cause = this.reason;
10822
- get isRetryable() {
10823
- return this.reason.isRetryable;
10824
- }
10825
- get retryAfter() {
10826
- return "retryAfter" in this.reason ? this.reason.retryAfter : void 0;
10827
- }
10828
- get message() {
10829
- return `${this.module}.${this.method}: ${this.reason.message}`;
10830
- }
10831
- };
10832
- const isAiError = (u) => hasProperty(u, TypeId$8);
10833
- const isAiErrorReason = (u) => hasProperty(u, ReasonTypeId);
10834
- const make$18 = (params) => new AiError(params);
10835
- const reasonFromHttpStatus = (params) => {
10836
- const { status, http, metadata, description } = params;
10837
- const common = {
10838
- http,
10839
- ...metadata ? { metadata } : void 0,
10840
- ...description ? { description } : void 0
10841
- };
10842
- switch (status) {
10843
- case 400: return new InvalidRequestError$1(common);
10844
- case 401: return new AuthenticationError({
10845
- kind: "InvalidKey",
10846
- ...common
10847
- });
10848
- case 403: return new AuthenticationError({
10849
- kind: "InsufficientPermissions",
10850
- ...common
10851
- });
10852
- case 429: return new RateLimitError(common);
10853
- default:
10854
- if (status >= 500) return new InternalProviderError({
10855
- description: "Server error",
10856
- ...common
10857
- });
10858
- return new UnknownError(common);
10859
- }
10860
- };
10861
10425
  // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/ai/Tool.js
10862
10426
  const TypeId$7 = "~effect/ai/Tool";
10863
10427
  const ProviderDefinedTypeId = "~effect/ai/Tool/ProviderDefined";
@@ -10922,7 +10486,7 @@ const make$17 = (name, options) => {
10922
10486
  successSchema,
10923
10487
  failureSchema,
10924
10488
  failureMode: options?.failureMode ?? "error",
10925
- annotations: empty$5(),
10489
+ annotations: empty$8(),
10926
10490
  needsApproval: options?.needsApproval,
10927
10491
  toModelOutput: options?.toModelOutput
10928
10492
  });
@@ -11016,7 +10580,7 @@ function isEmptyParamsRecord(indexSignature) {
11016
10580
  const TypeId$6 = "~effect/ai/Toolkit";
11017
10581
  const FailureOrigin = Reference("effect/ai/Toolkit/FailureOrigin", { defaultValue: () => "result" });
11018
10582
  const PreliminaryBuffer = Reference("effect/ai/Toolkit/PreliminaryBuffer", { defaultValue: () => "unbounded" });
11019
- const failureCause = (error, origin) => annotate$1(fail$5(error), make$41(FailureOrigin, origin));
10583
+ const failureCause = (error, origin) => annotate$1(fail$5(error), make$42(FailureOrigin, origin));
11020
10584
  const failureOrigin = (error) => isSchemaError(error) ? "result" : "handler";
11021
10585
  const Proto$2 = {
11022
10586
  ...Prototype({
@@ -11051,7 +10615,7 @@ const Proto$2 = {
11051
10615
  tool: name,
11052
10616
  parameters: params
11053
10617
  });
11054
- if (isUndefined(tool)) return yield* make$18({
10618
+ if (isUndefined(tool)) return yield* make$47({
11055
10619
  module: "Toolkit",
11056
10620
  method: `${name}.handle`,
11057
10621
  reason: new ToolNotFoundError({
@@ -11060,7 +10624,7 @@ const Proto$2 = {
11060
10624
  })
11061
10625
  });
11062
10626
  const schemas = getSchemas(tool);
11063
- const encodeResult = (result, isFailure) => schemas.encodeResult(result, isFailure).pipe(mapError((cause) => make$18({
10627
+ const encodeResult = (result, isFailure) => schemas.encodeResult(result, isFailure).pipe(mapError((cause) => make$47({
11064
10628
  module: "Toolkit",
11065
10629
  method: `${name}.handle`,
11066
10630
  reason: new ToolResultEncodingError({
@@ -11071,7 +10635,7 @@ const Proto$2 = {
11071
10635
  })));
11072
10636
  const decodedParamsResult = yield* result(schemas.decodeParameters(params, options));
11073
10637
  if (isFailure$1(decodedParamsResult)) {
11074
- const error = make$18({
10638
+ const error = make$47({
11075
10639
  module: "Toolkit",
11076
10640
  method: `${name}.handle`,
11077
10641
  reason: new ToolParameterValidationError({
@@ -11091,7 +10655,7 @@ const Proto$2 = {
11091
10655
  const decodedParams = decodedParamsResult.success;
11092
10656
  const capacity = yield* PreliminaryBuffer;
11093
10657
  if (capacity !== "unbounded" && !(Number.isInteger(capacity) && capacity > 0)) return yield* die(`Tool "${name}": PreliminaryBuffer must be a positive integer, got ${capacity}`);
11094
- const queue = yield* make$47(capacity === "unbounded" ? void 0 : { capacity });
10658
+ const queue = yield* make$46(capacity === "unbounded" ? void 0 : { capacity });
11095
10659
  const context = {
11096
10660
  toolCallId,
11097
10661
  preliminary: (result) => asVoid(offer(queue, {
@@ -11109,20 +10673,20 @@ const Proto$2 = {
11109
10673
  onSuccess: () => end(queue)
11110
10674
  }), forkChild);
11111
10675
  const normalizeError = (error) => {
11112
- return isSchemaError(error) ? make$18({
10676
+ return isSchemaError(error) ? make$47({
11113
10677
  module: "Toolkit",
11114
10678
  method: `${name}.handle`,
11115
10679
  reason: new InvalidToolResultError({
11116
10680
  toolName: name,
11117
10681
  description: `Tool handler returned invalid result: ${error.message}`
11118
10682
  })
11119
- }) : isAiErrorReason(error) ? make$18({
10683
+ }) : isAiErrorReason(error) ? make$47({
11120
10684
  module: "Toolkit",
11121
10685
  method: `${name}.handle`,
11122
10686
  reason: error
11123
10687
  }) : error;
11124
10688
  };
11125
- return fromQueue(queue).pipe(tool.failureMode === "error" ? catchCause$1((cause) => failCause$3(map$9(fromReasons(cause.reasons.map((reason) => isFailReason(reason) ? reason.annotate(make$41(FailureOrigin, failureOrigin(reason.error)), { overwrite: true }) : reason)), normalizeError))) : catch_$1((error) => succeed$6({
10689
+ return fromQueue(queue).pipe(tool.failureMode === "error" ? catchCause$1((cause) => failCause$3(map$9(fromReasons(cause.reasons.map((reason) => isFailReason(reason) ? reason.annotate(make$42(FailureOrigin, failureOrigin(reason.error)), { overwrite: true }) : reason)), normalizeError))) : catch_$1((error) => succeed$6({
11126
10690
  result: normalizeError(error),
11127
10691
  isFailure: true,
11128
10692
  failureOrigin: failureOrigin(error),
@@ -11873,7 +11437,7 @@ const AgentToolHandlersNoDeps = AgentToolsWithSearch.toLayer(gen(function* () {
11873
11437
  }
11874
11438
  args.push(options.pattern);
11875
11439
  const run = fnUntraced(function* (args) {
11876
- let stream = spawner.streamLines(make$25("rg", args, {
11440
+ let stream = spawner.streamLines(make$24("rg", args, {
11877
11441
  cwd,
11878
11442
  stdin: "ignore"
11879
11443
  }));
@@ -11897,7 +11461,7 @@ const AgentToolHandlersNoDeps = AgentToolsWithSearch.toLayer(gen(function* () {
11897
11461
  timeoutMs
11898
11462
  }));
11899
11463
  const cwd = yield* CurrentDirectory;
11900
- const cmd = make$25("bash", ["-c", options.command], {
11464
+ const cmd = make$24("bash", ["-c", options.command], {
11901
11465
  cwd,
11902
11466
  stdin: "ignore"
11903
11467
  });
@@ -11961,7 +11525,7 @@ const AgentToolHandlersNoDeps = AgentToolsWithSearch.toLayer(gen(function* () {
11961
11525
  gh: fn("AgentTools.gh")(function* (args) {
11962
11526
  yield* logInfo(`Calling "gh"`).pipe(annotateLogs({ args }));
11963
11527
  const cwd = yield* CurrentDirectory;
11964
- const cmd = make$25("gh", args, {
11528
+ const cmd = make$24("gh", args, {
11965
11529
  cwd,
11966
11530
  stdin: "ignore"
11967
11531
  });
@@ -12178,7 +11742,7 @@ const makeOutputBuffer = (maxChars) => {
12178
11742
  }
12179
11743
  };
12180
11744
  };
12181
- var ApplyPatchError = class extends TaggedClass$1("ApplyPatchError") {};
11745
+ var ApplyPatchError = class extends TaggedClass("ApplyPatchError") {};
12182
11746
  const backgroundRunningOutput = (task) => task.status === "running" ? {
12183
11747
  ...task,
12184
11748
  output: `Task "${task.id}" is still running in the background`
@@ -12681,7 +12245,7 @@ const isFiberSet = (u) => hasProperty(u, TypeId$5);
12681
12245
  const Proto$1 = {
12682
12246
  [TypeId$5]: TypeId$5,
12683
12247
  [Symbol.iterator]() {
12684
- if (this.state._tag === "Closed") return empty$6();
12248
+ if (this.state._tag === "Closed") return empty$9();
12685
12249
  return this.state.backing[Symbol.iterator]();
12686
12250
  },
12687
12251
  ...PipeInspectableProto,
@@ -12775,7 +12339,7 @@ function getStreamSchemas(schema) {
12775
12339
  }
12776
12340
  const schema = declare(isStream);
12777
12341
  function Stream(success, error) {
12778
- return make$45(schema.ast, {
12342
+ return make$41(schema.ast, {
12779
12343
  [StreamSchemaTypeId]: StreamSchemaTypeId,
12780
12344
  success,
12781
12345
  error
@@ -12897,7 +12461,7 @@ const make$14 = (tag, options) => {
12897
12461
  successSchema: options?.stream ? Stream(successSchema, errorSchema) : successSchema,
12898
12462
  errorSchema: options?.stream ? Never : errorSchema,
12899
12463
  defectSchema,
12900
- annotations: empty$5(),
12464
+ annotations: empty$8(),
12901
12465
  middlewares: new Set()
12902
12466
  });
12903
12467
  };
@@ -13022,8 +12586,8 @@ const makeNoSerialization = fnUntraced(function* (group, options) {
13022
12586
  const isStream = isStreamSchema(rpc.successSchema);
13023
12587
  const middleware = getRpcClientMiddleware(rpc);
13024
12588
  return (payload, opts) => {
13025
- const headers = opts?.headers ? fromInput$1(opts.headers) : empty$9;
13026
- const context = opts?.context ?? empty$5();
12589
+ const headers = opts?.headers ? fromInput$1(opts.headers) : empty$6;
12590
+ const context = opts?.context ?? empty$8();
13027
12591
  if (!isStream) {
13028
12592
  const onRequest = (span) => onEffectRequest(rpc, middleware, span, rpc.payloadSchema.make(payload), headers, context, opts?.discard ?? false);
13029
12593
  return disableTracing ? onRequest(void 0) : useSpan(spanName(spanPrefix, rpc._tag), {
@@ -13357,7 +12921,7 @@ const makeRpcSchemas = (codecFor) => {
13357
12921
  return entry;
13358
12922
  };
13359
12923
  };
13360
- const CurrentHeaders = Reference("effect/rpc/RpcClient/CurrentHeaders", { defaultValue: () => empty$9 });
12924
+ const CurrentHeaders = Reference("effect/rpc/RpcClient/CurrentHeaders", { defaultValue: () => empty$6 });
13361
12925
  var Protocol = class extends Service()("effect/rpc/RpcClient/Protocol") {
13362
12926
  static make = withRunClient;
13363
12927
  };
@@ -13463,7 +13027,7 @@ const RpcGroupProto = {
13463
13027
  });
13464
13028
  },
13465
13029
  annotateRpcs(service, value) {
13466
- return this.annotateRpcsMerge(make$41(service, value));
13030
+ return this.annotateRpcsMerge(make$42(service, value));
13467
13031
  },
13468
13032
  annotateMerge(context) {
13469
13033
  return makeProto({
@@ -13486,7 +13050,7 @@ const makeProto = (options) => Object.assign(function() {}, RpcGroupProto, {
13486
13050
  });
13487
13051
  const make$12 = (...rpcs) => makeProto({
13488
13052
  requests: new Map(rpcs.map((rpc) => [rpc._tag, rpc])),
13489
- annotations: empty$5()
13053
+ annotations: empty$8()
13490
13054
  });
13491
13055
  // src/ScriptPreprocessing.ts
13492
13056
  const callTemplateTargets = ["applyPatch", "taskComplete"];
@@ -14265,7 +13829,7 @@ const makeLocalWith = fnUntraced(function* (options) {
14265
13829
  currentDirectory = target;
14266
13830
  return onChange ? onChange(currentEnvironment()) : void_;
14267
13831
  }));
14268
- const taskServices = empty$5().pipe(add(TaskCompleter, opts.onTaskComplete), add(DirectoryChanger, changeDirectory), add(AgentTaskExecutor, {
13832
+ const taskServices = empty$8().pipe(add(TaskCompleter, opts.onTaskComplete), add(DirectoryChanger, changeDirectory), add(AgentTaskExecutor, {
14269
13833
  ...opts.agentTasks,
14270
13834
  subagent: (options) => renderEnvironment(currentEnvironment(), { reset: true }).pipe(flatMap$1((environment) => opts.agentTasks.subagent({
14271
13835
  ...options,
@@ -14274,7 +13838,7 @@ const makeLocalWith = fnUntraced(function* (options) {
14274
13838
  }), add(ImageAttacher, opts.onImage), add(TaskWatcher, opts.onTask ?? (() => void_)), add(TaskOwner, opts.agentId), add(CommandLimits, commandLimits), add(Console, console), add(CurrentLogAnnotations, {}), isSome(search) ? add(SemanticSearch, search.value) : identity);
14275
13839
  yield* gen(function* () {
14276
13840
  const source = prepareScript(opts.script);
14277
- const settled = yield* make$42();
13841
+ const settled = yield* make$43();
14278
13842
  const worker = yield* acquireRelease(sync(() => new Worker(workerSource, {
14279
13843
  eval: true,
14280
13844
  workerData: {
@@ -17173,7 +16737,7 @@ var ReferenceSlot = class {
17173
16737
  resolving = false;
17174
16738
  wrapper;
17175
16739
  constructor(key) {
17176
- this.wrapper = suspend$2(() => {
16740
+ this.wrapper = suspend$1(() => {
17177
16741
  if (this.body === void 0) throw new Error(`Reference ${key} was evaluated before it was resolved`);
17178
16742
  return this.body;
17179
16743
  });
@@ -18151,7 +17715,7 @@ const isBetweenBigIntReviver = makeReviverFilter("effect/schema/isBetweenBigInt"
18151
17715
  exclusiveMinimum: optional$2(Literal(true)),
18152
17716
  exclusiveMaximum: optional$2(Literal(true))
18153
17717
  }), ({ annotations, payload }) => isBetweenBigInt(payload, annotations));
18154
- const RepresentationSchema = suspend$2(() => RepresentationUnion);
17718
+ const RepresentationSchema = suspend$1(() => RepresentationUnion);
18155
17719
  const RepresentationsSchema = ArraySchema(RepresentationSchema);
18156
17720
  const RepresentationAnnotationSchema = Struct({
18157
17721
  id: NonEmptyString$1,
@@ -18170,7 +17734,7 @@ const AnnotationsSchema = optional$2(Record(String$7, Unknown)).pipe(encodeTo(op
18170
17734
  decode: passthroughSubtype(),
18171
17735
  encode: transformOptional((annotations) => isNone(annotations) || annotations.value === void 0 ? none() : pruneAnnotations(annotations.value))
18172
17736
  }));
18173
- const CheckSchema = suspend$2(() => CheckUnion);
17737
+ const CheckSchema = suspend$1(() => CheckUnion);
18174
17738
  const ChecksSchema = ArraySchema(CheckSchema);
18175
17739
  const KeywordFields = {
18176
17740
  annotations: AnnotationsSchema,
@@ -18343,8 +17907,8 @@ const HttpServerConfig = Struct({
18343
17907
  });
18344
17908
  const McpServerConfig = Union([StdioServerConfig, HttpServerConfig]);
18345
17909
  const defaultConnectTimeout = seconds(30);
18346
- var Connected = class extends TaggedClass$1("Connected") {};
18347
- var Failed = class extends TaggedClass$1("Failed") {};
17910
+ var Connected = class extends TaggedClass("Connected") {};
17911
+ var Failed = class extends TaggedClass("Failed") {};
18348
17912
  var McpServers = class extends Service()("clanka/McpServers") {};
18349
17913
  const layer$6 = (config) => fromEntries(Object.entries(config).map(([name, entry]) => toEntry(name, entry)));
18350
17914
  const fromEntries = (entries) => effect(McpServers, make$11(entries));
@@ -18912,7 +18476,7 @@ function toCodec(schema) {
18912
18476
  const encoded = toEncoded(jsonCodec.ast);
18913
18477
  const from = transform(encoded);
18914
18478
  if (from === encoded) return jsonCodec.ast === schema.ast ? schema : jsonCodec;
18915
- return make$45(decodeTo(from, jsonCodec.ast, passthrough$1()));
18479
+ return make$41(decodeTo(from, jsonCodec.ast, passthrough$1()));
18916
18480
  }
18917
18481
  function transform(root) {
18918
18482
  let cache;
@@ -19524,7 +19088,7 @@ const make$9 = fnUntraced(function* (params) {
19524
19088
  const generateText = (options) => useSpan("LanguageModel.generateText", { kind: "client" }, fnUntraced(function* (span) {
19525
19089
  const spanTransformer = yield* getSpanTransformer;
19526
19090
  const providerOptions = {
19527
- prompt: make$21(options.prompt),
19091
+ prompt: make$20(options.prompt),
19528
19092
  tools: [],
19529
19093
  toolChoice: "none",
19530
19094
  responseFormat: { type: "text" },
@@ -19535,7 +19099,7 @@ const make$9 = fnUntraced(function* (params) {
19535
19099
  const content = yield* generateContent(options, providerOptions);
19536
19100
  applySpanTransformer(spanTransformer, content, providerOptions);
19537
19101
  return new GenerateTextResponse(content);
19538
- }, catchTag("SchemaError", (error) => fail$1(make$18({
19102
+ }, catchTag("SchemaError", (error) => fail$1(make$47({
19539
19103
  module: "LanguageModel",
19540
19104
  method: "generateText",
19541
19105
  reason: InvalidOutputError.fromSchemaError(error)
@@ -19548,7 +19112,7 @@ const make$9 = fnUntraced(function* (params) {
19548
19112
  }, fnUntraced(function* (span) {
19549
19113
  const spanTransformer = yield* getSpanTransformer;
19550
19114
  const providerOptions = {
19551
- prompt: make$21(options.prompt),
19115
+ prompt: make$20(options.prompt),
19552
19116
  tools: [],
19553
19117
  toolChoice: "none",
19554
19118
  responseFormat: {
@@ -19564,7 +19128,7 @@ const make$9 = fnUntraced(function* (params) {
19564
19128
  applySpanTransformer(spanTransformer, content, providerOptions);
19565
19129
  const { codec } = yield* try_({
19566
19130
  try: () => codecTransformer(options.schema),
19567
- catch: (error) => make$18({
19131
+ catch: (error) => make$47({
19568
19132
  module: "LanguageModel",
19569
19133
  method: "generateObject",
19570
19134
  reason: new UnsupportedSchemaError({ description: error instanceof Error ? error.message : String(error) })
@@ -19572,7 +19136,7 @@ const make$9 = fnUntraced(function* (params) {
19572
19136
  });
19573
19137
  const value = yield* resolveStructuredOutput(content, codec);
19574
19138
  return new GenerateObjectResponse(value, content);
19575
- }, catchTag("SchemaError", (error) => fail$1(make$18({
19139
+ }, catchTag("SchemaError", (error) => fail$1(make$47({
19576
19140
  module: "LanguageModel",
19577
19141
  method: "generateObject",
19578
19142
  reason: InvalidOutputError.fromSchemaError(error)
@@ -19581,7 +19145,7 @@ const make$9 = fnUntraced(function* (params) {
19581
19145
  const streamText = fnUntraced(function* (options) {
19582
19146
  const span = yield* makeSpanScoped("LanguageModel.streamText", { kind: "client" });
19583
19147
  const providerOptions = {
19584
- prompt: make$21(options.prompt),
19148
+ prompt: make$20(options.prompt),
19585
19149
  tools: [],
19586
19150
  toolChoice: "none",
19587
19151
  responseFormat: { type: "text" },
@@ -19602,7 +19166,7 @@ const make$9 = fnUntraced(function* (params) {
19602
19166
  response: content
19603
19167
  });
19604
19168
  })));
19605
- }, unwrap$6, mapError$1((error) => isSchemaError(error) ? make$18({
19169
+ }, unwrap$6, mapError$1((error) => isSchemaError(error) ? make$47({
19606
19170
  module: "LanguageModel",
19607
19171
  method: "streamText",
19608
19172
  reason: InvalidOutputError.fromSchemaError(error)
@@ -19629,7 +19193,7 @@ const make$9 = fnUntraced(function* (params) {
19629
19193
  const { approved: allResolved, denied: allDenied, pendingApproved: approved, pendingDenied: denied } = collectToolApprovals(providerOptions.prompt.content);
19630
19194
  const hasPendingApprovals = approved.length > 0 || denied.length > 0;
19631
19195
  if (isUndefined(options.toolkit)) {
19632
- if (hasPendingApprovals) return yield* make$18({
19196
+ if (hasPendingApprovals) return yield* make$47({
19633
19197
  module: "LanguageModel",
19634
19198
  method: "generateText",
19635
19199
  reason: new ToolkitRequiredError({ pendingApprovals: [...approved, ...denied].map((result) => result.toolCall?.name).filter(isNotUndefined) })
@@ -19652,7 +19216,7 @@ const make$9 = fnUntraced(function* (params) {
19652
19216
  }
19653
19217
  const toolkit = yield* resolveToolkit(options.toolkit);
19654
19218
  if (Object.values(toolkit.tools).length === 0) {
19655
- if (hasPendingApprovals) return yield* make$18({
19219
+ if (hasPendingApprovals) return yield* make$47({
19656
19220
  module: "LanguageModel",
19657
19221
  method: "generateText",
19658
19222
  reason: new ToolkitRequiredError({ pendingApprovals: [...approved, ...denied].map((result) => result.toolCall?.name).filter(isNotUndefined) })
@@ -19675,7 +19239,7 @@ const make$9 = fnUntraced(function* (params) {
19675
19239
  }
19676
19240
  let preResolvedResults = [];
19677
19241
  if (hasPendingApprovals) {
19678
- for (const approval of approved) if (approval.toolCall && !toolkit.tools[approval.toolCall.name]) return yield* make$18({
19242
+ for (const approval of approved) if (approval.toolCall && !toolkit.tools[approval.toolCall.name]) return yield* make$47({
19679
19243
  module: "LanguageModel",
19680
19244
  method: "generateText",
19681
19245
  reason: new ToolNotFoundError({
@@ -19749,7 +19313,7 @@ const make$9 = fnUntraced(function* (params) {
19749
19313
  const { approved: allResolved, denied: allDenied, pendingApproved, pendingDenied } = collectToolApprovals(providerOptions.prompt.content);
19750
19314
  const hasPendingApprovals = pendingApproved.length > 0 || pendingDenied.length > 0;
19751
19315
  if (isUndefined(options.toolkit)) {
19752
- if (hasPendingApprovals) return yield* make$18({
19316
+ if (hasPendingApprovals) return yield* make$47({
19753
19317
  module: "LanguageModel",
19754
19318
  method: "streamText",
19755
19319
  reason: new ToolkitRequiredError({ pendingApprovals: [...pendingApproved, ...pendingDenied].map((a) => a.toolCall?.name).filter(isNotUndefined) })
@@ -19770,7 +19334,7 @@ const make$9 = fnUntraced(function* (params) {
19770
19334
  }
19771
19335
  const toolkit = yield* resolveToolkit(options.toolkit);
19772
19336
  if (Object.values(toolkit.tools).length === 0) {
19773
- if (hasPendingApprovals) return yield* make$18({
19337
+ if (hasPendingApprovals) return yield* make$47({
19774
19338
  module: "LanguageModel",
19775
19339
  method: "streamText",
19776
19340
  reason: new ToolkitRequiredError({ pendingApprovals: [...pendingApproved, ...pendingDenied].map((a) => a.toolCall?.name).filter(isNotUndefined) })
@@ -19791,7 +19355,7 @@ const make$9 = fnUntraced(function* (params) {
19791
19355
  }
19792
19356
  let preResolvedStreamParts = [];
19793
19357
  if (hasPendingApprovals) {
19794
- for (const approval of pendingApproved) if (approval.toolCall && !toolkit.tools[approval.toolCall.name]) return yield* make$18({
19358
+ for (const approval of pendingApproved) if (approval.toolCall && !toolkit.tools[approval.toolCall.name]) return yield* make$47({
19795
19359
  module: "LanguageModel",
19796
19360
  method: "streamText",
19797
19361
  reason: new ToolNotFoundError({
@@ -19832,7 +19396,7 @@ const make$9 = fnUntraced(function* (params) {
19832
19396
  return void_;
19833
19397
  }) : identity)));
19834
19398
  }
19835
- const queue = yield* make$47();
19399
+ const queue = yield* make$46();
19836
19400
  const deferredFinishParts = [];
19837
19401
  if (preResolvedStreamParts.length > 0) yield* offerAll(queue, preResolvedStreamParts);
19838
19402
  const toolCallFibers = yield* make$15();
@@ -19996,7 +19560,7 @@ const executeApprovedToolCalls = (approvals, toolkit, concurrency) => {
19996
19560
  const toolCall = approval.toolCall;
19997
19561
  if (isUndefined(toolCall)) return yield* die("Approval missing tool call reference");
19998
19562
  const tool = toolkit.tools[toolCall.name];
19999
- if (isUndefined(tool)) return yield* make$18({
19563
+ if (isUndefined(tool)) return yield* make$47({
20000
19564
  module: "LanguageModel",
20001
19565
  method: "generateText",
20002
19566
  reason: new ToolNotFoundError({
@@ -20178,7 +19742,7 @@ const resolveStructuredOutput = fnUntraced(function* (response, schema) {
20178
19742
  const texts = [];
20179
19743
  for (const part of response) if (part.type === "text") texts.push(part.text);
20180
19744
  const text = texts.join("");
20181
- if (text.length === 0) return yield* make$18({
19745
+ if (text.length === 0) return yield* make$47({
20182
19746
  module: "LanguageModel",
20183
19747
  method: "generateObject",
20184
19748
  reason: new StructuredOutputError({
@@ -20187,7 +19751,7 @@ const resolveStructuredOutput = fnUntraced(function* (response, schema) {
20187
19751
  })
20188
19752
  });
20189
19753
  const decode = decodeEffect(fromJsonString(schema));
20190
- return yield* mapError(decode(text), (error) => make$18({
19754
+ return yield* mapError(decode(text), (error) => make$47({
20191
19755
  module: "LanguageModel",
20192
19756
  method: "generateObject",
20193
19757
  reason: StructuredOutputError.fromSchemaError(error, text)
@@ -20445,7 +20009,7 @@ ${summary}
20445
20009
  })}<conversation>
20446
20010
  ${conversation}
20447
20011
  </conversation>`;
20448
- return make$21(text).pipe(setSystem(summarizerSystem));
20012
+ return make$20(text).pipe(setSystem(summarizerSystem));
20449
20013
  };
20450
20014
  const wrapSummary = (summary) => `${summaryOpenTag}\n${summary}\n${summaryCloseTag}`;
20451
20015
  const rewrite = (options) => fromMessages([
@@ -20475,7 +20039,7 @@ const compact = fnUntraced(function* (options) {
20475
20039
  onNone: () => summarize,
20476
20040
  onSome: (model) => summarize.pipe(provide$1(model), provideService(SummarizerTransform, identity))
20477
20041
  })).trim();
20478
- if (summary.length === 0) return yield* make$18({
20042
+ if (summary.length === 0) return yield* make$47({
20479
20043
  module: "clanka/Compaction",
20480
20044
  method: "compact",
20481
20045
  reason: new InvalidOutputError({ description: "The summarizer returned no text" })
@@ -20493,7 +20057,7 @@ const compact = fnUntraced(function* (options) {
20493
20057
  });
20494
20058
  });
20495
20059
  // src/AgentOutput.ts
20496
- var AgentStart = class extends TaggedClass$2()("AgentStart", {
20060
+ var AgentStart = class extends TaggedClass$1()("AgentStart", {
20497
20061
  id: Number$2,
20498
20062
  prompt: Prompt,
20499
20063
  provider: String$7,
@@ -20503,22 +20067,22 @@ var AgentStart = class extends TaggedClass$2()("AgentStart", {
20503
20067
  return `${this.provider}/${this.model}`;
20504
20068
  }
20505
20069
  };
20506
- var ReasoningStart = class extends TaggedClass$2()("ReasoningStart", {}) {};
20507
- var ReasoningDelta = class extends TaggedClass$2()("ReasoningDelta", { delta: String$7 }) {};
20508
- var ReasoningEnd = class extends TaggedClass$2()("ReasoningEnd", {}) {};
20509
- var ScriptStart = class extends TaggedClass$2()("ScriptStart", {}) {};
20510
- var ScriptDelta = class extends TaggedClass$2()("ScriptDelta", { delta: String$7 }) {};
20511
- var ScriptEnd = class extends TaggedClass$2()("ScriptEnd", {}) {};
20512
- var Usage = class extends TaggedClass$2()("Usage", {
20070
+ var ReasoningStart = class extends TaggedClass$1()("ReasoningStart", {}) {};
20071
+ var ReasoningDelta = class extends TaggedClass$1()("ReasoningDelta", { delta: String$7 }) {};
20072
+ var ReasoningEnd = class extends TaggedClass$1()("ReasoningEnd", {}) {};
20073
+ var ScriptStart = class extends TaggedClass$1()("ScriptStart", {}) {};
20074
+ var ScriptDelta = class extends TaggedClass$1()("ScriptDelta", { delta: String$7 }) {};
20075
+ var ScriptEnd = class extends TaggedClass$1()("ScriptEnd", {}) {};
20076
+ var Usage = class extends TaggedClass$1()("Usage", {
20513
20077
  contextTokens: Number$2,
20514
20078
  inputTokens: Number$2,
20515
20079
  outputTokens: Number$2,
20516
20080
  cacheRead: Number$2,
20517
20081
  cacheWrite: Number$2
20518
20082
  }) {};
20519
- var ErrorRetry = class extends TaggedClass$2()("ErrorRetry", { error: AiError }) {};
20520
- var ScriptOutput = class extends TaggedClass$2()("ScriptOutput", { output: String$7 }) {};
20521
- var SubagentStart = class extends TaggedClass$2()("SubagentStart", {
20083
+ var ErrorRetry = class extends TaggedClass$1()("ErrorRetry", { error: AiError }) {};
20084
+ var ScriptOutput = class extends TaggedClass$1()("ScriptOutput", { output: String$7 }) {};
20085
+ var SubagentStart = class extends TaggedClass$1()("SubagentStart", {
20522
20086
  id: Number$2,
20523
20087
  prompt: String$7,
20524
20088
  model: String$7,
@@ -20529,7 +20093,7 @@ var SubagentStart = class extends TaggedClass$2()("SubagentStart", {
20529
20093
  return `${this.provider}/${this.model}`;
20530
20094
  }
20531
20095
  };
20532
- var SubagentComplete = class extends TaggedClass$2()("SubagentComplete", {
20096
+ var SubagentComplete = class extends TaggedClass$1()("SubagentComplete", {
20533
20097
  id: Number$2,
20534
20098
  summary: String$7,
20535
20099
  status: Literals$2([
@@ -20538,24 +20102,24 @@ var SubagentComplete = class extends TaggedClass$2()("SubagentComplete", {
20538
20102
  "cancelled"
20539
20103
  ]).pipe(withDecodingDefaultKey(succeed$1("completed")), withConstructorDefault(succeed$1("completed")))
20540
20104
  }) {};
20541
- var ExecuteOutputCapped = class extends TaggedClass$2()("ExecuteOutputCapped", {
20105
+ var ExecuteOutputCapped = class extends TaggedClass$1()("ExecuteOutputCapped", {
20542
20106
  charsBefore: Number$2,
20543
20107
  charsAfter: Number$2
20544
20108
  }) {};
20545
20109
  const CompactionReason = Literals$2(["threshold", "overflow"]);
20546
- var CompactionStarted = class extends TaggedClass$2()("CompactionStarted", { reason: CompactionReason }) {};
20547
- var CompactionEnded = class extends TaggedClass$2()("CompactionEnded", {
20110
+ var CompactionStarted = class extends TaggedClass$1()("CompactionStarted", { reason: CompactionReason }) {};
20111
+ var CompactionEnded = class extends TaggedClass$1()("CompactionEnded", {
20548
20112
  reason: CompactionReason,
20549
20113
  tokensBefore: Number$2,
20550
20114
  tokensAfter: Number$2
20551
20115
  }) {};
20552
- var SessionRestarted = class extends TaggedClass$2()("SessionRestarted", {
20116
+ var SessionRestarted = class extends TaggedClass$1()("SessionRestarted", {
20553
20117
  reason: String$7,
20554
20118
  contextTokens: Number$2,
20555
20119
  cacheWrite: Number$2
20556
20120
  }) {};
20557
- var EnvironmentUpdated = class extends TaggedClass$2()("EnvironmentUpdated", { update: String$7 }) {};
20558
- var JobComplete = class extends TaggedClass$2()("JobComplete", {
20121
+ var EnvironmentUpdated = class extends TaggedClass$1()("EnvironmentUpdated", { update: String$7 }) {};
20122
+ var JobComplete = class extends TaggedClass$1()("JobComplete", {
20559
20123
  id: String$7,
20560
20124
  status: Literals$2([
20561
20125
  "completed",
@@ -20582,12 +20146,12 @@ const ContentPart = Union([
20582
20146
  EnvironmentUpdated,
20583
20147
  JobComplete
20584
20148
  ]);
20585
- var SubagentPart = class extends TaggedClass$2()("SubagentPart", {
20149
+ var SubagentPart = class extends TaggedClass$1()("SubagentPart", {
20586
20150
  id: Number$2,
20587
20151
  part: ContentPart
20588
20152
  }) {};
20589
- var HistoryAppended = class extends TaggedClass$2()("HistoryAppended", { messages: ArraySchema(Message) }) {};
20590
- var HistoryReplaced = class extends TaggedClass$2()("HistoryReplaced", { messages: ArraySchema(Message) }) {};
20153
+ var HistoryAppended = class extends TaggedClass$1()("HistoryAppended", { messages: ArraySchema(Message) }) {};
20154
+ var HistoryReplaced = class extends TaggedClass$1()("HistoryReplaced", { messages: ArraySchema(Message) }) {};
20591
20155
  const Output = Union([
20592
20156
  ...ContentPart.members,
20593
20157
  AgentStart,
@@ -20632,8 +20196,8 @@ const makeWith$1 = fnUntraced(function* (options) {
20632
20196
  const rootTaskOwner = crypto.randomUUID();
20633
20197
  const outputBuffer = new Map();
20634
20198
  let currentOutputAgent = null;
20635
- const history = make$46(empty$1);
20636
- const environment = make$46(capabilities.environment);
20199
+ const history = make$45(empty$1);
20200
+ const environment = make$45(capabilities.environment);
20637
20201
  const backgroundCompactions = new WeakMap();
20638
20202
  const spawn = fnUntraced(function* (opts) {
20639
20203
  const agentId = opts.agentId;
@@ -20657,11 +20221,18 @@ const makeWith$1 = fnUntraced(function* (options) {
20657
20221
  ...mcpServers.handlers(onImage)
20658
20222
  };
20659
20223
  let scriptsRan = false;
20660
- const output = yield* make$47();
20224
+ const output = yield* make$46();
20661
20225
  let inputTokens = 0;
20662
20226
  let outputTokens = 0;
20663
20227
  let cacheRead = 0;
20664
20228
  let cacheWrite = 0;
20229
+ const sendUsage = () => offerUnsafe(output, new Usage({
20230
+ contextTokens: lastContextTokens ?? 0,
20231
+ inputTokens,
20232
+ outputTokens,
20233
+ cacheRead,
20234
+ cacheWrite
20235
+ }));
20665
20236
  const prompt = opts.history;
20666
20237
  const mailbox = opts.mailbox;
20667
20238
  const onTask = (task) => task.await.pipe(flatMap$1((final) => sync(() => {
@@ -20727,7 +20298,7 @@ const makeWith$1 = fnUntraced(function* (options) {
20727
20298
  }
20728
20299
  state.push(options.part);
20729
20300
  }
20730
- const runScope = yield* make$43();
20301
+ const runScope = yield* make$44();
20731
20302
  const runContext = yield* context();
20732
20303
  const provideSubagentModel = (effect) => match$2(subagentModel, {
20733
20304
  onNone: () => effect,
@@ -20768,11 +20339,12 @@ const makeWith$1 = fnUntraced(function* (options) {
20768
20339
  const startTurn = fnUntraced(function* (options) {
20769
20340
  const { child } = options;
20770
20341
  const turn = child.turn;
20342
+ let childUsage;
20771
20343
  const display = opts.display && !options.background;
20772
20344
  const stream = spawn({
20773
20345
  agentId: child.id,
20774
20346
  taskOwner: child.taskOwner,
20775
- prompt: make$21(options.prompt),
20347
+ prompt: make$20(options.prompt),
20776
20348
  environmentUpdate: options.environmentUpdate,
20777
20349
  system: opts.system,
20778
20350
  history: child.history,
@@ -20794,20 +20366,30 @@ const makeWith$1 = fnUntraced(function* (options) {
20794
20366
  release: true
20795
20367
  });
20796
20368
  return yield* stream.pipe(runForEachArray((parts) => {
20797
- for (const part of parts) switch (part._tag) {
20798
- case "AgentStart":
20799
- case "HistoryAppended":
20800
- case "HistoryReplaced": break;
20801
- case "SubagentStart":
20802
- case "SubagentComplete":
20803
- offerUnsafe(output, part);
20804
- break;
20805
- default:
20806
- if (!display) break;
20807
- offerUnsafe(output, part._tag === "SubagentPart" ? part : new SubagentPart({
20808
- id: child.id,
20809
- part
20810
- }));
20369
+ for (const part of parts) {
20370
+ if (part._tag === "Usage") {
20371
+ inputTokens += part.inputTokens - (childUsage?.inputTokens ?? 0);
20372
+ outputTokens += part.outputTokens - (childUsage?.outputTokens ?? 0);
20373
+ cacheRead += part.cacheRead - (childUsage?.cacheRead ?? 0);
20374
+ cacheWrite += part.cacheWrite - (childUsage?.cacheWrite ?? 0);
20375
+ childUsage = part;
20376
+ sendUsage();
20377
+ }
20378
+ switch (part._tag) {
20379
+ case "AgentStart":
20380
+ case "HistoryAppended":
20381
+ case "HistoryReplaced": break;
20382
+ case "SubagentStart":
20383
+ case "SubagentComplete":
20384
+ offerUnsafe(output, part);
20385
+ break;
20386
+ default:
20387
+ if (!display) break;
20388
+ offerUnsafe(output, part._tag === "SubagentPart" ? part : new SubagentPart({
20389
+ id: child.id,
20390
+ part
20391
+ }));
20392
+ }
20811
20393
  }
20812
20394
  return void_;
20813
20395
  }), as(""), catchTag("AgentFinished", (finished) => succeed$1(finished.summary)));
@@ -20834,8 +20416,8 @@ const makeWith$1 = fnUntraced(function* (options) {
20834
20416
  id: Number(id),
20835
20417
  taskOwner: crypto.randomUUID(),
20836
20418
  prompt,
20837
- history: make$46(empty$1),
20838
- environment: make$46(environment.environment),
20419
+ history: make$45(empty$1),
20420
+ environment: make$45(environment.environment),
20839
20421
  mailbox: makeMailbox(),
20840
20422
  turn: makeTurn(background)
20841
20423
  };
@@ -21148,7 +20730,7 @@ ${prompt}`,
21148
20730
  return;
21149
20731
  }
21150
20732
  if (mailbox.messages.size > 0) {
21151
- appendHistory(make$21(Array$1.from(mailbox.messages, ({ message, resume }) => {
20733
+ appendHistory(make$20(Array$1.from(mailbox.messages, ({ message, resume }) => {
21152
20734
  resume(void_);
21153
20735
  return {
21154
20736
  role: "user",
@@ -21169,7 +20751,7 @@ ${prompt}`,
21169
20751
  });
21170
20752
  }
21171
20753
  for (const { task, claim } of mailbox.tasks.splice(0)) if (yield* claim) pushes.push(task);
21172
- if (pushes.length > 0) appendHistory(make$21(pushes.map((task) => ({
20754
+ if (pushes.length > 0) appendHistory(make$20(pushes.map((task) => ({
21173
20755
  role: "user",
21174
20756
  content: taskMessage(task)
21175
20757
  }))));
@@ -21266,16 +20848,7 @@ ${prompt}`,
21266
20848
  if (usage.inputTokens.total !== void 0) {
21267
20849
  lastContextTokens = usage.inputTokens.total;
21268
20850
  inputTokens += usage.inputTokens.total;
21269
- maybeSend({
21270
- agentId,
21271
- part: new Usage({
21272
- contextTokens: usage.inputTokens.total,
21273
- inputTokens,
21274
- outputTokens,
21275
- cacheRead,
21276
- cacheWrite
21277
- })
21278
- });
20851
+ sendUsage();
21279
20852
  }
21280
20853
  break;
21281
20854
  case "tool-call":
@@ -21383,7 +20956,7 @@ ${prompt}`,
21383
20956
  send: (options) => spawn({
21384
20957
  agentId: 0,
21385
20958
  taskOwner: rootTaskOwner,
21386
- prompt: make$21(options.prompt),
20959
+ prompt: make$20(options.prompt),
21387
20960
  system: options.system,
21388
20961
  history,
21389
20962
  environment,
@@ -21438,19 +21011,19 @@ const makeTurn = (background) => ({
21438
21011
  fiber: void 0
21439
21012
  });
21440
21013
  const causeMessage = (cause) => errorMessage(squash(cause));
21441
- const turnTimeoutError = make$18({
21014
+ const turnTimeoutError = make$47({
21442
21015
  module: "clanka/Agent",
21443
21016
  method: "send",
21444
- reason: new UnknownError({ description: "TurnTimeout was reached" })
21017
+ reason: new UnknownError$1({ description: "TurnTimeout was reached" })
21445
21018
  });
21446
- const incompleteResponseError = (description) => make$18({
21019
+ const incompleteResponseError = (description) => make$47({
21447
21020
  module: "clanka/Agent",
21448
21021
  method: "send",
21449
21022
  reason: new InternalProviderError({ description })
21450
21023
  });
21451
21024
  const retryPolicy = min([exponential(100, 1.5), spaced(5e3)]).pipe(jittered);
21452
21025
  const environmentUpdateOpen = "<environment-update>";
21453
- const environmentUpdateMessage = (text) => make$21([{
21026
+ const environmentUpdateMessage = (text) => make$20([{
21454
21027
  role: "user",
21455
21028
  content: `${environmentUpdateOpen}\n${text}\n</environment-update>`
21456
21029
  }]);
@@ -21673,7 +21246,7 @@ const LoadSessionParams = Struct({
21673
21246
  model: optionalKey(String$7),
21674
21247
  mcpServers: optionalKey(ArraySchema(McpServer))
21675
21248
  });
21676
- const redactValues = (entries) => Object.fromEntries((entries ?? []).map(({ name, value }) => [name, make$44(value)]));
21249
+ const redactValues = (entries) => Object.fromEntries((entries ?? []).map(({ name, value }) => [name, make$40(value)]));
21677
21250
  const mcpServerEntries = fnUntraced(function* (servers, cwd) {
21678
21251
  const entries = Object.create(null);
21679
21252
  for (const server of servers) {
@@ -22340,7 +21913,7 @@ const make$7 = fnUntraced(function* (options) {
22340
21913
  });
22341
21914
  const runStdio = (options) => gen(function* () {
22342
21915
  const stdio = yield* Stdio;
22343
- const output = yield* make$47();
21916
+ const output = yield* make$46();
22344
21917
  const writer = yield* fromQueue(output).pipe(map$11((line) => `${line}\n`), run$4(stdio.stdout()), forkScoped);
22345
21918
  const server = yield* make$7({
22346
21919
  ...options,
@@ -22642,7 +22215,7 @@ const Event = Struct({
22642
22215
  data: String$7
22643
22216
  });
22644
22217
  const RetryTypeId = "~effect/encoding/Sse/Retry";
22645
- var Retry = class Retry extends TaggedClass$1("Retry") {
22218
+ var Retry = class Retry extends TaggedClass("Retry") {
22646
22219
  [RetryTypeId] = RetryTypeId;
22647
22220
  static is(u) {
22648
22221
  return hasProperty(u, RetryTypeId);
@@ -22652,7 +22225,7 @@ var Retry = class Retry extends TaggedClass$1("Retry") {
22652
22225
  }
22653
22226
  };
22654
22227
  // node_modules/.pnpm/@effect+ai-openai@4.1.1_effect@4.1.1/node_modules/@effect/ai-openai/dist/Generated.js
22655
- const CompoundFilter = suspend$2(() => __recursive_CompoundFilter);
22228
+ const CompoundFilter = suspend$1(() => __recursive_CompoundFilter);
22656
22229
  const Metadata = Union([Record(String$7, String$7).annotate({ "description": "Set of 16 key-value pairs that can be attached to an object. This can be\nuseful for storing additional information about the object in a structured\nformat, and querying for objects via API or the dashboard.\n\nKeys are strings with a maximum length of 64 characters. Values are strings\nwith a maximum length of 512 characters.\n" }), Null]).annotate({ "identifier": "Metadata" });
22657
22230
  const ReasoningEffort = Union([Literals$2([
22658
22231
  "none",
@@ -23569,7 +23142,7 @@ const InlineSkillParam = Struct({
23569
23142
  "type": Literal("inline").annotate({ "description": "Defines an inline skill for this request." }),
23570
23143
  "name": String$7.annotate({ "description": "The name of the skill." }),
23571
23144
  "description": String$7.annotate({ "description": "The description of the skill." }),
23572
- "source": suspend$2(() => InlineSkillSourceParam).annotate({ "description": "Inline skill payload" })
23145
+ "source": suspend$1(() => InlineSkillSourceParam).annotate({ "description": "Inline skill payload" })
23573
23146
  }).annotate({ "identifier": "InlineSkillParam" });
23574
23147
  const ContainerNetworkPolicyAllowlistParam = Struct({
23575
23148
  "type": Literal("allowlist").annotate({ "description": "Allow outbound network access only to specified domains. Always `allowlist`." }),
@@ -23611,7 +23184,7 @@ const InputImageContent$1 = Struct({
23611
23184
  "format": "uri"
23612
23185
  }), Null])),
23613
23186
  "file_id": optionalKey(Union([String$7.annotate({ "description": "The ID of the file to be sent to the model." }), Null])),
23614
- "detail": suspend$2(() => ImageDetail$1).annotate({ "description": "The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`." }),
23187
+ "detail": suspend$1(() => ImageDetail$1).annotate({ "description": "The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`." }),
23615
23188
  "prompt_cache_breakpoint": optionalKey(PromptCacheBreakpointConfig)
23616
23189
  }).annotate({
23617
23190
  "title": "Input image",
@@ -23628,7 +23201,7 @@ const InputFileContent$1 = Struct({
23628
23201
  "description": "The URL of the file to be sent to the model.",
23629
23202
  "format": "uri"
23630
23203
  })),
23631
- "detail": optionalKey(suspend$2(() => FileInputDetail).annotate({ "description": "The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`." }))
23204
+ "detail": optionalKey(suspend$1(() => FileInputDetail).annotate({ "description": "The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`." }))
23632
23205
  }).annotate({
23633
23206
  "title": "Input file",
23634
23207
  "description": "A file input to the model.",
@@ -23644,7 +23217,7 @@ const ToolCallCallerParam = Union([DirectToolCallCallerParam, ProgramToolCallCal
23644
23217
  });
23645
23218
  const ClickParam = Struct({
23646
23219
  "type": Literal("click").annotate({ "description": "Specifies the event type. For a click action, this property is always `click`." }),
23647
- "button": suspend$2(() => ClickButtonType).annotate({ "description": "Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`." }),
23220
+ "button": suspend$1(() => ClickButtonType).annotate({ "description": "Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`." }),
23648
23221
  "x": Number$2.annotate({ "description": "The x-coordinate where the click occurred." }).check(isInt().annotate({ "expected": "an integer" })),
23649
23222
  "y": Number$2.annotate({ "description": "The y-coordinate where the click occurred." }).check(isInt().annotate({ "expected": "an integer" })),
23650
23223
  "keys": optionalKey(Union([ArraySchema(String$7).annotate({ "description": "The keys being held while clicking." }), Null]))
@@ -23686,14 +23259,14 @@ const ApplyPatchToolParam = Struct({
23686
23259
  "identifier": "ApplyPatchToolParam"
23687
23260
  });
23688
23261
  const RankingOptions = Struct({
23689
- "ranker": optionalKey(suspend$2(() => RankerVersionType).annotate({ "description": "The ranker to use for the file search." })),
23262
+ "ranker": optionalKey(suspend$1(() => RankerVersionType).annotate({ "description": "The ranker to use for the file search." })),
23690
23263
  "score_threshold": optionalKey(Number$2.annotate({ "description": "The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results." }).check(isFinite$1().annotate({ "expected": "a finite number" }))),
23691
- "hybrid_search": optionalKey(suspend$2(() => HybridSearchOptions).annotate({ "description": "Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled." }))
23264
+ "hybrid_search": optionalKey(suspend$1(() => HybridSearchOptions).annotate({ "description": "Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches when hybrid search is enabled." }))
23692
23265
  }).annotate({ "identifier": "RankingOptions" });
23693
23266
  const Filters = Union([ComparisonFilter, CompoundFilter]).annotate({ "identifier": "Filters" });
23694
23267
  const ComputerUsePreviewTool = Struct({
23695
23268
  "type": Literal("computer_use_preview").annotate({ "description": "The type of the computer use tool. Always `computer_use_preview`." }),
23696
- "environment": suspend$2(() => ComputerEnvironment).annotate({ "description": "The type of computer environment to control." }),
23269
+ "environment": suspend$1(() => ComputerEnvironment).annotate({ "description": "The type of computer environment to control." }),
23697
23270
  "display_width": Number$2.annotate({ "description": "The width of the computer display." }).check(isInt().annotate({ "expected": "an integer" })),
23698
23271
  "display_height": Number$2.annotate({ "description": "The height of the computer display." }).check(isInt().annotate({ "expected": "an integer" }))
23699
23272
  }).annotate({
@@ -23708,7 +23281,7 @@ const WebSearchTool = Struct({
23708
23281
  "title": "Allowed domains for the search.",
23709
23282
  "description": "Allowed domains for the search. If not provided, all domains are allowed.\nSubdomains of the provided domains are allowed as well.\n\nExample: `[\"pubmed.ncbi.nlm.nih.gov\"]`\n"
23710
23283
  }), Null])) }).annotate({ "description": "Filters for the search.\n" }), Null])),
23711
- "user_location": optionalKey(suspend$2(() => WebSearchApproximateLocation).annotate({ "description": "The approximate location of the user. If omitted or null, defaults to the\nUnited States. To avoid this fallback, pass `{\"type\": \"approximate\"}` without\nlocation fields. To localize results, provide the relevant location fields.\n" })),
23284
+ "user_location": optionalKey(suspend$1(() => WebSearchApproximateLocation).annotate({ "description": "The approximate location of the user. If omitted or null, defaults to the\nUnited States. To avoid this fallback, pass `{\"type\": \"approximate\"}` without\nlocation fields. To localize results, provide the relevant location fields.\n" })),
23712
23285
  "search_context_size": optionalKey(Literals$2([
23713
23286
  "low",
23714
23287
  "medium",
@@ -23806,7 +23379,7 @@ const ImageGenTool = Struct({
23806
23379
  "file_id": optionalKey(String$7.annotate({ "description": "File ID for the mask image.\n" }))
23807
23380
  }).annotate({ "description": "Optional mask for inpainting. Contains `image_url`\n(string, optional) and `file_id` (string, optional).\n" })),
23808
23381
  "partial_images": optionalKey(Number$2.annotate({ "description": "Number of partial images to generate in streaming mode, from 0 (default value) to 3.\n" }).check(isInt().annotate({ "expected": "an integer" })).check(isGreaterThanOrEqualTo(0).annotate({ "expected": "a value greater than or equal to 0" })).check(isLessThanOrEqualTo(3).annotate({ "expected": "a value less than or equal to 3" }))),
23809
- "action": optionalKey(suspend$2(() => ImageGenActionEnum).annotate({ "description": "Whether to generate a new image or edit an existing image. Default: `auto`.\n" }))
23382
+ "action": optionalKey(suspend$1(() => ImageGenActionEnum).annotate({ "description": "Whether to generate a new image or edit an existing image. Default: `auto`.\n" }))
23810
23383
  }).annotate({
23811
23384
  "title": "Image generation tool",
23812
23385
  "description": "A tool that generates images using the GPT image models.\n",
@@ -23818,7 +23391,7 @@ const LocalEnvironmentParam = Struct({
23818
23391
  }).annotate({ "identifier": "LocalEnvironmentParam" });
23819
23392
  const CustomGrammarFormatParam = Struct({
23820
23393
  "type": Literal("grammar").annotate({ "description": "Grammar format. Always `grammar`." }),
23821
- "syntax": suspend$2(() => GrammarSyntax1).annotate({ "description": "The syntax of the grammar definition. One of `lark` or `regex`." }),
23394
+ "syntax": suspend$1(() => GrammarSyntax1).annotate({ "description": "The syntax of the grammar definition. One of `lark` or `regex`." }),
23822
23395
  "definition": String$7.annotate({ "description": "The grammar definition." })
23823
23396
  }).annotate({
23824
23397
  "title": "Grammar format",
@@ -23838,9 +23411,9 @@ const FunctionToolParam = Struct({
23838
23411
  }).annotate({ "identifier": "FunctionToolParam" });
23839
23412
  const ToolSearchToolParam = Struct({
23840
23413
  "type": Literal("tool_search").annotate({ "description": "The type of the tool. Always `tool_search`." }),
23841
- "execution": optionalKey(suspend$2(() => ToolSearchExecutionType).annotate({ "description": "Whether tool search is executed by the server or by the client." })),
23414
+ "execution": optionalKey(suspend$1(() => ToolSearchExecutionType).annotate({ "description": "Whether tool search is executed by the server or by the client." })),
23842
23415
  "description": optionalKey(Union([String$7.annotate({ "description": "Description shown to the model for a client-executed tool search tool." }), Null])),
23843
- "parameters": optionalKey(Union([suspend$2(() => EmptyModelParam).annotate({ "description": "Parameter schema for a client-executed tool search tool." }), Null]))
23416
+ "parameters": optionalKey(Union([suspend$1(() => EmptyModelParam).annotate({ "description": "Parameter schema for a client-executed tool search tool." }), Null]))
23844
23417
  }).annotate({
23845
23418
  "title": "Tool search tool",
23846
23419
  "description": "Hosted or BYOT tool search configuration for deferred tools.",
@@ -23859,8 +23432,8 @@ const ToolSearchOutputFunctionToolParam = Struct({
23859
23432
  }).annotate({ "identifier": "ToolSearchOutputFunctionToolParam" });
23860
23433
  const WebSearchPreviewTool = Struct({
23861
23434
  "type": Literals$2(["web_search_preview", "web_search_preview_2025_03_11"]).annotate({ "description": "The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`." }),
23862
- "user_location": optionalKey(Union([suspend$2(() => ApproximateLocation).annotate({ "description": "The approximate location of the user. If omitted or null, defaults to the United States. To avoid this fallback, pass `{\"type\": \"approximate\"}` without location fields. To localize results, provide the relevant location fields." }), Null])),
23863
- "search_context_size": optionalKey(suspend$2(() => SearchContextSize).annotate({ "description": "High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default." })),
23435
+ "user_location": optionalKey(Union([suspend$1(() => ApproximateLocation).annotate({ "description": "The approximate location of the user. If omitted or null, defaults to the United States. To avoid this fallback, pass `{\"type\": \"approximate\"}` without location fields. To localize results, provide the relevant location fields." }), Null])),
23436
+ "search_context_size": optionalKey(suspend$1(() => SearchContextSize).annotate({ "description": "High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default." })),
23864
23437
  "search_content_types": optionalKey(ArraySchema(SearchContentType))
23865
23438
  }).annotate({
23866
23439
  "title": "Web search preview",
@@ -23879,7 +23452,7 @@ const InputImageContentParamAutoParam = Struct({
23879
23452
  "format": "uri"
23880
23453
  }).check(isMaxCodePoints(20971520).annotate({ "expected": "a string with at most 20971520 code points" })), Null])),
23881
23454
  "file_id": optionalKey(Union([String$7.annotate({ "description": "The ID of the file to be sent to the model." }), Null])),
23882
- "detail": optionalKey(Union([suspend$2(() => DetailEnum).annotate({ "description": "The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`." }), Null])),
23455
+ "detail": optionalKey(Union([suspend$1(() => DetailEnum).annotate({ "description": "The detail level of the image to be sent to the model. One of `high`, `low`, `auto`, or `original`. Defaults to `auto`." }), Null])),
23883
23456
  "prompt_cache_breakpoint": optionalKey(Union([PromptCacheBreakpointParam, Null]))
23884
23457
  }).annotate({
23885
23458
  "title": "Input image",
@@ -23895,7 +23468,7 @@ const InputFileContentParam = Struct({
23895
23468
  "description": "The URL of the file to be sent to the model.",
23896
23469
  "format": "uri"
23897
23470
  }), Null])),
23898
- "detail": optionalKey(suspend$2(() => FileDetailEnum).annotate({ "description": "The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`." })),
23471
+ "detail": optionalKey(suspend$1(() => FileDetailEnum).annotate({ "description": "The detail level of the file to be sent to the model. Use `auto` to let the system select the detail level; for GPT-5.6 and later models, `auto` uses high-quality rendering, which may increase input token usage. Use `low` for lower-cost rendering, or `high` to render the file at higher quality. Defaults to `auto`." })),
23899
23472
  "prompt_cache_breakpoint": optionalKey(Union([PromptCacheBreakpointParam, Null]))
23900
23473
  }).annotate({
23901
23474
  "title": "Input file",
@@ -23921,12 +23494,12 @@ const ProgramOutputItemParam = Struct({
23921
23494
  "type": Literal("program_output").annotate({ "description": "The item type. Always `program_output`." }),
23922
23495
  "call_id": String$7.annotate({ "description": "The call ID of the program item." }).check(isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })).check(isMaxCodePoints(64).annotate({ "expected": "a string with at most 64 code points" })),
23923
23496
  "result": String$7.annotate({ "description": "The result produced by the program item." }).check(isMaxCodePoints(10485760).annotate({ "expected": "a string with at most 10485760 code points" })),
23924
- "status": suspend$2(() => ProgramOutputItemStatus).annotate({ "description": "The terminal status of the program output." })
23497
+ "status": suspend$1(() => ProgramOutputItemStatus).annotate({ "description": "The terminal status of the program output." })
23925
23498
  }).annotate({ "identifier": "ProgramOutputItemParam" });
23926
23499
  const AutoCodeInterpreterToolParam = Struct({
23927
23500
  "type": Literal("auto").annotate({ "description": "Always `auto`." }),
23928
23501
  "file_ids": optionalKey(ArraySchema(String$7).annotate({ "description": "An optional list of uploaded files to make available to your code." }).check(isMaxLength(50).annotate({ "expected": "a value with a length of at most 50" }))),
23929
- "memory_limit": optionalKey(Union([suspend$2(() => ContainerMemoryLimit).annotate({ "description": "The memory limit for the code interpreter container." }), Null])),
23502
+ "memory_limit": optionalKey(Union([suspend$1(() => ContainerMemoryLimit).annotate({ "description": "The memory limit for the code interpreter container." }), Null])),
23930
23503
  "network_policy": optionalKey(Union([ContainerNetworkPolicyDisabledParam, ContainerNetworkPolicyAllowlistParam], { mode: "oneOf" }).annotate({ "description": "Network access policy for the container." }))
23931
23504
  }).annotate({
23932
23505
  "title": "CodeInterpreterToolAuto",
@@ -23936,7 +23509,7 @@ const AutoCodeInterpreterToolParam = Struct({
23936
23509
  const ContainerAutoParam = Struct({
23937
23510
  "type": Literal("container_auto").annotate({ "description": "Automatically creates a container for this request" }),
23938
23511
  "file_ids": optionalKey(ArraySchema(String$7).annotate({ "description": "An optional list of uploaded files to make available to your code." }).check(isMaxLength(50).annotate({ "expected": "a value with a length of at most 50" }))),
23939
- "memory_limit": optionalKey(Union([suspend$2(() => ContainerMemoryLimit).annotate({ "description": "The memory limit for the container." }), Null])),
23512
+ "memory_limit": optionalKey(Union([suspend$1(() => ContainerMemoryLimit).annotate({ "description": "The memory limit for the container." }), Null])),
23940
23513
  "network_policy": optionalKey(Union([ContainerNetworkPolicyDisabledParam, ContainerNetworkPolicyAllowlistParam], { mode: "oneOf" }).annotate({ "description": "Network access policy for the container." })),
23941
23514
  "skills": optionalKey(ArraySchema(Union([SkillReferenceParam, InlineSkillParam], { mode: "oneOf" })).annotate({ "description": "An optional list of skills referenced by id or inline data." }).check(isMaxLength(200).annotate({ "expected": "a value with a length of at most 200" })))
23942
23515
  }).annotate({ "identifier": "ContainerAutoParam" });
@@ -23975,8 +23548,8 @@ const FileSearchTool = Struct({
23975
23548
  "type": Literal("file_search").annotate({ "description": "The type of the file search tool. Always `file_search`." }),
23976
23549
  "vector_store_ids": ArraySchema(String$7).annotate({ "description": "The IDs of the vector stores to search." }),
23977
23550
  "max_num_results": optionalKey(Number$2.annotate({ "description": "The maximum number of results to return. This number should be between 1 and 50 inclusive." }).check(isInt().annotate({ "expected": "an integer" }))),
23978
- "ranking_options": optionalKey(suspend$2(() => RankingOptions).annotate({ "description": "Ranking options for search." })),
23979
- "filters": optionalKey(Union([suspend$2(() => Filters).annotate({ "description": "A filter to apply." }), Null]))
23551
+ "ranking_options": optionalKey(suspend$1(() => RankingOptions).annotate({ "description": "Ranking options for search." })),
23552
+ "filters": optionalKey(Union([suspend$1(() => Filters).annotate({ "description": "A filter to apply." }), Null]))
23980
23553
  }).annotate({
23981
23554
  "title": "File search",
23982
23555
  "description": "A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://developers.openai.com/api/docs/guides/tools-file-search).",
@@ -23998,7 +23571,7 @@ const CustomToolParam = Struct({
23998
23571
  const FunctionShellCallOutputContentParam = Struct({
23999
23572
  "stdout": String$7.annotate({ "description": "Captured stdout output for the shell call." }).check(isMaxCodePoints(10485760).annotate({ "expected": "a string with at most 10485760 code points" })),
24000
23573
  "stderr": String$7.annotate({ "description": "Captured stderr output for the shell call." }).check(isMaxCodePoints(10485760).annotate({ "expected": "a string with at most 10485760 code points" })),
24001
- "outcome": suspend$2(() => FunctionShellCallOutputOutcomeParam).annotate({ "description": "The exit or timeout outcome associated with this shell call." })
23574
+ "outcome": suspend$1(() => FunctionShellCallOutputOutcomeParam).annotate({ "description": "The exit or timeout outcome associated with this shell call." })
24002
23575
  }).annotate({
24003
23576
  "title": "Shell output content",
24004
23577
  "description": "Captured stdout and stderr for a portion of a shell tool call output.",
@@ -24199,7 +23772,7 @@ const InputItem$1 = Union([
24199
23772
  "type": Literal("computer_call_output").annotate({ "description": "The type of the computer tool call output. Always `computer_call_output`." }),
24200
23773
  "output": ComputerScreenshotImage,
24201
23774
  "acknowledged_safety_checks": optionalKey(Union([ArraySchema(ComputerCallSafetyCheckParam).annotate({ "description": "The safety checks reported by the API that have been acknowledged by the developer." }), Null])),
24202
- "status": optionalKey(Union([suspend$2(() => FunctionCallItemStatus).annotate({ "description": "The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API." }), Null]))
23775
+ "status": optionalKey(Union([suspend$1(() => FunctionCallItemStatus).annotate({ "description": "The status of the message input. One of `in_progress`, `completed`, or `incomplete`. Populated when input items are returned via API." }), Null]))
24203
23776
  }).annotate({
24204
23777
  "title": "Computer tool call output",
24205
23778
  "description": "The output of a computer tool call."
@@ -24207,7 +23780,7 @@ const InputItem$1 = Union([
24207
23780
  Struct({
24208
23781
  "id": String$7.annotate({ "description": "The unique ID of the web search tool call.\n" }),
24209
23782
  "type": Literal("web_search_call").annotate({ "description": "The type of the web search tool call. Always `web_search_call`.\n" }),
24210
- "status": suspend$2(() => WebSearchCallStatus).annotate({ "description": "The status of the web search tool call.\n" }),
23783
+ "status": suspend$1(() => WebSearchCallStatus).annotate({ "description": "The status of the web search tool call.\n" }),
24211
23784
  "action": optionalKey(Union([
24212
23785
  WebSearchActionSearch,
24213
23786
  WebSearchActionOpenPage,
@@ -24246,8 +23819,8 @@ const InputItem$1 = Union([
24246
23819
  ], { mode: "oneOf" }).annotate({ "description": "A piece of message content, such as text, an image, or a file." })).annotate({ "description": "An array of content outputs (text, image, file) for the function tool call." })], { mode: "oneOf" }).annotate({ "description": "Text, image, or file output of the function tool call." }),
24247
23820
  "name": optionalKey(Union([String$7.annotate({ "description": "The name of the tool that produced the output." }).check(isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })).check(isMaxCodePoints(128).annotate({ "expected": "a string with at most 128 code points" })), Null])),
24248
23821
  "namespace": optionalKey(Union([String$7.annotate({ "description": "The namespace of the tool that produced the output." }).check(isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })).check(isMaxCodePoints(64).annotate({ "expected": "a string with at most 64 code points" })).check(isPattern(new RegExp("^[a-zA-Z0-9_-]+$", "u")).annotate({ "expected": "a string matching the RegExp ^[a-zA-Z0-9_-]+$" })), Null])),
24249
- "caller": optionalKey(Union([suspend$2(() => ToolCallCallerParam).annotate({ "description": "The execution context that produced this tool call." }), Null])),
24250
- "status": optionalKey(Union([suspend$2(() => FunctionCallItemStatus).annotate({ "description": "The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API." }), Null]))
23822
+ "caller": optionalKey(Union([suspend$1(() => ToolCallCallerParam).annotate({ "description": "The execution context that produced this tool call." }), Null])),
23823
+ "status": optionalKey(Union([suspend$1(() => FunctionCallItemStatus).annotate({ "description": "The status of the item. One of `in_progress`, `completed`, or `incomplete`. Populated when items are returned via API." }), Null]))
24251
23824
  }).annotate({
24252
23825
  "title": "Function tool call output",
24253
23826
  "description": "The output of a function tool call."
@@ -24256,17 +23829,17 @@ const InputItem$1 = Union([
24256
23829
  "id": optionalKey(Union([String$7.annotate({ "description": "The unique ID of this tool search call." }), Null])),
24257
23830
  "call_id": optionalKey(Union([String$7.annotate({ "description": "The unique ID of the tool search call generated by the model." }).check(isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })).check(isMaxCodePoints(64).annotate({ "expected": "a string with at most 64 code points" })), Null])),
24258
23831
  "type": Literal("tool_search_call").annotate({ "description": "The item type. Always `tool_search_call`." }),
24259
- "execution": optionalKey(suspend$2(() => ToolSearchExecutionType).annotate({ "description": "Whether tool search was executed by the server or by the client." })),
24260
- "arguments": suspend$2(() => EmptyModelParam).annotate({ "description": "The arguments supplied to the tool search call." }),
24261
- "status": optionalKey(Union([suspend$2(() => FunctionCallItemStatus).annotate({ "description": "The status of the tool search call." }), Null]))
23832
+ "execution": optionalKey(suspend$1(() => ToolSearchExecutionType).annotate({ "description": "Whether tool search was executed by the server or by the client." })),
23833
+ "arguments": suspend$1(() => EmptyModelParam).annotate({ "description": "The arguments supplied to the tool search call." }),
23834
+ "status": optionalKey(Union([suspend$1(() => FunctionCallItemStatus).annotate({ "description": "The status of the tool search call." }), Null]))
24262
23835
  }),
24263
23836
  Struct({
24264
23837
  "id": optionalKey(Union([String$7.annotate({ "description": "The unique ID of this tool search output." }), Null])),
24265
23838
  "call_id": optionalKey(Union([String$7.annotate({ "description": "The unique ID of the tool search call generated by the model." }).check(isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })).check(isMaxCodePoints(64).annotate({ "expected": "a string with at most 64 code points" })), Null])),
24266
23839
  "type": Literal("tool_search_output").annotate({ "description": "The item type. Always `tool_search_output`." }),
24267
- "execution": optionalKey(suspend$2(() => ToolSearchExecutionType).annotate({ "description": "Whether tool search was executed by the server or by the client." })),
23840
+ "execution": optionalKey(suspend$1(() => ToolSearchExecutionType).annotate({ "description": "Whether tool search was executed by the server or by the client." })),
24268
23841
  "tools": ArraySchema(ToolSearchOutputTool).annotate({ "description": "The loaded tool definitions returned by the tool search output." }),
24269
- "status": optionalKey(Union([suspend$2(() => FunctionCallItemStatus).annotate({ "description": "The status of the tool search output." }), Null]))
23842
+ "status": optionalKey(Union([suspend$1(() => FunctionCallItemStatus).annotate({ "description": "The status of the tool search output." }), Null]))
24270
23843
  }),
24271
23844
  Struct({
24272
23845
  "id": optionalKey(Union([String$7.annotate({ "description": "The unique ID of this additional tools item." }), Null])),
@@ -24277,7 +23850,7 @@ const InputItem$1 = Union([
24277
23850
  Struct({
24278
23851
  "id": optionalKey(Union([String$7.annotate({ "description": "The unique ID of the configuration update item." }), Null])),
24279
23852
  "type": Literal("configuration_update").annotate({ "description": "The item type. Always `configuration_update`." }),
24280
- "reasoning": optionalKey(Struct({ "effort": optionalKey(suspend$2(() => ReasoningEffort).annotate({ "description": "The reasoning effort to use for subsequent responses until another\nconfiguration update replaces it.\n" })) }).annotate({ "description": "Updates to reasoning configuration. Only effort is supported." }))
23853
+ "reasoning": optionalKey(Struct({ "effort": optionalKey(suspend$1(() => ReasoningEffort).annotate({ "description": "The reasoning effort to use for subsequent responses until another\nconfiguration update replaces it.\n" })) }).annotate({ "description": "Updates to reasoning configuration. Only effort is supported." }))
24281
23854
  }).annotate({ "description": "An update to the conversation's response configuration. The configuration\nremains in effect for subsequent responses until it is replaced by another\nconfiguration update.\n" }),
24282
23855
  Struct({
24283
23856
  "type": Literal("reasoning").annotate({ "description": "The type of the object. Always `reasoning`.\n" }),
@@ -24325,9 +23898,9 @@ const InputItem$1 = Union([
24325
23898
  "max",
24326
23899
  "auto"
24327
23900
  ]).annotate({ "description": "The quality of the image generated by the image generation tool call. One of `low`, `medium`, `high`, `xhigh`, `max`, or `auto`." }), Null])),
24328
- "action": optionalKey(Union([suspend$2(() => ImageGenActionEnum).annotate({ "description": "The action used for image generation." }), Null])),
24329
- "background": optionalKey(Union([suspend$2(() => ImageBackground).annotate({ "description": "The background setting used for generation." }), Null])),
24330
- "output_format": optionalKey(Union([suspend$2(() => ImageOutputFormat).annotate({ "description": "The output format used for generation." }), Null])),
23901
+ "action": optionalKey(Union([suspend$1(() => ImageGenActionEnum).annotate({ "description": "The action used for image generation." }), Null])),
23902
+ "background": optionalKey(Union([suspend$1(() => ImageBackground).annotate({ "description": "The background setting used for generation." }), Null])),
23903
+ "output_format": optionalKey(Union([suspend$1(() => ImageOutputFormat).annotate({ "description": "The output format used for generation." }), Null])),
24331
23904
  "revised_prompt": optionalKey(Union([String$7.annotate({ "description": "The prompt that was used after any model prompt rewriting." }), Null]))
24332
23905
  }).annotate({
24333
23906
  "title": "Image generation call",
@@ -24381,10 +23954,10 @@ const InputItem$1 = Union([
24381
23954
  Struct({
24382
23955
  "id": optionalKey(Union([String$7.annotate({ "description": "The unique ID of the shell tool call. Populated when this item is returned via API." }), Null])),
24383
23956
  "call_id": String$7.annotate({ "description": "The unique ID of the shell tool call generated by the model." }).check(isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })).check(isMaxCodePoints(64).annotate({ "expected": "a string with at most 64 code points" })),
24384
- "caller": optionalKey(Union([suspend$2(() => ToolCallCallerParam).annotate({ "description": "The execution context that produced this tool call." }), Null])),
23957
+ "caller": optionalKey(Union([suspend$1(() => ToolCallCallerParam).annotate({ "description": "The execution context that produced this tool call." }), Null])),
24385
23958
  "type": Literal("shell_call").annotate({ "description": "The type of the item. Always `shell_call`." }),
24386
- "action": suspend$2(() => FunctionShellActionParam).annotate({ "description": "The shell commands and limits that describe how to run the tool call." }),
24387
- "status": optionalKey(Union([suspend$2(() => FunctionShellCallItemStatus).annotate({ "description": "The status of the shell call. One of `in_progress`, `completed`, or `incomplete`." }), Null])),
23959
+ "action": suspend$1(() => FunctionShellActionParam).annotate({ "description": "The shell commands and limits that describe how to run the tool call." }),
23960
+ "status": optionalKey(Union([suspend$1(() => FunctionShellCallItemStatus).annotate({ "description": "The status of the shell call. One of `in_progress`, `completed`, or `incomplete`." }), Null])),
24388
23961
  "environment": optionalKey(Union([Union([LocalEnvironmentParam, ContainerReferenceParam], { mode: "oneOf" }).annotate({ "description": "The environment to execute the shell commands in." }), Null]))
24389
23962
  }).annotate({
24390
23963
  "title": "Shell tool call",
@@ -24393,10 +23966,10 @@ const InputItem$1 = Union([
24393
23966
  Struct({
24394
23967
  "id": optionalKey(Union([String$7.annotate({ "description": "The unique ID of the shell tool call output. Populated when this item is returned via API." }), Null])),
24395
23968
  "call_id": String$7.annotate({ "description": "The unique ID of the shell tool call generated by the model." }).check(isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })).check(isMaxCodePoints(64).annotate({ "expected": "a string with at most 64 code points" })),
24396
- "caller": optionalKey(Union([suspend$2(() => ToolCallCallerParam).annotate({ "description": "The execution context that produced this tool call." }), Null])),
23969
+ "caller": optionalKey(Union([suspend$1(() => ToolCallCallerParam).annotate({ "description": "The execution context that produced this tool call." }), Null])),
24397
23970
  "type": Literal("shell_call_output").annotate({ "description": "The type of the item. Always `shell_call_output`." }),
24398
23971
  "output": ArraySchema(FunctionShellCallOutputContentParam).annotate({ "description": "Captured chunks of stdout and stderr output, along with their associated outcomes." }),
24399
- "status": optionalKey(Union([suspend$2(() => FunctionShellCallItemStatus).annotate({ "description": "The status of the shell call output." }), Null])),
23972
+ "status": optionalKey(Union([suspend$1(() => FunctionShellCallItemStatus).annotate({ "description": "The status of the shell call output." }), Null])),
24400
23973
  "max_output_length": optionalKey(Union([Number$2.annotate({ "description": "The maximum number of UTF-8 characters captured for this shell call's combined output." }).check(isInt().annotate({ "expected": "an integer" })), Null]))
24401
23974
  }).annotate({
24402
23975
  "title": "Shell tool call output",
@@ -24406,9 +23979,9 @@ const InputItem$1 = Union([
24406
23979
  "type": Literal("apply_patch_call").annotate({ "description": "The type of the item. Always `apply_patch_call`." }),
24407
23980
  "id": optionalKey(Union([String$7.annotate({ "description": "The unique ID of the apply patch tool call. Populated when this item is returned via API." }), Null])),
24408
23981
  "call_id": String$7.annotate({ "description": "The unique ID of the apply patch tool call generated by the model." }).check(isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })).check(isMaxCodePoints(64).annotate({ "expected": "a string with at most 64 code points" })),
24409
- "caller": optionalKey(Union([suspend$2(() => ToolCallCallerParam).annotate({ "description": "The execution context that produced this tool call." }), Null])),
24410
- "status": suspend$2(() => ApplyPatchCallStatusParam).annotate({ "description": "The status of the apply patch tool call. One of `in_progress` or `completed`." }),
24411
- "operation": suspend$2(() => ApplyPatchOperationParam).annotate({ "description": "The specific create, delete, or update instruction for the apply_patch tool call." })
23982
+ "caller": optionalKey(Union([suspend$1(() => ToolCallCallerParam).annotate({ "description": "The execution context that produced this tool call." }), Null])),
23983
+ "status": suspend$1(() => ApplyPatchCallStatusParam).annotate({ "description": "The status of the apply patch tool call. One of `in_progress` or `completed`." }),
23984
+ "operation": suspend$1(() => ApplyPatchOperationParam).annotate({ "description": "The specific create, delete, or update instruction for the apply_patch tool call." })
24412
23985
  }).annotate({
24413
23986
  "title": "Apply patch tool call",
24414
23987
  "description": "A tool call representing a request to create, delete, or update files using diff patches."
@@ -24417,8 +23990,8 @@ const InputItem$1 = Union([
24417
23990
  "type": Literal("apply_patch_call_output").annotate({ "description": "The type of the item. Always `apply_patch_call_output`." }),
24418
23991
  "id": optionalKey(Union([String$7.annotate({ "description": "The unique ID of the apply patch tool call output. Populated when this item is returned via API." }), Null])),
24419
23992
  "call_id": String$7.annotate({ "description": "The unique ID of the apply patch tool call generated by the model." }).check(isMinLength(1).annotate({ "expected": "a value with a length of at least 1" })).check(isMaxCodePoints(64).annotate({ "expected": "a string with at most 64 code points" })),
24420
- "caller": optionalKey(Union([suspend$2(() => ToolCallCallerParam).annotate({ "description": "The execution context that produced this tool call." }), Null])),
24421
- "status": suspend$2(() => ApplyPatchCallOutputStatusParam).annotate({ "description": "The status of the apply patch tool call output. One of `completed` or `failed`." }),
23993
+ "caller": optionalKey(Union([suspend$1(() => ToolCallCallerParam).annotate({ "description": "The execution context that produced this tool call." }), Null])),
23994
+ "status": suspend$1(() => ApplyPatchCallOutputStatusParam).annotate({ "description": "The status of the apply patch tool call output. One of `completed` or `failed`." }),
24422
23995
  "output": optionalKey(Union([String$7.annotate({ "description": "Optional human-readable log text from the apply patch tool (e.g., patch results or errors)." }).check(isMaxCodePoints(10485760).annotate({ "expected": "a string with at most 10485760 code points" })), Null]))
24423
23996
  }).annotate({
24424
23997
  "title": "Apply patch tool call output",
@@ -24463,7 +24036,7 @@ const InputItem$1 = Union([
24463
24036
  "arguments": String$7.annotate({ "description": "A JSON string of the arguments passed to the tool.\n" }),
24464
24037
  "output": optionalKey(Union([String$7.annotate({ "description": "The output from the tool call.\n" }), Null])),
24465
24038
  "error": optionalKey(Union([MCPToolCallError, Null]).annotate({ "description": "The error from the tool call, if any." })),
24466
- "status": optionalKey(suspend$2(() => MCPToolCallStatus).annotate({ "description": "The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.\n" })),
24039
+ "status": optionalKey(suspend$1(() => MCPToolCallStatus).annotate({ "description": "The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.\n" })),
24467
24040
  "approval_request_id": optionalKey(Union([String$7.annotate({ "description": "Unique identifier for the MCP tool call approval request.\nInclude this value in a subsequent `mcp_approval_response` input to approve or reject the corresponding tool call.\n" }), Null]))
24468
24041
  }).annotate({
24469
24042
  "title": "MCP tool call",
@@ -24509,7 +24082,7 @@ const InputItem$1 = Union([
24509
24082
  ], { mode: "oneOf" }).annotate({ "identifier": "InputItem" });
24510
24083
  const __recursive_CompoundFilter = Struct({
24511
24084
  "type": Literals$2(["and", "or"]).annotate({ "description": "Type of operation: `and` or `or`." }),
24512
- "filters": ArraySchema(Union([ComparisonFilter, suspend$2(() => CompoundFilter)], { mode: "oneOf" })).annotate({ "description": "Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`." })
24085
+ "filters": ArraySchema(Union([ComparisonFilter, suspend$1(() => CompoundFilter)], { mode: "oneOf" })).annotate({ "description": "Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`." })
24513
24086
  }).annotate({
24514
24087
  "title": "Compound Filter",
24515
24088
  "description": "Combine multiple filters using `and` or `or`.",
@@ -25136,12 +24709,12 @@ const OpenAiCompatibleErrorBody = Struct({
25136
24709
  error: String$7,
25137
24710
  code: optional$2(String$7)
25138
24711
  });
25139
- const mapSchemaError$1 = dual(2, (error, method) => make$18({
24712
+ const mapSchemaError$1 = dual(2, (error, method) => make$47({
25140
24713
  module: "OpenAiClient",
25141
24714
  method,
25142
24715
  reason: InvalidResponseError.fromSchemaError(error)
25143
24716
  }));
25144
- const mapSseError$1 = dual(2, (error, method) => make$18({
24717
+ const mapSseError$1 = dual(2, (error, method) => make$47({
25145
24718
  module: "OpenAiClient",
25146
24719
  method,
25147
24720
  reason: new InvalidResponseError({ description: error.message })
@@ -25151,18 +24724,18 @@ const mapHttpClientError$1 = dual(2, (error, method) => {
25151
24724
  switch (reason._tag) {
25152
24725
  case "TransportError":
25153
24726
  case "EncodeError":
25154
- case "InvalidUrlError": return fail$1(make$18({
24727
+ case "InvalidUrlError": return fail$1(make$47({
25155
24728
  module: "OpenAiClient",
25156
24729
  method,
25157
24730
  reason: NetworkError.fromHttpClientError(error)
25158
24731
  }));
25159
24732
  case "StatusCodeError": return mapStatusCodeError$1(reason, method);
25160
- case "DecodeError": return fail$1(make$18({
24733
+ case "DecodeError": return fail$1(make$47({
25161
24734
  module: "OpenAiClient",
25162
24735
  method,
25163
24736
  reason: new InvalidOutputError({ description: reason.description ?? "Failed to decode response" })
25164
24737
  }));
25165
- case "EmptyBodyError": return fail$1(make$18({
24738
+ case "EmptyBodyError": return fail$1(make$47({
25166
24739
  module: "OpenAiClient",
25167
24740
  method,
25168
24741
  reason: new InvalidOutputError({ description: reason.description ?? "Response body was empty" })
@@ -25207,7 +24780,7 @@ const mapStatusCodeError$1 = fnUntraced(function* (error, method) {
25207
24780
  requestId: requestId ?? null
25208
24781
  }
25209
24782
  });
25210
- return yield* make$18({
24783
+ return yield* make$47({
25211
24784
  module: "OpenAiClient",
25212
24785
  method,
25213
24786
  reason
@@ -25302,7 +24875,7 @@ const mapStatusCodeToReason$1 = ({ status, method, url, headers, message, metada
25302
24875
  metadata: { openai: metadata },
25303
24876
  http
25304
24877
  });
25305
- return new UnknownError({
24878
+ return new UnknownError$1({
25306
24879
  description: message,
25307
24880
  metadata: { openai: metadata },
25308
24881
  http
@@ -26209,7 +25782,7 @@ const makeSocket = gen(function* () {
26209
25782
  });
26210
25783
  const makeWebSocket$1 = yield* WebSocketConstructor;
26211
25784
  const decoder = new TextDecoder();
26212
- const queueRef = yield* make$37({
25785
+ const queueRef = yield* make$36({
26213
25786
  idleTimeToLive: 6e4,
26214
25787
  acquire: gen(function* () {
26215
25788
  const scope$1 = yield* scope;
@@ -26225,7 +25798,7 @@ const makeSocket = gen(function* () {
26225
25798
  send: (message) => writer.write(JSON.stringify({
26226
25799
  type: "response.create",
26227
25800
  ...message
26228
- })).pipe(mapError((_error) => make$18({
25801
+ })).pipe(mapError((_error) => make$47({
26229
25802
  module: "OpenAiClient",
26230
25803
  method: "createResponseStream",
26231
25804
  reason: new NetworkError({
@@ -26251,7 +25824,7 @@ const makeSocket = gen(function* () {
26251
25824
  const errorType = error.code ?? (error.type === "api_error" && /^gRPC error: Response with id=\S+ not found$/.test(error.message) ? "previous_response_not_found" : error.type ?? "unknown");
26252
25825
  const json = JSON.stringify(error);
26253
25826
  if (errorType === "previous_response_not_found") connection.current = void 0;
26254
- failCauseUnsafe(turn, fail$5(make$18({
25827
+ failCauseUnsafe(turn, fail$5(make$47({
26255
25828
  module: "OpenAiClient",
26256
25829
  method: "createResponseStream",
26257
25830
  reason: reasonFromHttpStatus({
@@ -26275,7 +25848,7 @@ const makeSocket = gen(function* () {
26275
25848
  const messages = yield* pull;
26276
25849
  for (let i = 0; i < messages.length; i++) handleMessage(messages[i]);
26277
25850
  }
26278
- }).pipe(scoped, catchTag("SocketError", (error) => make$18({
25851
+ }).pipe(scoped, catchTag("SocketError", (error) => make$47({
26279
25852
  module: "OpenAiClient",
26280
25853
  method: "createResponseStream",
26281
25854
  reason: new NetworkError({
@@ -26402,8 +25975,8 @@ var EmbedManyResponse = class extends Class$1("effect/ai/EmbeddingModel/EmbedMan
26402
25975
  embeddings: ArraySchema(EmbedResponse),
26403
25976
  usage: EmbeddingUsage
26404
25977
  }) {};
26405
- var EmbeddingRequest = class extends TaggedClass("EmbeddingRequest") {};
26406
- const invalidProviderResponse = (description) => make$18({
25978
+ var EmbeddingRequest = class extends TaggedClass$2("EmbeddingRequest") {};
25979
+ const invalidProviderResponse = (description) => make$47({
26407
25980
  module: "EmbeddingModel",
26408
25981
  method: "embedMany",
26409
25982
  reason: new InvalidOutputError({ description })
@@ -26439,7 +26012,7 @@ const mapProviderResults = (inputLength, results) => {
26439
26012
  };
26440
26013
  // node_modules/.pnpm/@effect+ai-openai@4.1.1_effect@4.1.1/node_modules/@effect/ai-openai/dist/OpenAiEmbeddingModel.js
26441
26014
  var Config$2 = class extends Service()("@effect/ai-openai/OpenAiEmbeddingModel/Config") {};
26442
- const model$5 = (model, options) => make$19("openai", model, merge$2(layer$3({
26015
+ const model$5 = (model, options) => make$18("openai", model, merge$2(layer$3({
26443
26016
  model,
26444
26017
  config: {
26445
26018
  ...options.config,
@@ -26483,7 +26056,7 @@ const mapProviderResponse = (inputLength, response) => {
26483
26056
  usage: { inputTokens: response.usage?.prompt_tokens }
26484
26057
  });
26485
26058
  };
26486
- const invalidOutput = (description) => make$18({
26059
+ const invalidOutput = (description) => make$47({
26487
26060
  module: "OpenAiEmbeddingModel",
26488
26061
  method: "embedMany",
26489
26062
  reason: new InvalidOutputError({ description })
@@ -26868,7 +26441,7 @@ const prepareMessages$1 = fnUntraced(function* ({ config, options, isReasoningMo
26868
26441
  case "assistant": {
26869
26442
  const reasoningMessages = Object.create(null);
26870
26443
  const providerExecutedParts = message.content.filter((part) => (part.type === "tool-call" || part.type === "tool-result") && part.providerExecuted);
26871
- const unreplayableProviderItem = (name, id) => make$18({
26444
+ const unreplayableProviderItem = (name, id) => make$47({
26872
26445
  module: "OpenAiLanguageModel",
26873
26446
  method: "prepareMessages",
26874
26447
  reason: new InvalidRequestError$1({ description: `Cannot replay provider-executed tool item '${name}' ('${id}') losslessly` })
@@ -27002,7 +26575,7 @@ const prepareMessages$1 = fnUntraced(function* ({ config, options, isReasoningMo
27002
26575
  }
27003
26576
  const toolName = toolNameMapper.getProviderName(part.name);
27004
26577
  if (isNotUndefined(localShellTool) && toolName === "local_shell") {
27005
- const params = yield* decodeUnknownEffect$1(localShellTool.parametersSchema)(part.params).pipe(mapError((error) => make$18({
26578
+ const params = yield* decodeUnknownEffect$1(localShellTool.parametersSchema)(part.params).pipe(mapError((error) => make$47({
27006
26579
  module: "OpenAiLanguageModel",
27007
26580
  method: "prepareMessages",
27008
26581
  reason: new ToolParameterValidationError({
@@ -27020,7 +26593,7 @@ const prepareMessages$1 = fnUntraced(function* ({ config, options, isReasoningMo
27020
26593
  break;
27021
26594
  }
27022
26595
  if (isNotUndefined(shellTool) && toolName === "shell") {
27023
- const params = yield* decodeUnknownEffect$1(shellTool.parametersSchema)(part.params).pipe(mapError((error) => make$18({
26596
+ const params = yield* decodeUnknownEffect$1(shellTool.parametersSchema)(part.params).pipe(mapError((error) => make$47({
27024
26597
  module: "OpenAiLanguageModel",
27025
26598
  method: "prepareMessages",
27026
26599
  reason: new ToolParameterValidationError({
@@ -27231,7 +26804,7 @@ const makeResponse$1 = fnUntraced(function* ({ options, rawResponse, response, t
27231
26804
  const toolName = part.name;
27232
26805
  const toolParams = yield* try_({
27233
26806
  try: () => unsafeSecureJsonParse(part.arguments),
27234
- catch: (cause) => make$18({
26807
+ catch: (cause) => make$47({
27235
26808
  module: "OpenAiLanguageModel",
27236
26809
  method: "makeResponse",
27237
26810
  reason: new ToolParameterValidationError({
@@ -27842,7 +27415,7 @@ const makeStreamResponse$1 = fnUntraced(function* ({ stream, response, config, o
27842
27415
  const toolArgs = event.item.arguments;
27843
27416
  const toolParams = yield* try_({
27844
27417
  try: () => unsafeSecureJsonParse(toolArgs),
27845
- catch: (cause) => make$18({
27418
+ catch: (cause) => make$47({
27846
27419
  module: "OpenAiLanguageModel",
27847
27420
  method: "makeStreamResponse",
27848
27421
  reason: new ToolParameterValidationError({
@@ -28089,7 +27662,7 @@ const makeStreamResponse$1 = fnUntraced(function* ({ stream, response, config, o
28089
27662
  hasToolCalls = true;
28090
27663
  const toolParams = yield* try_({
28091
27664
  try: () => unsafeSecureJsonParse(event.arguments),
28092
- catch: (cause) => make$18({
27665
+ catch: (cause) => make$47({
28093
27666
  module: "OpenAiLanguageModel",
28094
27667
  method: "makeStreamResponse",
28095
27668
  reason: new ToolParameterValidationError({
@@ -28309,7 +27882,7 @@ const prepareTools$1 = fnUntraced(function* ({ config, options, toolNameMapper }
28309
27882
  tools.push({ type: "apply_patch" });
28310
27883
  break;
28311
27884
  case "OpenAiCodeInterpreter": {
28312
- const args = yield* decodeUnknownEffect$1(openAiTool.argsSchema)(tool.args).pipe(mapError((error) => make$18({
27885
+ const args = yield* decodeUnknownEffect$1(openAiTool.argsSchema)(tool.args).pipe(mapError((error) => make$47({
28313
27886
  module: "OpenAiLanguageModel",
28314
27887
  method: "prepareTools",
28315
27888
  reason: new ToolConfigurationError({
@@ -28324,7 +27897,7 @@ const prepareTools$1 = fnUntraced(function* ({ config, options, toolNameMapper }
28324
27897
  break;
28325
27898
  }
28326
27899
  case "OpenAiFileSearch": {
28327
- const args = yield* decodeUnknownEffect$1(openAiTool.argsSchema)(tool.args).pipe(mapError((error) => make$18({
27900
+ const args = yield* decodeUnknownEffect$1(openAiTool.argsSchema)(tool.args).pipe(mapError((error) => make$47({
28328
27901
  module: "OpenAiLanguageModel",
28329
27902
  method: "prepareTools",
28330
27903
  reason: new ToolConfigurationError({
@@ -28342,7 +27915,7 @@ const prepareTools$1 = fnUntraced(function* ({ config, options, toolNameMapper }
28342
27915
  tools.push({ type: "shell" });
28343
27916
  break;
28344
27917
  case "OpenAiImageGeneration": {
28345
- const args = yield* decodeUnknownEffect$1(openAiTool.argsSchema)(tool.args).pipe(mapError((error) => make$18({
27918
+ const args = yield* decodeUnknownEffect$1(openAiTool.argsSchema)(tool.args).pipe(mapError((error) => make$47({
28346
27919
  module: "OpenAiLanguageModel",
28347
27920
  method: "prepareTools",
28348
27921
  reason: new ToolConfigurationError({
@@ -28360,7 +27933,7 @@ const prepareTools$1 = fnUntraced(function* ({ config, options, toolNameMapper }
28360
27933
  tools.push({ type: "local_shell" });
28361
27934
  break;
28362
27935
  case "OpenAiMcp": {
28363
- const args = yield* decodeUnknownEffect$1(openAiTool.argsSchema)(tool.args).pipe(mapError((error) => make$18({
27936
+ const args = yield* decodeUnknownEffect$1(openAiTool.argsSchema)(tool.args).pipe(mapError((error) => make$47({
28364
27937
  module: "OpenAiLanguageModel",
28365
27938
  method: "prepareTools",
28366
27939
  reason: new ToolConfigurationError({
@@ -28375,7 +27948,7 @@ const prepareTools$1 = fnUntraced(function* ({ config, options, toolNameMapper }
28375
27948
  break;
28376
27949
  }
28377
27950
  case "OpenAiWebSearch": {
28378
- const args = yield* decodeUnknownEffect$1(openAiTool.argsSchema)(tool.args).pipe(mapError((error) => make$18({
27951
+ const args = yield* decodeUnknownEffect$1(openAiTool.argsSchema)(tool.args).pipe(mapError((error) => make$47({
28379
27952
  module: "OpenAiLanguageModel",
28380
27953
  method: "prepareTools",
28381
27954
  reason: new ToolConfigurationError({
@@ -28390,7 +27963,7 @@ const prepareTools$1 = fnUntraced(function* ({ config, options, toolNameMapper }
28390
27963
  break;
28391
27964
  }
28392
27965
  case "OpenAiWebSearchPreview": {
28393
- const args = yield* decodeUnknownEffect$1(openAiTool.argsSchema)(tool.args).pipe(mapError((error) => make$18({
27966
+ const args = yield* decodeUnknownEffect$1(openAiTool.argsSchema)(tool.args).pipe(mapError((error) => make$47({
28394
27967
  module: "OpenAiLanguageModel",
28395
27968
  method: "prepareTools",
28396
27969
  reason: new ToolConfigurationError({
@@ -28404,7 +27977,7 @@ const prepareTools$1 = fnUntraced(function* ({ config, options, toolNameMapper }
28404
27977
  });
28405
27978
  break;
28406
27979
  }
28407
- default: return yield* make$18({
27980
+ default: return yield* make$47({
28408
27981
  module: "OpenAiLanguageModel",
28409
27982
  method: "prepareTools",
28410
27983
  reason: new InvalidRequestError$1({ description: `Unknown provider-defined tool '${tool.name}'` })
@@ -28476,7 +28049,7 @@ const prepareFilePart = fnUntraced(function* (part, index, config) {
28476
28049
  ...promptCacheBreakpoint
28477
28050
  };
28478
28051
  }
28479
- return yield* make$18({
28052
+ return yield* make$47({
28480
28053
  module: "OpenAiLanguageModel",
28481
28054
  method: "prepareMessages",
28482
28055
  reason: new InvalidRequestError$1({ description: `Detected unsupported media type for file: '${part.mediaType}'` })
@@ -28493,7 +28066,7 @@ const getPromptCacheBreakpoint = (input) => {
28493
28066
  };
28494
28067
  const makeItemIdMetadata$1 = (itemId) => isNotUndefined(itemId) ? { itemId } : {};
28495
28068
  const makeEncryptedContentMetadata = (encryptedContent) => isNotNullish(encryptedContent) ? { encryptedContent } : void 0;
28496
- const unsupportedSchemaError$1 = (error, method) => make$18({
28069
+ const unsupportedSchemaError$1 = (error, method) => make$47({
28497
28070
  module: "OpenAiLanguageModel",
28498
28071
  method,
28499
28072
  reason: new UnsupportedSchemaError({ description: error instanceof Error ? error.message : String(error) })
@@ -28555,7 +28128,7 @@ const normalizeMcpToolCall = fnUntraced(function* ({ toolNameMapper, toolParams,
28555
28128
  toolName,
28556
28129
  params: yield* try_({
28557
28130
  try: () => unsafeSecureJsonParse(toolParams),
28558
- catch: (cause) => make$18({
28131
+ catch: (cause) => make$47({
28559
28132
  module: "OpenAiLanguageModel",
28560
28133
  method,
28561
28134
  reason: new ToolParameterValidationError({
@@ -28621,7 +28194,7 @@ const transformToolCallParams$1 = fnUntraced(function* (options, toolName, toolP
28621
28194
  const tool = options.tools.find((tool) => tool.name === toolName);
28622
28195
  if (isUndefined(tool)) {
28623
28196
  if (options.toolCallValidation === "deferred") return toolParams;
28624
- return yield* make$18({
28197
+ return yield* make$47({
28625
28198
  module: "OpenAiLanguageModel",
28626
28199
  method: "makeResponse",
28627
28200
  reason: new ToolNotFoundError({
@@ -28635,7 +28208,7 @@ const transformToolCallParams$1 = fnUntraced(function* (options, toolName, toolP
28635
28208
  return yield* decodeEffect(codec)(toolParams).pipe(flatMap$1((decoded) => encodeUnknownEffect(tool.parametersSchema)(decoded)), orElseSucceed(() => toolParams));
28636
28209
  });
28637
28210
  // package.json
28638
- var version$1 = "0.24.2";
28211
+ var version$1 = "0.24.4";
28639
28212
  // src/ClaudeAgent.ts
28640
28213
  const minimumClaudeCodeVersion = "2.1.248";
28641
28214
  const serverName = "clanka";
@@ -28789,12 +28362,12 @@ const makeUsage = () => {
28789
28362
  }
28790
28363
  };
28791
28364
  };
28792
- const aiError = (reason) => make$18({
28365
+ const aiError = (reason) => make$47({
28793
28366
  module: "ClaudeAgent",
28794
28367
  method: "streamText",
28795
28368
  reason
28796
28369
  });
28797
- const unknownError = (description) => aiError(new UnknownError({ description }));
28370
+ const unknownError = (description) => aiError(new UnknownError$1({ description }));
28798
28371
  const resultError = (message, code) => {
28799
28372
  const status = message.subtype === "success" ? message.api_error_status : void 0;
28800
28373
  if (message.subtype === "success" && !message.is_error && (status === void 0 || status === null || status < 400)) return;
@@ -28807,7 +28380,8 @@ const resultError = (message, code) => {
28807
28380
  }));
28808
28381
  case "invalid_request": return aiError(new InvalidRequestError$1({ description }));
28809
28382
  }
28810
- return aiError(/prompt is too long/i.test(description) ? new InvalidRequestError$1({ description }) : new UnknownError({ description }));
28383
+ if (status === 429 || /Request rejected \(429\)|\brate_limit_error\b/i.test(description)) return aiError(new RateLimitError({ metadata: { description } }));
28384
+ return aiError(/prompt is too long/i.test(description) ? new InvalidRequestError$1({ description }) : new UnknownError$1({ description }));
28811
28385
  };
28812
28386
  const makeConverter = () => {
28813
28387
  const usage = makeUsage();
@@ -29060,7 +28634,7 @@ const closeSession = (session) => suspend(() => {
29060
28634
  const startSession = fnUntraced(function* (model, options, provider, withTools) {
29061
28635
  const query = options?.query ?? (yield* loadSdk).query;
29062
28636
  const executable = options?.executable ?? (yield* findExecutable);
29063
- const messages = yield* make$47();
28637
+ const messages = yield* make$46();
29064
28638
  const bridge = makeToolBridge((id) => {
29065
28639
  offerUnsafe(messages, {
29066
28640
  type: "clanka_parked",
@@ -29068,7 +28642,7 @@ const startSession = fnUntraced(function* (model, options, provider, withTools)
29068
28642
  });
29069
28643
  });
29070
28644
  const mcpServers = withTools ? { [serverName]: yield* makeToolServer(provider.tools, bridge) } : {};
29071
- const input = yield* make$47();
28645
+ const input = yield* make$46();
29072
28646
  offerUnsafe(input, userMessage(toUserContent(provider.prompt)));
29073
28647
  if (!withTools) yield* end(input);
29074
28648
  const session = query({
@@ -29084,7 +28658,7 @@ const startSession = fnUntraced(function* (model, options, provider, withTools)
29084
28658
  mcpServers
29085
28659
  }
29086
28660
  });
29087
- const scope = yield* make$43();
28661
+ const scope = yield* make$44();
29088
28662
  yield* fromAsyncIterable(session, (cause) => unknownError(`Claude Code failed: ${String(cause)}`)).pipe(runForEach((message) => offer(messages, message)), matchCauseEffect({
29089
28663
  onSuccess: () => end(messages),
29090
28664
  onFailure: (cause) => failCause$2(messages, cause)
@@ -29308,7 +28882,7 @@ const toParts = (parts) => {
29308
28882
  }
29309
28883
  return result;
29310
28884
  };
29311
- const model$4 = (model, options) => make$19("claude", model, merge$2(layerLanguageModel(model, options), AgentModelConfig.layer({
28885
+ const model$4 = (model, options) => make$18("claude", model, merge$2(layerLanguageModel(model, options), AgentModelConfig.layer({
29312
28886
  supportsImages: options?.supportsImages,
29313
28887
  cutStreamOnSteering: false
29314
28888
  })));
@@ -29547,9 +29121,9 @@ var CodexAuth = class CodexAuth extends Service()("clanka/CodexAuth") {
29547
29121
  };
29548
29122
  // src/Codex.ts
29549
29123
  const layerClient$3 = layer$4({ apiUrl: "https://chatgpt.com/backend-api/codex" }).pipe(provide$3(CodexAuth.layerClient));
29550
- const model$3 = (model, options) => make$19("openai", model, layerModel(model, options));
29551
- const modelWebSocket$1 = (model, options) => make$19("openai", model, layerModel(model, options).pipe(merge$2(fresh(layerWebSocketMode))));
29552
- const layerModel = (model, options) => suspend$1(() => layer$2({
29124
+ const model$3 = (model, options) => make$18("openai", model, layerModel(model, options));
29125
+ const modelWebSocket$1 = (model, options) => make$18("openai", model, layerModel(model, options).pipe(merge$2(fresh(layerWebSocketMode))));
29126
+ const layerModel = (model, options) => suspend$2(() => layer$2({
29553
29127
  model,
29554
29128
  config: {
29555
29129
  ...omit(options ?? {}, ["reasoning", ...AgentModelConfig.optionKeys]),
@@ -29577,12 +29151,12 @@ const OpenAiErrorBodyJson = decodeUnknownOption(fromJsonString(Union([OpenAiErro
29577
29151
  decode: headNonEmpty,
29578
29152
  encode: (item) => [item]
29579
29153
  })))])));
29580
- const mapSchemaError = dual(2, (error, method) => make$18({
29154
+ const mapSchemaError = dual(2, (error, method) => make$47({
29581
29155
  module: "OpenAiClient",
29582
29156
  method,
29583
29157
  reason: InvalidResponseError.fromSchemaError(error)
29584
29158
  }));
29585
- const mapSseError = dual(2, (error, method) => make$18({
29159
+ const mapSseError = dual(2, (error, method) => make$47({
29586
29160
  module: "OpenAiClient",
29587
29161
  method,
29588
29162
  reason: new InvalidResponseError({ description: error.message })
@@ -29592,18 +29166,18 @@ const mapHttpClientError = dual(2, (error, method) => {
29592
29166
  switch (reason._tag) {
29593
29167
  case "TransportError":
29594
29168
  case "EncodeError":
29595
- case "InvalidUrlError": return fail$1(make$18({
29169
+ case "InvalidUrlError": return fail$1(make$47({
29596
29170
  module: "OpenAiClient",
29597
29171
  method,
29598
29172
  reason: NetworkError.fromHttpClientError(error)
29599
29173
  }));
29600
29174
  case "StatusCodeError": return mapStatusCodeError(reason, method);
29601
- case "DecodeError": return fail$1(make$18({
29175
+ case "DecodeError": return fail$1(make$47({
29602
29176
  module: "OpenAiClient",
29603
29177
  method,
29604
29178
  reason: new InvalidOutputError({ description: reason.description ?? "Failed to decode response" })
29605
29179
  }));
29606
- case "EmptyBodyError": return fail$1(make$18({
29180
+ case "EmptyBodyError": return fail$1(make$47({
29607
29181
  module: "OpenAiClient",
29608
29182
  method,
29609
29183
  reason: new InvalidOutputError({ description: reason.description ?? "Response body was empty" })
@@ -29635,7 +29209,7 @@ const mapStatusCodeError = fnUntraced(function* (error, method) {
29635
29209
  requestId: requestId ?? null
29636
29210
  }
29637
29211
  });
29638
- return yield* make$18({
29212
+ return yield* make$47({
29639
29213
  module: "OpenAiClient",
29640
29214
  method,
29641
29215
  reason
@@ -29726,7 +29300,7 @@ const mapStatusCodeToReason = ({ status, method, url, headers, message, metadata
29726
29300
  metadata: { "openai-compat": metadata },
29727
29301
  http
29728
29302
  });
29729
- return new UnknownError({
29303
+ return new UnknownError$1({
29730
29304
  description: message,
29731
29305
  metadata: { "openai-compat": metadata },
29732
29306
  http
@@ -30044,7 +29618,7 @@ const prepareMessages = fnUntraced(function* ({ config, options, toolNameMapper
30044
29618
  file_data: fileData
30045
29619
  });
30046
29620
  }
30047
- } else return yield* make$18({
29621
+ } else return yield* make$47({
30048
29622
  module: "OpenAiLanguageModel",
30049
29623
  method: "prepareMessages",
30050
29624
  reason: new InvalidRequestError$1({ description: `Detected unsupported media type for file: '${part.mediaType}'` })
@@ -30139,7 +29713,7 @@ const makeResponse = fnUntraced(function* ({ options, rawResponse, response, too
30139
29713
  const toolParamsJson = toolCall.function?.arguments ?? "{}";
30140
29714
  const toolParams = yield* try_({
30141
29715
  try: () => unsafeSecureJsonParse(toolParamsJson),
30142
- catch: (cause) => make$18({
29716
+ catch: (cause) => make$47({
30143
29717
  module: "OpenAiLanguageModel",
30144
29718
  method: "makeResponse",
30145
29719
  reason: new ToolParameterValidationError({
@@ -30201,7 +29775,7 @@ const makeStreamResponse = fnUntraced(function* ({ options, stream, response, to
30201
29775
  const toolParams = toolCall.arguments.length > 0 ? toolCall.arguments : "{}";
30202
29776
  const parsedParams = yield* try_({
30203
29777
  try: () => unsafeSecureJsonParse(toolParams),
30204
- catch: (cause) => make$18({
29778
+ catch: (cause) => make$47({
30205
29779
  module: "OpenAiLanguageModel",
30206
29780
  method: "makeStreamResponse",
30207
29781
  reason: new ToolParameterValidationError({
@@ -30378,7 +29952,7 @@ const annotateStreamResponse = (span, part) => {
30378
29952
  });
30379
29953
  }
30380
29954
  };
30381
- const unsupportedSchemaError = (error, method) => make$18({
29955
+ const unsupportedSchemaError = (error, method) => make$47({
30382
29956
  module: "OpenAiLanguageModel",
30383
29957
  method,
30384
29958
  reason: new UnsupportedSchemaError({ description: error instanceof Error ? error.message : String(error) })
@@ -30396,7 +29970,7 @@ const transformToolCallParams = fnUntraced(function* (options, toolName, toolPar
30396
29970
  const tool = options.tools.find((tool) => tool.name === toolName);
30397
29971
  if (isUndefined(tool)) {
30398
29972
  if (options.toolCallValidation === "deferred") return toolParams;
30399
- return yield* make$18({
29973
+ return yield* make$47({
30400
29974
  module: "OpenAiLanguageModel",
30401
29975
  method: "makeResponse",
30402
29976
  reason: new ToolNotFoundError({
@@ -30884,7 +30458,7 @@ var GithubCopilotAuth = class GithubCopilotAuth extends Service()("clanka/Github
30884
30458
  };
30885
30459
  // src/Copilot.ts
30886
30460
  const layerClient$2 = layer$1({ apiUrl: API_URL }).pipe(provide$3(GithubCopilotAuth.layerClient));
30887
- const model$2 = (model, options) => make$19("openai", model, mergeAll(layer({
30461
+ const model$2 = (model, options) => make$18("openai", model, mergeAll(layer({
30888
30462
  model,
30889
30463
  config: omit(options ?? {}, options?.reasoning === null ? ["reasoning", ...AgentModelConfig.optionKeys] : AgentModelConfig.optionKeys)
30890
30464
  }), AgentModelConfig.layer(pick(options ?? {}, AgentModelConfig.optionKeys)), succeed$4(SummarizerTransform, (effect) => withConfigOverride(effect, { max_output_tokens: summarizerMaxOutputTokens }))));
@@ -31021,7 +30595,7 @@ var ModelsRepo = class ModelsRepo extends Service()("clanka/ModelsRepo") {
31021
30595
  };
31022
30596
  // src/OpenAiCompat.ts
31023
30597
  const layerClient$1 = (options) => layer$1(options);
31024
- const model$1 = (model, options) => make$19("openai-compat", model, mergeAll(layer({
30598
+ const model$1 = (model, options) => make$18("openai-compat", model, mergeAll(layer({
31025
30599
  model,
31026
30600
  config: {
31027
30601
  ...omit(options ?? {}, ["reasoning", ...AgentModelConfig.optionKeys]),
@@ -31189,7 +30763,7 @@ var XaiAuth = class XaiAuth extends Service()("clanka/XaiAuth") {
31189
30763
  };
31190
30764
  // src/Xai.ts
31191
30765
  const layerClient = layer$4({ apiUrl: "https://api.x.ai/v1" }).pipe(provide$3(XaiAuth.layerClient));
31192
- const modelWebSocket = (model, options) => make$19("xai", model, mergeAll(layer$2({
30766
+ const modelWebSocket = (model, options) => make$18("xai", model, mergeAll(layer$2({
31193
30767
  model,
31194
30768
  config: {
31195
30769
  ...omit(options ?? {}, ["reasoning", ...AgentModelConfig.optionKeys]),
@@ -31269,7 +30843,7 @@ const resolveEffort = (efforts, thoughtLevel) => {
31269
30843
  for (const effort of efforts) if (resolved === null || distance(effort) < distance(resolved) || distance(effort) === distance(resolved) && rank(effort) > rank(resolved)) resolved = effort;
31270
30844
  return resolved;
31271
30845
  };
31272
- const makeAcp = (options) => (modelId, thoughtLevel, fastMode = false) => map$8(parseAcpModelId(modelId), ({ provider, model }) => unwrap$3(map$5(options.models, (catalog) => {
30846
+ const makeAcp = (options) => (modelId, thoughtLevel, fastMode = false) => map$8(parseAcpModelId(modelId), ({ provider, model }) => unwrap$4(map$5(options.models, (catalog) => {
31273
30847
  const info = catalog.find((entry) => entry.provider === provider && entry.id === model);
31274
30848
  return make(provider, model, info?.efforts === void 0 ? thoughtLevel : resolveEffort(info.efforts, thoughtLevel), options.openai, fastMode, options.auxiliary);
31275
30849
  })));
@@ -31368,7 +30942,7 @@ const model = String$1("model").pipe(withAlias("m"), optional);
31368
30942
  const apiKey = Redacted("api-key").pipe(withDescription$1("API key for the openai API-key mode and the openai-compat provider (defaults to CLANKA_OPENAI_API_KEY)"), withFallbackConfig(Redacted$3("CLANKA_OPENAI_API_KEY")), optional);
31369
30943
  const apiUrl = String$1("api-url").pipe(withDescription$1("API base URL for the openai API-key mode and the openai-compat provider (defaults to CLANKA_OPENAI_API_URL or https://api.openai.com/v1). When set, the models it lists at /models are offered as openai-compat models."), withFallbackConfig(String$4("CLANKA_OPENAI_API_URL")), optional);
31370
30944
  const openAiCompatModels = (flags) => match$2(flags.apiUrl, {
31371
- onNone: () => empty$7,
30945
+ onNone: () => empty$10,
31372
30946
  onSome: (apiUrl) => layerModelsRepo({
31373
30947
  apiUrl,
31374
30948
  apiKey: getOrUndefined(flags.apiKey)
@@ -31394,19 +30968,19 @@ const fetch$1 = Boolean("fetch").pipe(withDescription$1("Expose the global Fetch
31394
30968
  const mcp = Boolean("mcp").pipe(withDescription$1("Start the MCP servers from ~/.config/clanka/mcp.json, ./.mcp.json and --mcp-config. Disable with --no-mcp or CLANKA_MCP=false."), withFallbackConfig(Boolean$3("CLANKA_MCP").pipe(withDefault$2(true))));
31395
30969
  const mcpConfig = String$1("mcp-config").pipe(withDescription$1("An MCP config file in the { \"mcpServers\": { ... } } format. Repeatable; a later file wins."), atLeast(0));
31396
30970
  const mcpSummary = (status) => `MCP: ${Object.entries(status).map(([name, server]) => server._tag === "Connected" ? `${name} (${server.tools.length} tools)` : `${name} failed: ${server.error.split("\n")[0]}`).join(", ")}`;
31397
- const Kvs = unwrap$3(gen(function* () {
30971
+ const Kvs = unwrap$4(gen(function* () {
31398
30972
  const path = yield* Path$3;
31399
30973
  const configHome = yield* NonEmptyString("XDG_CONFIG_HOME").pipe(orElse(() => NonEmptyString("HOME").pipe(map$3((home) => path.join(home, ".config")))));
31400
30974
  return layerFileSystem(path.join(configHome, "clanka"));
31401
30975
  })).pipe(provide$3(layer$9));
31402
- const Search = (directory) => unwrap$3(gen(function* () {
30976
+ const Search = (directory) => unwrap$4(gen(function* () {
31403
30977
  const apiKey = yield* Redacted$3("OPENAI_API_KEY").pipe(option);
31404
30978
  if (isNone(apiKey)) {
31405
30979
  yield* logWarning("OPENAI_API_KEY is not set");
31406
- return empty$7;
30980
+ return empty$10;
31407
30981
  }
31408
30982
  const path = yield* Path$3;
31409
- return (yield* promise(() => import("./SemanticSearch-CH125AHH.mjs"))).layer({
30983
+ return (yield* promise(() => import("./SemanticSearch-BlcfFvPr.mjs"))).layer({
31410
30984
  directory: process.cwd(),
31411
30985
  database: path.join(directory, "search.sqlite")
31412
30986
  }).pipe(provide$3(model$5("text-embedding-3-small", { dimensions: 1536 })), provide$3(layer$4({ apiKey: apiKey.value })));
@@ -31420,7 +30994,7 @@ const acpModel = String$1("model").pipe(withAlias("m"), withDescription$1("Defau
31420
30994
  }));
31421
30995
  const trustAllTools = Boolean("trust-all-tools").pipe(withDescription$1("Accepted for kiro-cli compatibility. Has no effect: clanka runs every tool call without asking."), withDefault(false));
31422
30996
  const reasoning = schema$1(ThoughtLevel, "CLANKA_REASONING").pipe(withDefault$2("medium"));
31423
- const acp = make$27("acp", {
30997
+ const acp = make$26("acp", {
31424
30998
  model: acpModel,
31425
30999
  fetch: fetch$1,
31426
31000
  trustAllTools,
@@ -31455,7 +31029,7 @@ const acp = make$27("acp", {
31455
31029
  })
31456
31030
  });
31457
31031
  })), provide((flags) => mergeAll(ConversationMode.layer(false), succeed$4(LogToStderr, true), layerLog, compactionConfig(flags), openAiCompatModels(flags))));
31458
- make$27("clanka", {
31032
+ make$26("clanka", {
31459
31033
  provider,
31460
31034
  fetch: fetch$1,
31461
31035
  model,
@@ -31477,7 +31051,7 @@ make$27("clanka", {
31477
31051
  files: mcpConfig,
31478
31052
  enabled: mcp
31479
31053
  });
31480
- const OutputFormatter = yield* promise(() => import("./OutputFormatter-U02YKTfy.mjs"));
31054
+ const OutputFormatter = yield* promise(() => import("./OutputFormatter-B8yF7iiq.mjs"));
31481
31055
  const { model, effort } = yield* match$2(modelRaw, {
31482
31056
  onSome: (selected) => succeed$1(parseModel(selected)),
31483
31057
  onNone: () => selectModel(provider)
@@ -31502,7 +31076,7 @@ make$27("clanka", {
31502
31076
  directory: process.cwd(),
31503
31077
  excludeTools: flags.fetch ? [] : ["fetch"]
31504
31078
  }).pipe(provide$3(match$2(semantic, {
31505
- onNone: () => empty$7,
31079
+ onNone: () => empty$10,
31506
31080
  onSome: Search
31507
31081
  })), provideMerge(layer$6(mcpServers))), Model]));
31508
31082
  })), provide(({ prompt, ...flags }) => mergeAll(ConversationMode.layer(isNone(prompt)), compactionConfig(flags), openAiCompatModels(flags))), withSubcommands([acp]), withGlobalFlags([ReportedVersion]), run$1({ version }), provide$1([
@@ -31511,4 +31085,4 @@ make$27("clanka", {
31511
31085
  layerWebSocketConstructor,
31512
31086
  layerConsole
31513
31087
  ]), runMain);
31514
- export { ChildProcessSpawner as C, FileSystem as E, make$25 as S, Path$3 as T, SocketReadError as _, makeGrouped as a, isCloseEvent as b, StreamableHTTPClientTransport as c, maybeRemoveFile as d, maybeUpdateFile as f, SocketOpenError as g, SocketError as h, batchN as i, Client as l, SocketCloseError as m, EmbeddingModel as n, setDelay as o, map as p, EmbeddingRequest as r, withSpan as s, Dimensions as t, SemanticSearch as u, SocketUpgradeError as v, Console as w, make$22 as x, SocketWriteError as y };
31088
+ export { make$21 as C, Path$3 as D, Console as E, FileSystem as O, isCloseEvent as S, ChildProcessSpawner as T, SocketError as _, makeGrouped as a, SocketUpgradeError as b, ReasoningEnd as c, Client as d, SemanticSearch as f, SocketCloseError as g, map as h, batchN as i, ScriptEnd as l, maybeUpdateFile as m, EmbeddingModel as n, setDelay as o, maybeRemoveFile as p, EmbeddingRequest as r, withSpan as s, Dimensions as t, StreamableHTTPClientTransport as u, SocketOpenError as v, make$24 as w, SocketWriteError as x, SocketReadError as y };