clanka 0.17.3 → 0.18.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 (100) hide show
  1. package/README.md +24 -0
  2. package/dist/Acp.d.ts.map +1 -1
  3. package/dist/Acp.js +5 -0
  4. package/dist/Acp.js.map +1 -1
  5. package/dist/Agent.d.ts +11 -0
  6. package/dist/Agent.d.ts.map +1 -1
  7. package/dist/Agent.js +35 -15
  8. package/dist/Agent.js.map +1 -1
  9. package/dist/Agent.test.js +23 -0
  10. package/dist/Agent.test.js.map +1 -1
  11. package/dist/AgentExecutor.d.ts.map +1 -1
  12. package/dist/AgentExecutor.js +40 -8
  13. package/dist/AgentExecutor.js.map +1 -1
  14. package/dist/AgentExecutor.test.js +51 -2
  15. package/dist/AgentExecutor.test.js.map +1 -1
  16. package/dist/AgentOutput.d.ts +23 -4
  17. package/dist/AgentOutput.d.ts.map +1 -1
  18. package/dist/AgentOutput.js +19 -0
  19. package/dist/AgentOutput.js.map +1 -1
  20. package/dist/AgentTools.d.ts +4 -4
  21. package/dist/AgentTools.d.ts.map +1 -1
  22. package/dist/AgentTools.js +7 -2
  23. package/dist/AgentTools.js.map +1 -1
  24. package/dist/AgentTools.test.js +22 -0
  25. package/dist/AgentTools.test.js.map +1 -1
  26. package/dist/ClaudeAgent.d.ts.map +1 -1
  27. package/dist/ClaudeAgent.js +37 -4
  28. package/dist/ClaudeAgent.js.map +1 -1
  29. package/dist/ClaudeAgent.test.js +82 -0
  30. package/dist/ClaudeAgent.test.js.map +1 -1
  31. package/dist/Codex.js +9 -5
  32. package/dist/Codex.js.map +1 -1
  33. package/dist/Codex.test.js +26 -7
  34. package/dist/Codex.test.js.map +1 -1
  35. package/dist/Compaction.d.ts +41 -6
  36. package/dist/Compaction.d.ts.map +1 -1
  37. package/dist/Compaction.js +52 -11
  38. package/dist/Compaction.js.map +1 -1
  39. package/dist/Compaction.test.js +5 -4
  40. package/dist/Compaction.test.js.map +1 -1
  41. package/dist/CompactionTransport.test.js +11 -0
  42. package/dist/CompactionTransport.test.js.map +1 -1
  43. package/dist/Copilot.d.ts.map +1 -1
  44. package/dist/Copilot.js +3 -6
  45. package/dist/Copilot.js.map +1 -1
  46. package/dist/ModelLayer.d.ts +35 -6
  47. package/dist/ModelLayer.d.ts.map +1 -1
  48. package/dist/ModelLayer.js +30 -18
  49. package/dist/ModelLayer.js.map +1 -1
  50. package/dist/ModelLayer.test.js +11 -3
  51. package/dist/ModelLayer.test.js.map +1 -1
  52. package/dist/OutputFormatter.d.ts.map +1 -1
  53. package/dist/OutputFormatter.js +3 -0
  54. package/dist/OutputFormatter.js.map +1 -1
  55. package/dist/Xai.d.ts.map +1 -1
  56. package/dist/Xai.js +4 -12
  57. package/dist/Xai.js.map +1 -1
  58. package/dist/bin/{Effect-DNYYQ84C.mjs → Effect-5XYMLOiB.mjs} +31 -30
  59. package/dist/bin/Effect-5XYMLOiB.mjs.map +1 -0
  60. package/dist/bin/{Latch-BSlIwuxI.mjs → Latch-BnrpWMd1.mjs} +2 -2
  61. package/dist/bin/{Latch-BSlIwuxI.mjs.map → Latch-BnrpWMd1.mjs.map} +1 -1
  62. package/dist/bin/{McpClient-C7ctqJWo.mjs → McpClient-DoPNaNzW.mjs} +3 -3
  63. package/dist/bin/{McpClient-C7ctqJWo.mjs.map → McpClient-DoPNaNzW.mjs.map} +1 -1
  64. package/dist/bin/{OutputFormatter-DXej05JW.mjs → OutputFormatter-Dqxyk2qD.mjs} +4 -3
  65. package/dist/bin/{OutputFormatter-DXej05JW.mjs.map → OutputFormatter-Dqxyk2qD.mjs.map} +1 -1
  66. package/dist/bin/{Schema-CSQN_Zso.mjs → Schema-Box_9VZG.mjs} +6 -3
  67. package/dist/bin/{Schema-CSQN_Zso.mjs.map → Schema-Box_9VZG.mjs.map} +1 -1
  68. package/dist/bin/{SemanticSearch-BiwCnpKX.mjs → SemanticSearch-CH125AHH.mjs} +4 -4
  69. package/dist/bin/{SemanticSearch-BiwCnpKX.mjs.map → SemanticSearch-CH125AHH.mjs.map} +1 -1
  70. package/dist/bin/{Stream-Dwvj9X5X.mjs → Stream-C51usiew.mjs} +3 -3
  71. package/dist/bin/{Stream-Dwvj9X5X.mjs.map → Stream-C51usiew.mjs.map} +1 -1
  72. package/dist/bin/cli.mjs +337 -229
  73. package/dist/bin/cli.mjs.map +1 -1
  74. package/dist/bin/{upgrade-BSNjCnra.mjs → upgrade-HMRGSqq8.mjs} +4 -4
  75. package/dist/bin/{upgrade-BSNjCnra.mjs.map → upgrade-HMRGSqq8.mjs.map} +1 -1
  76. package/dist/cli.js +45 -5
  77. package/dist/cli.js.map +1 -1
  78. package/package.json +1 -1
  79. package/src/Acp.ts +7 -0
  80. package/src/Agent.test.ts +27 -0
  81. package/src/Agent.ts +49 -15
  82. package/src/AgentExecutor.test.ts +80 -2
  83. package/src/AgentExecutor.ts +70 -10
  84. package/src/AgentOutput.ts +23 -0
  85. package/src/AgentTools.test.ts +28 -0
  86. package/src/AgentTools.ts +7 -2
  87. package/src/ClaudeAgent.test.ts +113 -0
  88. package/src/ClaudeAgent.ts +51 -4
  89. package/src/Codex.test.ts +37 -9
  90. package/src/Codex.ts +25 -20
  91. package/src/Compaction.test.ts +18 -15
  92. package/src/Compaction.ts +89 -20
  93. package/src/CompactionTransport.test.ts +36 -0
  94. package/src/Copilot.ts +5 -6
  95. package/src/ModelLayer.test.ts +17 -2
  96. package/src/ModelLayer.ts +68 -22
  97. package/src/OutputFormatter.ts +3 -0
  98. package/src/Xai.ts +8 -12
  99. package/src/cli.ts +97 -5
  100. package/dist/bin/Effect-DNYYQ84C.mjs.map +0 -1
package/dist/bin/cli.mjs CHANGED
@@ -1,9 +1,9 @@
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 try_$1, $n as TimeoutError, $o as some, $r as _await, A as ensuring, Aa as isReadonlyArrayNonEmpty, Ar as empty$7, As as getStackTraceLimit, At as raceFirst, B as fn, Ba as span, Bo as getOrElse, Br as unwrap$3, Bt as scope, C as catchTags, Ca as findLast, Cc as isUndefined, Co as getOption, Cr as reasonAnnotations, Ct as option$1, Da as isArray, Dc as constTrue, Do as make$41, Dr as effect, Ds as withFiber$1, Dt as provide$1, E as contextWith, Ea as headNonEmpty, Ec as constFalse, Eo as getUnsafe, Er as buildWithScope, Et as promise, F as failSync, Fa as map$7, Fn as jittered, Fo as flatMapNullishOr, Fr as orDie$1, Ft as runFork, G as forkChild, Gr as fork, Gt as sleep, Ha as headUnsafe, Hi as forkUnsafe, Hn as isDoneCause, Ho as getOrThrow$1, Hr as addFinalizer$1, Hs as redact, I as filterOrFail, Ia as match$3, Ic as pipe, In as min, Ir as provide$3, Is as format, It as runForkWith, J as forkScoped, Ja as isFailure$1, Jn as round, Jo as map$8, Jr as makeUnsafe$2, K as forkDetach, Ka as getOrThrow, Kn as parse$1, Ko as isSome, Kt as succeed$1, L as flatMap$1, La as of, Ln as spaced, Lr as provideMerge, M as fail$1, Ma as last$1, Mc as flow, Mn as forever$1, Mo as exists, Mr as merge$2, Ms as BaseProto, Mt as request, N as failCause, Nc as identity, Nn as fromStep, No as filter$1, Nr as mergeAll, Ns as Class, Nt as result, O as die, Oa as isArrayNonEmpty, Oc as constUndefined, Oo as makeUnsafe$3, Or as effectContext, Ot as provideContext, Pc as memoize, Pn as isSchedule, Po as flatMap$2, Pr as mock, Ps as NodeInspectSymbol, Pt as retry, Q as ignore, Qa as succeed$2, Qn as StackTrace, Qo as orElseSome, Qr as TracerTimingEnabled, Qt as tapCause, R as flatMapEager, Ra as reduce, Rn as toStep, Ro as fromNullishOr, Rr as succeed$4, Rt as runSync, S as catchTag, Sa as findFirstIndex, Sc as isTagged, Si as LogToStderr$1, Sn as TaggedClass, So as get$2, Sr as pretty, St as onInterrupt, T as context, Ta as fromIterable, Tc as or, To as getOrUndefinedUnsafe, Tr as build, Tt as orElseSucceed, U as forEach$1, Ua as fail$2, Uo as getOrUndefined, Ur as addFinalizerExit, Ut as service, V as fnUntraced, Va as empty$6, Vo as getOrNull, Vr as Scope, Vt as scoped, W as forever, Wa as failVoid, Wn as Random$1, Wo as isNone, Wr as close, Wt as serviceOption, X as fromResult, Xa as map$6, Xn as IllegalArgumentError, Xo as none, Xr as CurrentLogAnnotations, Xt as sync, Y as fromOption, Ya as isSuccess$1, Yn as Done, Yo as match$2, Yr as provide$2, Yt as suspend, Z as gen, Zo as orElse$1, Zr as MinimumLogLevel, Zt as tap, _ as catchEager, _a as appendAll, _c as isObject$1, _i as isSuccess, _n as withSpan$1, _o as zero, _r as isTimeoutError, _s as PipeInspectableProto, _t as matchEffect, a as andThen, aa as sync$1, ai as isDoneUnsafe, an as undefined_, ao as infinity, ar as fail$5, at as logFatal, bc as isString, bn as equalBatchKeys, bo as add, bt as onExit, c as as, ci as succeed$5, cn as updateContext, cr as fromReasons, ct as makeSpanScoped, d as cached, dc as isNotNull, di as fail$3, dn as void_, do as minutes, dr as interruptors, dt as mapEager, ei as doneUnsafe, en as timeout, er as UnknownError$1, es as toArray, et as interrupt, f as cachedWithTTL, fa as compose, fc as isNotNullish, fi as failCause$1, ft as mapError, gi as isFailure, gn as withParentSpan, gt as matchCauseEffect, h as catchCauseIf, ha as Array$1, hc as isNullish, ho as toMillis, hr as isFailReason, i as all, ic as hasProperty, ii as isDone, in as try_, io as hours, ir as done, is as String$6, it as logError, j as exit, ja as join$2, jc as dual, jn as exponential, jo as all$1, jr as fresh, js as setStackTraceLimit, jt as repeat, k as effectify, ka as isCanonicalArrayIndex, kc as constVoid, ko as merge$1, ks as assignProperty, kt as provideService, l as asSome, la as DisablePropagation, lc as isIterable, ln as updateService, lo as max, lr as hasInterrupts, lt as map$5, m as catchCause, ma as toPredicate, mc as isNull, mi as interrupt$1, mn as withFiber, mo as seconds, ms as Prototype, mt as match$4, nn as timeoutOrElse, no as format$1, nt as isEffect, o as annotateCurrentSpan, oi as make$42, on as uninterruptible, or as filterInterruptors, ot as logInfo, p as callback, pa as has, pc as isNotUndefined, pi as findErrorOption$1, pn as whileLoop, pr as isDieReason, q as forkIn, qa as getOrUndefined$2, qr as make$43, qt as succeedNone, r as addFinalizer, ri as into, rn as tryPromise, ro as fromInputUnsafe$1, rt as logDebug, s as annotateLogs, si as makeUnsafe$1, sn as uninterruptibleMask, so as isFinite, sr as findErrorOption, st as logWarning, t as acquireRelease, ti as fail$4, tn as timeoutOption, to as normalizeNonEmpty, tr as annotate$1, tt as interruptible, u as asVoid, ua as ParentSpan, ui as die$1, un as useSpan, uo as millis, ur as hasInterruptsOnly, us as mapInput, ut as mapBothEager, v as catchFilter, vc as isObjectKeyword, vi as succeed$3, vn as yieldNow, vo as Reference, vr as makeDieReason, vt as never$1, w as catch_, wo as getOrUndefined$1, wr as squash, wt as orDie, x as catchReason, xa as findFirst, xi as ConsoleRef, xo as empty$5, xr as map$9, y as catchIf, ya as empty$4, yi as void_$1, yn as zipWith, yo as Service, yr as makeFailReason, yt as onError, za as sort, zc as pipeArguments, zn as catchDone, zo as fromUndefinedOr, zr as succeedContext } from "./Effect-DNYYQ84C.mjs";
4
- import { $ as URLFromString, $n as replaceChecks, $r as value, $t as isPattern, A as Null, An as parseUriFragment, Ar as unwrap$4, At as isGreaterThan, B as String$7, Bn as PropertySignature, Br as set, Bt as isLessThanDate, C as Literal, Cr as CurrentRedactedNames$1, Ct as isBetweenCodePoints, D as Never, Dn as fromSchemaDraft2020_12, Dr as setAll$1, Dt as isBetweenSize, E as Natural, En as fromSchemaDraft07, Er as redactUrl, Et as isBetweenProperties, F as OptionFromOptional, Fn as Arrays, Fr as isRedactedName, Ft as isGreaterThanOrEqualToDate, G as TaggedClass$2, Gn as defaultParseOptions, Gt as isMaxLength, H as Struct, Hn as Union$1, Hr as empty$10, Ht as isLessThanOrEqualToBigInt, I as Record, In as Filter, Ir as merge$3, It as isIncluding, J as TaggedUnion, Jn as isNever, Jt as isMinCodePoints, K as TaggedError$1, Kn as getIndexSignatureKeys, Kr as fromDateUnsafe, Kt as isMaxProperties, L as Redacted$4, Ln as FilterGroup, Lr as parseRetryAfter$1, Lt as isInt, M as Number$2, Mn as decodeEffect$1, Mr as empty$9, Mt as isGreaterThanDate, N as Option, Nn as decodeUnknownEffect, Nr as fromInput$1, Nt as isGreaterThanOrEqualTo, O as NonEmptyArray, On as getReferenceKey, Or as toString, Ot as isEndingWith, Pn as encodeEffect, Pr as fromRecordUnsafe, Pt as isGreaterThanOrEqualToBigInt, Q as URL$1, Qn as optionalKey$1, Qr as make$44, Qt as isMultipleOf, R as RedactedFromValue, Rn as Literal$1, Rr as remove$1, Rt as isLessThan, S as JsonObject$1, Sn as withDecodingDefaultKey, Sr as jsonSchemaAnnotationKeys, St as isBetweenBigInt, T as MutableJson, Tn as errorWithPath, Tr as fromInput, Tt as isBetweenLength, U as StructWithRest, Un as applyToSelfOrLastLinkEncoding, Ur as fromSetCookie, Ut as isLessThanOrEqualToDate, V as StringForLiteralAutocomplete, Vn as Suspend, Vr as setAll, Vt as isLessThanOrEqualTo, W as Symbol$1, Wn as decodeTo, Wr as formatIso, Wt as isMaxCodePoints, X as Tuple, Xn as mapOrSame, Xr as encode, Xt as isMinProperties, Y as TrueLiterals, Yn as isOptional, Yr as decode$3, Yt as isMinLength, Z as TupleWithRest, Zn as null_, Zr as isRedacted, Zt as isMinSize, _ as Exit, _n as toEncoded$1, _r as transformEffect, _t as encodeUnknownEffect, ai as Error$1, an as isUnique, ar as toType$1, at as Void, b as Int$1, bn as withConstructorDefault, br as Pointer, bt as is, c as Date$2, ci as taggedEnum, cn as makeFilter$1, cr as passthrough$1, ct as declare, dn as optional$2, dr as transformOptional$1, dt as decodeTo$1, ei as stringOrRedacted, en as isPropertyNames, er as resolveAt, et as Uint8Array$2, f as DateTimeUtcFromString, fn as optionalKey, ft as decodeUnknownEffect$1, g as Error$2, gn as toCodecStringTree, gr as transform$4, gt as encodeTo, h as DurationFromMillis, hn as toCodecJson, hr as passthroughSubtype, ht as encodeEffect$1, i as Boolean$4, ii as EncodingError, in as isUUID, ir as toEncoded, it as Unknown, j as NullOr, jn as getSubschemaKind, jr as CurrentRedactedNames, jt as isGreaterThanBigInt, k as NonEmptyString$1, kn as escapeToken, kr as fromBody, kt as isFinite$1, l as DateTimeUtc, li as assignProperty$1, ln as makeFilterGroup, lr as transform$3, lt as decodeEffect, m as Duration, mn as tag, mr as passthrough, mt as decodeUnknownSync, n as ArraySchema, ni as currentTimeMillis, nn as isSchemaError, nr as resolveIdentifier, nt as UndefinedOr, o as BooleanLiterals, oi as TaggedClass$1, on as link$1, or as unknown$1, p as Defect, pn as suspend$1, pt as decodeUnknownOption, q as TaggedStruct, qn as isJson, qt as isMaxSize, r as BigInt$2, rn as isStartingWith, rr as string$1, rt as Union, s as Class$1, si as TaggedError, sn as make$45, sr as Transformation, st as check, t as Any, ti as Clock, tn as isSchema, tr as resolveDescription, tt as Uint8ArrayFromBase64, ui as map$10, un as mutable, ur as transformEffect$1, ut as decodeSync, v as FalseLiterals, vn as toJsonSchemaDocument, vr as transformOptional, vt as fromJsonString, w as Literals$2, wn as omit, wr as empty$8, wt as isBetweenDate, x as Json, xn as withDecodingDefault, xr as annotationExcludedKeys, xt as isBetween, y as Finite, yn as toType, yr as InvalidValue$1, yt as instanceOf, z as SchemaError, zn as Objects, zr as retryAfterDelay, zt as isLessThanBigInt } from "./Schema-CSQN_Zso.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$2, 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-Dwvj9X5X.mjs";
6
- import { n as makeUnsafe$5 } from "./Latch-BSlIwuxI.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";
7
7
  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
8
  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
9
  import { createRequire } from "node:module";
@@ -1297,7 +1297,7 @@ const Number$1 = (options) => {
1297
1297
  clear: handleNumberClear(opts)
1298
1298
  });
1299
1299
  };
1300
- const Int = (options) => {
1300
+ const Int$4 = (options) => {
1301
1301
  const opts = {
1302
1302
  default: 0,
1303
1303
  min: globalThis.Number.NEGATIVE_INFINITY,
@@ -3347,7 +3347,7 @@ var InterruptibleResponse = class {
3347
3347
  return source;
3348
3348
  }
3349
3349
  get stream() {
3350
- return suspend$2(() => {
3350
+ return suspend$3(() => {
3351
3351
  responseRegistry.unregister(this.original);
3352
3352
  return ensuring$1(this.original.stream, sync(() => {
3353
3353
  this.controller.abort();
@@ -3772,7 +3772,7 @@ var UndiciResponse = class extends Class {
3772
3772
  return pipeArguments(this, arguments);
3773
3773
  }
3774
3774
  };
3775
- const loadUpgrade = promise(() => import("./upgrade-BSNjCnra.mjs"));
3775
+ const loadUpgrade = promise(() => import("./upgrade-HMRGSqq8.mjs"));
3776
3776
  const takeOver = (conn, head, signal) => {
3777
3777
  if (head !== void 0 && head.length > 0) conn.unshift(head);
3778
3778
  conn.on("error", constVoid);
@@ -4282,6 +4282,9 @@ function String$4(name) {
4282
4282
  function NonEmptyString(name) {
4283
4283
  return schema$1(NonEmptyString$1, name);
4284
4284
  }
4285
+ function Int$3(name) {
4286
+ return schema$1(Int$5, name);
4287
+ }
4285
4288
  function Boolean$3(name) {
4286
4289
  return schema$1(BooleanLiterals, name);
4287
4290
  }
@@ -5156,6 +5159,7 @@ const makeSchemaPrimitive = (tag, schema) => {
5156
5159
  return makePrimitive(tag, (value) => mapError(decode(value), (error) => error.message));
5157
5160
  };
5158
5161
  const Boolean$2 = makeSchemaPrimitive("Boolean", BooleanLiterals);
5162
+ const Int$2 = makeSchemaPrimitive("Int", Int$5);
5159
5163
  const String$3 = makePrimitive("String", (value) => succeed$1(value));
5160
5164
  const Choice = (choices) => {
5161
5165
  const choiceMap = new Map(choices);
@@ -5236,6 +5240,11 @@ const Boolean$1 = (kind, name) => makeSingle({
5236
5240
  primitiveType: Boolean$2,
5237
5241
  kind
5238
5242
  });
5243
+ const Int$1 = (kind, name) => makeSingle({
5244
+ name,
5245
+ primitiveType: Int$2,
5246
+ kind
5247
+ });
5239
5248
  const ChoiceWithValue$1 = (kind, name, choices) => makeSingle({
5240
5249
  name,
5241
5250
  primitiveType: Choice(choices),
@@ -6675,6 +6684,7 @@ const generate = (executableName, shell, descriptor) => {
6675
6684
  // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/cli/Flag.js
6676
6685
  const String$1 = (name) => String$2(flagKind, name);
6677
6686
  const Boolean = (name) => Boolean$1(flagKind, name);
6687
+ const Int = (name) => Int$1(flagKind, name);
6678
6688
  const ChoiceWithValue = (name, choices) => ChoiceWithValue$1(flagKind, name, choices);
6679
6689
  const Literals = (name, literals) => Literals$1(flagKind, name, literals);
6680
6690
  const Directory = (name, options) => Directory$1(flagKind, name, options);
@@ -7453,7 +7463,7 @@ const promptParam = fnUntraced(function* (param) {
7453
7463
  return [];
7454
7464
  }
7455
7465
  }
7456
- const count = !metadata.isVariadic ? 1 : yield* run$3(Int({
7466
+ const count = !metadata.isVariadic ? 1 : yield* run$3(Int$4({
7457
7467
  message: `${renderParamLabel(single)} count`,
7458
7468
  default: getOrElse(metadata.variadicMin, () => 0),
7459
7469
  min: getOrElse(metadata.variadicMin, () => 0),
@@ -7499,7 +7509,7 @@ const promptSingle = (single) => {
7499
7509
  }
7500
7510
  case "Date": return map$5(run$3(Date$1({ message })), (date) => commandLineArg(date.toISOString()));
7501
7511
  case "Finite": return map$5(run$3(Number$1({ message })), (value) => commandLineArg(String(value)));
7502
- case "Int": return map$5(run$3(Int({ message })), (value) => commandLineArg(String(value)));
7512
+ case "Int": return map$5(run$3(Int$4({ message })), (value) => commandLineArg(String(value)));
7503
7513
  case "Redacted": return map$5(run$3(Password({ message })), (value$2) => commandLineArg(value(value$2), "<redacted>"));
7504
7514
  default: return map$5(run$3(String$5({ message })), commandLineArg);
7505
7515
  }
@@ -8299,7 +8309,7 @@ const make$24 = gen(function* () {
8299
8309
  nodeStream.on("error", (cause) => passThrough.destroy(cause));
8300
8310
  nodeStream.pipe(passThrough);
8301
8311
  const onError = (cause) => toPlatformError(`fromReadable(fd${fd})`, toError(cause), command);
8302
- stream = suspend$2(() => error === void 0 ? fromReadable({
8312
+ stream = suspend$3(() => error === void 0 ? fromReadable({
8303
8313
  evaluate: () => passThrough,
8304
8314
  onError
8305
8315
  }) : fail$6(onError(error)));
@@ -9315,7 +9325,7 @@ var SocketUpgradeError = class SocketUpgradeError extends Error$2("effect/socket
9315
9325
  };
9316
9326
  var SocketCloseError = class extends Error$2("effect/socket/Socket/SocketCloseError")({
9317
9327
  _tag: tag("SocketCloseError"),
9318
- code: Int$1,
9328
+ code: Int$5,
9319
9329
  closeReason: optional$2(String$7)
9320
9330
  }) {
9321
9331
  get message() {
@@ -10342,7 +10352,7 @@ var ExaError = class extends TaggedError$1()("ExaError", { cause: Defect() }) {}
10342
10352
  const layer$8 = effect(ExaSearch, gen(function* () {
10343
10353
  const scope$5 = yield* scope;
10344
10354
  const getClient = yield* cachedWithTTL(gen(function* () {
10345
- const McpClient = yield* tryPromise(() => import("./McpClient-C7ctqJWo.mjs"));
10355
+ const McpClient = yield* tryPromise(() => import("./McpClient-DoPNaNzW.mjs"));
10346
10356
  const context = yield* buildWithScope(McpClient.layer, scope$5);
10347
10357
  return get$2(context, McpClient.McpClient);
10348
10358
  }), (exit) => isSuccess(exit) ? infinity : zero);
@@ -10415,7 +10425,7 @@ const layer$7 = effect(WebToMarkdown, gen(function* () {
10415
10425
  }));
10416
10426
  // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/ai/AiError.js
10417
10427
  const HttpResponseDetails$1 = Struct({
10418
- status: Int$1,
10428
+ status: Int$5,
10419
10429
  headers: Record(String$7, Union([String$7, Redacted$4(String$7)]))
10420
10430
  }).annotate({ identifier: "HttpResponseDetails" });
10421
10431
  const ReasonTypeId = "~effect/ai/AiError/Reason";
@@ -10474,9 +10484,9 @@ var NetworkError = class NetworkError extends Error$2("effect/ai/AiError/Network
10474
10484
  };
10475
10485
  const ProviderMetadata$1 = Record(String$7, NullOr(MutableJson));
10476
10486
  const UsageInfo = Struct({
10477
- promptTokens: optional$2(Int$1),
10478
- completionTokens: optional$2(Int$1),
10479
- totalTokens: optional$2(Int$1)
10487
+ promptTokens: optional$2(Int$5),
10488
+ completionTokens: optional$2(Int$5),
10489
+ totalTokens: optional$2(Int$5)
10480
10490
  }).annotate({ identifier: "UsageInfo" });
10481
10491
  const HttpContext = Struct({
10482
10492
  response: optional$2(HttpResponseDetails$1),
@@ -11652,7 +11662,7 @@ const AgentTools = make$16(make$17("changeDirectory", {
11652
11662
  description: "Write content to a file, creating parent directories if needed.",
11653
11663
  parameters: Struct({
11654
11664
  path: String$7,
11655
- content: String$7
11665
+ content: Union([String$7, Uint8Array$2.annotate({ identifier: "Uint8Array" })])
11656
11666
  }),
11657
11667
  dependencies: [CurrentDirectory]
11658
11668
  }), make$17("removeFile", {
@@ -11751,7 +11761,7 @@ const AgentToolHandlersNoDeps = AgentToolsWithSearch.toLayer(gen(function* () {
11751
11761
  const cwd = yield* CurrentDirectory;
11752
11762
  const path = pathService.resolve(cwd, options.path);
11753
11763
  yield* fs.makeDirectory(pathService.dirname(path), { recursive: true });
11754
- yield* fs.writeFileString(path, options.content);
11764
+ yield* typeof options.content === "string" ? fs.writeFileString(path, options.content) : fs.writeFile(path, options.content);
11755
11765
  yield* maybeUpdateFile(path);
11756
11766
  }, orDie),
11757
11767
  removeFile: fn("AgentTools.removeFile")(function* (path) {
@@ -14234,10 +14244,14 @@ const makeRpc = gen(function* () {
14234
14244
  reset: options?.reset ?? false
14235
14245
  }).pipe(orDie),
14236
14246
  executeUnsafe({ environment, ...options }) {
14237
- return client.executeUnsafe(environment === void 0 ? options : {
14247
+ return encodeRpcParams(options.tool, options.params).pipe(flatMap$1((params) => client.executeUnsafe(environment === void 0 ? {
14248
+ ...options,
14249
+ params
14250
+ } : {
14238
14251
  ...options,
14252
+ params,
14239
14253
  environment
14240
- }).pipe(orDie);
14254
+ })), orDie);
14241
14255
  }
14242
14256
  });
14243
14257
  });
@@ -14305,6 +14319,14 @@ var Rpcs = class extends make$12(make$14("capabilities", { success: Capabilities
14305
14319
  }),
14306
14320
  success: Json
14307
14321
  })) {};
14322
+ const RpcWriteFileParams = Struct({
14323
+ ...AgentTools.tools.writeFile.parametersSchema.fields,
14324
+ content: Union([String$7, Struct({ base64: Uint8ArrayFromBase64 }).pipe(decodeTo$1(Uint8Array$2, transform$3({
14325
+ decode: ({ base64 }) => base64,
14326
+ encode: (base64) => ({ base64 })
14327
+ })))])
14328
+ });
14329
+ const encodeRpcParams = (tool, params) => tool === "writeFile" ? encodeUnknownEffect(RpcWriteFileParams)(params) : succeed$1(params);
14308
14330
  const handleRequest = (opts, request) => {
14309
14331
  switch (request._tag) {
14310
14332
  case "TaskComplete": return opts.onTaskComplete(request.summary);
@@ -14431,7 +14453,11 @@ function runScriptWorker(load) {
14431
14453
  });
14432
14454
  callback();
14433
14455
  } }),
14434
- colorMode: false
14456
+ inspectOptions: {
14457
+ colors: false,
14458
+ compact: true,
14459
+ breakLength: Infinity
14460
+ }
14435
14461
  }),
14436
14462
  fetch,
14437
14463
  process: void 0
@@ -14480,6 +14506,11 @@ const workerSource = `${toFailure}
14480
14506
  ${fromFailure}
14481
14507
  (${runScriptWorker})(require)
14482
14508
  `;
14509
+ const inspectOptions = {
14510
+ colors: false,
14511
+ compact: true,
14512
+ breakLength: Infinity
14513
+ };
14483
14514
  const homeDirectory = () => {
14484
14515
  const fromEnv = process.env.HOME;
14485
14516
  if (fromEnv) return some(fromEnv);
@@ -14493,7 +14524,7 @@ const makeConsole = fn(function* (queue) {
14493
14524
  const writable = new QueueWriteStream(queue);
14494
14525
  const newConsole = new NodeConsole.Console({
14495
14526
  stdout: writable,
14496
- colorMode: false
14527
+ inspectOptions
14497
14528
  });
14498
14529
  yield* addFinalizer(() => {
14499
14530
  writable.end();
@@ -16926,7 +16957,7 @@ var ReferenceSlot = class {
16926
16957
  resolving = false;
16927
16958
  wrapper;
16928
16959
  constructor(key) {
16929
- this.wrapper = suspend$1(() => {
16960
+ this.wrapper = suspend$2(() => {
16930
16961
  if (this.body === void 0) throw new Error(`Reference ${key} was evaluated before it was resolved`);
16931
16962
  return this.body;
16932
16963
  });
@@ -17904,7 +17935,7 @@ const isBetweenBigIntReviver = makeReviverFilter("effect/schema/isBetweenBigInt"
17904
17935
  exclusiveMinimum: optional$2(Literal(true)),
17905
17936
  exclusiveMaximum: optional$2(Literal(true))
17906
17937
  }), ({ annotations, payload }) => isBetweenBigInt(payload, annotations));
17907
- const RepresentationSchema = suspend$1(() => RepresentationUnion);
17938
+ const RepresentationSchema = suspend$2(() => RepresentationUnion);
17908
17939
  const RepresentationsSchema = ArraySchema(RepresentationSchema);
17909
17940
  const RepresentationAnnotationSchema = Struct({
17910
17941
  id: NonEmptyString$1,
@@ -17923,7 +17954,7 @@ const AnnotationsSchema = optional$2(Record(String$7, Unknown)).pipe(encodeTo(op
17923
17954
  decode: passthroughSubtype(),
17924
17955
  encode: transformOptional((annotations) => isNone(annotations) || annotations.value === void 0 ? none() : pruneAnnotations(annotations.value))
17925
17956
  }));
17926
- const CheckSchema = suspend$1(() => CheckUnion);
17957
+ const CheckSchema = suspend$2(() => CheckUnion);
17927
17958
  const ChecksSchema = ArraySchema(CheckSchema);
17928
17959
  const KeywordFields = {
17929
17960
  annotations: AnnotationsSchema,
@@ -18414,8 +18445,8 @@ const makeTool = fnUntraced(function* (serverName, id, tool) {
18414
18445
  dts: docs.length === 0 ? signature : `${renderJsDoc(docs.join("\n\n"), " ")}\n${signature}`,
18415
18446
  search: {
18416
18447
  names: [tool.name.toLowerCase(), id.toLowerCase()],
18417
- nameTokens: new Set([...tokens(tool.name), ...tokens(id)]),
18418
- parameterTokens: new Set(parameterNames.flatMap(tokens)),
18448
+ nameTokens: new Set([...tokens$1(tool.name), ...tokens$1(id)]),
18449
+ parameterTokens: new Set(parameterNames.flatMap(tokens$1)),
18419
18450
  description: (tool.description ?? "").toLowerCase()
18420
18451
  }
18421
18452
  };
@@ -18441,7 +18472,7 @@ const SearchParams = Struct({
18441
18472
  server: optionalKey(String$7)
18442
18473
  });
18443
18474
  const maxResults = 10;
18444
- const tokens = (text) => text.replace(/([a-z0-9])([A-Z])/g, "$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter((token) => token !== "");
18475
+ const tokens$1 = (text) => text.replace(/([a-z0-9])([A-Z])/g, "$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter((token) => token !== "");
18445
18476
  const score = (tool, query) => {
18446
18477
  let total = tool.search.names.includes(query.text) ? 1e3 : 0;
18447
18478
  for (const token of query.tokens) {
@@ -18468,7 +18499,7 @@ const makeSearchTools = (servers) => {
18468
18499
  } else if (query === "") return yield* fail$1(`searchTools: pass a query or a server. Servers: ${serverList}`);
18469
18500
  const terms = {
18470
18501
  text: query.toLowerCase(),
18471
- tokens: tokens(query)
18502
+ tokens: tokens$1(query)
18472
18503
  };
18473
18504
  const ranked = candidates.flatMap((server) => server.tools.map((tool) => ({
18474
18505
  server,
@@ -19123,15 +19154,15 @@ const FinishReason = Literals$2([
19123
19154
  ]);
19124
19155
  var Usage$1 = class extends Class$1("effect/ai/AiResponse/Usage")({
19125
19156
  inputTokens: Struct({
19126
- uncached: optional$2(Int$1),
19127
- total: optional$2(Int$1),
19128
- cacheRead: optional$2(Int$1),
19129
- cacheWrite: optional$2(Int$1)
19157
+ uncached: optional$2(Int$5),
19158
+ total: optional$2(Int$5),
19159
+ cacheRead: optional$2(Int$5),
19160
+ cacheWrite: optional$2(Int$5)
19130
19161
  }),
19131
19162
  outputTokens: Struct({
19132
- total: optional$2(Int$1),
19133
- text: optional$2(Int$1),
19134
- reasoning: optional$2(Int$1)
19163
+ total: optional$2(Int$5),
19164
+ text: optional$2(Int$5),
19165
+ reasoning: optional$2(Int$5)
19135
19166
  })
19136
19167
  }) {};
19137
19168
  const FinishPart = Struct({
@@ -19957,6 +19988,7 @@ const defaultConfig = {
19957
19988
  enabled: true,
19958
19989
  contextWindow: 236e3,
19959
19990
  reserveTokens: 16e3,
19991
+ thresholdTokens: 16e4,
19960
19992
  keepRecentTokens: 2e4
19961
19993
  };
19962
19994
  var CompactionConfig = class CompactionConfig extends Reference("clanka/Compaction/CompactionConfig", { defaultValue: () => defaultConfig }) {
@@ -19966,6 +19998,11 @@ var CompactionConfig = class CompactionConfig extends Reference("clanka/Compacti
19966
19998
  });
19967
19999
  };
19968
20000
  var SummarizerTransform = class extends Reference("clanka/Compaction/SummarizerTransform", { defaultValue: () => identity }) {};
20001
+ var SummarizerModel = class extends Service()("clanka/Compaction/SummarizerModel") {};
20002
+ const layerSummarizerModel = (layer) => effect(SummarizerModel, gen(function* () {
20003
+ const services = yield* context();
20004
+ return fresh(orDie$1(layer)).pipe(provide$3(succeedContext(services)));
20005
+ }));
19969
20006
  const executeOutputCapChars = 32e3;
19970
20007
  const summarizerToolResultCapChars = 2e3;
19971
20008
  const keptToolResultStubChars = 2e3;
@@ -20016,9 +20053,10 @@ const estimateTokens = (prompt) => {
20016
20053
  return Math.ceil(chars / 4);
20017
20054
  };
20018
20055
  const estimateMessageTokens = (message) => Math.ceil(estimateMessageChars(message) / 4);
20056
+ const compactionThreshold$1 = (config) => Math.min(config.thresholdTokens, config.contextWindow - config.reserveTokens);
20019
20057
  const shouldCompact = (options) => {
20020
20058
  if (!options.config.enabled) return false;
20021
- return (options.contextTokens ?? estimateTokens(options.prompt)) > options.config.contextWindow - options.config.reserveTokens;
20059
+ return (options.contextTokens ?? estimateTokens(options.prompt)) > compactionThreshold$1(options.config);
20022
20060
  };
20023
20061
  const contextLengthPattern = /context[_ ]?(length|window)|too many tokens|prompt is too long|prompt token count|exceeds the (context|token|input )?limit|input token limit|exceeds the model'?s? (context|token|input)/i;
20024
20062
  const contextLengthCode = "context_length_exceeded";
@@ -20205,11 +20243,18 @@ const compact = fnUntraced(function* (options) {
20205
20243
  if (isNone(parts)) return none();
20206
20244
  const { system, previousSummary, toSummarize, kept } = parts.value;
20207
20245
  if (options.onStart) yield* options.onStart(options.reason);
20208
- const ai = yield* LanguageModel;
20209
- const summary = (yield* (yield* SummarizerTransform)(ai.streamText({ prompt: summarizerPrompt({
20210
- previousSummary,
20211
- messages: toSummarize
20212
- }) }).pipe(runFold(() => "", (text, part) => part.type === "text-delta" ? text + part.delta : text)))).trim();
20246
+ const summarize = gen(function* () {
20247
+ const ai = yield* LanguageModel;
20248
+ return yield* (yield* SummarizerTransform)(ai.streamText({ prompt: summarizerPrompt({
20249
+ previousSummary,
20250
+ messages: toSummarize
20251
+ }) }).pipe(runFold(() => "", (text, part) => part.type === "text-delta" ? text + part.delta : text)));
20252
+ });
20253
+ const summarizerModel = yield* serviceOption(SummarizerModel);
20254
+ const summary = (yield* match$2(summarizerModel, {
20255
+ onNone: () => summarize,
20256
+ onSome: (model) => summarize.pipe(provide$1(model), provideService(SummarizerTransform, identity))
20257
+ })).trim();
20213
20258
  if (summary.length === 0) return yield* make$18({
20214
20259
  module: "clanka/Compaction",
20215
20260
  method: "compact",
@@ -20295,6 +20340,11 @@ var CompactionEnded = class extends TaggedClass$2()("CompactionEnded", {
20295
20340
  tokensBefore: Number$2,
20296
20341
  tokensAfter: Number$2
20297
20342
  }) {};
20343
+ var SessionRestarted = class extends TaggedClass$2()("SessionRestarted", {
20344
+ reason: String$7,
20345
+ contextTokens: Number$2,
20346
+ cacheWrite: Number$2
20347
+ }) {};
20298
20348
  var EnvironmentUpdated = class extends TaggedClass$2()("EnvironmentUpdated", { update: String$7 }) {};
20299
20349
  const ContentPart = Union([
20300
20350
  ReasoningStart,
@@ -20309,6 +20359,7 @@ const ContentPart = Union([
20309
20359
  ExecuteOutputCapped,
20310
20360
  CompactionStarted,
20311
20361
  CompactionEnded,
20362
+ SessionRestarted,
20312
20363
  EnvironmentUpdated
20313
20364
  ]);
20314
20365
  var SubagentPart = class extends TaggedClass$2()("SubagentPart", {
@@ -20396,6 +20447,7 @@ const makeWith$1 = fnUntraced(function* (options) {
20396
20447
  };
20397
20448
  const replaceHistory = (next) => {
20398
20449
  set$1(prompt, next);
20450
+ lastContextTokens = void 0;
20399
20451
  if (!opts.historyEvents) return;
20400
20452
  offerUnsafe(output, new HistoryReplaced({ messages: next.content.filter((message) => message.role !== "system") }));
20401
20453
  };
@@ -20686,7 +20738,6 @@ ${prompt}`,
20686
20738
  let tokensAfter;
20687
20739
  if (isSome(result)) {
20688
20740
  replaceHistory(fromMessages(result.value.prompt.content.filter((message) => !isEnvironmentUpdate(message))));
20689
- lastContextTokens = void 0;
20690
20741
  tokensBefore = result.value.tokensBefore;
20691
20742
  tokensAfter = result.value.tokensAfter;
20692
20743
  } else tokensBefore = tokensAfter = estimateTokens(prompt.current);
@@ -20816,13 +20867,10 @@ ${capOutput(turn.output ?? "").output}
20816
20867
  });
20817
20868
  return true;
20818
20869
  };
20819
- const runModel = pipe(suspend$2(() => ai.streamText({
20870
+ const runModel = pipe(suspend$3(() => ai.streamText({
20820
20871
  prompt: sendImages ? prompt.current : stripImages(prompt.current),
20821
20872
  toolkit: singleTool
20822
- })), takeUntil((part) => {
20823
- if ((part.type === "text-end" || part.type === "reasoning-end") && mailbox.messages.size > 0) return true;
20824
- return false;
20825
- }), runForEachArray((parts) => {
20873
+ })), takeUntil((part) => modelConfig.cutStreamOnSteering !== false && (part.type === "text-end" || part.type === "reasoning-end") && mailbox.messages.size > 0), runForEachArray((parts) => {
20826
20874
  response.push(...parts);
20827
20875
  turnTimeoutReset();
20828
20876
  for (const part of parts) switch (part.type) {
@@ -20865,6 +20913,14 @@ ${capOutput(turn.output ?? "").output}
20865
20913
  if (usage.outputTokens.total !== void 0) outputTokens += usage.outputTokens.total;
20866
20914
  if (usage.inputTokens.cacheRead !== void 0) cacheRead += usage.inputTokens.cacheRead;
20867
20915
  if (usage.inputTokens.cacheWrite !== void 0) cacheWrite += usage.inputTokens.cacheWrite;
20916
+ if (isHistoryResent(part.metadata)) maybeSend({
20917
+ agentId,
20918
+ part: new SessionRestarted({
20919
+ reason: part.metadata.clanka.historyResent.reason,
20920
+ contextTokens: usage.inputTokens.total ?? 0,
20921
+ cacheWrite: usage.inputTokens.cacheWrite ?? 0
20922
+ })
20923
+ });
20868
20924
  if (usage.inputTokens.total !== void 0) {
20869
20925
  lastContextTokens = usage.inputTokens.total;
20870
20926
  inputTokens += usage.inputTokens.total;
@@ -21047,6 +21103,7 @@ const when = (condition, text) => condition ? text : "";
21047
21103
  const generateSystemTools = (tools, conversationMode) => `YOU ONLY HAVE ONE TOOL AVAILABLE: "execute", to run javascript code to do your work.
21048
21104
 
21049
21105
  - Use \`console.log\` to print any output you need.
21106
+ - Print only what you need, as everything printed stays in your context.${when(tools.offers("readFile"), ` Read line ranges with "startLine" / "endLine" instead of whole files.`)} Slice or filter large results before printing them.
21050
21107
  - Use top level await.${when(tools.offers("search") && tools.offers("rg"), `
21051
21108
  - Prefer using the "search" function over "rg", unless you are targeting specific files or patterns.`)}${when(tools.offers("applyPatch"), `
21052
21109
  - You can add / update / remove multiple files in one go with "applyPatch".${when(tools.offers("writeFile"), ` Prefer it over "writeFile" to update existing files.`)}`)}${when(tools.offers("bash"), `
@@ -21092,16 +21149,13 @@ console.log("files:", files)
21092
21149
  console.log("package.json:", JSON.parse(content))
21093
21150
  \`\`\`
21094
21151
 
21095
- And then you will revieve back the console output:
21152
+ And then you will receive back the console output:
21096
21153
 
21097
21154
  \`\`\`
21098
21155
  [22:44:53.050] INFO (#47): Calling "ls" { directory: '.' }
21099
21156
  [22:44:53.054] INFO (#47): Calling "readFile" { path: 'package.json' }
21100
21157
  files: [ 'package.json' ]
21101
- package.json: {
21102
- "name": "my-project",
21103
- "version": "1.0.0"
21104
- }
21158
+ package.json: { name: 'my-project', version: '1.0.0' }
21105
21159
  \`\`\``;
21106
21160
  const ReadSkillTools = make$16(make$17("readSkill", {
21107
21161
  description: "Read the instructions of a skill listed under Skills, by its name.",
@@ -21166,7 +21220,13 @@ var MaxRetries = class MaxRetries extends Reference("clanka/Agent/MaxRetries", {
21166
21220
  };
21167
21221
  var AgentModelConfig = class AgentModelConfig extends Reference("clanka/Agent/SystemPromptTransform", { defaultValue: () => ({}) }) {
21168
21222
  static layer = (options) => succeed$4(AgentModelConfig, options);
21223
+ static optionKeys = [
21224
+ "systemPromptTransform",
21225
+ "supportsImages",
21226
+ "cutStreamOnSteering"
21227
+ ];
21169
21228
  };
21229
+ const isHistoryResent = is(Struct({ clanka: Struct({ historyResent: Struct({ reason: String$7 }) }) }));
21170
21230
  const responseToSummary = (response) => {
21171
21231
  const prompt = fromResponseParts(response);
21172
21232
  let parts = empty$4();
@@ -21632,6 +21692,10 @@ const make$7 = fnUntraced(function* (options) {
21632
21692
  sessionUpdate: "agent_thought_chunk",
21633
21693
  content: textContent(`Retrying after error: ${part.error.message}\n`)
21634
21694
  });
21695
+ case "SessionRestarted": return update(session.id, {
21696
+ sessionUpdate: "agent_thought_chunk",
21697
+ content: textContent(`Session restarted (${part.reason}): ${part.contextTokens} context tokens resent, ${part.cacheWrite} cache write\n`)
21698
+ });
21635
21699
  case "SubagentStart": {
21636
21700
  const announced = session.announcedSubagents.has(part.id);
21637
21701
  session.announcedSubagents.add(part.id);
@@ -22191,7 +22255,7 @@ var Retry = class Retry extends TaggedClass$1("Retry") {
22191
22255
  }
22192
22256
  };
22193
22257
  // node_modules/.pnpm/@effect+ai-openai@4.1.1_effect@4.1.1/node_modules/@effect/ai-openai/dist/Generated.js
22194
- const CompoundFilter = suspend$1(() => __recursive_CompoundFilter);
22258
+ const CompoundFilter = suspend$2(() => __recursive_CompoundFilter);
22195
22259
  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" });
22196
22260
  const ReasoningEffort = Union([Literals$2([
22197
22261
  "none",
@@ -23108,7 +23172,7 @@ const InlineSkillParam = Struct({
23108
23172
  "type": Literal("inline").annotate({ "description": "Defines an inline skill for this request." }),
23109
23173
  "name": String$7.annotate({ "description": "The name of the skill." }),
23110
23174
  "description": String$7.annotate({ "description": "The description of the skill." }),
23111
- "source": suspend$1(() => InlineSkillSourceParam).annotate({ "description": "Inline skill payload" })
23175
+ "source": suspend$2(() => InlineSkillSourceParam).annotate({ "description": "Inline skill payload" })
23112
23176
  }).annotate({ "identifier": "InlineSkillParam" });
23113
23177
  const ContainerNetworkPolicyAllowlistParam = Struct({
23114
23178
  "type": Literal("allowlist").annotate({ "description": "Allow outbound network access only to specified domains. Always `allowlist`." }),
@@ -23150,7 +23214,7 @@ const InputImageContent$1 = Struct({
23150
23214
  "format": "uri"
23151
23215
  }), Null])),
23152
23216
  "file_id": optionalKey(Union([String$7.annotate({ "description": "The ID of the file to be sent to the model." }), Null])),
23153
- "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`." }),
23217
+ "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`." }),
23154
23218
  "prompt_cache_breakpoint": optionalKey(PromptCacheBreakpointConfig)
23155
23219
  }).annotate({
23156
23220
  "title": "Input image",
@@ -23167,7 +23231,7 @@ const InputFileContent$1 = Struct({
23167
23231
  "description": "The URL of the file to be sent to the model.",
23168
23232
  "format": "uri"
23169
23233
  })),
23170
- "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`." }))
23234
+ "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`." }))
23171
23235
  }).annotate({
23172
23236
  "title": "Input file",
23173
23237
  "description": "A file input to the model.",
@@ -23183,7 +23247,7 @@ const ToolCallCallerParam = Union([DirectToolCallCallerParam, ProgramToolCallCal
23183
23247
  });
23184
23248
  const ClickParam = Struct({
23185
23249
  "type": Literal("click").annotate({ "description": "Specifies the event type. For a click action, this property is always `click`." }),
23186
- "button": suspend$1(() => ClickButtonType).annotate({ "description": "Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`." }),
23250
+ "button": suspend$2(() => ClickButtonType).annotate({ "description": "Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`." }),
23187
23251
  "x": Number$2.annotate({ "description": "The x-coordinate where the click occurred." }).check(isInt().annotate({ "expected": "an integer" })),
23188
23252
  "y": Number$2.annotate({ "description": "The y-coordinate where the click occurred." }).check(isInt().annotate({ "expected": "an integer" })),
23189
23253
  "keys": optionalKey(Union([ArraySchema(String$7).annotate({ "description": "The keys being held while clicking." }), Null]))
@@ -23225,14 +23289,14 @@ const ApplyPatchToolParam = Struct({
23225
23289
  "identifier": "ApplyPatchToolParam"
23226
23290
  });
23227
23291
  const RankingOptions = Struct({
23228
- "ranker": optionalKey(suspend$1(() => RankerVersionType).annotate({ "description": "The ranker to use for the file search." })),
23292
+ "ranker": optionalKey(suspend$2(() => RankerVersionType).annotate({ "description": "The ranker to use for the file search." })),
23229
23293
  "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" }))),
23230
- "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." }))
23294
+ "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." }))
23231
23295
  }).annotate({ "identifier": "RankingOptions" });
23232
23296
  const Filters = Union([ComparisonFilter, CompoundFilter]).annotate({ "identifier": "Filters" });
23233
23297
  const ComputerUsePreviewTool = Struct({
23234
23298
  "type": Literal("computer_use_preview").annotate({ "description": "The type of the computer use tool. Always `computer_use_preview`." }),
23235
- "environment": suspend$1(() => ComputerEnvironment).annotate({ "description": "The type of computer environment to control." }),
23299
+ "environment": suspend$2(() => ComputerEnvironment).annotate({ "description": "The type of computer environment to control." }),
23236
23300
  "display_width": Number$2.annotate({ "description": "The width of the computer display." }).check(isInt().annotate({ "expected": "an integer" })),
23237
23301
  "display_height": Number$2.annotate({ "description": "The height of the computer display." }).check(isInt().annotate({ "expected": "an integer" }))
23238
23302
  }).annotate({
@@ -23247,7 +23311,7 @@ const WebSearchTool = Struct({
23247
23311
  "title": "Allowed domains for the search.",
23248
23312
  "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"
23249
23313
  }), Null])) }).annotate({ "description": "Filters for the search.\n" }), Null])),
23250
- "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" })),
23314
+ "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" })),
23251
23315
  "search_context_size": optionalKey(Literals$2([
23252
23316
  "low",
23253
23317
  "medium",
@@ -23345,7 +23409,7 @@ const ImageGenTool = Struct({
23345
23409
  "file_id": optionalKey(String$7.annotate({ "description": "File ID for the mask image.\n" }))
23346
23410
  }).annotate({ "description": "Optional mask for inpainting. Contains `image_url`\n(string, optional) and `file_id` (string, optional).\n" })),
23347
23411
  "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" }))),
23348
- "action": optionalKey(suspend$1(() => ImageGenActionEnum).annotate({ "description": "Whether to generate a new image or edit an existing image. Default: `auto`.\n" }))
23412
+ "action": optionalKey(suspend$2(() => ImageGenActionEnum).annotate({ "description": "Whether to generate a new image or edit an existing image. Default: `auto`.\n" }))
23349
23413
  }).annotate({
23350
23414
  "title": "Image generation tool",
23351
23415
  "description": "A tool that generates images using the GPT image models.\n",
@@ -23357,7 +23421,7 @@ const LocalEnvironmentParam = Struct({
23357
23421
  }).annotate({ "identifier": "LocalEnvironmentParam" });
23358
23422
  const CustomGrammarFormatParam = Struct({
23359
23423
  "type": Literal("grammar").annotate({ "description": "Grammar format. Always `grammar`." }),
23360
- "syntax": suspend$1(() => GrammarSyntax1).annotate({ "description": "The syntax of the grammar definition. One of `lark` or `regex`." }),
23424
+ "syntax": suspend$2(() => GrammarSyntax1).annotate({ "description": "The syntax of the grammar definition. One of `lark` or `regex`." }),
23361
23425
  "definition": String$7.annotate({ "description": "The grammar definition." })
23362
23426
  }).annotate({
23363
23427
  "title": "Grammar format",
@@ -23377,9 +23441,9 @@ const FunctionToolParam = Struct({
23377
23441
  }).annotate({ "identifier": "FunctionToolParam" });
23378
23442
  const ToolSearchToolParam = Struct({
23379
23443
  "type": Literal("tool_search").annotate({ "description": "The type of the tool. Always `tool_search`." }),
23380
- "execution": optionalKey(suspend$1(() => ToolSearchExecutionType).annotate({ "description": "Whether tool search is executed by the server or by the client." })),
23444
+ "execution": optionalKey(suspend$2(() => ToolSearchExecutionType).annotate({ "description": "Whether tool search is executed by the server or by the client." })),
23381
23445
  "description": optionalKey(Union([String$7.annotate({ "description": "Description shown to the model for a client-executed tool search tool." }), Null])),
23382
- "parameters": optionalKey(Union([suspend$1(() => EmptyModelParam).annotate({ "description": "Parameter schema for a client-executed tool search tool." }), Null]))
23446
+ "parameters": optionalKey(Union([suspend$2(() => EmptyModelParam).annotate({ "description": "Parameter schema for a client-executed tool search tool." }), Null]))
23383
23447
  }).annotate({
23384
23448
  "title": "Tool search tool",
23385
23449
  "description": "Hosted or BYOT tool search configuration for deferred tools.",
@@ -23398,8 +23462,8 @@ const ToolSearchOutputFunctionToolParam = Struct({
23398
23462
  }).annotate({ "identifier": "ToolSearchOutputFunctionToolParam" });
23399
23463
  const WebSearchPreviewTool = Struct({
23400
23464
  "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`." }),
23401
- "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])),
23402
- "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." })),
23465
+ "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])),
23466
+ "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." })),
23403
23467
  "search_content_types": optionalKey(ArraySchema(SearchContentType))
23404
23468
  }).annotate({
23405
23469
  "title": "Web search preview",
@@ -23418,7 +23482,7 @@ const InputImageContentParamAutoParam = Struct({
23418
23482
  "format": "uri"
23419
23483
  }).check(isMaxCodePoints(20971520).annotate({ "expected": "a string with at most 20971520 code points" })), Null])),
23420
23484
  "file_id": optionalKey(Union([String$7.annotate({ "description": "The ID of the file to be sent to the model." }), Null])),
23421
- "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])),
23485
+ "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])),
23422
23486
  "prompt_cache_breakpoint": optionalKey(Union([PromptCacheBreakpointParam, Null]))
23423
23487
  }).annotate({
23424
23488
  "title": "Input image",
@@ -23434,7 +23498,7 @@ const InputFileContentParam = Struct({
23434
23498
  "description": "The URL of the file to be sent to the model.",
23435
23499
  "format": "uri"
23436
23500
  }), Null])),
23437
- "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`." })),
23501
+ "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`." })),
23438
23502
  "prompt_cache_breakpoint": optionalKey(Union([PromptCacheBreakpointParam, Null]))
23439
23503
  }).annotate({
23440
23504
  "title": "Input file",
@@ -23460,12 +23524,12 @@ const ProgramOutputItemParam = Struct({
23460
23524
  "type": Literal("program_output").annotate({ "description": "The item type. Always `program_output`." }),
23461
23525
  "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" })),
23462
23526
  "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" })),
23463
- "status": suspend$1(() => ProgramOutputItemStatus).annotate({ "description": "The terminal status of the program output." })
23527
+ "status": suspend$2(() => ProgramOutputItemStatus).annotate({ "description": "The terminal status of the program output." })
23464
23528
  }).annotate({ "identifier": "ProgramOutputItemParam" });
23465
23529
  const AutoCodeInterpreterToolParam = Struct({
23466
23530
  "type": Literal("auto").annotate({ "description": "Always `auto`." }),
23467
23531
  "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" }))),
23468
- "memory_limit": optionalKey(Union([suspend$1(() => ContainerMemoryLimit).annotate({ "description": "The memory limit for the code interpreter container." }), Null])),
23532
+ "memory_limit": optionalKey(Union([suspend$2(() => ContainerMemoryLimit).annotate({ "description": "The memory limit for the code interpreter container." }), Null])),
23469
23533
  "network_policy": optionalKey(Union([ContainerNetworkPolicyDisabledParam, ContainerNetworkPolicyAllowlistParam], { mode: "oneOf" }).annotate({ "description": "Network access policy for the container." }))
23470
23534
  }).annotate({
23471
23535
  "title": "CodeInterpreterToolAuto",
@@ -23475,7 +23539,7 @@ const AutoCodeInterpreterToolParam = Struct({
23475
23539
  const ContainerAutoParam = Struct({
23476
23540
  "type": Literal("container_auto").annotate({ "description": "Automatically creates a container for this request" }),
23477
23541
  "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" }))),
23478
- "memory_limit": optionalKey(Union([suspend$1(() => ContainerMemoryLimit).annotate({ "description": "The memory limit for the container." }), Null])),
23542
+ "memory_limit": optionalKey(Union([suspend$2(() => ContainerMemoryLimit).annotate({ "description": "The memory limit for the container." }), Null])),
23479
23543
  "network_policy": optionalKey(Union([ContainerNetworkPolicyDisabledParam, ContainerNetworkPolicyAllowlistParam], { mode: "oneOf" }).annotate({ "description": "Network access policy for the container." })),
23480
23544
  "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" })))
23481
23545
  }).annotate({ "identifier": "ContainerAutoParam" });
@@ -23514,8 +23578,8 @@ const FileSearchTool = Struct({
23514
23578
  "type": Literal("file_search").annotate({ "description": "The type of the file search tool. Always `file_search`." }),
23515
23579
  "vector_store_ids": ArraySchema(String$7).annotate({ "description": "The IDs of the vector stores to search." }),
23516
23580
  "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" }))),
23517
- "ranking_options": optionalKey(suspend$1(() => RankingOptions).annotate({ "description": "Ranking options for search." })),
23518
- "filters": optionalKey(Union([suspend$1(() => Filters).annotate({ "description": "A filter to apply." }), Null]))
23581
+ "ranking_options": optionalKey(suspend$2(() => RankingOptions).annotate({ "description": "Ranking options for search." })),
23582
+ "filters": optionalKey(Union([suspend$2(() => Filters).annotate({ "description": "A filter to apply." }), Null]))
23519
23583
  }).annotate({
23520
23584
  "title": "File search",
23521
23585
  "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).",
@@ -23537,7 +23601,7 @@ const CustomToolParam = Struct({
23537
23601
  const FunctionShellCallOutputContentParam = Struct({
23538
23602
  "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" })),
23539
23603
  "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" })),
23540
- "outcome": suspend$1(() => FunctionShellCallOutputOutcomeParam).annotate({ "description": "The exit or timeout outcome associated with this shell call." })
23604
+ "outcome": suspend$2(() => FunctionShellCallOutputOutcomeParam).annotate({ "description": "The exit or timeout outcome associated with this shell call." })
23541
23605
  }).annotate({
23542
23606
  "title": "Shell output content",
23543
23607
  "description": "Captured stdout and stderr for a portion of a shell tool call output.",
@@ -23738,7 +23802,7 @@ const InputItem$1 = Union([
23738
23802
  "type": Literal("computer_call_output").annotate({ "description": "The type of the computer tool call output. Always `computer_call_output`." }),
23739
23803
  "output": ComputerScreenshotImage,
23740
23804
  "acknowledged_safety_checks": optionalKey(Union([ArraySchema(ComputerCallSafetyCheckParam).annotate({ "description": "The safety checks reported by the API that have been acknowledged by the developer." }), Null])),
23741
- "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]))
23805
+ "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]))
23742
23806
  }).annotate({
23743
23807
  "title": "Computer tool call output",
23744
23808
  "description": "The output of a computer tool call."
@@ -23746,7 +23810,7 @@ const InputItem$1 = Union([
23746
23810
  Struct({
23747
23811
  "id": String$7.annotate({ "description": "The unique ID of the web search tool call.\n" }),
23748
23812
  "type": Literal("web_search_call").annotate({ "description": "The type of the web search tool call. Always `web_search_call`.\n" }),
23749
- "status": suspend$1(() => WebSearchCallStatus).annotate({ "description": "The status of the web search tool call.\n" }),
23813
+ "status": suspend$2(() => WebSearchCallStatus).annotate({ "description": "The status of the web search tool call.\n" }),
23750
23814
  "action": optionalKey(Union([
23751
23815
  WebSearchActionSearch,
23752
23816
  WebSearchActionOpenPage,
@@ -23785,8 +23849,8 @@ const InputItem$1 = Union([
23785
23849
  ], { 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." }),
23786
23850
  "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])),
23787
23851
  "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])),
23788
- "caller": optionalKey(Union([suspend$1(() => ToolCallCallerParam).annotate({ "description": "The execution context that produced this tool call." }), Null])),
23789
- "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]))
23852
+ "caller": optionalKey(Union([suspend$2(() => ToolCallCallerParam).annotate({ "description": "The execution context that produced this tool call." }), Null])),
23853
+ "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]))
23790
23854
  }).annotate({
23791
23855
  "title": "Function tool call output",
23792
23856
  "description": "The output of a function tool call."
@@ -23795,17 +23859,17 @@ const InputItem$1 = Union([
23795
23859
  "id": optionalKey(Union([String$7.annotate({ "description": "The unique ID of this tool search call." }), Null])),
23796
23860
  "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])),
23797
23861
  "type": Literal("tool_search_call").annotate({ "description": "The item type. Always `tool_search_call`." }),
23798
- "execution": optionalKey(suspend$1(() => ToolSearchExecutionType).annotate({ "description": "Whether tool search was executed by the server or by the client." })),
23799
- "arguments": suspend$1(() => EmptyModelParam).annotate({ "description": "The arguments supplied to the tool search call." }),
23800
- "status": optionalKey(Union([suspend$1(() => FunctionCallItemStatus).annotate({ "description": "The status of the tool search call." }), Null]))
23862
+ "execution": optionalKey(suspend$2(() => ToolSearchExecutionType).annotate({ "description": "Whether tool search was executed by the server or by the client." })),
23863
+ "arguments": suspend$2(() => EmptyModelParam).annotate({ "description": "The arguments supplied to the tool search call." }),
23864
+ "status": optionalKey(Union([suspend$2(() => FunctionCallItemStatus).annotate({ "description": "The status of the tool search call." }), Null]))
23801
23865
  }),
23802
23866
  Struct({
23803
23867
  "id": optionalKey(Union([String$7.annotate({ "description": "The unique ID of this tool search output." }), Null])),
23804
23868
  "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])),
23805
23869
  "type": Literal("tool_search_output").annotate({ "description": "The item type. Always `tool_search_output`." }),
23806
- "execution": optionalKey(suspend$1(() => ToolSearchExecutionType).annotate({ "description": "Whether tool search was executed by the server or by the client." })),
23870
+ "execution": optionalKey(suspend$2(() => ToolSearchExecutionType).annotate({ "description": "Whether tool search was executed by the server or by the client." })),
23807
23871
  "tools": ArraySchema(ToolSearchOutputTool).annotate({ "description": "The loaded tool definitions returned by the tool search output." }),
23808
- "status": optionalKey(Union([suspend$1(() => FunctionCallItemStatus).annotate({ "description": "The status of the tool search output." }), Null]))
23872
+ "status": optionalKey(Union([suspend$2(() => FunctionCallItemStatus).annotate({ "description": "The status of the tool search output." }), Null]))
23809
23873
  }),
23810
23874
  Struct({
23811
23875
  "id": optionalKey(Union([String$7.annotate({ "description": "The unique ID of this additional tools item." }), Null])),
@@ -23816,7 +23880,7 @@ const InputItem$1 = Union([
23816
23880
  Struct({
23817
23881
  "id": optionalKey(Union([String$7.annotate({ "description": "The unique ID of the configuration update item." }), Null])),
23818
23882
  "type": Literal("configuration_update").annotate({ "description": "The item type. Always `configuration_update`." }),
23819
- "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." }))
23883
+ "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." }))
23820
23884
  }).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" }),
23821
23885
  Struct({
23822
23886
  "type": Literal("reasoning").annotate({ "description": "The type of the object. Always `reasoning`.\n" }),
@@ -23864,9 +23928,9 @@ const InputItem$1 = Union([
23864
23928
  "max",
23865
23929
  "auto"
23866
23930
  ]).annotate({ "description": "The quality of the image generated by the image generation tool call. One of `low`, `medium`, `high`, `xhigh`, `max`, or `auto`." }), Null])),
23867
- "action": optionalKey(Union([suspend$1(() => ImageGenActionEnum).annotate({ "description": "The action used for image generation." }), Null])),
23868
- "background": optionalKey(Union([suspend$1(() => ImageBackground).annotate({ "description": "The background setting used for generation." }), Null])),
23869
- "output_format": optionalKey(Union([suspend$1(() => ImageOutputFormat).annotate({ "description": "The output format used for generation." }), Null])),
23931
+ "action": optionalKey(Union([suspend$2(() => ImageGenActionEnum).annotate({ "description": "The action used for image generation." }), Null])),
23932
+ "background": optionalKey(Union([suspend$2(() => ImageBackground).annotate({ "description": "The background setting used for generation." }), Null])),
23933
+ "output_format": optionalKey(Union([suspend$2(() => ImageOutputFormat).annotate({ "description": "The output format used for generation." }), Null])),
23870
23934
  "revised_prompt": optionalKey(Union([String$7.annotate({ "description": "The prompt that was used after any model prompt rewriting." }), Null]))
23871
23935
  }).annotate({
23872
23936
  "title": "Image generation call",
@@ -23920,10 +23984,10 @@ const InputItem$1 = Union([
23920
23984
  Struct({
23921
23985
  "id": optionalKey(Union([String$7.annotate({ "description": "The unique ID of the shell tool call. Populated when this item is returned via API." }), Null])),
23922
23986
  "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" })),
23923
- "caller": optionalKey(Union([suspend$1(() => ToolCallCallerParam).annotate({ "description": "The execution context that produced this tool call." }), Null])),
23987
+ "caller": optionalKey(Union([suspend$2(() => ToolCallCallerParam).annotate({ "description": "The execution context that produced this tool call." }), Null])),
23924
23988
  "type": Literal("shell_call").annotate({ "description": "The type of the item. Always `shell_call`." }),
23925
- "action": suspend$1(() => FunctionShellActionParam).annotate({ "description": "The shell commands and limits that describe how to run the tool call." }),
23926
- "status": optionalKey(Union([suspend$1(() => FunctionShellCallItemStatus).annotate({ "description": "The status of the shell call. One of `in_progress`, `completed`, or `incomplete`." }), Null])),
23989
+ "action": suspend$2(() => FunctionShellActionParam).annotate({ "description": "The shell commands and limits that describe how to run the tool call." }),
23990
+ "status": optionalKey(Union([suspend$2(() => FunctionShellCallItemStatus).annotate({ "description": "The status of the shell call. One of `in_progress`, `completed`, or `incomplete`." }), Null])),
23927
23991
  "environment": optionalKey(Union([Union([LocalEnvironmentParam, ContainerReferenceParam], { mode: "oneOf" }).annotate({ "description": "The environment to execute the shell commands in." }), Null]))
23928
23992
  }).annotate({
23929
23993
  "title": "Shell tool call",
@@ -23932,10 +23996,10 @@ const InputItem$1 = Union([
23932
23996
  Struct({
23933
23997
  "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])),
23934
23998
  "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" })),
23935
- "caller": optionalKey(Union([suspend$1(() => ToolCallCallerParam).annotate({ "description": "The execution context that produced this tool call." }), Null])),
23999
+ "caller": optionalKey(Union([suspend$2(() => ToolCallCallerParam).annotate({ "description": "The execution context that produced this tool call." }), Null])),
23936
24000
  "type": Literal("shell_call_output").annotate({ "description": "The type of the item. Always `shell_call_output`." }),
23937
24001
  "output": ArraySchema(FunctionShellCallOutputContentParam).annotate({ "description": "Captured chunks of stdout and stderr output, along with their associated outcomes." }),
23938
- "status": optionalKey(Union([suspend$1(() => FunctionShellCallItemStatus).annotate({ "description": "The status of the shell call output." }), Null])),
24002
+ "status": optionalKey(Union([suspend$2(() => FunctionShellCallItemStatus).annotate({ "description": "The status of the shell call output." }), Null])),
23939
24003
  "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]))
23940
24004
  }).annotate({
23941
24005
  "title": "Shell tool call output",
@@ -23945,9 +24009,9 @@ const InputItem$1 = Union([
23945
24009
  "type": Literal("apply_patch_call").annotate({ "description": "The type of the item. Always `apply_patch_call`." }),
23946
24010
  "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])),
23947
24011
  "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" })),
23948
- "caller": optionalKey(Union([suspend$1(() => ToolCallCallerParam).annotate({ "description": "The execution context that produced this tool call." }), Null])),
23949
- "status": suspend$1(() => ApplyPatchCallStatusParam).annotate({ "description": "The status of the apply patch tool call. One of `in_progress` or `completed`." }),
23950
- "operation": suspend$1(() => ApplyPatchOperationParam).annotate({ "description": "The specific create, delete, or update instruction for the apply_patch tool call." })
24012
+ "caller": optionalKey(Union([suspend$2(() => ToolCallCallerParam).annotate({ "description": "The execution context that produced this tool call." }), Null])),
24013
+ "status": suspend$2(() => ApplyPatchCallStatusParam).annotate({ "description": "The status of the apply patch tool call. One of `in_progress` or `completed`." }),
24014
+ "operation": suspend$2(() => ApplyPatchOperationParam).annotate({ "description": "The specific create, delete, or update instruction for the apply_patch tool call." })
23951
24015
  }).annotate({
23952
24016
  "title": "Apply patch tool call",
23953
24017
  "description": "A tool call representing a request to create, delete, or update files using diff patches."
@@ -23956,8 +24020,8 @@ const InputItem$1 = Union([
23956
24020
  "type": Literal("apply_patch_call_output").annotate({ "description": "The type of the item. Always `apply_patch_call_output`." }),
23957
24021
  "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])),
23958
24022
  "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" })),
23959
- "caller": optionalKey(Union([suspend$1(() => ToolCallCallerParam).annotate({ "description": "The execution context that produced this tool call." }), Null])),
23960
- "status": suspend$1(() => ApplyPatchCallOutputStatusParam).annotate({ "description": "The status of the apply patch tool call output. One of `completed` or `failed`." }),
24023
+ "caller": optionalKey(Union([suspend$2(() => ToolCallCallerParam).annotate({ "description": "The execution context that produced this tool call." }), Null])),
24024
+ "status": suspend$2(() => ApplyPatchCallOutputStatusParam).annotate({ "description": "The status of the apply patch tool call output. One of `completed` or `failed`." }),
23961
24025
  "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]))
23962
24026
  }).annotate({
23963
24027
  "title": "Apply patch tool call output",
@@ -24002,7 +24066,7 @@ const InputItem$1 = Union([
24002
24066
  "arguments": String$7.annotate({ "description": "A JSON string of the arguments passed to the tool.\n" }),
24003
24067
  "output": optionalKey(Union([String$7.annotate({ "description": "The output from the tool call.\n" }), Null])),
24004
24068
  "error": optionalKey(Union([MCPToolCallError, Null]).annotate({ "description": "The error from the tool call, if any." })),
24005
- "status": optionalKey(suspend$1(() => MCPToolCallStatus).annotate({ "description": "The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.\n" })),
24069
+ "status": optionalKey(suspend$2(() => MCPToolCallStatus).annotate({ "description": "The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`.\n" })),
24006
24070
  "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]))
24007
24071
  }).annotate({
24008
24072
  "title": "MCP tool call",
@@ -24048,7 +24112,7 @@ const InputItem$1 = Union([
24048
24112
  ], { mode: "oneOf" }).annotate({ "identifier": "InputItem" });
24049
24113
  const __recursive_CompoundFilter = Struct({
24050
24114
  "type": Literals$2(["and", "or"]).annotate({ "description": "Type of operation: `and` or `or`." }),
24051
- "filters": ArraySchema(Union([ComparisonFilter, suspend$1(() => CompoundFilter)], { mode: "oneOf" })).annotate({ "description": "Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`." })
24115
+ "filters": ArraySchema(Union([ComparisonFilter, suspend$2(() => CompoundFilter)], { mode: "oneOf" })).annotate({ "description": "Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`." })
24052
24116
  }).annotate({
24053
24117
  "title": "Compound Filter",
24054
24118
  "description": "Combine multiple filters using `and` or `or`.",
@@ -24928,28 +24992,28 @@ const ComputerScreenshotContent = Struct({
24928
24992
  const FileCitationAnnotation = Struct({
24929
24993
  type: Literal("file_citation"),
24930
24994
  file_id: String$7,
24931
- index: Int$1,
24995
+ index: Int$5,
24932
24996
  filename: String$7
24933
24997
  });
24934
24998
  const UrlCitationAnnotation = Struct({
24935
24999
  type: Literal("url_citation"),
24936
25000
  url: String$7,
24937
- start_index: Int$1,
24938
- end_index: Int$1,
25001
+ start_index: Int$5,
25002
+ end_index: Int$5,
24939
25003
  title: String$7
24940
25004
  });
24941
25005
  const ContainerFileCitationAnnotation = Struct({
24942
25006
  type: Literal("container_file_citation"),
24943
25007
  container_id: String$7,
24944
25008
  file_id: String$7,
24945
- start_index: Int$1,
24946
- end_index: Int$1,
25009
+ start_index: Int$5,
25010
+ end_index: Int$5,
24947
25011
  filename: String$7
24948
25012
  });
24949
25013
  const FilePathAnnotation = Struct({
24950
25014
  type: Literal("file_path"),
24951
25015
  file_id: String$7,
24952
- index: Int$1
25016
+ index: Int$5
24953
25017
  });
24954
25018
  const Annotation = Union([
24955
25019
  FileCitationAnnotation,
@@ -25183,7 +25247,7 @@ const TextResponseFormatConfiguration = Union([
25183
25247
  ]);
25184
25248
  const CreateResponse = Struct({
25185
25249
  metadata: optional$2(Record(String$7, String$7)),
25186
- top_logprobs: optional$2(Int$1),
25250
+ top_logprobs: optional$2(Int$5),
25187
25251
  temperature: optional$2(Finite),
25188
25252
  top_p: optional$2(Finite),
25189
25253
  user: optional$2(String$7),
@@ -25220,8 +25284,8 @@ const CreateResponse = Struct({
25220
25284
  ]))
25221
25285
  })),
25222
25286
  background: optional$2(Boolean$4),
25223
- max_output_tokens: optional$2(Int$1),
25224
- max_tool_calls: optional$2(Int$1),
25287
+ max_output_tokens: optional$2(Int$5),
25288
+ max_tool_calls: optional$2(Int$5),
25225
25289
  text: optional$2(Struct({
25226
25290
  format: optional$2(TextResponseFormatConfiguration),
25227
25291
  verbosity: optional$2(Literals$2([
@@ -25240,12 +25304,12 @@ const CreateResponse = Struct({
25240
25304
  stream: optional$2(Boolean$4),
25241
25305
  conversation: optional$2(String$7),
25242
25306
  modalities: optional$2(ArraySchema(Literals$2(["text", "audio"]))),
25243
- seed: optional$2(Int$1)
25307
+ seed: optional$2(Int$5)
25244
25308
  });
25245
25309
  const ResponseUsage = StructWithRest(Struct({
25246
- input_tokens: Int$1,
25247
- output_tokens: Int$1,
25248
- total_tokens: Int$1,
25310
+ input_tokens: Int$5,
25311
+ output_tokens: Int$5,
25312
+ total_tokens: Int$5,
25249
25313
  input_tokens_details: optionalKey(Unknown),
25250
25314
  output_tokens_details: optionalKey(Unknown)
25251
25315
  }), [UnknownRecord]);
@@ -25359,8 +25423,8 @@ const PromptCacheDiagnostics = Union([
25359
25423
  "input_changed",
25360
25424
  "service_tier_changed"
25361
25425
  ]),
25362
- cache_missed_tokens: Int$1,
25363
- comparison_reusable_tokens: optionalKey(Int$1)
25426
+ cache_missed_tokens: Int$5,
25427
+ comparison_reusable_tokens: optionalKey(Int$5)
25364
25428
  }),
25365
25429
  Struct({ type: Literal("cache_hit") }),
25366
25430
  Struct({ type: Literal("comparison_response_not_found") }),
@@ -25370,7 +25434,7 @@ const Response$1 = Struct({
25370
25434
  id: String$7,
25371
25435
  object: optionalKey(Literal("response")),
25372
25436
  model: String$7,
25373
- created_at: Int$1,
25437
+ created_at: Int$5,
25374
25438
  output: ArraySchema(OutputItem).pipe(withDecodingDefault(succeed$1([]))),
25375
25439
  usage: optionalKey(NullOr(ResponseUsage)),
25376
25440
  error: optionalKey(NullOr(ResponseError)),
@@ -25381,124 +25445,124 @@ const Response$1 = Struct({
25381
25445
  const ResponseCreatedEvent = Struct({
25382
25446
  type: Literal("response.created"),
25383
25447
  response: Response$1,
25384
- sequence_number: optionalKey(Int$1)
25448
+ sequence_number: optionalKey(Int$5)
25385
25449
  });
25386
25450
  const ResponseCompletedEvent = Struct({
25387
25451
  type: Literal("response.completed"),
25388
25452
  response: Response$1,
25389
- sequence_number: optionalKey(Int$1)
25453
+ sequence_number: optionalKey(Int$5)
25390
25454
  });
25391
25455
  const ResponseIncompleteEvent = Struct({
25392
25456
  type: Literal("response.incomplete"),
25393
25457
  response: Response$1,
25394
- sequence_number: optionalKey(Int$1)
25458
+ sequence_number: optionalKey(Int$5)
25395
25459
  });
25396
25460
  const ResponseFailedEvent = Struct({
25397
25461
  type: Literal("response.failed"),
25398
25462
  response: Response$1,
25399
- sequence_number: optionalKey(Int$1)
25463
+ sequence_number: optionalKey(Int$5)
25400
25464
  });
25401
25465
  const ResponseOutputItemAddedEvent = Struct({
25402
25466
  type: Literal("response.output_item.added"),
25403
- output_index: Int$1,
25404
- sequence_number: optionalKey(Int$1),
25467
+ output_index: Int$5,
25468
+ sequence_number: optionalKey(Int$5),
25405
25469
  item: OutputItem
25406
25470
  });
25407
25471
  const ResponseOutputItemDoneEvent = Struct({
25408
25472
  type: Literal("response.output_item.done"),
25409
- output_index: Int$1,
25410
- sequence_number: optionalKey(Int$1),
25473
+ output_index: Int$5,
25474
+ sequence_number: optionalKey(Int$5),
25411
25475
  item: OutputItem
25412
25476
  });
25413
25477
  const ResponseOutputTextDeltaEvent = Struct({
25414
25478
  type: Literal("response.output_text.delta"),
25415
25479
  item_id: String$7,
25416
- output_index: Int$1,
25417
- content_index: Int$1,
25480
+ output_index: Int$5,
25481
+ content_index: Int$5,
25418
25482
  delta: String$7,
25419
- sequence_number: optionalKey(Int$1),
25483
+ sequence_number: optionalKey(Int$5),
25420
25484
  logprobs: optionalKey(ArraySchema(Unknown))
25421
25485
  });
25422
25486
  const ResponseOutputTextAnnotationAddedEvent = Struct({
25423
25487
  type: Literal("response.output_text.annotation.added"),
25424
25488
  item_id: String$7,
25425
- output_index: Int$1,
25426
- content_index: Int$1,
25427
- annotation_index: Int$1,
25428
- sequence_number: optionalKey(Int$1),
25489
+ output_index: Int$5,
25490
+ content_index: Int$5,
25491
+ annotation_index: Int$5,
25492
+ sequence_number: optionalKey(Int$5),
25429
25493
  annotation: Annotation
25430
25494
  });
25431
25495
  const ResponseReasoningSummaryPartAddedEvent = Struct({
25432
25496
  type: Literal("response.reasoning_summary_part.added"),
25433
25497
  item_id: String$7,
25434
- output_index: Int$1,
25435
- summary_index: Int$1,
25436
- sequence_number: optionalKey(Int$1),
25498
+ output_index: Int$5,
25499
+ summary_index: Int$5,
25500
+ sequence_number: optionalKey(Int$5),
25437
25501
  part: SummaryTextContent
25438
25502
  });
25439
25503
  const ResponseReasoningSummaryPartDoneEvent = Struct({
25440
25504
  type: Literal("response.reasoning_summary_part.done"),
25441
25505
  item_id: String$7,
25442
- output_index: Int$1,
25443
- summary_index: Int$1,
25444
- sequence_number: optionalKey(Int$1),
25506
+ output_index: Int$5,
25507
+ summary_index: Int$5,
25508
+ sequence_number: optionalKey(Int$5),
25445
25509
  part: SummaryTextContent
25446
25510
  });
25447
25511
  const ResponseReasoningSummaryTextDeltaEvent = Struct({
25448
25512
  type: Literal("response.reasoning_summary_text.delta"),
25449
25513
  item_id: String$7,
25450
- output_index: Int$1,
25451
- summary_index: Int$1,
25514
+ output_index: Int$5,
25515
+ summary_index: Int$5,
25452
25516
  delta: String$7,
25453
- sequence_number: optionalKey(Int$1)
25517
+ sequence_number: optionalKey(Int$5)
25454
25518
  });
25455
25519
  const ResponseFunctionCallArgumentsDeltaEvent = Struct({
25456
25520
  type: Literal("response.function_call_arguments.delta"),
25457
25521
  item_id: String$7,
25458
- output_index: Int$1,
25459
- sequence_number: optionalKey(Int$1),
25522
+ output_index: Int$5,
25523
+ sequence_number: optionalKey(Int$5),
25460
25524
  delta: String$7
25461
25525
  });
25462
25526
  const ResponseFunctionCallArgumentsDoneEvent = Struct({
25463
25527
  type: Literal("response.function_call_arguments.done"),
25464
25528
  item_id: String$7,
25465
- output_index: Int$1,
25466
- sequence_number: optionalKey(Int$1),
25529
+ output_index: Int$5,
25530
+ sequence_number: optionalKey(Int$5),
25467
25531
  arguments: String$7
25468
25532
  });
25469
25533
  const ResponseCodeInterpreterCallCodeDeltaEvent = Struct({
25470
25534
  type: Literal("response.code_interpreter_call_code.delta"),
25471
25535
  item_id: String$7,
25472
- output_index: Int$1,
25473
- sequence_number: optionalKey(Int$1),
25536
+ output_index: Int$5,
25537
+ sequence_number: optionalKey(Int$5),
25474
25538
  delta: String$7
25475
25539
  });
25476
25540
  const ResponseCodeInterpreterCallCodeDoneEvent = Struct({
25477
25541
  type: Literal("response.code_interpreter_call_code.done"),
25478
25542
  item_id: String$7,
25479
- output_index: Int$1,
25480
- sequence_number: optionalKey(Int$1),
25543
+ output_index: Int$5,
25544
+ sequence_number: optionalKey(Int$5),
25481
25545
  code: String$7
25482
25546
  });
25483
25547
  const ResponseApplyPatchCallOperationDiffDeltaEvent = Struct({
25484
25548
  type: Literal("response.apply_patch_call_operation_diff.delta"),
25485
25549
  item_id: String$7,
25486
- output_index: Int$1,
25487
- sequence_number: optionalKey(Int$1),
25550
+ output_index: Int$5,
25551
+ sequence_number: optionalKey(Int$5),
25488
25552
  delta: String$7
25489
25553
  });
25490
25554
  const ResponseApplyPatchCallOperationDiffDoneEvent = Struct({
25491
25555
  type: Literal("response.apply_patch_call_operation_diff.done"),
25492
25556
  item_id: String$7,
25493
- output_index: Int$1,
25494
- sequence_number: optionalKey(Int$1),
25557
+ output_index: Int$5,
25558
+ sequence_number: optionalKey(Int$5),
25495
25559
  delta: optionalKey(String$7)
25496
25560
  });
25497
25561
  const ResponseImageGenerationCallPartialImageEvent = Struct({
25498
25562
  type: Literal("response.image_generation_call.partial_image"),
25499
25563
  item_id: String$7,
25500
- output_index: Int$1,
25501
- sequence_number: optionalKey(Int$1),
25564
+ output_index: Int$5,
25565
+ sequence_number: optionalKey(Int$5),
25502
25566
  partial_image_b64: String$7
25503
25567
  });
25504
25568
  const ResponseErrorEvent = Struct({
@@ -25506,8 +25570,8 @@ const ResponseErrorEvent = Struct({
25506
25570
  code: NullOr(String$7),
25507
25571
  message: String$7,
25508
25572
  param: NullOr(String$7),
25509
- sequence_number: optionalKey(Int$1),
25510
- status: optionalKey(Int$1)
25573
+ sequence_number: optionalKey(Int$5),
25574
+ status: optionalKey(Int$5)
25511
25575
  });
25512
25576
  const NestedResponseErrorEvent = Struct({
25513
25577
  type: Literal("error"),
@@ -25516,8 +25580,8 @@ const NestedResponseErrorEvent = Struct({
25516
25580
  message: String$7,
25517
25581
  param: NullOr(String$7)
25518
25582
  }),
25519
- sequence_number: optionalKey(Int$1),
25520
- status: optionalKey(Int$1)
25583
+ sequence_number: optionalKey(Int$5),
25584
+ status: optionalKey(Int$5)
25521
25585
  }).pipe(decodeTo$1(ResponseErrorEvent, transform$3({
25522
25586
  decode: ({ error, ...rest }) => ({
25523
25587
  ...rest,
@@ -25582,19 +25646,19 @@ const ResponseStreamEvent = Union([
25582
25646
  ]);
25583
25647
  const Embedding = Struct({
25584
25648
  embedding: Union([ArraySchema(Finite), String$7]),
25585
- index: Int$1,
25649
+ index: Int$5,
25586
25650
  object: optionalKey(String$7)
25587
25651
  });
25588
25652
  const CreateEmbeddingRequest = Struct({
25589
25653
  input: Union([
25590
25654
  String$7,
25591
25655
  ArraySchema(String$7),
25592
- ArraySchema(Int$1),
25593
- ArraySchema(ArraySchema(Int$1))
25656
+ ArraySchema(Int$5),
25657
+ ArraySchema(ArraySchema(Int$5))
25594
25658
  ]),
25595
25659
  model: String$7,
25596
25660
  encoding_format: optionalKey(Literals$2(["float", "base64"])),
25597
- dimensions: optionalKey(Int$1),
25661
+ dimensions: optionalKey(Int$5),
25598
25662
  user: optionalKey(String$7)
25599
25663
  });
25600
25664
  const CreateEmbeddingResponse = Struct({
@@ -25602,8 +25666,8 @@ const CreateEmbeddingResponse = Struct({
25602
25666
  model: String$7,
25603
25667
  object: optionalKey(Literal("list")),
25604
25668
  usage: optionalKey(Struct({
25605
- prompt_tokens: Int$1,
25606
- total_tokens: Int$1
25669
+ prompt_tokens: Int$5,
25670
+ total_tokens: Int$5
25607
25671
  }))
25608
25672
  });
25609
25673
  const DecisionQuestion = Union([
@@ -25667,7 +25731,7 @@ const DecisionAnswer = Union([
25667
25731
  name: String$7,
25668
25732
  score: Number$2,
25669
25733
  probabilities: ArraySchema(Struct({
25670
- value: Int$1,
25734
+ value: Int$5,
25671
25735
  label: String$7,
25672
25736
  probability: Number$2
25673
25737
  })),
@@ -25681,8 +25745,8 @@ const DecisionAnswer = Union([
25681
25745
  const CreateDecisionsResponse = Struct({
25682
25746
  answers: ArraySchema(DecisionAnswer),
25683
25747
  usage: optionalKey(Struct({
25684
- input_tokens: optionalKey(Int$1),
25685
- output_tokens: optionalKey(Int$1)
25748
+ input_tokens: optionalKey(Int$5),
25749
+ output_tokens: optionalKey(Int$5)
25686
25750
  }))
25687
25751
  });
25688
25752
  // node_modules/.pnpm/@effect+ai-openai@4.1.1_effect@4.1.1/node_modules/@effect/ai-openai/dist/OpenAiClient.js
@@ -25846,7 +25910,7 @@ const makeSocket = gen(function* () {
25846
25910
  });
25847
25911
  const ErrorEvent = Struct({
25848
25912
  type: Literal("error").pipe(withDecodingDefault(succeed$1("error"))),
25849
- status: optionalKey(Int$1),
25913
+ status: optionalKey(Int$5),
25850
25914
  error: Struct({
25851
25915
  type: optional$2(String$7),
25852
25916
  code: optional$2(String$7),
@@ -28174,7 +28238,7 @@ const transformToolCallParams$1 = fnUntraced(function* (options, toolName, toolP
28174
28238
  return yield* decodeEffect(codec)(toolParams).pipe(flatMap$1((decoded) => encodeUnknownEffect(tool.parametersSchema)(decoded)), orElseSucceed(() => toolParams));
28175
28239
  });
28176
28240
  // package.json
28177
- var version$1 = "0.17.3";
28241
+ var version$1 = "0.18.1";
28178
28242
  // src/ClaudeAgent.ts
28179
28243
  const minimumClaudeCodeVersion = "2.1.248";
28180
28244
  const serverName = "clanka";
@@ -28590,6 +28654,7 @@ const compareVersions = (a, b) => {
28590
28654
  }
28591
28655
  return 0;
28592
28656
  };
28657
+ const toolNames = (provider) => provider.tools.map((tool) => tool.name).join(",");
28593
28658
  const closeSession = (session) => suspend(() => {
28594
28659
  session.bridge.cancel();
28595
28660
  session.query.close();
@@ -28633,7 +28698,7 @@ const startSession = fnUntraced(function* (model, options, provider, withTools)
28633
28698
  bridge,
28634
28699
  messages,
28635
28700
  scope,
28636
- toolNames: provider.tools.map((tool) => tool.name).join(","),
28701
+ toolNames: toolNames(provider),
28637
28702
  seen: provider.prompt.content,
28638
28703
  outcome: void 0
28639
28704
  };
@@ -28672,7 +28737,7 @@ const continuation = (session, provider) => {
28672
28737
  const messages = provider.prompt.content;
28673
28738
  const seen = session.seen;
28674
28739
  const response = messages[seen.length];
28675
- if (outcome === void 0 || session.toolNames !== provider.tools.map((tool) => tool.name).join(",") || response?.role !== "assistant" || !seen.every((message, i) => messages[i] === message) || !isDeepStrictEqual(appended(response), emitted(outcome))) return;
28740
+ if (outcome === void 0 || session.toolNames !== toolNames(provider) || response?.role !== "assistant" || !seen.every((message, i) => messages[i] === message) || !isDeepStrictEqual(appended(response), emitted(outcome))) return;
28676
28741
  const [toolMessages, users] = span(messages.slice(seen.length + 1), (message) => message.role === "tool");
28677
28742
  const results = new Map(toolMessages.flatMap((message) => message.content.flatMap((part) => part.type === "tool-result" ? [[part.id, part]] : [])));
28678
28743
  const ids = outcome.calls.map((call) => call.id);
@@ -28683,6 +28748,14 @@ const continuation = (session, provider) => {
28683
28748
  users
28684
28749
  };
28685
28750
  };
28751
+ const restartReason = (session, provider) => session === void 0 || session.outcome === void 0 ? "step-abandoned" : session.toolNames !== toolNames(provider) ? "tools-changed" : "history-changed";
28752
+ const reportRestart = (step, reason) => map$11(step, (part) => part.type === "finish" ? {
28753
+ ...part,
28754
+ metadata: {
28755
+ ...part.metadata,
28756
+ clanka: { historyResent: { reason } }
28757
+ }
28758
+ } : part);
28686
28759
  const continueSession = (session, plan) => {
28687
28760
  const results = plan.ids.map((id) => toolResult(plan.results.get(id)));
28688
28761
  const last = results.at(-1);
@@ -28704,7 +28777,7 @@ const toolResults = (message) => typeof message.message.content === "string" ? [
28704
28777
  text: typeof block.content === "string" ? block.content : (block.content ?? []).flatMap((part) => part.type === "text" ? [part.text] : []).join("\n")
28705
28778
  }] : []);
28706
28779
  const isToolUseError = (text) => text.trimStart().startsWith("<tool_use_error>");
28707
- const readStep = (session, onAbandon) => suspend$2(() => {
28780
+ const readStep = (session, onAbandon) => suspend$3(() => {
28708
28781
  const convert = makeConverter();
28709
28782
  const calls = [];
28710
28783
  const parked = new Set();
@@ -28779,7 +28852,8 @@ const layerLanguageModel = (model, options) => effect(LanguageModel, gen(functio
28779
28852
  });
28780
28853
  yield* addFinalizer(() => closeCurrent);
28781
28854
  let reading = false;
28782
- const step = (provider) => suspend$2(() => {
28855
+ let started = false;
28856
+ const step = (provider) => suspend$3(() => {
28783
28857
  if (reading) return fail$6(unknownError("This Claude Agent model is already reading a step. Every agent needs its own model instance."));
28784
28858
  reading = true;
28785
28859
  return unwrap$6(gen(function* () {
@@ -28790,9 +28864,12 @@ const layerLanguageModel = (model, options) => effect(LanguageModel, gen(functio
28790
28864
  current.outcome = void 0;
28791
28865
  return readStep(current, closeCurrent);
28792
28866
  }
28867
+ const reason = started ? restartReason(current, provider) : void 0;
28793
28868
  yield* closeCurrent;
28794
28869
  current = yield* startSession(model, options, provider, true);
28795
- return readStep(current, closeCurrent);
28870
+ started = true;
28871
+ const read = readStep(current, closeCurrent);
28872
+ return reason === void 0 ? read : reportRestart(read, reason);
28796
28873
  })).pipe(ensuring$1(sync(() => {
28797
28874
  reading = false;
28798
28875
  })));
@@ -28834,7 +28911,10 @@ const toParts = (parts) => {
28834
28911
  }
28835
28912
  return result;
28836
28913
  };
28837
- const model$3 = (model, options) => make$19("claude", model, merge$2(layerLanguageModel(model, options), AgentModelConfig.layer({ supportsImages: options?.supportsImages })));
28914
+ const model$3 = (model, options) => make$19("claude", model, merge$2(layerLanguageModel(model, options), AgentModelConfig.layer({
28915
+ supportsImages: options?.supportsImages,
28916
+ cutStreamOnSteering: false
28917
+ })));
28838
28918
  // src/DeviceCodeHandler.ts
28839
28919
  var DeviceCodeHandler = class extends Service()("clanka/DeviceCodeHandler") {};
28840
28920
  const layerConsole = succeed$4(DeviceCodeHandler, { onCode: (options) => log(`Open ${options.verifyUrl} and enter code ${options.deviceCode}.`) });
@@ -29072,14 +29152,11 @@ var CodexAuth = class CodexAuth extends Service()("clanka/CodexAuth") {
29072
29152
  const layerClient$2 = layer$4({ apiUrl: "https://chatgpt.com/backend-api/codex" }).pipe(provide$3(CodexAuth.layerClient));
29073
29153
  const model$2 = (model, options) => make$19("openai", model, layerModel(model, options));
29074
29154
  const modelWebSocket$1 = (model, options) => make$19("openai", model, layerModel(model, options).pipe(merge$2(fresh(layerWebSocketMode))));
29075
- const layerModel = (model, options) => layer$2({
29155
+ const layerModel = (model, options) => suspend$1(() => layer$2({
29076
29156
  model,
29077
29157
  config: {
29078
- ...omit(options ?? {}, [
29079
- "reasoning",
29080
- "systemPromptTransform",
29081
- "supportsImages"
29082
- ]),
29158
+ ...omit(options ?? {}, ["reasoning", ...AgentModelConfig.optionKeys]),
29159
+ prompt_cache_key: options?.prompt_cache_key ?? crypto.randomUUID(),
29083
29160
  store: false,
29084
29161
  reasoning: options?.reasoning === null ? void 0 : {
29085
29162
  effort: "medium",
@@ -29087,9 +29164,9 @@ const layerModel = (model, options) => layer$2({
29087
29164
  ...options?.reasoning
29088
29165
  }
29089
29166
  }
29090
- }).pipe(merge$2(AgentModelConfig.layer({
29091
- systemPromptTransform: (system, effect) => withConfigOverride$1(effect, { instructions: system }),
29092
- supportsImages: options?.supportsImages
29167
+ })).pipe(merge$2(AgentModelConfig.layer({
29168
+ ...pick(options ?? {}, AgentModelConfig.optionKeys),
29169
+ systemPromptTransform: (system, effect) => withConfigOverride$1(effect, { instructions: system })
29093
29170
  })));
29094
29171
  // node_modules/.pnpm/@effect+ai-openai-compat@4.1.1_effect@4.1.1/node_modules/@effect/ai-openai-compat/dist/internal/errors.js
29095
29172
  const OpenAiErrorBody = Struct({ error: Struct({
@@ -29308,7 +29385,7 @@ const make$2 = fnUntraced(function* (options) {
29308
29385
  const layer$1 = (options) => effect(OpenAiClient, make$2(options));
29309
29386
  const EmbeddingSchema = Struct({
29310
29387
  embedding: Union([ArraySchema(Finite), String$7]),
29311
- index: Int$1,
29388
+ index: Int$5,
29312
29389
  object: optionalKey(String$7)
29313
29390
  });
29314
29391
  const CreateEmbeddingResponseSchema = Struct({
@@ -29316,8 +29393,8 @@ const CreateEmbeddingResponseSchema = Struct({
29316
29393
  model: String$7,
29317
29394
  object: optionalKey(Literal("list")),
29318
29395
  usage: optionalKey(Struct({
29319
- prompt_tokens: Int$1,
29320
- total_tokens: Int$1
29396
+ prompt_tokens: Int$5,
29397
+ total_tokens: Int$5
29321
29398
  }))
29322
29399
  });
29323
29400
  const ChatCompletionToolFunction = Struct({
@@ -29330,14 +29407,14 @@ const ChatCompletionToolFunctionDelta = Struct({
29330
29407
  });
29331
29408
  const ChatCompletionToolCall = Struct({
29332
29409
  id: optionalKey(String$7),
29333
- index: optionalKey(Int$1),
29410
+ index: optionalKey(Int$5),
29334
29411
  type: optionalKey(String$7),
29335
29412
  extra_content: optionalKey(NullOr(JsonObject$1)),
29336
29413
  function: optionalKey(ChatCompletionToolFunction)
29337
29414
  });
29338
29415
  const ChatCompletionToolCallDelta = Struct({
29339
29416
  id: optionalKey(NullOr(String$7)),
29340
- index: optionalKey(Int$1),
29417
+ index: optionalKey(Int$5),
29341
29418
  type: optionalKey(String$7),
29342
29419
  extra_content: optionalKey(NullOr(JsonObject$1)),
29343
29420
  function: optionalKey(ChatCompletionToolFunctionDelta)
@@ -29357,22 +29434,22 @@ const ChatCompletionDelta = Struct({
29357
29434
  tool_calls: optionalKey(NullOr(ArraySchema(ChatCompletionToolCallDelta)))
29358
29435
  });
29359
29436
  const ChatCompletionChoice = Struct({
29360
- index: Int$1,
29437
+ index: Int$5,
29361
29438
  finish_reason: optionalKey(NullOr(String$7)),
29362
29439
  message: optionalKey(ChatCompletionMessage),
29363
29440
  delta: optionalKey(ChatCompletionDelta)
29364
29441
  });
29365
29442
  const ChatCompletionUsage = Struct({
29366
- prompt_tokens: Int$1,
29367
- completion_tokens: Int$1,
29368
- total_tokens: Int$1,
29443
+ prompt_tokens: Int$5,
29444
+ completion_tokens: Int$5,
29445
+ total_tokens: Int$5,
29369
29446
  prompt_tokens_details: optionalKey(Any),
29370
29447
  completion_tokens_details: optionalKey(Any)
29371
29448
  });
29372
29449
  const ChatCompletionResponse = Struct({
29373
29450
  id: String$7,
29374
29451
  model: String$7,
29375
- created: Int$1,
29452
+ created: Int$5,
29376
29453
  choices: ArraySchema(ChatCompletionChoice),
29377
29454
  usage: optionalKey(NullOr(ChatCompletionUsage)),
29378
29455
  service_tier: optionalKey(String$7)
@@ -29380,7 +29457,7 @@ const ChatCompletionResponse = Struct({
29380
29457
  const ChatCompletionChunk = Struct({
29381
29458
  id: String$7,
29382
29459
  model: String$7,
29383
- created: Int$1,
29460
+ created: Int$5,
29384
29461
  choices: ArraySchema(ChatCompletionChoice),
29385
29462
  usage: optionalKey(NullOr(ChatCompletionUsage)),
29386
29463
  service_tier: optionalKey(String$7)
@@ -30412,15 +30489,8 @@ var GithubCopilotAuth = class GithubCopilotAuth extends Service()("clanka/Github
30412
30489
  const layerClient$1 = layer$1({ apiUrl: API_URL }).pipe(provide$3(GithubCopilotAuth.layerClient));
30413
30490
  const model$1 = (model, options) => make$19("openai", model, mergeAll(layer({
30414
30491
  model,
30415
- config: omit(options ?? {}, options?.reasoning === null ? [
30416
- "reasoning",
30417
- "systemPromptTransform",
30418
- "supportsImages"
30419
- ] : ["systemPromptTransform", "supportsImages"])
30420
- }), AgentModelConfig.layer({
30421
- systemPromptTransform: options?.systemPromptTransform,
30422
- supportsImages: options?.supportsImages
30423
- }), succeed$4(SummarizerTransform, (effect) => withConfigOverride(effect, { max_output_tokens: summarizerMaxOutputTokens }))));
30492
+ config: omit(options ?? {}, options?.reasoning === null ? ["reasoning", ...AgentModelConfig.optionKeys] : AgentModelConfig.optionKeys)
30493
+ }), AgentModelConfig.layer(pick(options ?? {}, AgentModelConfig.optionKeys)), succeed$4(SummarizerTransform, (effect) => withConfigOverride(effect, { max_output_tokens: summarizerMaxOutputTokens }))));
30424
30494
  // src/ModelsRepo.ts
30425
30495
  const Provider = Literals$2([
30426
30496
  "openai",
@@ -30696,11 +30766,7 @@ const layerClient = layer$4({ apiUrl: "https://api.x.ai/v1" }).pipe(provide$3(Xa
30696
30766
  const modelWebSocket = (model, options) => make$19("xai", model, mergeAll(layer$2({
30697
30767
  model,
30698
30768
  config: {
30699
- ...omit(options ?? {}, [
30700
- "reasoning",
30701
- "systemPromptTransform",
30702
- "supportsImages"
30703
- ]),
30769
+ ...omit(options ?? {}, ["reasoning", ...AgentModelConfig.optionKeys]),
30704
30770
  store: true,
30705
30771
  useItemReferences: false,
30706
30772
  reasoning: options?.reasoning === null ? void 0 : {
@@ -30708,26 +30774,27 @@ const modelWebSocket = (model, options) => make$19("xai", model, mergeAll(layer$
30708
30774
  ...options?.reasoning
30709
30775
  }
30710
30776
  }
30711
- }), AgentModelConfig.layer({
30712
- systemPromptTransform: options?.systemPromptTransform,
30713
- supportsImages: options?.supportsImages
30714
- }), succeed$4(SummarizerTransform, (effect) => withConfigOverride$1(effect, { max_output_tokens: summarizerMaxOutputTokens })), fresh(layerWebSocketMode)));
30777
+ }), AgentModelConfig.layer(pick(options ?? {}, AgentModelConfig.optionKeys)), succeed$4(SummarizerTransform, (effect) => withConfigOverride$1(effect, { max_output_tokens: summarizerMaxOutputTokens })), fresh(layerWebSocketMode)));
30715
30778
  // src/ModelLayer.ts
30716
- const withSubagentModel = (model) => merge$2(model, layerSubagentModel(model));
30717
30779
  const supportsFastMode = (provider) => provider === "openai";
30718
- const make = (provider, model, effort, openai, fastMode = false) => {
30780
+ const languageModel = (provider, model, effort, openai, fastMode) => {
30719
30781
  const options = effort === void 0 ? void 0 : { reasoning: effort === null ? null : { effort } };
30720
30782
  const openaiOptions = fastMode ? {
30721
30783
  ...options,
30722
30784
  service_tier: "priority"
30723
30785
  } : options;
30724
30786
  switch (provider) {
30725
- case "openai": return openai.apiKey !== void 0 ? withSubagentModel(model$2(model, openaiOptions)).pipe(provide$3(layer$4(openai))) : withSubagentModel(modelWebSocket$1(model, openaiOptions)).pipe(provide$3(layerClient$2));
30726
- case "xai": return withSubagentModel(modelWebSocket(model, options)).pipe(provide$3(layerClient));
30727
- case "claude": return withSubagentModel(model$3(model, { effort }));
30728
- case "copilot": return withSubagentModel(model$1(model, options)).pipe(provide$3(layerClient$1));
30787
+ case "openai": return openai.apiKey !== void 0 ? model$2(model, openaiOptions).pipe(provide$3(layer$4(openai))) : modelWebSocket$1(model, openaiOptions).pipe(provide$3(layerClient$2));
30788
+ case "xai": return modelWebSocket(model, options).pipe(provide$3(layerClient));
30789
+ case "claude": return model$3(model, { effort });
30790
+ case "copilot": return model$1(model, options).pipe(provide$3(layerClient$1));
30729
30791
  }
30730
30792
  };
30793
+ const make = (provider, model, effort, openai, fastMode = false, auxiliary) => {
30794
+ const fromSpec = (spec) => languageModel(spec.provider, spec.model, spec.effort, openai, fastMode);
30795
+ const main = languageModel(provider, model, effort, openai, fastMode);
30796
+ return mergeAll(main, layerSubagentModel(auxiliary?.subagent === void 0 ? main : fromSpec(auxiliary.subagent)), auxiliary?.summarizer === void 0 ? empty$7 : layerSummarizerModel(fromSpec(auxiliary.summarizer)));
30797
+ };
30731
30798
  const isProvider$1 = is(Provider);
30732
30799
  const parseAcpModelId = (modelId) => {
30733
30800
  const [provider, model, ...rest] = modelId.split(":");
@@ -30750,7 +30817,7 @@ const resolveEffort = (efforts, thoughtLevel) => {
30750
30817
  };
30751
30818
  const makeAcp = (options) => (modelId, thoughtLevel, fastMode = false) => map$8(parseAcpModelId(modelId), ({ provider, model }) => unwrap$3(map$5(options.models, (catalog) => {
30752
30819
  const info = catalog.find((entry) => entry.provider === provider && entry.id === model);
30753
- return make(provider, model, info === void 0 ? thoughtLevel : resolveEffort(info.efforts, thoughtLevel), options.openai, fastMode);
30820
+ return make(provider, model, info === void 0 ? thoughtLevel : resolveEffort(info.efforts, thoughtLevel), options.openai, fastMode, options.auxiliary);
30754
30821
  })));
30755
30822
  // node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Logger.js
30756
30823
  const LogToStderr = LogToStderr$1;
@@ -30806,6 +30873,28 @@ const parseModelId = (modelId) => {
30806
30873
  }) : none();
30807
30874
  };
30808
30875
  const ModelId = String$7.pipe(check(makeFilter$1((modelId) => isSome(parseModelId(modelId)) || `Invalid model "${modelId}", expected <provider>/<model>[/<effort>] with effort one of ${ThoughtLevel.literals.join(", ")}`)));
30876
+ const auxiliaryModel = (options) => String$1(options.name).pipe(withDescription$1(`${options.description} As <provider>/<model>[/<effort>], e.g. openai/gpt-6-astra/low; also ${options.env}.`), withFallbackConfig(String$4(options.env)), withSchema(ModelId), map$1((modelId) => {
30877
+ const [provider, model, effort] = modelId.split("/");
30878
+ return {
30879
+ provider,
30880
+ model,
30881
+ effort
30882
+ };
30883
+ }), optional);
30884
+ const subagentModel = auxiliaryModel({
30885
+ name: "subagent-model",
30886
+ env: "CLANKA_SUBAGENT_MODEL",
30887
+ description: "Run sub-agents on this model instead of the agent's model."
30888
+ });
30889
+ const summarizerModel = auxiliaryModel({
30890
+ name: "summarizer-model",
30891
+ env: "CLANKA_SUMMARIZER_MODEL",
30892
+ description: "Summarize the history for compaction with this model instead of the agent's model."
30893
+ });
30894
+ const auxiliaryModels = (flags) => ({
30895
+ subagent: getOrUndefined(flags.subagentModel),
30896
+ summarizer: getOrUndefined(flags.summarizerModel)
30897
+ });
30809
30898
  const provider = Literals("provider", providers).pipe(withAlias("p"), withFallbackPrompt(Select({
30810
30899
  message: "Select a provider",
30811
30900
  choices: [
@@ -30835,6 +30924,18 @@ const fast = Boolean("fast").pipe(withDescription$1("Use OpenAI fast mode (the p
30835
30924
  const semantic = Directory("search").pipe(withDescription$1("Directory for semantic search data (uses OPENAI_API_KEY env var)"), withAlias("s"), optional);
30836
30925
  const prompt = String$1("prompt").pipe(withDescription$1("Pass a prompt in non-interactive mode"), optional);
30837
30926
  const compaction = Boolean("compaction").pipe(withDescription$1("Auto-compact the conversation history when it nears the context window. Disable with --no-compaction or CLANKA_COMPACTION=false; the execute output cap stays on."), withFallbackConfig(Boolean$3("CLANKA_COMPACTION").pipe(withDefault$2(true))));
30927
+ const NonNegativeInt = Int$5.pipe(check(isGreaterThanOrEqualTo(0)));
30928
+ const tokens = (options) => Int(options.name).pipe(withDescription$1(`${options.description} Defaults to ${options.env} or ${options.defaultValue}.`), withFallbackConfig(Int$3(options.env).pipe(withDefault$2(options.defaultValue))), withSchema(NonNegativeInt));
30929
+ const compactionThreshold = tokens({
30930
+ name: "compaction-threshold",
30931
+ env: "CLANKA_COMPACTION_THRESHOLD",
30932
+ description: "Compact once the context exceeds this many tokens, or the context window minus its reserve when that is lower.",
30933
+ defaultValue: defaultConfig.thresholdTokens
30934
+ });
30935
+ const compactionConfig = (flags) => CompactionConfig.layer({
30936
+ enabled: flags.compaction,
30937
+ thresholdTokens: flags.compactionThreshold
30938
+ });
30838
30939
  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))));
30839
30940
  const mcpConfig = String$1("mcp-config").pipe(withDescription$1("An MCP config file in the { \"mcpServers\": { ... } } format. Repeatable; a later file wins."), atLeast(0));
30840
30941
  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(", ")}`;
@@ -30850,7 +30951,7 @@ const Search = (directory) => unwrap$3(gen(function* () {
30850
30951
  return empty$7;
30851
30952
  }
30852
30953
  const path = yield* Path$3;
30853
- return (yield* promise(() => import("./SemanticSearch-BiwCnpKX.mjs"))).layer({
30954
+ return (yield* promise(() => import("./SemanticSearch-CH125AHH.mjs"))).layer({
30854
30955
  directory: process.cwd(),
30855
30956
  database: path.join(directory, "search.sqlite")
30856
30957
  }).pipe(provide$3(model$4("text-embedding-3-small", { dimensions: 1536 })), provide$3(layer$4({ apiKey: apiKey.value })));
@@ -30863,9 +30964,12 @@ const acp = make$27("acp", {
30863
30964
  trustAllTools,
30864
30965
  fast,
30865
30966
  compaction,
30967
+ compactionThreshold,
30968
+ subagentModel,
30969
+ summarizerModel,
30866
30970
  apiKey,
30867
30971
  apiUrl
30868
- }).pipe(withDescription("Run as an Agent Client Protocol (ACP) server over stdio"), withHandler(({ model, fast, apiKey, apiUrl }) => gen(function* () {
30972
+ }).pipe(withDescription("Run as an Agent Client Protocol (ACP) server over stdio"), withHandler(({ model, fast, apiKey, apiUrl, ...flags }) => gen(function* () {
30869
30973
  const repo = yield* ModelsRepo;
30870
30974
  const defaultThoughtLevel = yield* reasoning;
30871
30975
  return yield* runStdio({
@@ -30881,10 +30985,11 @@ const acp = make$27("acp", {
30881
30985
  openai: {
30882
30986
  apiKey: getOrUndefined(apiKey),
30883
30987
  apiUrl: getOrUndefined(apiUrl)
30884
- }
30988
+ },
30989
+ auxiliary: auxiliaryModels(flags)
30885
30990
  })
30886
30991
  });
30887
- })), provide(({ compaction }) => mergeAll(ConversationMode.layer(false), succeed$4(LogToStderr, true), layerLog, CompactionConfig.layer({ enabled: compaction }))));
30992
+ })), provide((flags) => mergeAll(ConversationMode.layer(false), succeed$4(LogToStderr, true), layerLog, compactionConfig(flags))));
30888
30993
  make$27("clanka", {
30889
30994
  provider,
30890
30995
  model,
@@ -30892,18 +30997,21 @@ make$27("clanka", {
30892
30997
  semantic,
30893
30998
  prompt,
30894
30999
  compaction,
31000
+ compactionThreshold,
31001
+ subagentModel,
31002
+ summarizerModel,
30895
31003
  apiKey,
30896
31004
  apiUrl,
30897
31005
  mcp,
30898
31006
  mcpConfig
30899
- }).pipe(withHandler(fnUntraced(function* ({ provider, model: modelRaw, fast, semantic, prompt: nonInteractivePrompt, apiKey, apiUrl, mcp, mcpConfig }) {
31007
+ }).pipe(withHandler(fnUntraced(function* ({ provider, model: modelRaw, fast, semantic, prompt: nonInteractivePrompt, apiKey, apiUrl, mcp, mcpConfig, ...flags }) {
30900
31008
  const stdio = yield* Stdio;
30901
31009
  const mcpServers = yield* load({
30902
31010
  cwd: process.cwd(),
30903
31011
  files: mcpConfig,
30904
31012
  enabled: mcp
30905
31013
  });
30906
- const OutputFormatter = yield* promise(() => import("./OutputFormatter-DXej05JW.mjs"));
31014
+ const OutputFormatter = yield* promise(() => import("./OutputFormatter-Dqxyk2qD.mjs"));
30907
31015
  const { model, effort } = yield* match$2(modelRaw, {
30908
31016
  onSome: (selected) => {
30909
31017
  const [model, effort] = selected.split("/");
@@ -30917,7 +31025,7 @@ make$27("clanka", {
30917
31025
  const Model = make(provider, model, effort, {
30918
31026
  apiKey: getOrUndefined(apiKey),
30919
31027
  apiUrl: getOrUndefined(apiUrl)
30920
- }, fast);
31028
+ }, fast, auxiliaryModels(flags));
30921
31029
  return yield* gen(function* () {
30922
31030
  const agent = yield* Agent;
30923
31031
  if (isSome(nonInteractivePrompt)) return yield* pipe(agent.send({ prompt: nonInteractivePrompt.value }), unwrap$6, OutputFormatter.pretty(), run$4(stdio.stdout()));
@@ -30934,7 +31042,7 @@ make$27("clanka", {
30934
31042
  onNone: () => empty$7,
30935
31043
  onSome: Search
30936
31044
  })), provideMerge(layer$6(mcpServers))), Model]));
30937
- })), provide(({ prompt, compaction }) => mergeAll(ConversationMode.layer(isNone(prompt)), CompactionConfig.layer({ enabled: compaction }))), withSubcommands([acp]), withGlobalFlags([ReportedVersion]), run$1({ version }), provide$1([
31045
+ })), provide(({ prompt, ...flags }) => mergeAll(ConversationMode.layer(isNone(prompt)), compactionConfig(flags))), withSubcommands([acp]), withGlobalFlags([ReportedVersion]), run$1({ version }), provide$1([
30938
31046
  layer$9,
30939
31047
  ModelsRepo.layerModelsDev().pipe(provideMerge([Kvs, HttpClientLive])),
30940
31048
  layerWebSocketConstructor,