clanka 0.24.2 → 0.24.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Agent.d.ts.map +1 -1
- package/dist/Agent.js +23 -10
- package/dist/Agent.js.map +1 -1
- package/dist/Agent.test.js +137 -0
- package/dist/Agent.test.js.map +1 -1
- package/dist/ClaudeAgent.d.ts.map +1 -1
- package/dist/ClaudeAgent.js +5 -1
- package/dist/ClaudeAgent.js.map +1 -1
- package/dist/ClaudeAgent.test.js +45 -0
- package/dist/ClaudeAgent.test.js.map +1 -1
- package/dist/OutputFormatter.d.ts +1 -1
- package/dist/OutputFormatter.d.ts.map +1 -1
- package/dist/OutputFormatter.js +42 -2
- package/dist/OutputFormatter.js.map +1 -1
- package/dist/OutputFormatter.test.d.ts +2 -0
- package/dist/OutputFormatter.test.d.ts.map +1 -0
- package/dist/OutputFormatter.test.js +93 -0
- package/dist/OutputFormatter.test.js.map +1 -0
- package/dist/bin/{Stream-C51usiew.mjs → AiError-fiHIiGOy.mjs} +469 -34
- package/dist/bin/{Latch-BnrpWMd1.mjs → Latch-D1909CI6.mjs} +1 -1
- package/dist/bin/{McpClient-DoPNaNzW.mjs → McpClient-CXwyRd_3.mjs} +2 -3
- package/dist/bin/{OutputFormatter-U02YKTfy.mjs → OutputFormatter-B8yF7iiq.mjs} +40 -4
- package/dist/bin/{Schema-Box_9VZG.mjs → Schema-D629S5yu.mjs} +5459 -278
- package/dist/bin/{SemanticSearch-CH125AHH.mjs → SemanticSearch-BlcfFvPr.mjs} +14 -15
- package/dist/bin/cli.mjs +393 -819
- package/dist/bin/{upgrade-HMRGSqq8.mjs → upgrade-E_f-q2h8.mjs} +3 -4
- package/package.json +1 -1
- package/src/Agent.test.ts +198 -0
- package/src/Agent.ts +27 -10
- package/src/ClaudeAgent.test.ts +62 -0
- package/src/ClaudeAgent.ts +7 -1
- package/src/OutputFormatter.test.ts +158 -0
- package/src/OutputFormatter.ts +56 -1
- package/dist/bin/Effect-5XYMLOiB.mjs +0 -5183
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { A as fromQueue, C as fromArray, Ct as failCauseUnsafe, G as provideService$1, Ht as interruptAllAs, J as runDrain, Ot as offerUnsafe, Ut as join$1, Wt as runIn, _t as makeUnsafe$3, dt as unwrap, gt as make$13, q as runCollect, st as tap$1, u as die$1, w as fromArrayEffect, wt as make$12, y as flatMap$1 } from "./Stream-C51usiew.mjs";
|
|
1
|
+
import { $c as void_$2, $i as interrupt, $l as isZero, Aa as request$1, B as String$1, Bd as pipeArguments, Bi as fn, Bs as addFinalizer, Bu as Number$2, Ca as orElseSucceed, Ci as catchTag, Cn as evolve, Co as isEmpty, Da as provideService, Di as contextWith, Dl as map$2, Do as size, E as Natural, Ea as provideContext, Ec as exitHasInterrupts, Ei as context, Eo as set, Es as effectDiscard, Fd as dual, Fu as none, Go as Clock, Gs as make$7, H as Struct$2, Hc as makeSpanUnsafe, Hi as forEach, Hs as close, Hu as make$10, Id as flow, Ii as filterOrFail, Ja as tap, Jr as now, K as TaggedError, Ka as suspend, Kr as formatIsoDate, Ku as PipeInspectableProto, Ld as identity, Li as flatMap, M as Number$1, Ma as retry, Md as constUndefined, Mu as isSome, N as Option, Na as runFork, Ni as fail, Ns as provide$1, Nu as map$3, Oi as delay, P as OptionFromNullOr, Pa as runForkWith, Pc as fiberJoin, Pi as failCause$1, Po as spaced, Ps as provideMerge, Pu as match, Qc as updateContext, Qi as ignoreCause, Ql as isFinite, Qs as doneUnsafe, Ra as scoped, Rc as forkUnsafe, Ru as some, Sa as orDie, So as get$2, Tc as endSpan, Ti as catch_, To as remove, Ts as effectContext, Tu as fromNullishOr, Ua as succeed, Ui as forever, Va as serviceOption, Vi as fnUntraced, Wc as onExitUnsafe, Wu as Prototype, Xi as gen, Xo as NoSuchElementError, Xs as TracerTimingEnabled, Ya as tapCause, Yl as fromInputUnsafe, Yr as removeTime, Zi as ignore, Zl as infinity, _a as onError, _c as void_$3, _d as hasProperty, _i as catchDefect, _l as flatMapNullishOr, _r as transform, _u as merge, a as BooleanFromBit, aa as logInfo, ac as makeUnsafe$2, ai as all, al as TaggedError$1, as as filterInterruptors, au as zero, bi as catchIf, bn as withConstructorDefault, bo as empty$1, bs as reasonAnnotations, ca as map, ci as annotateLogs, cl as has, co as void_$1, cu as add, d as DateTimeUtcFromMillis, da as mapError, dd as byReferenceUnsafe, di as asVoid, dn as optional, do as withFiber, dt as decodeTo, du as getOption, eo as tryPromise, f as DateTimeUtcFromString, fd as equals, fl as empty, fn as optionalKey, fo as withLogSpan, fr as transformOptional, ft as decodeUnknownEffect, fu as getOrUndefined, gc as succeed$2, gd as symbol$1, gs as makeDieReason, hc as isSuccess, hi as catchCause, ht as encodeEffect, hu as make$9, i as Boolean, io as uninterruptibleMask, iu as toMillis, j as NullOr, jc as fiberInterrupt, jl as sort, ju as isNone, ki as die, l as DateTimeUtc, lc as fail$1, li as as, ll as toPredicate, ls as hasInterruptsOnly, ma as matchCauseEffect, mc as isFailure, md as hash, mo as withSpan, mr as map$1, ms as isFailReason, mu as getUnsafe, n as ArraySchema, na as logDebug, nd as assignProperty, ni as acquireRelease, nu as minutes, oi as andThen, ot as brand, ou as Reference, p as Defect, pa as matchCauseEager, pd as symbol, pr as dateTimeUtcFromInput, qa as sync, qc as succeed$1, qi as forkScoped, qo as monotonicTimeNanos, qs as provide, ri as acquireUseRelease, rt as Union$2, ru as seconds, s as Class$1, sa as makeSpanScoped, si as annotateCurrentSpan, sl as compose, so as useSpan, ss as fromReasons, su as Service, ta as isEffect, tc as into, td as withFiber$1, tl as ParentSpan, tn as isSchema, to as try_, ts as combine, tu as millis, u as DateTimeUtcFromDate, uc as failCause, un as mutable, ur as transform$1, uu as get$1, va as onExit, vc as ClockRef, vl as fromIterable, vo as Class$2, vu as omit, wc as contextWith$1, wi as catchTags, wo as make$8, ws as effect, wu as flatten, xi as catchNoSuchElement, xl as isArrayNonEmpty, xo as forEach$1, xu as filter, ya as onExitPrimitive, yd as isNotNull, yn as toType, yt as instanceOf, zd as pipe, zs as Scope } from "./Schema-D629S5yu.mjs";
|
|
2
|
+
import { D as Path, E as Console, O as FileSystem, T as ChildProcessSpawner, a as makeGrouped, f as SemanticSearch, h as map$4, i as batchN, m as maybeUpdateFile, n as EmbeddingModel, o as setDelay, p as maybeRemoveFile, r as EmbeddingRequest, s as withSpan$1, t as Dimensions, w as make$11 } from "./cli.mjs";
|
|
3
|
+
import { $t as offerUnsafe, Ht as makeUnsafe$3, It as unwrap, J as fromArrayEffect, Jt as failCauseUnsafe, Mt as tap$1, P as die$1, U as flatMap$1, Vt as make$13, Yt as make$12, gt as provideService$1, hn as runIn, mn as join$1, pn as interruptAllAs, q as fromArray, tt as fromQueue, vt as runCollect, yt as runDrain } from "./AiError-fiHIiGOy.mjs";
|
|
5
4
|
import { createHash } from "node:crypto";
|
|
6
5
|
import { DatabaseSync, backup } from "node:sqlite";
|
|
7
6
|
import TreeSitter from "tree-sitter";
|
|
@@ -1138,7 +1137,7 @@ const extract$1 = dual((args) => isStruct(args[0]), (self, variant, options) =>
|
|
|
1138
1137
|
const make$3 = (options) => {
|
|
1139
1138
|
function Class(identifier) {
|
|
1140
1139
|
return function(fields, annotations) {
|
|
1141
|
-
return makeClass(fields, (defaultFields) => Class$
|
|
1140
|
+
return makeClass(fields, (defaultFields) => Class$1(identifier)(defaultFields, annotations));
|
|
1142
1141
|
};
|
|
1143
1142
|
}
|
|
1144
1143
|
function makeClass(fields, makeSchemaClass) {
|
|
@@ -1255,7 +1254,7 @@ const BooleanSqlite = Field({
|
|
|
1255
1254
|
jsonUpdate: Boolean
|
|
1256
1255
|
});
|
|
1257
1256
|
const Date$1 = String$1.pipe(decodeTo(DateTimeUtc, {
|
|
1258
|
-
decode: map$
|
|
1257
|
+
decode: map$1(dateTimeUtcFromInput(), removeTime),
|
|
1259
1258
|
encode: transform(formatIsoDate)
|
|
1260
1259
|
}));
|
|
1261
1260
|
const DateWithNow = Overrideable(Date$1, { defaultValue: map(now, removeTime) });
|
|
@@ -1297,7 +1296,7 @@ const DateTimeUpdateFromNumber = Field({
|
|
|
1297
1296
|
});
|
|
1298
1297
|
// node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/sql/SqlResolver.js
|
|
1299
1298
|
const SqlRequestProto = {
|
|
1300
|
-
...Class$
|
|
1299
|
+
...Class$2.prototype,
|
|
1301
1300
|
[symbol](that) {
|
|
1302
1301
|
return equals(this.payload, that.payload);
|
|
1303
1302
|
},
|
|
@@ -1470,10 +1469,10 @@ select * from ${sql(options.tableName)} where ${withSoftDeleteFilter(sql`${sql(i
|
|
|
1470
1469
|
};
|
|
1471
1470
|
});
|
|
1472
1471
|
// src/ChunkRepo.ts
|
|
1473
|
-
const ChunkId = Number$
|
|
1472
|
+
const ChunkId = Number$1.pipe(brand("ChunkRepo/ChunkId"));
|
|
1474
1473
|
const SyncId = String$1.pipe(brand("ChunkRepo/SyncId"));
|
|
1475
1474
|
const Float32ArraySchema = instanceOf(Float32Array);
|
|
1476
|
-
const Float32ArrayFromArray = ArraySchema(Number$
|
|
1475
|
+
const Float32ArrayFromArray = ArraySchema(Number$1).pipe(decodeTo(Float32ArraySchema, transform$1({
|
|
1477
1476
|
decode: (arr) => new Float32Array(arr),
|
|
1478
1477
|
encode: (array) => Array.from(array)
|
|
1479
1478
|
})));
|
|
@@ -1533,7 +1532,7 @@ const layer$4 = effect(ChunkRepo, gen(function* () {
|
|
|
1533
1532
|
const search = findAll({
|
|
1534
1533
|
Request: Struct$2({
|
|
1535
1534
|
vector: Float32ArraySchema,
|
|
1536
|
-
limit: Number$
|
|
1535
|
+
limit: Number$1
|
|
1537
1536
|
}),
|
|
1538
1537
|
Result: Chunk,
|
|
1539
1538
|
execute: ({ vector, limit }) => sql`
|
|
@@ -2326,11 +2325,11 @@ ORDER BY migration_id`,
|
|
|
2326
2325
|
pg: () => flatMap(migrationsTableExists(sql, table), (exists) => exists ? void_$1 : asVoid(createMigrationsTable).pipe(catch_((error) => flatMap(migrationsTableExists(sql, table), (exists) => exists ? void_$1 : fail(error))))),
|
|
2327
2326
|
orElse: () => createMigrationsTable
|
|
2328
2327
|
});
|
|
2329
|
-
const insertMigrations = (rows) => transformWrites(sql`INSERT INTO ${sql(table)} ${sql.insert(map$
|
|
2328
|
+
const insertMigrations = (rows) => transformWrites(sql`INSERT INTO ${sql(table)} ${sql.insert(map$2(rows, ([migration_id, name]) => ({
|
|
2330
2329
|
migration_id,
|
|
2331
2330
|
name
|
|
2332
2331
|
})))}`.withoutTransform);
|
|
2333
|
-
const latestMigration = map(sql`SELECT migration_id, name, created_at FROM ${sql(table)} ORDER BY migration_id DESC`.withoutTransform, (_) => map$
|
|
2332
|
+
const latestMigration = map(sql`SELECT migration_id, name, created_at FROM ${sql(table)} ORDER BY migration_id DESC`.withoutTransform, (_) => map$3(fromNullishOr(_[0]), ({ created_at, migration_id, name }) => ({
|
|
2334
2333
|
id: migration_id,
|
|
2335
2334
|
name,
|
|
2336
2335
|
createdAt: created_at
|
|
@@ -2377,7 +2376,7 @@ ORDER BY migration_id`,
|
|
|
2377
2376
|
yield* loadMigration(resolved)
|
|
2378
2377
|
]);
|
|
2379
2378
|
}
|
|
2380
|
-
if (transactional && isArrayNonEmpty(required)) yield* pipe(insertMigrations(map$
|
|
2379
|
+
if (transactional && isArrayNonEmpty(required)) yield* pipe(insertMigrations(map$2(required, ([id, name]) => [id, name])), mapError((error) => isConstraintConflict(error) ? new MigrationError({
|
|
2381
2380
|
kind: "Locked",
|
|
2382
2381
|
message: "Migrations already running"
|
|
2383
2382
|
}) : error));
|
|
@@ -2397,9 +2396,9 @@ const migrationsTableExists = (sql, table) => {
|
|
|
2397
2396
|
const quotedTable = sql`${sql(table)}`.compile(true)[0];
|
|
2398
2397
|
return map(sql`SELECT 1 AS found WHERE to_regclass(${quotedTable}) IS NOT NULL`.withoutTransform, (rows) => rows.length > 0);
|
|
2399
2398
|
};
|
|
2400
|
-
const migrationOrder = make$10(([a], [b]) => Number$
|
|
2399
|
+
const migrationOrder = make$10(([a], [b]) => Number$2(a, b));
|
|
2401
2400
|
const isConstraintConflict = (error) => error.reason._tag === "ConstraintError" || error.reason._tag === "UniqueViolation";
|
|
2402
|
-
const fromRecord = (migrations) => pipe(Object.keys(migrations), flatMapNullishOr((_) => _.match(/^(\d+)_(.+)$/)), map$
|
|
2401
|
+
const fromRecord = (migrations) => pipe(Object.keys(migrations), flatMapNullishOr((_) => _.match(/^(\d+)_(.+)$/)), map$2(([key, id, name]) => [
|
|
2403
2402
|
Number(id),
|
|
2404
2403
|
name,
|
|
2405
2404
|
succeed(migrations[key])
|