clanka 0.7.5 → 0.7.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bin/cli.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env -S node --optimize-for-size
2
2
  import { $ as isEffect, $a as getOrUndefined, $n as effect, $t as uninterruptibleMask, A as ensuring, Aa as Reference, Ai as decodeBase64$1, An as StackTrace, Ar as isDoneUnsafe, As as identity, At as result, B as fnUntraced, Ba as makeUnsafe$3, Bi as appendAll, Bn as hasInterruptsOnly, Br as void_$1, Bt as sleep, C as catch_, Ca as minutes, Cs as constFalse, Ct as promise, Da as toMillis, Dn as Done, Dt as raceFirst, E as contextWith, Ea as seconds, En as nextBetween, Er as doneUnsafe, Es as constVoid, Et as provideService, F as filterOrFail, Fa as getOption, Fi as TaggedClass, Fn as fail$4, Fo as BaseProto, Fr as interrupt$1, Fs as pipeArguments, G as forkIn, Ga as flatMap$2, Gn as isTimeoutError, Go as symbolRedactable, Gt as tap, H as forEach$2, Ha as all, Hi as findFirst, Hr as ConsoleRef, Ht as succeedNone, I as flatMap$1, Ia as getOrUndefined$1, Ii as TaggedError, In as filterInterruptors, Io as Class, It as scope, Ji as isArrayNonEmpty, Jo as symbol$1, Jt as timeoutOrElse, K as forkScoped, Ka as flatMapNullishOr, Ki as fromIterable$1, Kt as tapCause, L as flatMapEager, La as getOrUndefinedUnsafe, Li as taggedEnum, Lo as NodeInspectSymbol, Lr as isFailure$1, Lt as scoped, M as fail$2, Ma as add, Mi as encodeBase64, Mn as UnknownError$1, Mo as assignProperty, Mr as die$1, Mt as runFork, N as failCause, Na as empty$7, No as getStackTraceLimit, Nr as fail$3, Ns as pipe, Nt as runForkWith, O as die, Oi as DisablePropagation, Or as into, Os as dual, Ot as repeat, Pa as get$3, Pi as Error$2, Pn as done, Po as setStackTraceLimit, Pr as failCause$1, Pt as runSync, Q as interruptible, Qa as getOrNull, Qi as last$1, Qn as buildWithScope, Qt as uninterruptible, Ra as getUnsafe, Ri as Array$1, Ro as toJson, Rr as isSuccess$1, S as catchTags, Sa as millis, So as Prototype, Sr as MinimumLogLevel, Ss as or, St as orElseSucceed, T as context, Tn as Random$1, To as PipeInspectableProto, Ts as constUndefined, Tt as provideContext, U as forever, Ua as exists, Ui as findFirstIndex, Ur as LogToStderr$1, Ut as suspend, Va as merge$2, Vi as empty$6, Vn as interruptors, Vt as succeed$2, W as forkChild, Wa as filter$1, Wi as findLast, Wo as redact$1, Wt as sync, X as ignore, Xa as fromUndefinedOr, Xi as isReadonlyArrayNonEmpty, Xn as pretty, Xt as try_, Y as gen, Ya as fromNullishOr, Yi as isCanonicalArrayIndex, Yt as tryPromise, Z as interrupt, Za as getOrElse, Zi as join$1, Zn as squash, Zo as hash, Zt as undefined_, _ as catchFilter, _a as fromInputUnsafe$1, _n as min, _t as onExit, a as andThen, aa as empty$8, an as whileLoop, ao as match$2, ar as mergeAll, at as makeSpanScoped, b as catchReason, ba as isFinite, bn as catchDone, br as provide$2, bs as isUndefined, bt as option$1, c as as, ca as failVoid, cn as withParentSpan, co as orElseSome, cr as provide$3, ct as mapEager, d as cached, da as isFailure, dn as zipWith, dr as succeedContext, ds as isNotUndefined, dt as match$4, ea as map$6, en as updateContext, eo as isNone, er as effectContext, es as structure, et as logDebug, f as cachedWithTTL, fa as isSuccess, fr as unwrap$1, fs as isNull, g as catchEager, ga as format$1, gn as jittered, gr as close, gt as onError, h as catchDefect, ha as try_$1, hn as isSchedule, hr as addFinalizerExit, hs as isObject, ht as never, i as all$1, io as map$7, ir as merge$3, it as logWarning, j as exit, ja as Service, ji as decodeBase64UrlString, jn as TimeoutError, jo as withFiber$1, jr as makeUnsafe$2, js as memoize, jt as retry, k as effectify, ka as zero, ki as ParentSpan, kr as isDone, ks as flow, kt as request, l as asSome, ln as withSpan$1, lo as some, lr as provideMerge, ls as isNotNull, lt as mapError, m as catchCause, ma as succeed$1, mn as exponential, mr as addFinalizer$1, mt as matchEffect, na as of, nn as useSpan, no as isSome, nr as empty$9, ns as hasProperty, nt as logFatal, o as annotateCurrentSpan, oa as headUnsafe, on as withFiber, oo as none, or as mock, ot as map$5, p as callback, pn as TaggedClass$1, pr as Scope, ps as isNullish, pt as matchCauseEffect, q as fromOption, qi as headNonEmpty, qo as equals, qt as timeout, r as addFinalizer, ra as reduce, rn as void_, rr as fresh, rt as logInfo, s as annotateLogs, sa as fail$1, so as orElse$1, sr as orDie$1, ss as isIterable, st as mapBothEager, t as acquireRelease, ta as match$3, tn as updateService, ts as symbol$2, tt as logError, u as asVoid, ua as getOrUndefined$2, un as yieldNow, uo as toArray, ur as succeed$4, us as isNotNullish, ut as mapErrorEager, v as catchIf, va as infinity, vn as passthrough, vs as isString, w as clockWith, wi as sync$1, wr as _await, ws as constTrue, wt as provide$1, x as catchTag, xo as strictEqual, xr as CurrentLogAnnotations, xt as orDie, yn as spaced, yr as makeUnsafe$1, ys as isTagged, yt as onInterrupt, z as fn, za as make$42, zn as hasInterrupts, zo as format, zr as succeed$3, zt as serviceOption } from "./Effect-DdkIoNCD.mjs";
3
3
  import { $ as transduce, A as mapEffect$1, At as interrupt$2, B as run$4, Bt as normalizeNonEmpty, C as fromPull, D as map$8, Dt as makeUnsafe$5, E as isStream, Et as update, F as onEnd, Ft as runIn, G as runForEachArray, I as orDie$2, It as camelToSnake, J as succeed$5, L as pipeThroughChannel, Lt as toLowerCase, M as merge$4, Mt as interruptAllAs, N as mergeAll$1, O as mapArray, Ot as await_, P as mkString, Pt as join$2, Q as tap$1, R as provideContext$1, Rt as parse$2, St as unbounded, T as fromReadableStream, Tt as set$2, U as runFold, V as runCollect, W as runForEach, X as take$1, Y as suspend$1, Z as takeUntil, _t as offerAll, a as catchTags$1, at as toTransform, b as fromEffect, bt as poll, c as die$2, ct as makeUnsafe$4, d as ensuring$1, dt as endUnsafe, et as unwrap$3, f as fail$5, ft as fail$6, g as flattenIterable, gt as offer, h as flatMap$3, ht as make$44, i as catchReason$1, it as pipeTo, j as mapError$1, jt as interruptAll, k as mapArrayEffect, kt as getCurrent, l as drop, lt as bounded, m as filterMap, mt as failCauseUnsafe, n as callback$1, nt as map$9, o as catch_$1, ot as unwrap$2, p as filter$2, pt as failCause$2, q as splitLines, rt as mapDone, s as decodeText, st as make$45, t as broadcast, tt as fromTransform$1, u as empty$10, ut as end, vt as offerAllUnsafe, w as fromQueue, wt as make$43, x as fromIterable$2, xt as take, y as fromChannel$1, yt as offerUnsafe, z as provideService$1, zt as round } from "./Stream-B5ebASRi.mjs";
4
- import { $ as check, $t as Arrays, A as Option, An as transformEffect, At as optionalKey, B as TaggedError$1, Bn as value, Bt as empty$11, C as Never, Cn as passthrough$2, Ct as isSchema, D as NullOr, Dt as makeFilterGroup, E as Null, En as transformOptional, Et as makeFilter, F as SchemaError, Fn as fromDateUnsafe, Ft as toJsonSchemaDocument, G as URLFromString, Gn as map$10, Gt as fromSetCookie, H as TrueLiterals, Hn as Clock, Ht as setAll$1, I as String$5, It as toType, J as UndefinedOr, Jt as getReferenceKey, K as Uint8Array$2, L as Struct, Lt as withConstructorDefault, M as OptionFromOptional, Mn as Pointer, Mt as toCodecJson, N as Record, Nn as formatIso, Nt as toCodecStringTree, O as Number$2, On as passthrough$1, Ot as mutable, P as Redacted$1, Pt as toEncoded$1, Qt as encodeEffect, R as StructWithRest, Rn as isRedacted, Rt as withDecodingDefault, Sn as Transformation, St as isPropertyNames, T as NonEmptyString$1, Tn as transformEffect$1, Tt as make$47, U as Tuple, Un as assignProperty$1, Ut as toString, V as TaggedUnion, Vn as stringOrRedacted, Vt as fromInput$1, W as URL$1, Wn as makeEquivalence, Wt as empty$12, X as Unknown, Xt as decodeEffect$1, Y as Union, Yt as _is, Z as Void, Zt as decodeUnknownEffect, _ as Int$1, _n as resolveIdentifier, _t as isLessThanOrEqualTo, a as BooleanLiterals, an as Suspend, at as decodeUnknownOption, b as Literals$2, bn as toType$1, bt as isMinLength, cn as decodeTo, ct as encodeTo, d as Defect, dn as mapOrSame, en as Filter, et as declare, f as Duration, fn as null_, ft as is, g as Finite, gn as resolveDescription, gt as isInt, h as FalseLiterals, hn as resolveAt, ht as isGreaterThanOrEqualTo, in as PropertySignature, it as decodeUnknownEffect$1, jn as InvalidValue$1, jt as tag, k as Opaque, kt as optional$2, ln as isNever, lt as encodeUnknownEffect, m as Exit, mn as replaceChecks, mt as isGreaterThan, n as ArraySchema, nn as Literal$1, nt as decodeSync, o as Class$1, on as Union$1, ot as decodeUnknownSync, p as Error$3, pn as optionalKey$1, pt as isFinite$1, q as Uint8ArrayFromBase64, qt as omit, r as Boolean$4, rn as Objects, rt as decodeTo$1, s as DateTimeUtc, sn as applyToSelfOrLastLinkEncoding, st as encodeEffect$1, t as Any, tn as FilterGroup, tt as decodeEffect, u as DateTimeUtcFromString, un as isOptional, ut as fromJsonString, v as Json, vn as string, vt as isMaxLength, w as NonEmptyArray, wn as transform$3, wt as isSchemaError, x as MutableJson, xn as unknown, xt as isPattern, y as Literal, yn as toEncoded, yt as isMaxProperties, z as TaggedClass$2, zn as make$46, zt as withDecodingDefaultKey } from "./Schema-BALIXGp7.mjs";
4
+ import { $ as declare, $t as Filter, An as InvalidValue$1, At as tag, B as TaggedUnion, Bn as stringOrRedacted, Bt as fromInput$1, C as Never, Cn as transform$3, Ct as isSchemaError, D as NullOr, Dn as passthrough$1, Dt as mutable, E as Null, Et as makeFilterGroup, F as String$5, Ft as toType, G as Uint8Array$2, H as Tuple, Hn as assignProperty$1, Ht as toString, I as Struct, It as withConstructorDefault, J as Union, Jt as _is, K as Uint8ArrayFromBase64, Kt as omit, L as StructWithRest, Ln as isRedacted, Lt as withDecodingDefault, M as Record, Mn as formatIso, Mt as toCodecStringTree, N as Redacted$1, Nt as toEncoded$1, O as Number$2, Ot as optional$2, P as SchemaError, Pn as fromDateUnsafe, Pt as toJsonSchemaDocument, Q as check, Qt as Arrays, R as TaggedClass$2, Rn as make$46, Rt as withDecodingDefaultKey, Sn as passthrough$2, St as isSchema, T as NonEmptyString$1, Tn as transformOptional, Tt as makeFilter, U as URL$1, Un as makeEquivalence, Ut as empty$12, V as TrueLiterals, Vn as Clock, Vt as setAll$1, W as URLFromString, Wn as map$10, Wt as fromSetCookie, X as Void, Xt as decodeUnknownEffect, Y as Unknown, Yt as decodeEffect$1, Zt as encodeEffect, _ as Int$1, _n as string, _t as isMaxLength, a as BooleanLiterals, an as Union$1, at as decodeUnknownSync, b as Literals$2, bn as unknown, bt as isPattern, cn as isNever, ct as encodeUnknownEffect, d as Defect, dn as null_, dt as is, en as FilterGroup, et as decodeEffect, f as Duration, fn as optionalKey$1, ft as isFinite$1, g as Finite, gn as resolveIdentifier, gt as isLessThanOrEqualTo, h as FalseLiterals, hn as resolveDescription, ht as isInt, in as Suspend, it as decodeUnknownOption, j as OptionFromOptional, jn as Pointer, jt as toCodecJson, k as Option, kn as transformEffect, kt as optionalKey, ln as isOptional, lt as fromJsonString, m as Exit, mn as resolveAt, mt as isGreaterThanOrEqualTo, n as ArraySchema, nn as Objects, nt as decodeTo$1, o as Class$1, on as applyToSelfOrLastLinkEncoding, ot as encodeEffect$1, p as Error$3, pn as replaceChecks, pt as isGreaterThan, q as UndefinedOr, qt as getReferenceKey, r as Boolean$4, rn as PropertySignature, rt as decodeUnknownEffect$1, s as DateTimeUtc, sn as decodeTo, st as encodeTo, t as Any, tn as Literal$1, tt as decodeSync, u as DateTimeUtcFromString, un as mapOrSame, v as Json, vn as toEncoded, vt as isMaxProperties, w as NonEmptyArray, wn as transformEffect$1, wt as make$47, x as MutableJson, xn as Transformation, xt as isPropertyNames, y as Literal, yn as toType$1, yt as isMinLength, z as TaggedError$1, zn as value, zt as empty$11 } from "./Schema-gTtf66A-.mjs";
5
5
  import * as Http from "node:http";
6
6
  import * as Https from "node:https";
7
7
  import { PassThrough, Readable, Writable } from "node:stream";
@@ -11938,7 +11938,7 @@ var ExaError = class extends TaggedError$1()("ExaError", { cause: Defect() }) {}
11938
11938
  const layer$7 = effect(ExaSearch, gen(function* () {
11939
11939
  const scope$4 = yield* scope;
11940
11940
  const getClient = yield* cachedWithTTL(gen(function* () {
11941
- const McpClient = yield* tryPromise(() => import("./McpClient-CJ0Vugoi.mjs"));
11941
+ const McpClient = yield* tryPromise(() => import("./McpClient-0f-vTQC-.mjs"));
11942
11942
  const context = yield* buildWithScope(McpClient.layer, scope$4);
11943
11943
  return get$3(context, McpClient.McpClient);
11944
11944
  }), (exit) => isSuccess$1(exit) ? infinity : zero);
@@ -12028,11 +12028,6 @@ var DirectoryChanger = class extends Service()("clanka/AgentTools/DirectoryChang
12028
12028
  var TaskCompleter = class extends Service()("clanka/AgentTools/TaskCompleter") {};
12029
12029
  var SubagentExecutor = class extends Service()("clanka/AgentTools/SubagentExecutor") {};
12030
12030
  var ImageAttacher = class extends Service()("clanka/AgentTools/ImageAttacher") {};
12031
- var TodoItem = class extends Opaque()(Struct({
12032
- id: Number$2,
12033
- text: String$5,
12034
- completed: Boolean$4
12035
- })) {};
12036
12031
  const AgentTools = make$14(make$16("changeDirectory", {
12037
12032
  description: "Change the executor's working directory to an existing directory and return its absolute path. Relative paths resolve from the current directory without shell expansion. Await this before dependent tools. The change persists across scripts and is shared with delegates using this executor. Startup AGENTS.md, skills, and the semantic-search index root remain fixed. Navigation does not survive a session reload.",
12038
12033
  parameters: String$5.annotate({ identifier: "directory" }),
@@ -12072,23 +12067,6 @@ const AgentTools = make$14(make$16("changeDirectory", {
12072
12067
  parameters: ArraySchema(String$5).annotate({ identifier: "args" }),
12073
12068
  success: String$5,
12074
12069
  dependencies: [CurrentDirectory]
12075
- }), make$16("listTodos", {
12076
- description: "Read your todo list",
12077
- parameters: Void,
12078
- success: ArraySchema(TodoItem)
12079
- }), make$16("addTodo", {
12080
- description: "Add an item to your todo list",
12081
- parameters: String$5.annotate({ identifier: "text" })
12082
- }), make$16("updateTodo", {
12083
- description: "Update an item in your todo list",
12084
- parameters: Struct({
12085
- id: Number$2,
12086
- text: optional$2(String$5),
12087
- completed: optional$2(Boolean$4)
12088
- })
12089
- }), make$16("clearTodos", {
12090
- description: "Clear all items in your todo list",
12091
- parameters: Void
12092
12070
  }), make$16("bash", {
12093
12071
  description: "Run a bash command and return the output",
12094
12072
  parameters: Struct({
@@ -12155,8 +12133,6 @@ const AgentToolHandlersNoDeps = AgentToolsWithSearch.toLayer(gen(function* () {
12155
12133
  const pathService = yield* Path$3;
12156
12134
  const webSearch = yield* ExaSearch;
12157
12135
  const fetchMarkdown = yield* WebToMarkdown;
12158
- const todoMap = new Map();
12159
- let todoIdCounter = 0;
12160
12136
  const execute = fn(function* (command) {
12161
12137
  const handle = yield* spawner.spawn(command);
12162
12138
  return yield* handle.all.pipe(decodeText, mkString, flatMap$1(fnUntraced(function* (output) {
@@ -12262,34 +12238,6 @@ const AgentToolHandlersNoDeps = AgentToolsWithSearch.toLayer(gen(function* () {
12262
12238
  const cwd = yield* CurrentDirectory;
12263
12239
  return yield* promise(() => import("./index.min-CI3qqohw.mjs").then((Glob) => Glob.glob(pattern, { cwd })));
12264
12240
  }),
12265
- listTodos: fn("AgentTools.listTodos")(function* () {
12266
- yield* logInfo(`Calling "listTodos"`);
12267
- return fromIterable$1(todoMap.values());
12268
- }),
12269
- addTodo: fn("AgentTools.addTodo")(function* (text) {
12270
- yield* logInfo(`Calling "addTodo"`).pipe(annotateLogs({ text }));
12271
- const id = ++todoIdCounter;
12272
- const item = {
12273
- id,
12274
- text,
12275
- completed: false
12276
- };
12277
- todoMap.set(id, item);
12278
- }),
12279
- updateTodo: fn("AgentTools.updateTodo")(function* (options) {
12280
- yield* logInfo(`Calling "updateTodo"`).pipe(annotateLogs(options));
12281
- const item = todoMap.get(options.id);
12282
- if (item === void 0) return yield* die(`Todo item ${options.id} not found`);
12283
- todoMap.set(item.id, {
12284
- ...item,
12285
- text: options.text ?? item.text,
12286
- completed: options.completed ?? item.completed
12287
- });
12288
- }),
12289
- clearTodos: fn("AgentTools.clearTodos")(function* () {
12290
- yield* logInfo(`Calling "clearTodos"`);
12291
- todoMap.clear();
12292
- }),
12293
12241
  bash: fn("AgentTools.bash")(function* (options) {
12294
12242
  const timeoutMs = Math.min(options.timeoutMs ?? 12e4, 24e4);
12295
12243
  yield* logInfo(`Calling "bash"`).pipe(annotateLogs({
@@ -23887,8 +23835,7 @@ const generateSystemTools = (capabilities, conversationMode) => `YOU ONLY HAVE O
23887
23835
  - You can add / update / remove multiple files in one go with "applyPatch".
23888
23836
  - Avoid passing scripts into the "bash" function, and instead write javascript.
23889
23837
  - Variables are not shared between executions.
23890
- - Do not use \`require\`, \`import\`, \`process\`, or any other Node.js apis.
23891
- - Make use of the todo functions to keep track of your progress.${conversationMode ? "" : `
23838
+ - Do not use \`require\`, \`import\`, \`process\`, or any other Node.js apis.${conversationMode ? "" : `
23892
23839
 
23893
23840
  When you have fully completed your task, call the "taskComplete" function with the final output.
23894
23841
  Make sure every detail of the task is done before calling "taskComplete".`}
@@ -25644,7 +25591,7 @@ const model$1 = (model, options) => make$5("xai", model, mergeAll(layer$3({
25644
25591
  const LogToStderr = LogToStderr$1;
25645
25592
  //#endregion
25646
25593
  //#region package.json
25647
- var version$1 = "0.7.5";
25594
+ var version$1 = "0.7.6";
25648
25595
  //#endregion
25649
25596
  //#region src/cli.ts
25650
25597
  const version = version$1;
@@ -25699,7 +25646,7 @@ const Search = (directory) => unwrap$1(gen(function* () {
25699
25646
  return empty$9;
25700
25647
  }
25701
25648
  const path = yield* Path$3;
25702
- return (yield* promise(() => import("./SemanticSearch-O6PZBRfd.mjs"))).layer({
25649
+ return (yield* promise(() => import("./SemanticSearch-CBs6yELV.mjs"))).layer({
25703
25650
  directory: process.cwd(),
25704
25651
  database: path.join(directory, "search.sqlite")
25705
25652
  }).pipe(provide$3(model$3("text-embedding-3-small", { dimensions: 1536 })), provide$3(layer$5({ apiKey: apiKey.value })));