clanka 0.25.3 → 0.26.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/dist/Acp.d.ts +5 -37
  2. package/dist/Acp.d.ts.map +1 -1
  3. package/dist/Acp.js +33 -48
  4. package/dist/Acp.js.map +1 -1
  5. package/dist/Acp.test.js +64 -3
  6. package/dist/Acp.test.js.map +1 -1
  7. package/dist/AcpImage.test.js +3 -2
  8. package/dist/AcpImage.test.js.map +1 -1
  9. package/dist/AcpSessionStore.d.ts +114 -0
  10. package/dist/AcpSessionStore.d.ts.map +1 -0
  11. package/dist/AcpSessionStore.js +327 -0
  12. package/dist/AcpSessionStore.js.map +1 -0
  13. package/dist/AcpSessionStore.test.d.ts +2 -0
  14. package/dist/AcpSessionStore.test.d.ts.map +1 -0
  15. package/dist/AcpSessionStore.test.js +135 -0
  16. package/dist/AcpSessionStore.test.js.map +1 -0
  17. package/dist/Agent.d.ts.map +1 -1
  18. package/dist/Agent.js +6 -5
  19. package/dist/Agent.js.map +1 -1
  20. package/dist/Agent.test.js +7 -6
  21. package/dist/Agent.test.js.map +1 -1
  22. package/dist/AgentBashJobs.test.js +7 -7
  23. package/dist/AgentBashJobs.test.js.map +1 -1
  24. package/dist/AgentExecutor.test.js +20 -20
  25. package/dist/AgentExecutor.test.js.map +1 -1
  26. package/dist/AgentImage.test.js +1 -1
  27. package/dist/AgentImage.test.js.map +1 -1
  28. package/dist/AgentSubagents.test.js +57 -29
  29. package/dist/AgentSubagents.test.js.map +1 -1
  30. package/dist/AgentTools.d.ts +4 -3
  31. package/dist/AgentTools.d.ts.map +1 -1
  32. package/dist/AgentTools.js +9 -7
  33. package/dist/AgentTools.js.map +1 -1
  34. package/dist/bin/{AiError-CsvdOsKR.mjs → AiError-DBaKz35C.mjs} +2 -2
  35. package/dist/bin/{Latch-B3e9629m.mjs → Latch-DOdbsGMQ.mjs} +1 -1
  36. package/dist/bin/{McpClient-BCxZZgnA.mjs → McpClient-B-FFG6Pg.mjs} +1 -1
  37. package/dist/bin/{OutputFormatter-ByMjyBhe.mjs → OutputFormatter-DhhP2i-7.mjs} +2 -2
  38. package/dist/bin/{Schema-BfUmMefy.mjs → Schema-CFdSO6iH.mjs} +11 -1
  39. package/dist/bin/{SemanticSearch-Cw10ozz8.mjs → SemanticSearch-C3a7LAQr.mjs} +2 -2
  40. package/dist/bin/cli.mjs +360 -154
  41. package/dist/bin/{upgrade-t590zYhO.mjs → upgrade-C4aOEWJH.mjs} +2 -2
  42. package/dist/cli.js +10 -3
  43. package/dist/cli.js.map +1 -1
  44. package/dist/index.d.ts +4 -0
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/index.js +4 -0
  47. package/dist/index.js.map +1 -1
  48. package/package.json +1 -1
  49. package/src/Acp.test.ts +122 -3
  50. package/src/Acp.ts +41 -55
  51. package/src/AcpImage.test.ts +7 -2
  52. package/src/AcpSessionStore.test.ts +220 -0
  53. package/src/AcpSessionStore.ts +455 -0
  54. package/src/Agent.test.ts +10 -6
  55. package/src/Agent.ts +8 -6
  56. package/src/AgentBashJobs.test.ts +9 -9
  57. package/src/AgentExecutor.test.ts +20 -20
  58. package/src/AgentImage.test.ts +1 -1
  59. package/src/AgentSubagents.test.ts +77 -34
  60. package/src/AgentTools.ts +15 -10
  61. package/src/cli.ts +20 -9
  62. package/src/index.ts +5 -0
package/dist/bin/cli.mjs CHANGED
@@ -1,8 +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-CXhmmSW5.mjs";
3
- import { $ as URLFromString, $c as sync$1, $i as ignore, $l as fromInputUnsafe$1, $n as optionalKey$1, $r as stripCrlf, $s as TracerTimingEnabled, $t as isPattern, A as Null, Aa as provideServiceEffect, Ad as isTagged, An as escapeToken, Ar as fromBody, As as empty$10, At as isGreaterThan, Au as fromUndefinedOr, B as String$7, Ba as scope, Bd as identity, Bi as flatMapEager, Bl as headUnsafe, Bn as Objects, Br as retryAfterDelay, Bs as suspend$2, Bt as isLessThanDate, Bu as orElse$1, C as Literal, Ca as option$1, Cc as LogToStderr$1, Cd as isNotNullish, Cl as headNonEmpty, Cr as jsonSchemaAnnotationKeys, Cs as reasonAnnotations, Ct as isBetweenCodePoints, Cu as all$1, D as Never, Da as provide$1, Dd as isObject$1, Di as catch_, Dl as isReadonlyArrayNonEmpty, Dn as fromSchemaDraft07, Dr as redactUrl, Ds as effect, Dt as isBetweenSize, Du as flatMapNullishOr, E as Natural, Ea as promise, Ed as isNullish, Ei as catchTags, El as isCanonicalArrayIndex, En as errorWithPath, Er as fromInput, Es as buildWithScope, Et as isBetweenProperties, Eu as flatMap$2, F as OptionFromOptional, Fa as retry, Fd as constUndefined, Fi as fail$1, Fl as sort, Fn as encodeEffect, Fo as jittered, Fr as fromRecordUnsafe, Fs as orDie$1, Ft as isGreaterThanOrEqualToDate, Fu as isNone, G as TaggedClass$1, Ga as sleep, Gi as forever, Gl as isFailure$1, Gn as decodeTo, Gr as formatIso, Gs as close, Gt as isMaxLength, Gu as String$6, H as Struct, Hd as pipe, Hi as fn, Hl as failVoid, Hn as Suspend, Ho as isDoneCause, Hr as setAll, Hs as Scope, Ht as isLessThanOrEqualToBigInt, Hu as some, I as Record, Ia as runFork, Id as constVoid, Ii as failCause, Il as span, In as Arrays, Io as min, Ir as isRedactedName, Is as provide$3, It as isIncluding, Iu as isSome, J as TaggedUnion, Ji as forkIn, Jl as succeed$2, Jn as isJson, Jo as Clock, Js as make$44, Jt as isMinCodePoints, Ju as Prototype, K as TaggedError$1, Ka as succeed$1, Ki as forkChild, Kl as isSuccess$1, Kn as defaultParseOptions, Ko as parse$1, Ks as fork, Kt as isMaxProperties, L as Redacted$4, La as runForkWith, Li as failSync, Ll as assignProperty$1, Ln as Filter, Lo as spaced, Lr as merge$3, Ls as provideMerge, Lt as isInt, Lu as map$8, M as Number$2, Ma as repeat, Md as or, Mi as effectify, Ml as match$3, Mn as getSubschemaKind, Mo as forever$1, Mr as CurrentRedactedNames$1, Ms as merge$2, Mt as isGreaterThanDate, Mu as getOrNull, N as Option, Na as request, Nd as constFalse, Ni as ensuring, Nl as of, Nn as decodeEffect$1, No as fromStep, Nr as empty$6, Ns as mergeAll, Nt as isGreaterThanOrEqualTo, Nu as getOrThrow$1, O as NonEmptyArray, Oa as provideContext, Od as isObjectKeyword, Oi as context, Ol as join$2, On as fromSchemaDraft2020_12, Or as setAll$1, Os as effectContext, Ot as isEndingWith, Pa as result, Pd as constTrue, Pi as exit, Pl as reduce, Pn as decodeUnknownEffect, Po as isSchedule, Pr as fromInput$1, Ps as mock, Pt as isGreaterThanOrEqualToBigInt, Pu as getOrUndefined, Q as URL$1, Qa as tapCause, Qi as gen, Ql as format$1, Qn as null_, Qo as IllegalArgumentError, Qr as decodeNative, Qs as MinimumLogLevel, Qt as isMultipleOf, R as RedactedFromValue, Rd as dual, Ri as filterOrFail, Rl as map$10, Rn as FilterGroup, Ro as toStep, Rr as parseRetryAfter$1, Rs as succeed$4, Rt as isLessThan, Ru as match$2, S as JsonObject$1, Sa as onInterrupt, Sc as ConsoleRef, Sd as isNotNull, Si as catchIf, Sl as fromIterable, Sn as withDecodingDefaultKey, So as TaggedClass$2, Sr as annotationExcludedKeys, Ss as pretty, St as isBetweenBigInt, Ta as orElseSucceed, Td as isNull, Ti as catchTag, Tl as isArrayNonEmpty, Tn as pick, Tr as empty$5, Ts as build, Tt as isBetweenLength, Tu as filter$1, U as StructWithRest, Ua as service, Ud as pipeArguments, Ui as fnUntraced, Ul as getOrThrow, Un as Union$1, Ur as empty$7, Us as addFinalizer, Ut as isLessThanOrEqualToDate, Uu as toArray, V as StringForLiteralAutocomplete, Va as scoped, Vc as forkUnsafe, Vd as memoize, Vl as fail$2, Vn as PropertySignature, Vr as set, Vs as unwrap$4, Vt as isLessThanOrEqualTo, Vu as orElseSome, W as Symbol$1, Wa as serviceOption, Wi as forEach$1, Wl as getOrUndefined$2, Wn as applyToSelfOrLastLinkEncoding, Wo as Random$1, Wr as fromSetCookie, Ws as addFinalizerExit, Wt as isMaxCodePoints, X as Tuple, Xa as sync, Xi as fromOption, Xn as isOptional, Xr as decode$3, Xs as provide$2, Xt as isMinProperties, Xu as PipeInspectableProto, Y as TrueLiterals, Ya as suspend, Yi as forkScoped, Yl as try_$1, Yn as isNever, Yo as currentTimeMillis, Ys as makeUnsafe$2, Yt as isMinLength, Z as TupleWithRest, Za as tap, Zi as fromResult, Zl as normalizeNonEmpty, Zn as mapOrSame, Zo as Done, Zr as encode, Zs as CurrentLogAnnotations, Zt as isMinSize, _ as Exit, _a as matchEffect, _c as isFailure, _i as catchCause, _n as toEncoded$1, _o as withSpan$1, _r as transform$3, _s as isFailReason, _t as encodeUnknownEffect, _u as getOrUndefinedUnsafe, aa as logError, ac as isDone, ad as withFiber$1, al as ParentSpan, an as isUnique, ao as undefined_, ar as toEncoded, at as Void, au as millis, b as Int$5, ba as onExit, bc as void_$1, bd as hasProperty, bi as catchEager, bl as findLast, bn as withConstructorDefault, bo as equalBatchKeys, br as InvalidValue$1, bs as makeFailReason, bt as is, bu as makeUnsafe$3, c as Date$2, ca as logWarning, cc as makeUnsafe$1, cd as setStackTraceLimit, ci as andThen, cl as TaggedClass, cn as makeFilter$1, co as updateContext, cr as Transformation, cs as filterInterruptors, ct as declare, cu as toMillis, da as mapBothEager, dc as die$1, dd as NodeInspectSymbol, di as as, dl as compose, dn as optional$2, do as void_, dr as transformEffect$1, ds as hasInterrupts, dt as decodeTo$1, du as Service, ea as ignoreCause, ec as _await, ei as isRedacted, en as isPropertyNames, eo as timeout, er as replaceChecks, es as StackTrace, et as Uint8Array$2, eu as hours, f as DateTimeUtcFromString, fa as mapEager, fc as fail$3, fi as asSome, fl as has, fn as optionalKey, fr as transformOptional$1, fs as hasInterruptsOnly, ft as decodeUnknownEffect$1, fu as add, g as Error$2, ga as matchCauseEffect, gi as callback, gl as empty$4, gn as toCodecStringTree, go as withParentSpan, gr as passthroughSubtype, gt as encodeTo, gu as getOrUndefined$1, h as DurationFromMillis, hc as interrupt$1, hi as cachedWithTTL, hl as appendAll, hn as toCodecJson, hr as passthrough, hs as isDieReason, ht as encodeEffect$1, hu as getOption, i as Boolean$4, ia as logDebug, ic as into, ii as acquireRelease, il as DisablePropagation, in as isUUID, io as try_, ir as string$1, it as Unknown, iu as max, j as NullOr, ja as raceFirst, jd as isUndefined, ji as die, jl as map$7, jn as parseUriFragment, jo as exponential, jr as unwrap$3, js as fresh, jt as isGreaterThanBigInt, ju as getOrElse, k as NonEmptyString$1, ka as provideService, kd as isString, ki as contextWith, kl as last$1, kn as getReferenceKey, kr as toString, kt as isFinite$1, ku as fromNullishOr, la as makeSpanScoped, lc as succeed$5, ld as BaseProto, li as annotateCurrentSpan, ll as TaggedError, ln as makeFilterGroup, lo as updateService, lr as passthrough$1, ls as findErrorOption, lt as decodeEffect, lu as zero, m as Duration, ma as match$4, mc as findErrorOption$1, md as redact, mi as cached, ml as Array$1, mn as tag, mo as withFiber, mt as decodeUnknownSync, mu as get$2, n as ArraySchema, na as interruptible, nc as fail$4, ni as value, nn as isSchemaError, no as timeoutOrElse, nr as resolveDescription, ns as UnknownError, nt as UndefinedOr, nu as isFinite, o as BooleanLiterals, oa as logFatal, oc as isDoneUnsafe, od as assignProperty, oi as addFinalizer$1, ol as EncodingError, on as link$1, oo as uninterruptible, or as toType$1, os as done, ou as minutes, p as Defect, pa as mapError, pc as failCause$1, pd as format, pi as asVoid, pl as toPredicate, pn as suspend$1, po as whileLoop, ps as interruptors, pt as decodeUnknownOption, pu as empty$8, q as TaggedStruct, qa as succeedNone, qi as forkDetach, ql as map$6, qn as getIndexSignatureKeys, qo as round, qr as fromDateUnsafe, qt as isMaxSize, qu as mapInput, r as BigInt$2, ra as isEffect, ri as stringOrRedacted, rn as isStartingWith, ro as tryPromise, rr as resolveIdentifier, rs as annotate$1, rt as Union, s as Class$1, sa as logInfo, sc as make$43, sd as getStackTraceLimit, si as all, sl as Error$1, sn as make$41, so as uninterruptibleMask, sr as unknown$1, ss as fail$5, st as check, su as seconds, t as Any, ta as interrupt, tc as doneUnsafe, ti as make$40, tn as isSchema, to as timeoutOption, tr as resolveAt, ts as TimeoutError, tt as Uint8ArrayFromBase64, tu as infinity, ua as map$5, ud as Class, ui as annotateLogs, ul as taggedEnum, un as mutable, uo as useSpan, ur as transform$2, us as fromReasons, ut as decodeSync, uu as Reference, v as FalseLiterals, va as never$1, vc as isSuccess, vi as catchCauseIf, vl as findFirst, vn as toJsonSchemaDocument, vo as yieldNow, vr as transformEffect, vs as isTimeoutError, vt as fromJsonString, vu as getUnsafe, w as Literals$2, wa as orDie, wd as isNotUndefined, wi as catchReason, wl as isArray, wn as omit, wr as CurrentRedactedNames, ws as squash, wt as isBetweenDate, wu as exists, x as Json, xd as isIterable, xi as catchFilter, xn as withDecodingDefault, xr as Pointer, xs as map$9, xt as isBetween, xu as merge$1, y as Finite, ya as onError, yc as succeed$3, yl as findFirstIndex, yn as toType, yo as zipWith, yr as transformOptional, ys as makeDieReason, yt as instanceOf, yu as make$42, z as SchemaError, za as runSync, zd as flow, zi as flatMap$1, zl as empty$9, zn as Literal$1, zo as catchDone, zr as remove$1, zs as succeedContext, zt as isLessThanBigInt, zu as none } from "./Schema-BfUmMefy.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-CsvdOsKR.mjs";
5
- import { n as makeUnsafe$5 } from "./Latch-B3e9629m.mjs";
3
+ import { $ as URLFromString, $a as tapCause, $i as gen, $l as format$1, $n as null_, $o as IllegalArgumentError, $r as decodeNative, $s as MinimumLogLevel, $t as isMultipleOf, A as Null, Aa as provideService, Ad as isString, Ai as contextWith, Al as last$1, An as getReferenceKey, Ar as toString, At as isFinite$1, Au as fromNullishOr, B as String$7, Ba as runSync, Bd as flow, Bi as flatMap$1, Bl as empty$9, Bn as Literal$1, Bo as catchDone, Br as remove$1, Bs as succeedContext, Bt as isLessThanBigInt, Bu as none, C as Literal, Ca as onInterrupt, Cc as ConsoleRef, Cd as isNotNull, Ci as catchIf, Cl as fromIterable, Cn as withDecodingDefaultKey, Co as TaggedClass$2, Cr as annotationExcludedKeys, Cs as pretty, Ct as isBetweenBigInt, D as Never, Da as promise, Dd as isNullish, Di as catchTags, Dl as isCanonicalArrayIndex, Dn as errorWithPath, Dr as fromInput, Ds as buildWithScope, Dt as isBetweenProperties, Du as flatMap$2, E as Natural, Ea as orElseSucceed, Ed as isNull, Ei as catchTag, El as isArrayNonEmpty, En as pick, Er as empty$5, Es as build, Et as isBetweenLength, Eu as filter$1, F as OptionFromOptional, Fa as result, Fd as constTrue, Fi as exit, Fl as reduce, Fn as decodeUnknownEffect, Fo as isSchedule, Fr as fromInput$1, Fs as mock, Ft as isGreaterThanOrEqualToBigInt, Fu as getOrUndefined, G as TaggedClass$1, Ga as serviceOption, Gi as forEach$1, Gl as getOrUndefined$2, Gn as applyToSelfOrLastLinkEncoding, Go as Random$1, Gr as fromSetCookie, Gs as addFinalizerExit, Gt as isMaxCodePoints, H as Struct, Ha as scoped, Hc as forkUnsafe, Hd as memoize, Hl as fail$2, Hn as PropertySignature, Hr as set, Hs as unwrap$4, Ht as isLessThanOrEqualTo, Hu as orElseSome, I as Record, Ia as retry, Id as constUndefined, Ii as fail$1, Il as sort, In as encodeEffect, Io as jittered, Ir as fromRecordUnsafe, Is as orDie$1, It as isGreaterThanOrEqualToDate, Iu as isNone, J as TaggedUnion, Ja as succeedNone, Ji as forkDetach, Jl as map$6, Jn as getIndexSignatureKeys, Jo as round, Jr as fromDateUnsafe, Jt as isMaxSize, Ju as mapInput, K as TaggedError$1, Ka as sleep, Ki as forever, Kl as isFailure$1, Kn as decodeTo, Kr as formatIso, Ks as close, Kt as isMaxLength, Ku as String$6, L as Redacted$4, La as runFork, Ld as constVoid, Li as failCause, Ll as span, Ln as Arrays, Lo as min, Lr as isRedactedName, Ls as provide$3, Lt as isIncluding, Lu as isSome, M as Number$2, Ma as raceFirst, Md as isUndefined, Mi as die, Ml as map$7, Mn as parseUriFragment, Mo as exponential, Mr as unwrap$3, Ms as fresh, Mt as isGreaterThanBigInt, Mu as getOrElse, N as Option, Na as repeat, Nd as or, Ni as effectify, Nl as match$3, Nn as getSubschemaKind, No as forever$1, Nr as CurrentRedactedNames$1, Ns as merge$3, Nt as isGreaterThanDate, Nu as getOrNull, O as NonEmptyArray, Oa as provide$1, Od as isObject$1, Oi as catch_, Ol as isReadonlyArrayNonEmpty, On as fromSchemaDraft07, Or as redactUrl, Os as effect, Ot as isBetweenSize, Ou as flatMapNullishOr, Pa as request, Pd as constFalse, Pi as ensuring, Pl as of, Pn as decodeEffect$1, Po as fromStep, Pr as empty$6, Ps as mergeAll, Pt as isGreaterThanOrEqualTo, Pu as getOrThrow$1, Q as URL$1, Qa as tap, Qi as fromResult, Ql as normalizeNonEmpty, Qn as mapOrSame, Qo as Done, Qr as encode, Qs as CurrentLogAnnotations, Qt as isMinSize, R as RedactedFromValue, Ra as runForkWith, Ri as failSync, Rl as assignProperty$1, Rn as Filter, Ro as spaced, Rr as merge$2, Rs as provideMerge, Rt as isInt, Ru as map$8, S as JsonObject$1, Sd as isIterable, Si as catchFilter, Sn as withDecodingDefault, Sr as Pointer, Ss as map$9, St as isBetween, Su as merge$1, Ta as orDie, Td as isNotUndefined, Ti as catchReason, Tl as isArray, Tn as omit, Tr as CurrentRedactedNames, Ts as squash, Tt as isBetweenDate, Tu as exists, U as StructWithRest, Ud as pipe, Ui as fn, Ul as failVoid, Un as Suspend, Uo as isDoneCause, Ur as setAll, Us as Scope, Ut as isLessThanOrEqualToBigInt, Uu as some, V as StringForLiteralAutocomplete, Va as scope, Vd as identity, Vi as flatMapEager, Vl as headUnsafe, Vn as Objects, Vr as retryAfterDelay, Vs as suspend$2, Vt as isLessThanDate, Vu as orElse$1, W as Symbol$1, Wa as service, Wd as pipeArguments, Wi as fnUntraced, Wl as getOrThrow, Wn as Union$1, Wr as empty$7, Ws as addFinalizer, Wt as isLessThanOrEqualToDate, Wu as toArray, X as Tuple, Xa as suspend, Xi as forkScoped, Xl as try_$1, Xn as isNever, Xo as currentTimeMillis, Xs as makeUnsafe$2, Xt as isMinLength, Y as TrueLiterals, Yi as forkIn, Yl as succeed$2, Yn as isJson, Yo as Clock, Ys as make$44, Yt as isMinCodePoints, Yu as Prototype, Z as TupleWithRest, Za as sync, Zi as fromOption, Zn as isOptional, Zr as decode$3, Zs as provide$2, Zt as isMinProperties, Zu as PipeInspectableProto, _ as Exit, _a as matchCauseEffect, _i as callback, _l as empty$4, _n as toCodecStringTree, _o as withParentSpan, _r as passthroughSubtype, _t as encodeTo, _u as getOrUndefined$1, aa as logDebug, ac as into, ai as acquireRelease, al as DisablePropagation, an as isUUID, ao as try_, ar as string$1, at as Void, au as max, b as Int$5, ba as onError, bc as succeed$3, bl as findFirstIndex, bn as toType, bo as zipWith, br as transformOptional, bs as makeDieReason, bt as instanceOf, bu as make$42, c as Date$2, ca as logInfo, cc as make$43, cd as getStackTraceLimit, ci as all, cl as Error$1, cn as make$41, co as uninterruptibleMask, cr as unknown$1, cs as fail$5, ct as declare, cu as seconds, da as map$5, dd as Class, di as annotateLogs, dl as taggedEnum, dn as mutable, do as useSpan, dr as transform$2, ds as fromReasons, dt as decodeSync, du as Reference, ea as ignore, ec as TracerTimingEnabled, ei as stripCrlf, el as sync$1, en as isPattern, er as optionalKey$1, et as Uint8Array$2, eu as fromInputUnsafe$1, f as DateTimeUtcFromString, fa as mapBothEager, fc as die$1, fd as NodeInspectSymbol, fi as as, fl as compose, fn as optional$2, fo as void_, fr as transformEffect$1, fs as hasInterrupts, ft as decodeTo$1, fu as Service, g as Error$2, gc as interrupt$1, gi as cachedWithTTL, gl as appendAll, gn as toCodecJson, gr as passthrough, gs as isDieReason, gt as encodeEffect$1, gu as getOption, h as DurationFromMillis, ha as match$4, hc as findErrorOption$1, hd as redact, hi as cached, hl as Array$1, hn as tag, ho as withFiber, ht as decodeUnknownSync, hu as get$2, i as Boolean$4, ia as isEffect, ii as stringOrRedacted, in as isStartingWith, io as tryPromise, ir as resolveIdentifier, is as annotate$1, it as Unknown, j as NullOr, ja as provideServiceEffect, jd as isTagged, jn as escapeToken, jr as fromBody, js as empty$10, jt as isGreaterThan, ju as fromUndefinedOr, k as NonEmptyString$1, ka as provideContext, kd as isObjectKeyword, ki as context, kl as join$2, kn as fromSchemaDraft2020_12, kr as setAll$1, ks as effectContext, kt as isEndingWith, la as logWarning, lc as makeUnsafe$1, ld as setStackTraceLimit, li as andThen, ll as TaggedClass, ln as makeFilter$1, lo as updateContext, lr as Transformation, ls as filterInterruptors, lt as decodeEffect, lu as toMillis, m as Duration, ma as mapError, mc as failCause$1, md as format, mi as asVoid, ml as toPredicate, mn as suspend$1, mo as whileLoop, ms as interruptors, mt as decodeUnknownOption, mu as empty$8, n as ArraySchema, na as interrupt, nc as doneUnsafe, ni as make$40, nn as isSchema, no as timeoutOption, nr as resolveAt, ns as TimeoutError, nt as UndefinedOr, nu as infinity, o as BooleanLiterals, oa as logError, oc as isDone, od as withFiber$1, ol as ParentSpan, on as isUnique, oo as undefined_, or as toEncoded, ou as millis, p as Defect, pa as mapEager, pc as fail$3, pi as asSome, pl as has, pn as optionalKey, pr as transformOptional$1, ps as hasInterruptsOnly, pt as decodeUnknownEffect$1, pu as add, q as TaggedStruct, qa as succeed$1, qi as forkChild, ql as isSuccess$1, qn as defaultParseOptions, qo as parse$1, qs as fork, qt as isMaxProperties, r as BigInt$2, ra as interruptible, rc as fail$4, ri as value, rn as isSchemaError, ro as timeoutOrElse, rr as resolveDescription, rs as UnknownError, rt as Union, ru as isFinite, s as Class$1, sa as logFatal, sc as isDoneUnsafe, sd as assignProperty, si as addFinalizer$1, sl as EncodingError, sn as link$1, so as uninterruptible, sr as toType$1, ss as done, st as check, su as minutes, t as Any, ta as ignoreCause, tc as _await, ti as isRedacted, tn as isPropertyNames, to as timeout, tr as replaceChecks, ts as StackTrace, tt as Uint8ArrayFromBase64, tu as hours, ua as makeSpanScoped, uc as succeed$5, ud as BaseProto, ui as annotateCurrentSpan, ul as TaggedError, un as makeFilterGroup, uo as updateService, ur as passthrough$1, us as findErrorOption, ut as decodeExit, uu as zero, v as FalseLiterals, va as matchEffect, vc as isFailure, vi as catchCause, vn as toEncoded$1, vo as withSpan$1, vr as transform$3, vs as isFailReason, vt as encodeUnknownEffect, vu as getOrUndefinedUnsafe, w as Literals$2, wa as option$1, wc as LogToStderr$1, wd as isNotNullish, wl as headNonEmpty, wr as jsonSchemaAnnotationKeys, ws as reasonAnnotations, wt as isBetweenCodePoints, wu as all$1, x as Json, xa as onExit, xc as void_$1, xd as hasProperty, xi as catchEager, xl as findLast, xn as withConstructorDefault, xo as equalBatchKeys, xr as InvalidValue$1, xs as makeFailReason, xt as is, xu as makeUnsafe$3, y as Finite, ya as never$1, yc as isSuccess, yi as catchCauseIf, yl as findFirst, yn as toJsonSchemaDocument, yo as yieldNow, yr as transformEffect, ys as isTimeoutError, yt as fromJsonString, yu as getUnsafe, z as SchemaError, zd as dual, zi as filterOrFail, zl as map$10, zn as FilterGroup, zo as toStep, zr as parseRetryAfter$1, zs as succeed$4, zt as isLessThan, zu as match$2 } from "./Schema-CFdSO6iH.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-DBaKz35C.mjs";
5
+ import { n as makeUnsafe$5 } from "./Latch-DOdbsGMQ.mjs";
6
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-Bb68A2Sv.mjs";
7
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-N9Z-HYP0.mjs";
8
8
  import { createRequire } from "node:module";
@@ -1101,8 +1101,8 @@ const nativeDecodeOptions = { alphabet: "base64url" };
1101
1101
  const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
1102
1102
  const codes = new Uint8Array(128);
1103
1103
  for (let i = 0; i < 64; i++) codes[alphabet.charCodeAt(i)] = i;
1104
- const decodeString = (str) => map$6(decode$2(str), (_) => decoder.decode(_));
1105
- const decoder = new TextDecoder("utf-8", { ignoreBOM: true });
1104
+ const decodeString = (str) => map$6(decode$2(str), (_) => decoder$1.decode(_));
1105
+ const decoder$1 = new TextDecoder("utf-8", { ignoreBOM: true });
1106
1106
  // node_modules/.pnpm/effect@4.1.3/node_modules/effect/dist/Terminal.js
1107
1107
  const TypeId$25 = "~effect/Terminal";
1108
1108
  const QuitErrorTypeId = "~effect/Terminal/QuitError";
@@ -2674,13 +2674,13 @@ var Uint8Array$1 = class extends Proto$14 {
2674
2674
  };
2675
2675
  }
2676
2676
  };
2677
- const encoder$1 = new TextEncoder();
2677
+ const encoder$2 = new TextEncoder();
2678
2678
  const buffer = globalThis.Buffer;
2679
- const encodeText = buffer !== void 0 ? (body) => buffer.from(body, "utf8") : (body) => encoder$1.encode(body);
2679
+ const encodeText = buffer !== void 0 ? (body) => buffer.from(body, "utf8") : (body) => encoder$2.encode(body);
2680
2680
  const text = (body, contentType) => {
2681
2681
  if (typeof body !== "string") body = body === void 0 ? "" : String(body);
2682
2682
  if (buffer !== void 0) return new Uint8Array$1(void 0, contentType ?? "text/plain", buffer.byteLength(body, "utf8"), body);
2683
- const bytes = encoder$1.encode(body);
2683
+ const bytes = encoder$2.encode(body);
2684
2684
  return new Uint8Array$1(bytes, contentType ?? "text/plain", bytes.length, body);
2685
2685
  };
2686
2686
  const jsonUnsafe = (body, contentType) => text(JSON.stringify(body), contentType ?? "application/json");
@@ -3801,7 +3801,7 @@ var UndiciResponse = class extends Class {
3801
3801
  return pipeArguments(this, arguments);
3802
3802
  }
3803
3803
  };
3804
- const loadUpgrade = promise(() => import("./upgrade-t590zYhO.mjs"));
3804
+ const loadUpgrade = promise(() => import("./upgrade-C4aOEWJH.mjs"));
3805
3805
  const takeOver = (conn, head, signal) => {
3806
3806
  if (head !== void 0 && head.length > 0) conn.unshift(head);
3807
3807
  conn.on("error", constVoid);
@@ -9357,7 +9357,7 @@ const make$21 = (options) => Socket.of({
9357
9357
  reader: options.reader,
9358
9358
  writer: options.writer
9359
9359
  });
9360
- const encoder = new TextEncoder();
9360
+ const encoder$1 = new TextEncoder();
9361
9361
  const CloseEventTypeId = "~effect/socket/Socket/CloseEvent";
9362
9362
  const isCloseEvent = (u) => hasProperty(u, CloseEventTypeId);
9363
9363
  const SocketErrorTypeId = "~effect/socket/Socket/SocketError";
@@ -9478,7 +9478,7 @@ const fromWebSocket = (acquire, options) => withFiber((fiber) => {
9478
9478
  }
9479
9479
  function push(data) {
9480
9480
  buffer.push(data);
9481
- if (highWaterMark !== void 0) bufferSize += typeof data === "string" ? encoder.encode(data).byteLength : data.byteLength;
9481
+ if (highWaterMark !== void 0) bufferSize += typeof data === "string" ? encoder$1.encode(data).byteLength : data.byteLength;
9482
9482
  if (waiter !== void 0) deliver();
9483
9483
  if (pausable && bufferSize >= highWaterMark) pauseWebSocket();
9484
9484
  else if (!pausable && !waiter && highWaterMark !== void 0 && bufferSize > highWaterMark) fail(new SocketError({ reason: new SocketReadError({ cause: new Error(`Socket highWaterMark of ${highWaterMark} bytes exceeded`) }) }));
@@ -9952,7 +9952,7 @@ const prefix = dual(2, (self, prefix) => {
9952
9952
  modifyUint8Array: (key, f) => self.modifyUint8Array(`${prefix}${key}`, f)
9953
9953
  };
9954
9954
  });
9955
- const layerFileSystem = (directory) => effect(KeyValueStore)(gen(function* () {
9955
+ const layerFileSystem$1 = (directory) => effect(KeyValueStore)(gen(function* () {
9956
9956
  const fs = yield* FileSystem;
9957
9957
  const path = yield* Path$3;
9958
9958
  const withKeyPath = (method, key, f) => key.length === 0 || key === "." || key === ".." ? fail$1(new KeyValueStoreError({
@@ -10054,30 +10054,6 @@ const toSchemaStore = (self, schema) => {
10054
10054
  isEmpty: self.isEmpty
10055
10055
  };
10056
10056
  };
10057
- // node_modules/.pnpm/effect@4.1.3/node_modules/effect/dist/ai/Model.js
10058
- const TypeId$8 = "~effect/ai/Model";
10059
- var ProviderName = class extends Service()("effect/ai/Model/ProviderName") {};
10060
- var ModelName = class extends Service()("effect/ai/Model/ModelName") {};
10061
- const Proto$4 = {
10062
- [TypeId$8]: TypeId$8,
10063
- ["~effect/Layer"]: {
10064
- _ROut: identity,
10065
- _E: identity,
10066
- _RIn: identity
10067
- },
10068
- get captureRequirements() {
10069
- const self = this;
10070
- return contextWith((context) => succeed$1(provide$3(self, succeedContext(context))));
10071
- },
10072
- ...PipeInspectableProto,
10073
- toJSON() {
10074
- return {
10075
- _id: "effect/ai/Model",
10076
- provider: this.provider
10077
- };
10078
- }
10079
- };
10080
- const make$18 = (provider, modelName, layer) => Object.assign(Object.create(Proto$4), { provider }, merge$2(layer, succeedContext(ProviderName.context(provider).pipe(add(ModelName, modelName)))));
10081
10057
  // src/ApplyPatch.ts
10082
10058
  const BEGIN = "*** Begin Patch";
10083
10059
  const END = "*** End Patch";
@@ -10421,7 +10397,7 @@ var ExaError = class extends TaggedError$1()("ExaError", { cause: Defect() }) {}
10421
10397
  const layer$8 = effect(ExaSearch, gen(function* () {
10422
10398
  const scope$5 = yield* scope;
10423
10399
  const getClient = yield* cachedWithTTL(gen(function* () {
10424
- const McpClient = yield* tryPromise(() => import("./McpClient-BCxZZgnA.mjs"));
10400
+ const McpClient = yield* tryPromise(() => import("./McpClient-B-FFG6Pg.mjs"));
10425
10401
  const context = yield* buildWithScope(McpClient.layer, scope$5);
10426
10402
  return get$2(context, McpClient.McpClient);
10427
10403
  }), (exit) => isSuccess(exit) ? infinity : zero);
@@ -10493,7 +10469,7 @@ const layer$7 = effect(WebToMarkdown, gen(function* () {
10493
10469
  });
10494
10470
  }));
10495
10471
  // node_modules/.pnpm/effect@4.1.3/node_modules/effect/dist/ai/Tool.js
10496
- const TypeId$7 = "~effect/ai/Tool";
10472
+ const TypeId$8 = "~effect/ai/Tool";
10497
10473
  const ProviderDefinedTypeId = "~effect/ai/Tool/ProviderDefined";
10498
10474
  const DynamicTypeId = "~effect/ai/Tool/Dynamic";
10499
10475
  const isUserDefined = (u) => hasProperty(u, "~effect/ai/Tool") && !isProviderDefined(u) && !isDynamic(u);
@@ -10501,8 +10477,8 @@ const isProviderDefined = (u) => hasProperty(u, ProviderDefinedTypeId);
10501
10477
  const isDynamic = (u) => hasProperty(u, DynamicTypeId);
10502
10478
  const isClientExecuted = (tool) => tool.execution === "client";
10503
10479
  const clone = (self, overrides) => Object.assign(Object.create(Object.getPrototypeOf(self)), self, overrides);
10504
- const Proto$3 = {
10505
- [TypeId$7]: {
10480
+ const Proto$4 = {
10481
+ [TypeId$8]: {
10506
10482
  _Config: identity,
10507
10483
  _Requirements: identity
10508
10484
  },
@@ -10538,19 +10514,19 @@ const Proto$3 = {
10538
10514
  }
10539
10515
  };
10540
10516
  const ProviderDefinedProto = {
10541
- ...Proto$3,
10517
+ ...Proto$4,
10542
10518
  [ProviderDefinedTypeId]: ProviderDefinedTypeId
10543
10519
  };
10544
10520
  const DynamicProto = {
10545
- ...Proto$3,
10521
+ ...Proto$4,
10546
10522
  [DynamicTypeId]: DynamicTypeId
10547
10523
  };
10548
10524
  const userDefinedProto = (options) => {
10549
- const self = Object.assign(Object.create(Proto$3), options);
10525
+ const self = Object.assign(Object.create(Proto$4), options);
10550
10526
  self.id = `effect/ai/Tool/${options.name}`;
10551
10527
  return self;
10552
10528
  };
10553
- const make$17 = (name, options) => {
10529
+ const make$18 = (name, options) => {
10554
10530
  const successSchema = options?.success ?? Void;
10555
10531
  const failureSchema = options?.failure ?? Never;
10556
10532
  return userDefinedProto({
@@ -10652,7 +10628,7 @@ function isEmptyParamsRecord(indexSignature) {
10652
10628
  return indexSignature.parameter === string$1 && isNever(indexSignature.type);
10653
10629
  }
10654
10630
  // node_modules/.pnpm/effect@4.1.3/node_modules/effect/dist/ai/Toolkit.js
10655
- const TypeId$6 = "~effect/ai/Toolkit";
10631
+ const TypeId$7 = "~effect/ai/Toolkit";
10656
10632
  const FailureOrigin = Reference("effect/ai/Toolkit/FailureOrigin", { defaultValue: () => "result" });
10657
10633
  const PreliminaryBuffer = Reference("effect/ai/Toolkit/PreliminaryBuffer", { defaultValue: () => "unbounded" });
10658
10634
  const RecordToolArguments = Reference("effect/ai/Toolkit/RecordToolArguments", { defaultValue: () => false });
@@ -10665,7 +10641,7 @@ const stringifyToolArguments = (params) => {
10665
10641
  };
10666
10642
  const failureCause = (error, origin) => annotate$1(fail$5(error), make$42(FailureOrigin, origin));
10667
10643
  const failureOrigin = (error) => isSchemaError(error) ? "result" : "handler";
10668
- const Proto$2 = {
10644
+ const Proto$3 = {
10669
10645
  ...Prototype({
10670
10646
  label: "Toolkit",
10671
10647
  evaluate: fnUntraced(function* (parent) {
@@ -10793,7 +10769,7 @@ const Proto$2 = {
10793
10769
  };
10794
10770
  })
10795
10771
  }),
10796
- [TypeId$6]: TypeId$6,
10772
+ [TypeId$7]: TypeId$7,
10797
10773
  of: identity,
10798
10774
  toHandlers(build) {
10799
10775
  return gen({ self: this }, function* () {
@@ -10821,14 +10797,14 @@ const Proto$2 = {
10821
10797
  };
10822
10798
  }
10823
10799
  };
10824
- const makeProto$2 = (tools) => Object.assign(function() {}, Proto$2, { tools });
10800
+ const makeProto$2 = (tools) => Object.assign(function() {}, Proto$3, { tools });
10825
10801
  const resolveInput = (...tools) => {
10826
10802
  const output = {};
10827
10803
  for (const tool of tools) assignProperty(output, tool.name, tool);
10828
10804
  return output;
10829
10805
  };
10830
10806
  const empty = makeProto$2({});
10831
- const make$16 = (...tools) => makeProto$2(resolveInput(...tools));
10807
+ const make$17 = (...tools) => makeProto$2(resolveInput(...tools));
10832
10808
  const merge = (...toolkits) => {
10833
10809
  const tools = {};
10834
10810
  for (const toolkit of toolkits) for (const [name, tool] of Object.entries(toolkit.tools)) assignProperty(tools, name, tool);
@@ -11222,7 +11198,7 @@ var CommandLimits = class extends Reference("clanka/AgentTools/CommandLimits", {
11222
11198
  timeout: void 0,
11223
11199
  outputChars: void 0
11224
11200
  }) }) {};
11225
- const makeBashTool = (timeout) => make$17("bash", {
11201
+ const makeBashTool = (timeout) => make$18("bash", {
11226
11202
  description: "Run a bash command and return a task.",
11227
11203
  parameters: Struct({
11228
11204
  command: String$7,
@@ -11233,12 +11209,12 @@ const makeBashTool = (timeout) => make$17("bash", {
11233
11209
  dependencies: [CurrentDirectory]
11234
11210
  });
11235
11211
  const globNamesDirectory = (glob) => glob.split("/").slice(0, -1).some((segment) => segment.length > 0 && !/[*?[\]{}]/.test(segment));
11236
- const AgentTools = make$16(make$17("changeDirectory", {
11212
+ const AgentTools = make$17(make$18("changeDirectory", {
11237
11213
  description: "Change the executor's working directory to an existing directory and return its absolute path. The change persists across your scripts.",
11238
11214
  parameters: String$7.annotate({ identifier: "directory" }),
11239
11215
  success: String$7,
11240
11216
  dependencies: [DirectoryChanger]
11241
- }), make$17("readFile", {
11217
+ }), make$18("readFile", {
11242
11218
  description: "Read a file and optionally filter the lines to return. Returns null if the file doesn't exist. For png/jpeg/gif/webp files the image itself is attached to your next turn.",
11243
11219
  parameters: Struct({
11244
11220
  path: String$7,
@@ -11248,12 +11224,12 @@ const AgentTools = make$16(make$17("changeDirectory", {
11248
11224
  }),
11249
11225
  success: NullOr(String$7),
11250
11226
  dependencies: [CurrentDirectory, ImageAttacher]
11251
- }), make$17("run", {
11227
+ }), make$18("run", {
11252
11228
  description: "Run a shell command and return its output. If it takes too long it will become a background task. Use 'bash' for more control.",
11253
11229
  parameters: String$7.annotate({ identifier: "command" }),
11254
11230
  success: String$7,
11255
11231
  dependencies: [CurrentDirectory]
11256
- }), make$17("rg", {
11232
+ }), make$18("rg", {
11257
11233
  description: "Search for a pattern in files using ripgrep",
11258
11234
  parameters: Struct({
11259
11235
  pattern: String$7,
@@ -11263,7 +11239,7 @@ const AgentTools = make$16(make$17("changeDirectory", {
11263
11239
  }),
11264
11240
  success: String$7,
11265
11241
  dependencies: [CurrentDirectory]
11266
- }), make$17("subagent", {
11242
+ }), make$18("subagent", {
11267
11243
  description: "Delegate a task to another software engineer / sub-agent. With `background: true` the sub-agent works in the background, and its result is sent to you when it finishes.",
11268
11244
  parameters: Struct({
11269
11245
  prompt: String$7,
@@ -11272,57 +11248,57 @@ const AgentTools = make$16(make$17("changeDirectory", {
11272
11248
  success: Task,
11273
11249
  failure: String$7,
11274
11250
  dependencies: [AgentTaskExecutor]
11275
- }), make$17("gh", {
11251
+ }), make$18("gh", {
11276
11252
  description: "Use the GitHub CLI to run a command - use this instead of the bash tool.",
11277
11253
  parameters: ArraySchema(String$7).annotate({ identifier: "args" }),
11278
11254
  success: String$7,
11279
11255
  dependencies: [CurrentDirectory]
11280
- }), makeBashTool(defaultBashTimeout), make$17("applyPatch", {
11256
+ }), makeBashTool(defaultBashTimeout), make$18("applyPatch", {
11281
11257
  description: "Add, update or remove multiple files with a git diff / unified diff / wrapped patch.",
11282
11258
  parameters: String$7.annotate({ identifier: "patch" }),
11283
11259
  success: String$7,
11284
11260
  dependencies: [CurrentDirectory]
11285
- }), make$17("writeFile", {
11261
+ }), make$18("writeFile", {
11286
11262
  description: "Write content to a file, creating parent directories if needed.",
11287
11263
  parameters: Struct({
11288
11264
  path: String$7,
11289
11265
  content: Union([String$7, Uint8Array$2.annotate({ identifier: "Uint8Array" })])
11290
11266
  }),
11291
11267
  dependencies: [CurrentDirectory]
11292
- }), make$17("removeFile", {
11268
+ }), make$18("removeFile", {
11293
11269
  description: "Remove a file.",
11294
11270
  parameters: String$7.annotate({ identifier: "path" }),
11295
11271
  dependencies: [CurrentDirectory]
11296
- }), make$17("renameFile", {
11272
+ }), make$18("renameFile", {
11297
11273
  description: "Rename or move a file, creating parent directories if needed.",
11298
11274
  parameters: Struct({
11299
11275
  from: String$7,
11300
11276
  to: String$7
11301
11277
  }),
11302
11278
  dependencies: [CurrentDirectory]
11303
- }), make$17("ls", {
11279
+ }), make$18("ls", {
11304
11280
  description: "List the contents of a directory",
11305
11281
  parameters: String$7.annotate({ identifier: "directory" }),
11306
11282
  success: ArraySchema(String$7),
11307
11283
  dependencies: [CurrentDirectory]
11308
- }), make$17("webSearch", {
11284
+ }), make$18("webSearch", {
11309
11285
  description: "Search the web for recent information.",
11310
11286
  parameters: ExaSearchOptions,
11311
11287
  success: String$7
11312
- }), make$17("fetchMarkdown", {
11288
+ }), make$18("fetchMarkdown", {
11313
11289
  description: "Fetch a web page and convert it to markdown.",
11314
11290
  parameters: String$7.annotate({ identifier: "url" }),
11315
11291
  success: String$7
11316
- }), make$17("sleep", {
11292
+ }), make$18("sleep", {
11317
11293
  description: "Sleep for a specified number of milliseconds",
11318
11294
  parameters: Finite.annotate({ identifier: "ms" })
11319
- }), make$17("taskOutput", {
11295
+ }), make$18("taskOutput", {
11320
11296
  description: "Return the status and output so far of one of your tasks: a background bash command or a sub-agent.",
11321
11297
  parameters: String$7.annotate({ identifier: "id" }),
11322
11298
  success: Task,
11323
11299
  failure: String$7,
11324
11300
  dependencies: [AgentTaskExecutor]
11325
- }), make$17("waitTasks", {
11301
+ }), make$18("waitTasks", {
11326
11302
  description: "Wait until the given tasks have ended and return them, in the order given.",
11327
11303
  parameters: Struct({
11328
11304
  ids: ArraySchema(String$7),
@@ -11331,17 +11307,17 @@ const AgentTools = make$16(make$17("changeDirectory", {
11331
11307
  success: ArraySchema(Task),
11332
11308
  failure: String$7,
11333
11309
  dependencies: [AgentTaskExecutor]
11334
- }), make$17("stopTask", {
11310
+ }), make$18("stopTask", {
11335
11311
  description: "Stop one of your tasks.",
11336
11312
  parameters: String$7.annotate({ identifier: "id" }),
11337
11313
  failure: String$7,
11338
11314
  dependencies: [AgentTaskExecutor]
11339
- }), make$17("listTasks", {
11315
+ }), make$18("listTasks", {
11340
11316
  description: "List the tasks you have started, with their status.",
11341
11317
  parameters: Void,
11342
11318
  success: ArraySchema(Task),
11343
11319
  dependencies: [AgentTaskExecutor]
11344
- }), make$17("messageAgent", {
11320
+ }), make$18("messageAgent", {
11345
11321
  description: "Send a message to one of your sub-agents.",
11346
11322
  parameters: Struct({
11347
11323
  id: String$7,
@@ -11349,13 +11325,13 @@ const AgentTools = make$16(make$17("changeDirectory", {
11349
11325
  }),
11350
11326
  failure: String$7,
11351
11327
  dependencies: [AgentTaskExecutor]
11352
- }), make$17("taskComplete", {
11328
+ }), make$18("taskComplete", {
11353
11329
  description: "Only call this when the task is fully complete and you have a final output message to send.",
11354
11330
  parameters: String$7.annotate({ identifier: "output" }),
11355
11331
  dependencies: [TaskCompleter],
11356
11332
  failure: String$7
11357
11333
  }));
11358
- const SearchTool = make$16(make$17("search", {
11334
+ const SearchTool = make$17(make$18("search", {
11359
11335
  description: "Semantic code search - you just need to describe what you are looking for",
11360
11336
  parameters: String$7.annotate({ identifier: "query" }),
11361
11337
  success: String$7,
@@ -11395,7 +11371,7 @@ const AgentToolHandlersNoDeps = AgentToolsWithSearch.toLayer(gen(function* () {
11395
11371
  const tasks = new Map();
11396
11372
  let nextTaskId = 1;
11397
11373
  const registerAgentTask = gen(function* () {
11398
- const id = String(nextTaskId++);
11374
+ const id = `subagent_${nextTaskId++}`;
11399
11375
  tasks.set(id, {
11400
11376
  kind: "agent",
11401
11377
  id,
@@ -11406,7 +11382,7 @@ const AgentToolHandlersNoDeps = AgentToolsWithSearch.toLayer(gen(function* () {
11406
11382
  const addBashTask = fnUntraced(function* (description, command) {
11407
11383
  const entry = {
11408
11384
  kind: "bash",
11409
- id: String(nextTaskId++),
11385
+ id: `bash_${nextTaskId++}`,
11410
11386
  owner: yield* TaskOwner,
11411
11387
  description,
11412
11388
  command: {
@@ -11608,7 +11584,7 @@ const AgentToolHandlersNoDeps = AgentToolsWithSearch.toLayer(gen(function* () {
11608
11584
  const owner = yield* TaskOwner;
11609
11585
  const bashTasks = Array$1.from(tasks.values()).flatMap((entry) => entry.kind === "bash" && entry.owner === owner ? [bashTask(entry)] : []);
11610
11586
  const agentTasks = yield* AgentTaskExecutor;
11611
- return [...bashTasks, ...yield* agentTasks.listTasks].toSorted((a, b) => Number(a.id) - Number(b.id));
11587
+ return [...bashTasks, ...yield* agentTasks.listTasks].toSorted((a, b) => taskNumber(a.id) - taskNumber(b.id));
11612
11588
  }),
11613
11589
  gh: fn("AgentTools.gh")(function* (args) {
11614
11590
  yield* logInfo(`Calling "gh"`).pipe(annotateLogs({ args }));
@@ -11759,11 +11735,12 @@ const decodeParams$1 = (schema, usage) => {
11759
11735
  return (input) => mapError(decode(input), () => usage);
11760
11736
  };
11761
11737
  const decodeSubagent = decodeParams$1(AgentTools.tools.subagent.parametersSchema, "subagent requires an options object, for example: subagent({ prompt: \"...\" }) or subagent({ prompt: \"...\", background: true }).");
11762
- const decodeMessageAgent = decodeParams$1(AgentTools.tools.messageAgent.parametersSchema, "messageAgent requires an options object, for example: messageAgent({ id: \"3\", message: \"...\" }).");
11763
- const decodeTaskOutput = decodeParams$1(AgentTools.tools.taskOutput.parametersSchema, "taskOutput requires a task id, for example: taskOutput(\"1\").");
11764
- const decodeWaitTasks = decodeParams$1(AgentTools.tools.waitTasks.parametersSchema, "waitTasks requires an options object, for example: waitTasks({ ids: [\"3\", \"4\"] }) or waitTasks({ ids: [\"3\"], timeoutMs: 60000 }).");
11738
+ const decodeMessageAgent = decodeParams$1(AgentTools.tools.messageAgent.parametersSchema, "messageAgent requires an options object, for example: messageAgent({ id: \"subagent_3\", message: \"...\" }).");
11739
+ const decodeTaskOutput = decodeParams$1(AgentTools.tools.taskOutput.parametersSchema, "taskOutput requires a task id, for example: taskOutput(\"bash_1\").");
11740
+ const decodeWaitTasks = decodeParams$1(AgentTools.tools.waitTasks.parametersSchema, "waitTasks requires an options object, for example: waitTasks({ ids: [\"subagent_3\", \"bash_4\"] }) or waitTasks({ ids: [\"subagent_3\"], timeoutMs: 60000 }).");
11765
11741
  const bashTimeoutMs = (limits) => toMillis(limits.timeout ?? defaultBashTimeout);
11766
- const decodeStopTask = decodeParams$1(AgentTools.tools.stopTask.parametersSchema, "stopTask requires a task id, for example: stopTask(\"1\").");
11742
+ const taskNumber = (id) => Number(id.slice(id.indexOf("_") + 1));
11743
+ const decodeStopTask = decodeParams$1(AgentTools.tools.stopTask.parametersSchema, "stopTask requires a task id, for example: stopTask(\"bash_1\").");
11767
11744
  const awaitCommand = (command, timeout) => {
11768
11745
  const awaited = await_(command.fiber);
11769
11746
  return (timeout === void 0 ? asSome(awaited) : timeoutOption(awaited, timeout)).pipe(onInterrupt(() => interrupt$2(command.fiber)));
@@ -12328,10 +12305,10 @@ const makeCollectorUnsafe = () => {
12328
12305
  });
12329
12306
  };
12330
12307
  // node_modules/.pnpm/effect@4.1.3/node_modules/effect/dist/FiberSet.js
12331
- const TypeId$5 = "~effect/FiberSet";
12332
- const isFiberSet = (u) => hasProperty(u, TypeId$5);
12333
- const Proto$1 = {
12334
- [TypeId$5]: TypeId$5,
12308
+ const TypeId$6 = "~effect/FiberSet";
12309
+ const isFiberSet = (u) => hasProperty(u, TypeId$6);
12310
+ const Proto$2 = {
12311
+ [TypeId$6]: TypeId$6,
12335
12312
  [Symbol.iterator]() {
12336
12313
  if (this.state._tag === "Closed") return empty$9();
12337
12314
  return this.state.backing[Symbol.iterator]();
@@ -12345,7 +12322,7 @@ const Proto$1 = {
12345
12322
  }
12346
12323
  };
12347
12324
  const makeUnsafe = (backing, deferred) => {
12348
- const self = Object.create(Proto$1);
12325
+ const self = Object.create(Proto$2);
12349
12326
  self.state = {
12350
12327
  _tag: "Open",
12351
12328
  backing
@@ -12353,7 +12330,7 @@ const makeUnsafe = (backing, deferred) => {
12353
12330
  self.deferred = deferred;
12354
12331
  return self;
12355
12332
  };
12356
- const make$15 = () => acquireRelease(sync(() => makeUnsafe(new Set(), makeUnsafe$1())), (set) => suspend(() => {
12333
+ const make$16 = () => acquireRelease(sync(() => makeUnsafe(new Set(), makeUnsafe$1())), (set) => suspend(() => {
12357
12334
  const state = set.state;
12358
12335
  if (state._tag === "Closed") return void_;
12359
12336
  set.state = { _tag: "Closed" };
@@ -12441,9 +12418,9 @@ var ClientAbort = class extends Service()("effect/rpc/RpcSchema/ClientAbort") {
12441
12418
  }));
12442
12419
  };
12443
12420
  // node_modules/.pnpm/effect@4.1.3/node_modules/effect/dist/rpc/Rpc.js
12444
- const TypeId$4 = "~effect/rpc/Rpc";
12445
- const Proto = {
12446
- [TypeId$4]: TypeId$4,
12421
+ const TypeId$5 = "~effect/rpc/Rpc";
12422
+ const Proto$1 = {
12423
+ [TypeId$5]: TypeId$5,
12447
12424
  pipe() {
12448
12425
  return pipeArguments(this, arguments);
12449
12426
  },
@@ -12527,12 +12504,12 @@ const Proto = {
12527
12504
  };
12528
12505
  const makeProto$1 = (options) => {
12529
12506
  function Rpc() {}
12530
- Object.setPrototypeOf(Rpc, Proto);
12507
+ Object.setPrototypeOf(Rpc, Proto$1);
12531
12508
  Object.assign(Rpc, options);
12532
12509
  Rpc.key = `effect/rpc/Rpc/${options._tag}`;
12533
12510
  return Rpc;
12534
12511
  };
12535
- const make$14 = (tag, options) => {
12512
+ const make$15 = (tag, options) => {
12536
12513
  const successSchema = options?.success ?? Void;
12537
12514
  const errorSchema = options?.error ?? Never;
12538
12515
  const defectSchema = options?.defect ?? Defect();
@@ -12704,7 +12681,7 @@ const makeNoSerialization = fnUntraced(function* (group, options) {
12704
12681
  spanId: span.spanId,
12705
12682
  sampled: span.sampled
12706
12683
  } : {},
12707
- headers: merge$3(parentFiber.getRef(CurrentHeaders), headers),
12684
+ headers: merge$2(parentFiber.getRef(CurrentHeaders), headers),
12708
12685
  ...discard ? { discard: true } : {}
12709
12686
  });
12710
12687
  let fiber;
@@ -12775,7 +12752,7 @@ const makeNoSerialization = fnUntraced(function* (group, options) {
12775
12752
  spanId: span.spanId,
12776
12753
  sampled: span.sampled
12777
12754
  } : {},
12778
- headers: merge$3(fiber.getRef(CurrentHeaders), headers)
12755
+ headers: merge$2(fiber.getRef(CurrentHeaders), headers)
12779
12756
  }).pipe(span ? withParentSpan(span, { captureStackTrace: false }) : identity, onError((cause) => {
12780
12757
  if (!hasInterruptsOnly(cause)) entries.delete(id);
12781
12758
  return failCause$2(queue, cause);
@@ -12866,7 +12843,7 @@ const makeNoSerialization = fnUntraced(function* (group, options) {
12866
12843
  };
12867
12844
  });
12868
12845
  let clientIdCounter = 0;
12869
- const make$13 = fnUntraced(function* (group, options) {
12846
+ const make$14 = fnUntraced(function* (group, options) {
12870
12847
  const clientId = clientIdCounter++;
12871
12848
  const { codecFor, run, send, supportsAck, supportsTransferables } = yield* Protocol;
12872
12849
  const rpcSchemas = makeRpcSchemas(codecFor);
@@ -13136,7 +13113,7 @@ const makeProto = (options) => Object.assign(function() {}, RpcGroupProto, {
13136
13113
  requests: options.requests,
13137
13114
  annotations: options.annotations
13138
13115
  });
13139
- const make$12 = (...rpcs) => makeProto({
13116
+ const make$13 = (...rpcs) => makeProto({
13140
13117
  requests: new Map(rpcs.map((rpc) => [rpc._tag, rpc])),
13141
13118
  annotations: empty$8()
13142
13119
  });
@@ -13854,7 +13831,7 @@ const makeLocalWith = fnUntraced(function* (options) {
13854
13831
  const excluded = excludedToolNames(options.excludeTools);
13855
13832
  const offersFetch = !excluded.has("fetch");
13856
13833
  const search = yield* serviceOption(SemanticSearch);
13857
- const BuiltInTools = make$16(...Object.values(merge(isSome(search) ? AgentToolsWithSearch : AgentTools, make$16(makeBashTool(commandLimits.timeout ?? defaultBashTimeout))).tools).filter((tool) => !excluded.has(tool.name)));
13834
+ const BuiltInTools = make$17(...Object.values(merge(isSome(search) ? AgentToolsWithSearch : AgentTools, make$17(makeBashTool(commandLimits.timeout ?? defaultBashTimeout))).tools).filter((tool) => !excluded.has(tool.name)));
13858
13835
  const hasSearch = "search" in BuiltInTools.tools;
13859
13836
  const AllTools = merge(BuiltInTools, options.tools ?? empty);
13860
13837
  const tools = yield* AllTools;
@@ -14031,7 +14008,7 @@ const makeLocalWith = fnUntraced(function* (options) {
14031
14008
  };
14032
14009
  });
14033
14010
  const makeRpc = gen(function* () {
14034
- const client = yield* make$13(Rpcs, { spanPrefix: "AgentExecutorClient" });
14011
+ const client = yield* make$14(Rpcs, { spanPrefix: "AgentExecutorClient" });
14035
14012
  return AgentExecutor.of({
14036
14013
  capabilities: orDie(client.capabilities()),
14037
14014
  execute: (opts) => Scope.useSync((scope) => {
@@ -14135,10 +14112,10 @@ const ExecuteOutput = TaggedUnion({
14135
14112
  kind: TaskKind
14136
14113
  }
14137
14114
  });
14138
- var Rpcs = class extends make$12(make$14("capabilities", { success: Capabilities }), make$14("respond", { payload: {
14115
+ var Rpcs = class extends make$13(make$15("capabilities", { success: Capabilities }), make$15("respond", { payload: {
14139
14116
  id: Finite,
14140
14117
  response: AgentResponse
14141
- } }), make$14("execute", {
14118
+ } }), make$15("execute", {
14142
14119
  payload: Struct({
14143
14120
  script: String$7,
14144
14121
  environment: ExecutionEnvironment,
@@ -14148,21 +14125,21 @@ var Rpcs = class extends make$12(make$14("capabilities", { success: Capabilities
14148
14125
  }),
14149
14126
  success: ExecuteOutput,
14150
14127
  stream: true
14151
- }), make$14("awaitTask", {
14128
+ }), make$15("awaitTask", {
14152
14129
  payload: { id: String$7 },
14153
14130
  success: Task,
14154
14131
  error: String$7
14155
- }), make$14("claimTask", {
14132
+ }), make$15("claimTask", {
14156
14133
  payload: { id: String$7 },
14157
14134
  success: Boolean$4,
14158
14135
  error: String$7
14159
- }), make$14("renderEnvironment", {
14136
+ }), make$15("renderEnvironment", {
14160
14137
  payload: {
14161
14138
  environment: ExecutionEnvironment,
14162
14139
  reset: Boolean$4
14163
14140
  },
14164
14141
  success: EnvironmentUpdate
14165
- }), make$14("executeUnsafe", {
14142
+ }), make$15("executeUnsafe", {
14166
14143
  payload: Struct({
14167
14144
  tool: String$7,
14168
14145
  params: optionalKey(Json),
@@ -14411,6 +14388,233 @@ var QueueWriteStream = class extends Writable {
14411
14388
  callback();
14412
14389
  }
14413
14390
  };
14391
+ // src/AcpSessionStore.ts
14392
+ const ThoughtLevel = Literals$2([
14393
+ "none",
14394
+ "minimal",
14395
+ "low",
14396
+ "medium",
14397
+ "high",
14398
+ "xhigh",
14399
+ "max"
14400
+ ]);
14401
+ var SessionRecord = class extends Class$1("clanka/Acp/SessionRecord")({
14402
+ cwd: String$7,
14403
+ model: String$7,
14404
+ thoughtLevel: ThoughtLevel,
14405
+ fastMode: optionalKey(Boolean$4),
14406
+ history: Prompt,
14407
+ environment: optionalKey(ExecutionEnvironment)
14408
+ }) {};
14409
+ var AcpSessionStoreError = class extends TaggedError$1()("AcpSessionStoreError", {
14410
+ message: String$7,
14411
+ cause: optional$2(Defect())
14412
+ }) {};
14413
+ var AcpSessionStore = class extends Service()("clanka/AcpSessionStore") {};
14414
+ const keyValueStore = (kvs) => {
14415
+ const store = toSchemaStore(prefix(kvs, "session-"), SessionRecord);
14416
+ return AcpSessionStore.of({
14417
+ get: (sessionId) => store.get(sessionId).pipe(mapError((cause) => new AcpSessionStoreError({
14418
+ message: cause.message,
14419
+ cause
14420
+ }))),
14421
+ set: (sessionId, record) => store.set(sessionId, record).pipe(mapError((cause) => new AcpSessionStoreError({
14422
+ message: cause.message,
14423
+ cause
14424
+ })))
14425
+ });
14426
+ };
14427
+ const layerKeyValueStore = effect(AcpSessionStore, gen(function* () {
14428
+ return keyValueStore(yield* KeyValueStore);
14429
+ }));
14430
+ const Snapshot = TaggedStruct("Snapshot", {
14431
+ record: SessionRecord,
14432
+ id: String$7
14433
+ });
14434
+ const Update = TaggedStruct("Update", {
14435
+ cwd: optionalKey(String$7),
14436
+ model: optionalKey(String$7),
14437
+ thoughtLevel: optionalKey(ThoughtLevel),
14438
+ fastMode: optionalKey(Boolean$4),
14439
+ environment: optionalKey(ExecutionEnvironment),
14440
+ messages: optionalKey(ArraySchema(Message)),
14441
+ parent: String$7,
14442
+ id: String$7
14443
+ });
14444
+ const Entry = Union([Snapshot, Update]);
14445
+ const EntryJson = fromJsonString(toCodecJson(Entry));
14446
+ const decodeEntry$2 = decodeExit(EntryJson);
14447
+ const encodeEntry = encodeEffect$1(EntryJson);
14448
+ const fieldKeys = [
14449
+ "cwd",
14450
+ "model",
14451
+ "thoughtLevel",
14452
+ "fastMode",
14453
+ "environment"
14454
+ ];
14455
+ const applyUpdate = (record, update) => {
14456
+ const { _tag, messages, parent: _parent, id: _id, ...fields } = update;
14457
+ return new SessionRecord({
14458
+ ...record,
14459
+ ...fields,
14460
+ history: messages === void 0 ? record.history : fromMessages([...record.history.content, ...messages])
14461
+ });
14462
+ };
14463
+ const diff = (previous, next) => {
14464
+ const before = previous.history.content;
14465
+ const after = next.history.content;
14466
+ if (after.length < before.length || before.some((message, index) => after[index] !== message)) return;
14467
+ const changes = {};
14468
+ for (const key of fieldKeys) {
14469
+ if (previous[key] === next[key]) continue;
14470
+ if (next[key] === void 0) return void 0;
14471
+ changes[key] = next[key];
14472
+ }
14473
+ if (after.length > before.length) changes.messages = after.slice(before.length);
14474
+ return changes;
14475
+ };
14476
+ const storeError = (message) => (cause) => new AcpSessionStoreError({
14477
+ message,
14478
+ cause
14479
+ });
14480
+ const encodeLine = (entry) => encodeEntry(entry).pipe(map$5((json) => encoder.encode(`${json}\n`)), mapError(storeError("Failed to encode session")));
14481
+ const newline = 10;
14482
+ const encoder = new TextEncoder();
14483
+ const decoder = new TextDecoder();
14484
+ const layerFileSystem = (directory) => effect(AcpSessionStore, gen(function* () {
14485
+ const fs = yield* FileSystem;
14486
+ const path = yield* Path$3;
14487
+ yield* fs.makeDirectory(directory, { recursive: true });
14488
+ const semaphore = yield* make$48(1);
14489
+ const files = new Map();
14490
+ const fileFor = (sessionId) => path.join(directory, `${encodeURIComponent(sessionId)}.jsonl`);
14491
+ const read = fnUntraced(function* (sessionId) {
14492
+ const file = fileFor(sessionId);
14493
+ files.delete(sessionId);
14494
+ const result = yield* fs.readFile(file).pipe(asSome, catchReason("PlatformError", "NotFound", () => succeedNone), mapError(storeError(`Failed to read session ${sessionId}`)));
14495
+ if (isNone(result)) return none();
14496
+ const bytes = result.value;
14497
+ let record;
14498
+ let id = "";
14499
+ let start = 0;
14500
+ while (start < bytes.length) {
14501
+ const end = bytes.indexOf(newline, start);
14502
+ if (end === -1) break;
14503
+ const entry = decodeEntry$2(decoder.decode(bytes.subarray(start, end)));
14504
+ start = end + 1;
14505
+ if (entry._tag === "Failure") continue;
14506
+ const line = entry.value;
14507
+ if (line._tag === "Snapshot") {
14508
+ if (record !== void 0) continue;
14509
+ record = line.record;
14510
+ } else {
14511
+ if (record === void 0 || line.parent !== id) continue;
14512
+ record = applyUpdate(record, line);
14513
+ }
14514
+ id = line.id;
14515
+ }
14516
+ if (record === void 0) return yield* new AcpSessionStoreError({ message: `Session file for ${sessionId} does not start with a snapshot` });
14517
+ if (start < bytes.length) yield* logWarning("Ignoring an incomplete end of an ACP session file").pipe(annotateLogs({
14518
+ sessionId,
14519
+ file
14520
+ }));
14521
+ else files.set(sessionId, {
14522
+ record,
14523
+ id,
14524
+ size: bytes.length,
14525
+ tail: bytes.slice(-64)
14526
+ });
14527
+ return some(record);
14528
+ });
14529
+ const writeSnapshot = fnUntraced(function* (sessionId, record) {
14530
+ const file = fileFor(sessionId);
14531
+ const temporary = `${file}.${crypto.randomUUID()}.tmp`;
14532
+ const id = crypto.randomUUID();
14533
+ const bytes = yield* encodeLine(Snapshot.make({
14534
+ record,
14535
+ id
14536
+ }));
14537
+ files.delete(sessionId);
14538
+ yield* fs.writeFile(temporary, bytes).pipe(andThen(fs.rename(temporary, file)), onError(() => ignore(fs.remove(temporary, { force: true }))), mapError(storeError(`Failed to write session ${sessionId}`)));
14539
+ files.set(sessionId, {
14540
+ record,
14541
+ id,
14542
+ size: bytes.length,
14543
+ tail: bytes.slice(-64)
14544
+ });
14545
+ });
14546
+ const append = fnUntraced(function* (sessionId, known, bytes) {
14547
+ const handle = yield* fs.open(fileFor(sessionId), { flag: "a+" });
14548
+ const info = yield* handle.stat;
14549
+ if (Number(info.size) !== known.size) return false;
14550
+ const tail = new Uint8Array(known.tail.length);
14551
+ if ((yield* handle.read(tail, { position: BigInt(known.size - tail.length) })) !== tail.length || tail.some((byte, index) => byte !== known.tail[index])) return false;
14552
+ if (bytes.length === 0) return true;
14553
+ files.delete(sessionId);
14554
+ yield* handle.writeAll(bytes);
14555
+ return true;
14556
+ }, scoped, (effect, sessionId) => mapError(effect, storeError(`Failed to write session ${sessionId}`)));
14557
+ const write = fnUntraced(function* (sessionId, record) {
14558
+ const known = files.get(sessionId);
14559
+ const changes = known && diff(known.record, record);
14560
+ if (known !== void 0 && changes !== void 0) {
14561
+ if (Object.keys(changes).length === 0) {
14562
+ if (yield* append(sessionId, known, new Uint8Array())) {
14563
+ files.set(sessionId, {
14564
+ ...known,
14565
+ record
14566
+ });
14567
+ return;
14568
+ }
14569
+ } else {
14570
+ const id = crypto.randomUUID();
14571
+ const bytes = yield* encodeLine(Update.make({
14572
+ ...changes,
14573
+ parent: known.id,
14574
+ id
14575
+ }));
14576
+ if (yield* append(sessionId, known, bytes)) {
14577
+ files.set(sessionId, {
14578
+ record,
14579
+ id,
14580
+ size: known.size + bytes.length,
14581
+ tail: bytes.slice(-64)
14582
+ });
14583
+ return;
14584
+ }
14585
+ }
14586
+ }
14587
+ yield* writeSnapshot(sessionId, record);
14588
+ });
14589
+ return AcpSessionStore.of({
14590
+ get: (sessionId) => semaphore.withPermit(read(sessionId)),
14591
+ set: (sessionId, record) => semaphore.withPermit(write(sessionId, record))
14592
+ });
14593
+ }));
14594
+ // node_modules/.pnpm/effect@4.1.3/node_modules/effect/dist/ai/Model.js
14595
+ const TypeId$4 = "~effect/ai/Model";
14596
+ var ProviderName = class extends Service()("effect/ai/Model/ProviderName") {};
14597
+ var ModelName = class extends Service()("effect/ai/Model/ModelName") {};
14598
+ const Proto = {
14599
+ [TypeId$4]: TypeId$4,
14600
+ ["~effect/Layer"]: {
14601
+ _ROut: identity,
14602
+ _E: identity,
14603
+ _RIn: identity
14604
+ },
14605
+ get captureRequirements() {
14606
+ const self = this;
14607
+ return contextWith((context) => succeed$1(provide$3(self, succeedContext(context))));
14608
+ },
14609
+ ...PipeInspectableProto,
14610
+ toJSON() {
14611
+ return {
14612
+ _id: "effect/ai/Model",
14613
+ provider: this.provider
14614
+ };
14615
+ }
14616
+ };
14617
+ const make$12 = (provider, modelName, layer) => Object.assign(Object.create(Proto), { provider }, merge$3(layer, succeedContext(ProviderName.context(provider).pipe(add(ModelName, modelName)))));
14414
14618
  // node_modules/.pnpm/zod@4.4.2/node_modules/zod/v4/classic/compat.js
14415
14619
  const ZodIssueCode = {
14416
14620
  invalid_type: "invalid_type",
@@ -19551,7 +19755,7 @@ const make$9 = fnUntraced(function* (params) {
19551
19755
  const queue = yield* make$46();
19552
19756
  const deferredFinishParts = [];
19553
19757
  if (preResolvedStreamParts.length > 0) yield* offerAll(queue, preResolvedStreamParts);
19554
- const toolCallFibers = yield* make$15();
19758
+ const toolCallFibers = yield* make$16();
19555
19759
  const toolCallSemaphore = concurrency === "unbounded" ? void 0 : yield* make$48(concurrency);
19556
19760
  const pendingToolCalls = new Map();
19557
19761
  const bufferedToolCalls = [];
@@ -19868,8 +20072,8 @@ const withParameterMode = (tool, mode) => {
19868
20072
  }
19869
20073
  return tools[mode] ??= tool.setParameters(mode === "opaque" ? Unknown : hasProviderParameters(tool) ? toEncoded$1(tool.parametersSchema) : toEncoded$1(toCodecJson(tool.parametersSchema)));
19870
20074
  };
19871
- const makeToolkitWithEncodedParameters = (toolkit) => make$16(...Object.values(toolkit.tools).map((tool) => withParameterMode(tool, "encoded")));
19872
- const makeToolkitWithOpaqueParameters = (toolkit) => make$16(...Object.values(toolkit.tools).map((tool) => withParameterMode(tool, "opaque")));
20075
+ const makeToolkitWithEncodedParameters = (toolkit) => make$17(...Object.values(toolkit.tools).map((tool) => withParameterMode(tool, "encoded")));
20076
+ const makeToolkitWithOpaqueParameters = (toolkit) => make$17(...Object.values(toolkit.tools).map((tool) => withParameterMode(tool, "opaque")));
19873
20077
  const isToolCallValidationDeferred = (options) => options.disableToolCallResolution === true && options.toolCallValidation === "deferred";
19874
20078
  const UndeclaredToolCallPart = ToolCallPart("", Unknown).mapFields((fields) => ({
19875
20079
  ...fields,
@@ -20550,8 +20754,8 @@ const makeWith$1 = fnUntraced(function* (options) {
20550
20754
  }), as(""), catchTag("AgentFinished", (finished) => succeed$1(finished.summary)));
20551
20755
  }).pipe(onExit((exit) => finishTurn(child, turn, exit)), provideSubagentModel, provideContext(runContext), forkIn(runScope, { startImmediately: true }));
20552
20756
  });
20553
- const childTask = ({ id, prompt, turn }) => ({
20554
- id: String(id),
20757
+ const childTask = ({ taskId, prompt, turn }) => ({
20758
+ id: taskId,
20555
20759
  kind: "agent",
20556
20760
  status: turn.status,
20557
20761
  description: prompt,
@@ -20568,7 +20772,8 @@ const makeWith$1 = fnUntraced(function* (options) {
20568
20772
  const agentTasks = {
20569
20773
  subagent: fnUntraced(function* ({ id, prompt, background, environment }) {
20570
20774
  const child = {
20571
- id: Number(id),
20775
+ id: Number(id.slice(9)),
20776
+ taskId: id,
20572
20777
  taskOwner: crypto.randomUUID(),
20573
20778
  prompt,
20574
20779
  history: make$45(empty$1),
@@ -20589,7 +20794,7 @@ ${prompt}`,
20589
20794
  });
20590
20795
  if (background) return childTask(child);
20591
20796
  yield* _await(turn.done).pipe(onInterrupt(() => interrupt$2(turn.fiber)));
20592
- if (turn.status !== "completed") return yield* die(new Error(`Sub-agent ${child.id} ${turn.status}${turn.output ? `: ${turn.output}` : ""}`));
20797
+ if (turn.status !== "completed") return yield* die(new Error(`Sub-agent ${child.taskId} ${turn.status}${turn.output ? `: ${turn.output}` : ""}`));
20593
20798
  return childTask(child);
20594
20799
  }),
20595
20800
  taskOutput: (id) => map$5(lookupChild(id), reportChild),
@@ -20632,7 +20837,7 @@ ${prompt}`,
20632
20837
  const onTaskComplete = (summary) => suspend(() => {
20633
20838
  const running = runningChildren();
20634
20839
  if (running.length > 0) {
20635
- const ids = running.map((child) => String(child.id));
20840
+ const ids = running.map((child) => child.taskId);
20636
20841
  const quoted = ids.map((id) => JSON.stringify(id)).join(", ");
20637
20842
  return fail$1(`taskComplete was rejected: sub-agents ${quoted} are still running. Call waitTasks({ ids: ${JSON.stringify(ids)} }) to wait for them, or stopTask(id) to stop them, before calling taskComplete.`);
20638
20843
  }
@@ -21259,7 +21464,7 @@ And then you will receive back the console output:
21259
21464
  files: [ 'package.json' ]
21260
21465
  package.json: { name: 'my-project', version: '1.0.0' }
21261
21466
  \`\`\``;
21262
- const ReadSkillTools = make$16(make$17("readSkill", {
21467
+ const ReadSkillTools = make$17(make$18("readSkill", {
21263
21468
  description: "Read the instructions of a skill listed under Skills, by its name.",
21264
21469
  parameters: String$7.annotate({ identifier: "name" }),
21265
21470
  success: String$7,
@@ -21294,7 +21499,7 @@ const makeLoopTools = fnUntraced(function* (options) {
21294
21499
  });
21295
21500
  const errorMessage = (error) => typeof error === "string" ? error : error instanceof Error ? error.message : JSON.stringify(error) ?? String(error);
21296
21501
  var ScriptExecutor = class extends Service()("clanka/Agent/ScriptExecutor") {};
21297
- const SingleTools = make$16(make$17("execute", {
21502
+ const SingleTools = make$17(make$18("execute", {
21298
21503
  description: "Execute javascript code and return the output",
21299
21504
  parameters: Struct({ script: String$7 }),
21300
21505
  success: String$7,
@@ -21339,23 +21544,6 @@ const responseToSummary = (response) => {
21339
21544
  return parts.join("\n\n");
21340
21545
  };
21341
21546
  // src/Acp.ts
21342
- const ThoughtLevel = Literals$2([
21343
- "none",
21344
- "minimal",
21345
- "low",
21346
- "medium",
21347
- "high",
21348
- "xhigh",
21349
- "max"
21350
- ]);
21351
- var SessionRecord = class extends Class$1("clanka/Acp/SessionRecord")({
21352
- cwd: String$7,
21353
- model: String$7,
21354
- thoughtLevel: ThoughtLevel,
21355
- fastMode: optionalKey(Boolean$4),
21356
- history: Prompt,
21357
- environment: optionalKey(ExecutionEnvironment)
21358
- }) {};
21359
21547
  var RpcError = class extends TaggedError$1()("AcpRpcError", {
21360
21548
  code: Number$2,
21361
21549
  message: String$7
@@ -21549,13 +21737,12 @@ const historyUpdates = (history) => {
21549
21737
  return updates;
21550
21738
  };
21551
21739
  const make$7 = fnUntraced(function* (options) {
21552
- const kvs = yield* KeyValueStore;
21740
+ const store = yield* AcpSessionStore;
21553
21741
  const { contextWindow } = yield* CompactionConfig;
21554
21742
  const size = Number.isFinite(contextWindow) ? Math.max(0, Math.round(contextWindow)) : 0;
21555
21743
  const http = yield* serviceOption(HttpClient);
21556
21744
  const fs = yield* serviceOption(FileSystem);
21557
21745
  const path = yield* serviceOption(Path$3);
21558
- const store = toSchemaStore(prefix(kvs, "session-"), SessionRecord);
21559
21746
  const scope$3 = yield* scope;
21560
21747
  const sessions = new Map();
21561
21748
  yield* addFinalizer$1(() => {
@@ -21616,14 +21803,24 @@ const make$7 = fnUntraced(function* (options) {
21616
21803
  configOptions: configOptions(session)
21617
21804
  };
21618
21805
  });
21619
- const persist = (session) => store.set(session.id, new SessionRecord({
21620
- cwd: session.cwd,
21621
- model: session.model,
21622
- thoughtLevel: session.thoughtLevel,
21623
- fastMode: session.fastMode,
21624
- history: session.agent.history.current,
21625
- environment: session.agent.environment.current
21626
- })).pipe(catch_((error) => logWarning("Failed to persist session", error)));
21806
+ const persist = (session) => {
21807
+ const history = session.agent.history.current;
21808
+ const environment = session.agent.environment.current;
21809
+ return store.set(session.id, new SessionRecord({
21810
+ cwd: session.cwd,
21811
+ model: session.model,
21812
+ thoughtLevel: session.thoughtLevel,
21813
+ fastMode: session.fastMode,
21814
+ history,
21815
+ environment
21816
+ })).pipe(tap(() => sync(() => {
21817
+ session.stored = {
21818
+ history,
21819
+ environment
21820
+ };
21821
+ })), catch_((error) => logWarning("Failed to persist session", error)));
21822
+ };
21823
+ const persistCommitted = (session) => suspend(() => session.stored?.history === session.agent.history.current && session.stored.environment === session.agent.environment.current ? void_ : persist(session));
21627
21824
  const openSession = fnUntraced(function* (id, record, mcpServers) {
21628
21825
  const sessionScope = yield* fork(scope$3);
21629
21826
  let makeAgent = options.makeAgent(record.cwd);
@@ -21650,7 +21847,8 @@ const make$7 = fnUntraced(function* (options) {
21650
21847
  toolCalls: 0,
21651
21848
  announcedSubagents: new Set(),
21652
21849
  scope: sessionScope,
21653
- mcpFailures
21850
+ mcpFailures,
21851
+ stored: void 0
21654
21852
  };
21655
21853
  sessions.set(id, session);
21656
21854
  return session;
@@ -21843,6 +22041,8 @@ const make$7 = fnUntraced(function* (options) {
21843
22041
  }]
21844
22042
  });
21845
22043
  }
22044
+ case "HistoryAppended":
22045
+ case "HistoryReplaced": return persistCommitted(session);
21846
22046
  default: return void_;
21847
22047
  }
21848
22048
  };
@@ -21989,7 +22189,7 @@ const make$7 = fnUntraced(function* (options) {
21989
22189
  session.running = yield* runPrompt(session, input).pipe(provide$1(model), forkChild);
21990
22190
  const exit$1 = yield* exit(join$3(session.running));
21991
22191
  session.running = void 0;
21992
- yield* persist(session);
22192
+ yield* persistCommitted(session);
21993
22193
  if (isSuccess(exit$1)) return { stopReason: "end_turn" };
21994
22194
  if (hasInterruptsOnly(exit$1.cause)) return { stopReason: "cancelled" };
21995
22195
  return yield* toRpcError(exit$1.cause);
@@ -26168,7 +26368,7 @@ const mapProviderResults = (inputLength, results) => {
26168
26368
  };
26169
26369
  // node_modules/.pnpm/@effect+ai-openai@4.1.3_effect@4.1.3/node_modules/@effect/ai-openai/dist/OpenAiEmbeddingModel.js
26170
26370
  var Config$2 = class extends Service()("@effect/ai-openai/OpenAiEmbeddingModel/Config") {};
26171
- const model$5 = (model, options) => make$18("openai", model, merge$2(layer$3({
26371
+ const model$5 = (model, options) => make$12("openai", model, merge$3(layer$3({
26172
26372
  model,
26173
26373
  config: {
26174
26374
  ...options.config,
@@ -28366,7 +28566,7 @@ const transformToolCallParams$1 = fnUntraced(function* (options, toolName, toolP
28366
28566
  return yield* decodeEffect(codec)(toolParams).pipe(flatMap$1((decoded) => encodeUnknownEffect(toCodecJson(tool.parametersSchema))(decoded)), orElseSucceed(() => toolParams));
28367
28567
  });
28368
28568
  // package.json
28369
- var version$1 = "0.25.3";
28569
+ var version$1 = "0.26.1";
28370
28570
  // src/ClaudeAgent.ts
28371
28571
  const minimumClaudeCodeVersion = "2.1.248";
28372
28572
  const serverName = "clanka";
@@ -29040,7 +29240,7 @@ const toParts = (parts) => {
29040
29240
  }
29041
29241
  return result;
29042
29242
  };
29043
- const model$4 = (model, options) => make$18("claude", model, merge$2(layerLanguageModel(model, options), AgentModelConfig.layer({
29243
+ const model$4 = (model, options) => make$12("claude", model, merge$3(layerLanguageModel(model, options), AgentModelConfig.layer({
29044
29244
  supportsImages: options?.supportsImages,
29045
29245
  cutStreamOnSteering: false
29046
29246
  })));
@@ -29279,8 +29479,8 @@ var CodexAuth = class CodexAuth extends Service()("clanka/CodexAuth") {
29279
29479
  };
29280
29480
  // src/Codex.ts
29281
29481
  const layerClient$3 = layer$4({ apiUrl: "https://chatgpt.com/backend-api/codex" }).pipe(provide$3(CodexAuth.layerClient));
29282
- const model$3 = (model, options) => make$18("openai", model, layerModel(model, options));
29283
- const modelWebSocket$1 = (model, options) => make$18("openai", model, layerModel(model, options).pipe(merge$2(fresh(layerWebSocketMode))));
29482
+ const model$3 = (model, options) => make$12("openai", model, layerModel(model, options));
29483
+ const modelWebSocket$1 = (model, options) => make$12("openai", model, layerModel(model, options).pipe(merge$3(fresh(layerWebSocketMode))));
29284
29484
  const layerModel = (model, options) => suspend$2(() => layer$2({
29285
29485
  model,
29286
29486
  config: {
@@ -29293,7 +29493,7 @@ const layerModel = (model, options) => suspend$2(() => layer$2({
29293
29493
  ...options?.reasoning
29294
29494
  }
29295
29495
  }
29296
- })).pipe(merge$2(AgentModelConfig.layer({
29496
+ })).pipe(merge$3(AgentModelConfig.layer({
29297
29497
  ...pick(options ?? {}, AgentModelConfig.optionKeys),
29298
29498
  systemPromptTransform: (system, effect) => withConfigOverride$1(effect, { instructions: system })
29299
29499
  })));
@@ -30616,7 +30816,7 @@ var GithubCopilotAuth = class GithubCopilotAuth extends Service()("clanka/Github
30616
30816
  };
30617
30817
  // src/Copilot.ts
30618
30818
  const layerClient$2 = layer$1({ apiUrl: API_URL }).pipe(provide$3(GithubCopilotAuth.layerClient));
30619
- const model$2 = (model, options) => make$18("openai", model, mergeAll(layer({
30819
+ const model$2 = (model, options) => make$12("openai", model, mergeAll(layer({
30620
30820
  model,
30621
30821
  config: omit(options ?? {}, options?.reasoning === null ? ["reasoning", ...AgentModelConfig.optionKeys] : AgentModelConfig.optionKeys)
30622
30822
  }), AgentModelConfig.layer(pick(options ?? {}, AgentModelConfig.optionKeys)), succeed$4(SummarizerTransform, (effect) => withConfigOverride(effect, { max_output_tokens: summarizerMaxOutputTokens }))));
@@ -30753,7 +30953,7 @@ var ModelsRepo = class ModelsRepo extends Service()("clanka/ModelsRepo") {
30753
30953
  };
30754
30954
  // src/OpenAiCompat.ts
30755
30955
  const layerClient$1 = (options) => layer$1(options);
30756
- const model$1 = (model, options) => make$18("openai-compat", model, mergeAll(layer({
30956
+ const model$1 = (model, options) => make$12("openai-compat", model, mergeAll(layer({
30757
30957
  model,
30758
30958
  config: {
30759
30959
  ...omit(options ?? {}, ["reasoning", ...AgentModelConfig.optionKeys]),
@@ -30921,7 +31121,7 @@ var XaiAuth = class XaiAuth extends Service()("clanka/XaiAuth") {
30921
31121
  };
30922
31122
  // src/Xai.ts
30923
31123
  const layerClient = layer$4({ apiUrl: "https://api.x.ai/v1" }).pipe(provide$3(XaiAuth.layerClient));
30924
- const modelWebSocket = (model, options) => make$18("xai", model, mergeAll(layer$2({
31124
+ const modelWebSocket = (model, options) => make$12("xai", model, mergeAll(layer$2({
30925
31125
  model,
30926
31126
  config: {
30927
31127
  ...omit(options ?? {}, ["reasoning", ...AgentModelConfig.optionKeys]),
@@ -31126,10 +31326,16 @@ const fetch$1 = Boolean("fetch").pipe(withDescription$1("Expose the global Fetch
31126
31326
  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))));
31127
31327
  const mcpConfig = String$1("mcp-config").pipe(withDescription$1("An MCP config file in the { \"mcpServers\": { ... } } format. Repeatable; a later file wins."), atLeast(0));
31128
31328
  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(", ")}`;
31129
- const Kvs = unwrap$4(gen(function* () {
31329
+ const configDirectory = gen(function* () {
31130
31330
  const path = yield* Path$3;
31131
31331
  const configHome = yield* NonEmptyString("XDG_CONFIG_HOME").pipe(orElse(() => NonEmptyString("HOME").pipe(map$3((home) => path.join(home, ".config")))));
31132
- return layerFileSystem(path.join(configHome, "clanka"));
31332
+ return path.join(configHome, "clanka");
31333
+ });
31334
+ const Kvs = unwrap$4(map$5(configDirectory, layerFileSystem$1)).pipe(provide$3(layer$9));
31335
+ const AcpSessions = unwrap$4(gen(function* () {
31336
+ const path = yield* Path$3;
31337
+ const directory = yield* configDirectory;
31338
+ return layerFileSystem(path.join(directory, "sessions"));
31133
31339
  })).pipe(provide$3(layer$9));
31134
31340
  const Search = (directory) => unwrap$4(gen(function* () {
31135
31341
  const apiKey = yield* Redacted$3("OPENAI_API_KEY").pipe(option);
@@ -31138,7 +31344,7 @@ const Search = (directory) => unwrap$4(gen(function* () {
31138
31344
  return empty$10;
31139
31345
  }
31140
31346
  const path = yield* Path$3;
31141
- return (yield* promise(() => import("./SemanticSearch-Cw10ozz8.mjs"))).layer({
31347
+ return (yield* promise(() => import("./SemanticSearch-C3a7LAQr.mjs"))).layer({
31142
31348
  directory: process.cwd(),
31143
31349
  database: path.join(directory, "search.sqlite")
31144
31350
  }).pipe(provide$3(model$5("text-embedding-3-small", { dimensions: 1536 })), provide$3(layer$4({ apiKey: apiKey.value })));
@@ -31186,7 +31392,7 @@ const acp = make$26("acp", {
31186
31392
  auxiliary: auxiliaryModels(flags)
31187
31393
  })
31188
31394
  });
31189
- })), provide((flags) => mergeAll(ConversationMode.layer(false), succeed$4(LogToStderr, true), layerLog, compactionConfig(flags), openAiCompatModels(flags))));
31395
+ })), provide((flags) => mergeAll(AcpSessions, ConversationMode.layer(false), succeed$4(LogToStderr, true), layerLog, compactionConfig(flags), openAiCompatModels(flags))));
31190
31396
  make$26("clanka", {
31191
31397
  provider,
31192
31398
  fetch: fetch$1,
@@ -31209,7 +31415,7 @@ make$26("clanka", {
31209
31415
  files: mcpConfig,
31210
31416
  enabled: mcp
31211
31417
  });
31212
- const OutputFormatter = yield* promise(() => import("./OutputFormatter-ByMjyBhe.mjs"));
31418
+ const OutputFormatter = yield* promise(() => import("./OutputFormatter-DhhP2i-7.mjs"));
31213
31419
  const { model, effort } = yield* match$2(modelRaw, {
31214
31420
  onSome: (selected) => succeed$1(parseModel(selected)),
31215
31421
  onNone: () => selectModel(provider)