eminiar 0.13.3 → 0.13.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/.claude-plugin/plugin.json +1 -1
- package/.cursor-plugin/plugin.json +1 -1
- package/dist/cli.js +109 -54
- package/dist/{hook-async-3TLK23ZY.js → hook-async-7GK6H3OO.js} +3 -3
- package/dist/{hook-chunk-ZLRLOPLR.js → hook-chunk-6EFFDI3S.js} +24 -31
- package/dist/{hook-chunk-MVSMFCKL.js → hook-chunk-77LASZ3C.js} +2 -2
- package/dist/{hook-chunk-ETYHCPPH.js → hook-chunk-G7UP4ZVA.js} +36 -4
- package/dist/{hook-hooks-5U2AI6W7.js → hook-hooks-YGXLOZ6H.js} +4 -4
- package/dist/hook.js +29 -26
- package/dist/server.js +120 -67
- package/eminiar.config.schema.json +3 -0
- package/package.json +3 -1
package/dist/server.js
CHANGED
|
@@ -10441,7 +10441,7 @@ var require_micromatch = __commonJS({
|
|
|
10441
10441
|
const index = v.indexOf("{");
|
|
10442
10442
|
return index > -1 && v.indexOf("}", index) > -1;
|
|
10443
10443
|
};
|
|
10444
|
-
var
|
|
10444
|
+
var micromatch2 = (list2, patterns, options) => {
|
|
10445
10445
|
patterns = [].concat(patterns);
|
|
10446
10446
|
list2 = [].concat(list2);
|
|
10447
10447
|
let omit2 = /* @__PURE__ */ new Set();
|
|
@@ -10482,11 +10482,11 @@ var require_micromatch = __commonJS({
|
|
|
10482
10482
|
}
|
|
10483
10483
|
return matches2;
|
|
10484
10484
|
};
|
|
10485
|
-
|
|
10486
|
-
|
|
10487
|
-
|
|
10488
|
-
|
|
10489
|
-
|
|
10485
|
+
micromatch2.match = micromatch2;
|
|
10486
|
+
micromatch2.matcher = (pattern2, options) => picomatch(pattern2, options);
|
|
10487
|
+
micromatch2.isMatch = (str4, patterns, options) => picomatch(patterns, options)(str4);
|
|
10488
|
+
micromatch2.any = micromatch2.isMatch;
|
|
10489
|
+
micromatch2.not = (list2, patterns, options = {}) => {
|
|
10490
10490
|
patterns = [].concat(patterns).map(String);
|
|
10491
10491
|
let result = /* @__PURE__ */ new Set();
|
|
10492
10492
|
let items = [];
|
|
@@ -10494,7 +10494,7 @@ var require_micromatch = __commonJS({
|
|
|
10494
10494
|
if (options.onResult) options.onResult(state);
|
|
10495
10495
|
items.push(state.output);
|
|
10496
10496
|
};
|
|
10497
|
-
let matches2 = new Set(
|
|
10497
|
+
let matches2 = new Set(micromatch2(list2, patterns, { ...options, onResult }));
|
|
10498
10498
|
for (let item of items) {
|
|
10499
10499
|
if (!matches2.has(item)) {
|
|
10500
10500
|
result.add(item);
|
|
@@ -10502,12 +10502,12 @@ var require_micromatch = __commonJS({
|
|
|
10502
10502
|
}
|
|
10503
10503
|
return [...result];
|
|
10504
10504
|
};
|
|
10505
|
-
|
|
10505
|
+
micromatch2.contains = (str4, pattern2, options) => {
|
|
10506
10506
|
if (typeof str4 !== "string") {
|
|
10507
10507
|
throw new TypeError(`Expected a string: "${util2.inspect(str4)}"`);
|
|
10508
10508
|
}
|
|
10509
10509
|
if (Array.isArray(pattern2)) {
|
|
10510
|
-
return pattern2.some((p2) =>
|
|
10510
|
+
return pattern2.some((p2) => micromatch2.contains(str4, p2, options));
|
|
10511
10511
|
}
|
|
10512
10512
|
if (typeof pattern2 === "string") {
|
|
10513
10513
|
if (isEmptyString(str4) || isEmptyString(pattern2)) {
|
|
@@ -10517,18 +10517,18 @@ var require_micromatch = __commonJS({
|
|
|
10517
10517
|
return true;
|
|
10518
10518
|
}
|
|
10519
10519
|
}
|
|
10520
|
-
return
|
|
10520
|
+
return micromatch2.isMatch(str4, pattern2, { ...options, contains: true });
|
|
10521
10521
|
};
|
|
10522
|
-
|
|
10522
|
+
micromatch2.matchKeys = (obj, patterns, options) => {
|
|
10523
10523
|
if (!utils.isObject(obj)) {
|
|
10524
10524
|
throw new TypeError("Expected the first argument to be an object");
|
|
10525
10525
|
}
|
|
10526
|
-
let keys =
|
|
10526
|
+
let keys = micromatch2(Object.keys(obj), patterns, options);
|
|
10527
10527
|
let res = {};
|
|
10528
10528
|
for (let key of keys) res[key] = obj[key];
|
|
10529
10529
|
return res;
|
|
10530
10530
|
};
|
|
10531
|
-
|
|
10531
|
+
micromatch2.some = (list2, patterns, options) => {
|
|
10532
10532
|
let items = [].concat(list2);
|
|
10533
10533
|
for (let pattern2 of [].concat(patterns)) {
|
|
10534
10534
|
let isMatch = picomatch(String(pattern2), options);
|
|
@@ -10538,7 +10538,7 @@ var require_micromatch = __commonJS({
|
|
|
10538
10538
|
}
|
|
10539
10539
|
return false;
|
|
10540
10540
|
};
|
|
10541
|
-
|
|
10541
|
+
micromatch2.every = (list2, patterns, options) => {
|
|
10542
10542
|
let items = [].concat(list2);
|
|
10543
10543
|
for (let pattern2 of [].concat(patterns)) {
|
|
10544
10544
|
let isMatch = picomatch(String(pattern2), options);
|
|
@@ -10548,13 +10548,13 @@ var require_micromatch = __commonJS({
|
|
|
10548
10548
|
}
|
|
10549
10549
|
return true;
|
|
10550
10550
|
};
|
|
10551
|
-
|
|
10551
|
+
micromatch2.all = (str4, patterns, options) => {
|
|
10552
10552
|
if (typeof str4 !== "string") {
|
|
10553
10553
|
throw new TypeError(`Expected a string: "${util2.inspect(str4)}"`);
|
|
10554
10554
|
}
|
|
10555
10555
|
return [].concat(patterns).every((p2) => picomatch(p2, options)(str4));
|
|
10556
10556
|
};
|
|
10557
|
-
|
|
10557
|
+
micromatch2.capture = (glob2, input2, options) => {
|
|
10558
10558
|
let posix3 = utils.isWindows(options);
|
|
10559
10559
|
let regex = picomatch.makeRe(String(glob2), { ...options, capture: true });
|
|
10560
10560
|
let match = regex.exec(posix3 ? utils.toPosixSlashes(input2) : input2);
|
|
@@ -10562,9 +10562,9 @@ var require_micromatch = __commonJS({
|
|
|
10562
10562
|
return match.slice(1).map((v) => v === void 0 ? "" : v);
|
|
10563
10563
|
}
|
|
10564
10564
|
};
|
|
10565
|
-
|
|
10566
|
-
|
|
10567
|
-
|
|
10565
|
+
micromatch2.makeRe = (...args) => picomatch.makeRe(...args);
|
|
10566
|
+
micromatch2.scan = (...args) => picomatch.scan(...args);
|
|
10567
|
+
micromatch2.parse = (patterns, options) => {
|
|
10568
10568
|
let res = [];
|
|
10569
10569
|
for (let pattern2 of [].concat(patterns || [])) {
|
|
10570
10570
|
for (let str4 of braces(String(pattern2), options)) {
|
|
@@ -10573,19 +10573,19 @@ var require_micromatch = __commonJS({
|
|
|
10573
10573
|
}
|
|
10574
10574
|
return res;
|
|
10575
10575
|
};
|
|
10576
|
-
|
|
10576
|
+
micromatch2.braces = (pattern2, options) => {
|
|
10577
10577
|
if (typeof pattern2 !== "string") throw new TypeError("Expected a string");
|
|
10578
10578
|
if (options && options.nobrace === true || !hasBraces(pattern2)) {
|
|
10579
10579
|
return [pattern2];
|
|
10580
10580
|
}
|
|
10581
10581
|
return braces(pattern2, options);
|
|
10582
10582
|
};
|
|
10583
|
-
|
|
10583
|
+
micromatch2.braceExpand = (pattern2, options) => {
|
|
10584
10584
|
if (typeof pattern2 !== "string") throw new TypeError("Expected a string");
|
|
10585
|
-
return
|
|
10585
|
+
return micromatch2.braces(pattern2, { ...options, expand: true });
|
|
10586
10586
|
};
|
|
10587
|
-
|
|
10588
|
-
module.exports =
|
|
10587
|
+
micromatch2.hasBraces = hasBraces;
|
|
10588
|
+
module.exports = micromatch2;
|
|
10589
10589
|
}
|
|
10590
10590
|
});
|
|
10591
10591
|
|
|
@@ -10598,7 +10598,7 @@ var require_pattern2 = __commonJS({
|
|
|
10598
10598
|
exports.isAbsolute = exports.partitionAbsoluteAndRelative = exports.removeDuplicateSlashes = exports.matchAny = exports.convertPatternsToRe = exports.makeRe = exports.getPatternParts = exports.expandBraceExpansion = exports.expandPatternsWithBraceExpansion = exports.isAffectDepthOfReadingPattern = exports.endsWithSlashGlobStar = exports.hasGlobStar = exports.getBaseDirectory = exports.isPatternRelatedToParentDirectory = exports.getPatternsOutsideCurrentDirectory = exports.getPatternsInsideCurrentDirectory = exports.getPositivePatterns = exports.getNegativePatterns = exports.isPositivePattern = exports.isNegativePattern = exports.convertToNegativePattern = exports.convertToPositivePattern = exports.isDynamicPattern = exports.isStaticPattern = void 0;
|
|
10599
10599
|
var path3 = __require("path");
|
|
10600
10600
|
var globParent = require_glob_parent();
|
|
10601
|
-
var
|
|
10601
|
+
var micromatch2 = require_micromatch();
|
|
10602
10602
|
var GLOBSTAR = "**";
|
|
10603
10603
|
var ESCAPE_SYMBOL = "\\";
|
|
10604
10604
|
var COMMON_GLOB_SYMBOLS_RE = /[*?]|^!/;
|
|
@@ -10691,8 +10691,8 @@ var require_pattern2 = __commonJS({
|
|
|
10691
10691
|
}
|
|
10692
10692
|
exports.endsWithSlashGlobStar = endsWithSlashGlobStar;
|
|
10693
10693
|
function isAffectDepthOfReadingPattern(pattern2) {
|
|
10694
|
-
const
|
|
10695
|
-
return endsWithSlashGlobStar(pattern2) || isStaticPattern(
|
|
10694
|
+
const basename10 = path3.basename(pattern2);
|
|
10695
|
+
return endsWithSlashGlobStar(pattern2) || isStaticPattern(basename10);
|
|
10696
10696
|
}
|
|
10697
10697
|
exports.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;
|
|
10698
10698
|
function expandPatternsWithBraceExpansion(patterns) {
|
|
@@ -10702,13 +10702,13 @@ var require_pattern2 = __commonJS({
|
|
|
10702
10702
|
}
|
|
10703
10703
|
exports.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion;
|
|
10704
10704
|
function expandBraceExpansion(pattern2) {
|
|
10705
|
-
const patterns =
|
|
10705
|
+
const patterns = micromatch2.braces(pattern2, { expand: true, nodupes: true, keepEscaping: true });
|
|
10706
10706
|
patterns.sort((a, b) => a.length - b.length);
|
|
10707
10707
|
return patterns.filter((pattern3) => pattern3 !== "");
|
|
10708
10708
|
}
|
|
10709
10709
|
exports.expandBraceExpansion = expandBraceExpansion;
|
|
10710
10710
|
function getPatternParts(pattern2, options) {
|
|
10711
|
-
let { parts } =
|
|
10711
|
+
let { parts } = micromatch2.scan(pattern2, Object.assign(Object.assign({}, options), { parts: true }));
|
|
10712
10712
|
if (parts.length === 0) {
|
|
10713
10713
|
parts = [pattern2];
|
|
10714
10714
|
}
|
|
@@ -10720,7 +10720,7 @@ var require_pattern2 = __commonJS({
|
|
|
10720
10720
|
}
|
|
10721
10721
|
exports.getPatternParts = getPatternParts;
|
|
10722
10722
|
function makeRe(pattern2, options) {
|
|
10723
|
-
return
|
|
10723
|
+
return micromatch2.makeRe(pattern2, options);
|
|
10724
10724
|
}
|
|
10725
10725
|
exports.makeRe = makeRe;
|
|
10726
10726
|
function convertPatternsToRe(patterns, options) {
|
|
@@ -10739,7 +10739,7 @@ var require_pattern2 = __commonJS({
|
|
|
10739
10739
|
const absolute = [];
|
|
10740
10740
|
const relative16 = [];
|
|
10741
10741
|
for (const pattern2 of patterns) {
|
|
10742
|
-
if (
|
|
10742
|
+
if (isAbsolute8(pattern2)) {
|
|
10743
10743
|
absolute.push(pattern2);
|
|
10744
10744
|
} else {
|
|
10745
10745
|
relative16.push(pattern2);
|
|
@@ -10748,10 +10748,10 @@ var require_pattern2 = __commonJS({
|
|
|
10748
10748
|
return [absolute, relative16];
|
|
10749
10749
|
}
|
|
10750
10750
|
exports.partitionAbsoluteAndRelative = partitionAbsoluteAndRelative;
|
|
10751
|
-
function
|
|
10751
|
+
function isAbsolute8(pattern2) {
|
|
10752
10752
|
return path3.isAbsolute(pattern2);
|
|
10753
10753
|
}
|
|
10754
|
-
exports.isAbsolute =
|
|
10754
|
+
exports.isAbsolute = isAbsolute8;
|
|
10755
10755
|
}
|
|
10756
10756
|
});
|
|
10757
10757
|
|
|
@@ -42987,6 +42987,26 @@ function adjudicatorDefaults() {
|
|
|
42987
42987
|
privacy: { maxChars: 2e3, storeHead: true, captureExchanges: false }
|
|
42988
42988
|
};
|
|
42989
42989
|
}
|
|
42990
|
+
function graphGlobProblem(g) {
|
|
42991
|
+
if (g.length > 200) return "longer than 200 characters";
|
|
42992
|
+
if ((g.match(/\{/g)?.length ?? 0) > 4) return "more than 4 braces";
|
|
42993
|
+
if ((g.match(/\(/g)?.length ?? 0) > 2) return "more than 2 extglob groups";
|
|
42994
|
+
let total = 0;
|
|
42995
|
+
for (const seg of g.split(/[\\/]/)) {
|
|
42996
|
+
const groups = seg.match(/\*+|\?/g)?.length ?? 0;
|
|
42997
|
+
if (groups > 3) return "more than 3 wildcards in one path segment";
|
|
42998
|
+
total += groups;
|
|
42999
|
+
}
|
|
43000
|
+
return total > 8 ? "more than 8 wildcards" : void 0;
|
|
43001
|
+
}
|
|
43002
|
+
var GraphGlob = external_exports.string().superRefine((g, ctx) => {
|
|
43003
|
+
const why = graphGlobProblem(g);
|
|
43004
|
+
if (why)
|
|
43005
|
+
ctx.addIssue({
|
|
43006
|
+
code: "custom",
|
|
43007
|
+
message: `graph glob ${JSON.stringify(g.slice(0, 40))} is ${why}`
|
|
43008
|
+
});
|
|
43009
|
+
});
|
|
42990
43010
|
var BaseConfigSchema = external_exports.object({
|
|
42991
43011
|
routing: external_exports.object({
|
|
42992
43012
|
/** auto = annotate while context-mode is installed, enforce once it is gone. */
|
|
@@ -43013,18 +43033,21 @@ var BaseConfigSchema = external_exports.object({
|
|
|
43013
43033
|
dims: external_exports.number().int().positive().default(384)
|
|
43014
43034
|
}).prefault({}),
|
|
43015
43035
|
graph: external_exports.object({
|
|
43016
|
-
include: external_exports.array(
|
|
43036
|
+
include: external_exports.array(GraphGlob).default([
|
|
43017
43037
|
"**/*.ts",
|
|
43018
43038
|
"**/*.tsx",
|
|
43019
43039
|
"**/*.js",
|
|
43020
43040
|
"**/*.jsx",
|
|
43021
43041
|
"**/*.mjs",
|
|
43022
43042
|
"**/*.cjs",
|
|
43043
|
+
"**/*.mts",
|
|
43044
|
+
"**/*.cts",
|
|
43023
43045
|
"**/*.py",
|
|
43046
|
+
"**/*.pyi",
|
|
43024
43047
|
"**/*.go",
|
|
43025
43048
|
"**/*.php"
|
|
43026
43049
|
]),
|
|
43027
|
-
exclude: external_exports.array(
|
|
43050
|
+
exclude: external_exports.array(GraphGlob).default([
|
|
43028
43051
|
"**/node_modules/**",
|
|
43029
43052
|
"**/dist/**",
|
|
43030
43053
|
"**/build/**",
|
|
@@ -43659,8 +43682,9 @@ function embeddingStatus(ctx, db) {
|
|
|
43659
43682
|
// src/graph/reindex.ts
|
|
43660
43683
|
init_esm_shims();
|
|
43661
43684
|
var import_fast_glob2 = __toESM(require_out4(), 1);
|
|
43685
|
+
var import_micromatch = __toESM(require_micromatch(), 1);
|
|
43662
43686
|
import { readFileSync as readFileSync7, statSync as statSync7 } from "fs";
|
|
43663
|
-
import { join as join11 } from "path";
|
|
43687
|
+
import { basename as basename3, isAbsolute as isAbsolute3, join as join11 } from "path";
|
|
43664
43688
|
|
|
43665
43689
|
// src/chunker/index.ts
|
|
43666
43690
|
init_esm_shims();
|
|
@@ -48227,15 +48251,44 @@ function readCycles(db) {
|
|
|
48227
48251
|
// src/graph/reindex.ts
|
|
48228
48252
|
var MAX_CODE_BYTES = 15e5;
|
|
48229
48253
|
var CODE_INDEX_VERSION = "3";
|
|
48254
|
+
var CODE_GLOB = { onlyFiles: true, dot: false, followSymbolicLinks: false };
|
|
48255
|
+
var MATCH = { dot: false, posix: true, strictSlashes: false };
|
|
48230
48256
|
function listCodeFiles(ctx) {
|
|
48231
48257
|
return import_fast_glob2.default.sync(ctx.config.graph.include, {
|
|
48258
|
+
...CODE_GLOB,
|
|
48232
48259
|
cwd: ctx.root,
|
|
48233
|
-
ignore: ctx.config.graph.exclude
|
|
48234
|
-
onlyFiles: true,
|
|
48235
|
-
dot: false,
|
|
48236
|
-
followSymbolicLinks: false
|
|
48260
|
+
ignore: ctx.config.graph.exclude
|
|
48237
48261
|
});
|
|
48238
48262
|
}
|
|
48263
|
+
function codeFileFilter(graph) {
|
|
48264
|
+
const cached7 = FILTERS.get(graph);
|
|
48265
|
+
if (cached7) return cached7;
|
|
48266
|
+
const f = compileCodeFilter(graph);
|
|
48267
|
+
FILTERS.set(graph, f);
|
|
48268
|
+
return f;
|
|
48269
|
+
}
|
|
48270
|
+
var FILTERS = /* @__PURE__ */ new WeakMap();
|
|
48271
|
+
function compileCodeFilter(graph) {
|
|
48272
|
+
const tasks = import_fast_glob2.default.generateTasks(graph.include, { ignore: graph.exclude });
|
|
48273
|
+
const re = (patterns, opts) => patterns.map((p2) => import_micromatch.default.makeRe(p2, opts));
|
|
48274
|
+
const any2 = (res, s) => res.some((r) => r.test(s));
|
|
48275
|
+
const positive = re(
|
|
48276
|
+
tasks.flatMap((t) => t.positive),
|
|
48277
|
+
MATCH
|
|
48278
|
+
);
|
|
48279
|
+
const ignore = tasks[0]?.negative ?? [];
|
|
48280
|
+
const ignored = re(ignore, { ...MATCH, dot: true });
|
|
48281
|
+
const pruned = re(
|
|
48282
|
+
ignore.filter((p2) => p2.endsWith("/**") || !import_fast_glob2.default.isDynamicPattern(basename3(p2))),
|
|
48283
|
+
MATCH
|
|
48284
|
+
);
|
|
48285
|
+
return (rel) => {
|
|
48286
|
+
if (isAbsolute3(rel) || rel.startsWith("../") || !any2(positive, rel) || any2(ignored, rel))
|
|
48287
|
+
return false;
|
|
48288
|
+
const dirs = rel.split("/").slice(0, -1);
|
|
48289
|
+
return !dirs.some((_, i) => any2(pruned, dirs.slice(0, i + 1).join("/")));
|
|
48290
|
+
};
|
|
48291
|
+
}
|
|
48239
48292
|
async function indexOne(ctx, db, rel, force) {
|
|
48240
48293
|
const abs = join11(ctx.root, rel);
|
|
48241
48294
|
const st = statSync7(abs);
|
|
@@ -48437,7 +48490,7 @@ function statSafe(p2) {
|
|
|
48437
48490
|
var draining = false;
|
|
48438
48491
|
async function drainReindexQueue(ctx, db) {
|
|
48439
48492
|
if (draining) return 0;
|
|
48440
|
-
const paths2 = db.reindexQueueDrain();
|
|
48493
|
+
const paths2 = db.reindexQueueDrain().filter(codeFileFilter(ctx.config.graph));
|
|
48441
48494
|
if (!paths2.length) return 0;
|
|
48442
48495
|
draining = true;
|
|
48443
48496
|
try {
|
|
@@ -53872,7 +53925,7 @@ init_esm_shims();
|
|
|
53872
53925
|
init_esm_shims();
|
|
53873
53926
|
import { createHash as createHash4 } from "crypto";
|
|
53874
53927
|
import { realpathSync as realpathSync6 } from "fs";
|
|
53875
|
-
import { isAbsolute as
|
|
53928
|
+
import { isAbsolute as isAbsolute4, relative as relative9 } from "path";
|
|
53876
53929
|
|
|
53877
53930
|
// src/capture/categories.ts
|
|
53878
53931
|
init_esm_shims();
|
|
@@ -58611,7 +58664,7 @@ init_esm_shims();
|
|
|
58611
58664
|
init_esm_shims();
|
|
58612
58665
|
import { existsSync as existsSync10, readdirSync as readdirSync8, readFileSync as readFileSync12, statSync as statSync10 } from "fs";
|
|
58613
58666
|
import { homedir as homedir2 } from "os";
|
|
58614
|
-
import { basename as
|
|
58667
|
+
import { basename as basename4, dirname as dirname11, isAbsolute as isAbsolute5, join as join16, relative as relative11, resolve as resolve8 } from "path";
|
|
58615
58668
|
|
|
58616
58669
|
// src/swarm/agents.ts
|
|
58617
58670
|
init_esm_shims();
|
|
@@ -59038,7 +59091,7 @@ function byName(dir, type) {
|
|
|
59038
59091
|
}
|
|
59039
59092
|
function shown(file3, home) {
|
|
59040
59093
|
const rel = relative11(home, file3);
|
|
59041
|
-
return rel && !rel.startsWith("..") && !
|
|
59094
|
+
return rel && !rel.startsWith("..") && !isAbsolute5(rel) ? join16("~", rel) : file3;
|
|
59042
59095
|
}
|
|
59043
59096
|
function decide(defs, source, home) {
|
|
59044
59097
|
const pins = new Set(defs.map((d) => isPinned(d.model) ? d.model.trim() : ""));
|
|
@@ -59076,7 +59129,7 @@ function projectDirs(root, cwd) {
|
|
|
59076
59129
|
const top2 = resolve8(root);
|
|
59077
59130
|
const inside = (d2) => {
|
|
59078
59131
|
const rel = relative11(top2, d2);
|
|
59079
|
-
return rel === "" || !rel.startsWith("..") && !
|
|
59132
|
+
return rel === "" || !rel.startsWith("..") && !isAbsolute5(rel);
|
|
59080
59133
|
};
|
|
59081
59134
|
let d = cwd && inside(resolve8(cwd)) ? resolve8(cwd) : top2;
|
|
59082
59135
|
const dirs = [];
|
|
@@ -59119,9 +59172,9 @@ function pluginDirs(plugin, env, home) {
|
|
|
59119
59172
|
const sep6 = process.platform === "win32" ? ";" : ":";
|
|
59120
59173
|
for (const raw of (env.CLAUDE_CODE_PLUGIN_DIRS ?? "").split(sep6)) {
|
|
59121
59174
|
const p2 = raw.trim().replace(/^~(?=$|[/\\])/, home);
|
|
59122
|
-
if (!p2 || !
|
|
59175
|
+
if (!p2 || !isAbsolute5(p2)) continue;
|
|
59123
59176
|
const name = manifest(p2)?.name;
|
|
59124
|
-
if ((typeof name === "string" ? name :
|
|
59177
|
+
if ((typeof name === "string" ? name : basename4(p2)) === plugin) out.add(p2);
|
|
59125
59178
|
}
|
|
59126
59179
|
return [...out];
|
|
59127
59180
|
}
|
|
@@ -59145,7 +59198,7 @@ function pluginDefs(segments, env, home) {
|
|
|
59145
59198
|
const installs = pluginDirs(plugin, env, home);
|
|
59146
59199
|
if (!installs.length) return `plugin ${plugin} is not installed where eminiar can see it`;
|
|
59147
59200
|
const defs = [];
|
|
59148
|
-
const matches2 = (d, file3) => !!d && (d.name === agent ||
|
|
59201
|
+
const matches2 = (d, file3) => !!d && (d.name === agent || basename4(file3, ".md") === agent);
|
|
59149
59202
|
for (const install of installs) {
|
|
59150
59203
|
for (const p2 of agentPaths(install)) {
|
|
59151
59204
|
let isDir = false;
|
|
@@ -59515,7 +59568,7 @@ init_esm_shims();
|
|
|
59515
59568
|
init_esm_shims();
|
|
59516
59569
|
import { randomBytes as randomBytes3 } from "crypto";
|
|
59517
59570
|
import { existsSync as existsSync12, statSync as statSync11 } from "fs";
|
|
59518
|
-
import { isAbsolute as
|
|
59571
|
+
import { isAbsolute as isAbsolute6, join as join18, relative as relative12 } from "path";
|
|
59519
59572
|
|
|
59520
59573
|
// src/swarm/config.ts
|
|
59521
59574
|
init_esm_shims();
|
|
@@ -60239,7 +60292,7 @@ function requireActive(db, run) {
|
|
|
60239
60292
|
}
|
|
60240
60293
|
function relPath(root, p2) {
|
|
60241
60294
|
let s = p2.trim().replace(/\\/g, "/");
|
|
60242
|
-
if (!
|
|
60295
|
+
if (!isAbsolute6(s)) {
|
|
60243
60296
|
while (s.startsWith("./")) s = s.slice(2);
|
|
60244
60297
|
return s;
|
|
60245
60298
|
}
|
|
@@ -61403,7 +61456,7 @@ function topToolConsumers(toolUses, limit = 10) {
|
|
|
61403
61456
|
init_esm_shims();
|
|
61404
61457
|
import { createHash as createHash10 } from "crypto";
|
|
61405
61458
|
import { closeSync as closeSync2, existsSync as existsSync13, openSync as openSync2, readdirSync as readdirSync9, readSync as readSync2, statSync as statSync13 } from "fs";
|
|
61406
|
-
import { basename as
|
|
61459
|
+
import { basename as basename5, dirname as dirname12, join as join20, resolve as resolve10, sep as sep4 } from "path";
|
|
61407
61460
|
|
|
61408
61461
|
// src/usage/transcript.ts
|
|
61409
61462
|
init_esm_shims();
|
|
@@ -61710,8 +61763,8 @@ function byteAt(path3, pos) {
|
|
|
61710
61763
|
}
|
|
61711
61764
|
function sessionIdFromName(path3) {
|
|
61712
61765
|
const dir = dirname12(path3);
|
|
61713
|
-
if (
|
|
61714
|
-
const name =
|
|
61766
|
+
if (basename5(dir) === "subagents") return basename5(dirname12(dir));
|
|
61767
|
+
const name = basename5(path3, ".jsonl");
|
|
61715
61768
|
return name.startsWith("agent-") ? void 0 : name;
|
|
61716
61769
|
}
|
|
61717
61770
|
function contextEventExists(db, e) {
|
|
@@ -61842,7 +61895,7 @@ function sidechainFilesFor(db, dir, sessionId) {
|
|
|
61842
61895
|
const inside = (p2) => insideDir(p2, dir) && p2.endsWith(".jsonl");
|
|
61843
61896
|
const out = listJsonl(join20(dir, sessionId, "subagents")).filter(inside);
|
|
61844
61897
|
for (const path3 of listJsonl(dir)) {
|
|
61845
|
-
if (!inside(path3) || !
|
|
61898
|
+
if (!inside(path3) || !basename5(path3).startsWith("agent-")) continue;
|
|
61846
61899
|
const known = db.transcriptFileGet(path3)?.session_id;
|
|
61847
61900
|
let owner = known ?? void 0;
|
|
61848
61901
|
if (!owner) {
|
|
@@ -64444,7 +64497,7 @@ function checkReadPath(rules, abs) {
|
|
|
64444
64497
|
// src/sandbox/file.ts
|
|
64445
64498
|
init_esm_shims();
|
|
64446
64499
|
import { existsSync as existsSync16, realpathSync as realpathSync9 } from "fs";
|
|
64447
|
-
import { isAbsolute as
|
|
64500
|
+
import { isAbsolute as isAbsolute7, relative as relative13, resolve as resolve11 } from "path";
|
|
64448
64501
|
function confinePath(root, target2, given) {
|
|
64449
64502
|
const abs = resolve11(root, target2);
|
|
64450
64503
|
const rules = given.root ? given : { ...given, root };
|
|
@@ -64457,7 +64510,7 @@ function confinePath(root, target2, given) {
|
|
|
64457
64510
|
}
|
|
64458
64511
|
refuse(checkReadPath(rules, abs), target2);
|
|
64459
64512
|
const rel = relative13(root, real);
|
|
64460
|
-
const inside = rel !== "" && !rel.startsWith("..") && !
|
|
64513
|
+
const inside = rel !== "" && !rel.startsWith("..") && !isAbsolute7(rel);
|
|
64461
64514
|
if (inside) return real;
|
|
64462
64515
|
if (readMatcher(rules.allow, rules.root).test(real)) return real;
|
|
64463
64516
|
throw new Error(
|
|
@@ -67736,7 +67789,7 @@ init_esm_shims();
|
|
|
67736
67789
|
init_esm_shims();
|
|
67737
67790
|
var import_fast_glob4 = __toESM(require_out4(), 1);
|
|
67738
67791
|
import { existsSync as existsSync19, readFileSync as readFileSync17, statSync as statSync16 } from "fs";
|
|
67739
|
-
import { basename as
|
|
67792
|
+
import { basename as basename6, join as join25, relative as relative15 } from "path";
|
|
67740
67793
|
var IGNORE = [
|
|
67741
67794
|
"**/node_modules/**",
|
|
67742
67795
|
"**/.git/**",
|
|
@@ -68217,7 +68270,7 @@ function apiSignals(dir, project) {
|
|
|
68217
68270
|
const text2 = readText(file3);
|
|
68218
68271
|
if (!text2 || text2.includes("\0")) continue;
|
|
68219
68272
|
const rel = relative15(dir, file3).split("\\").join("/");
|
|
68220
|
-
const isEnv =
|
|
68273
|
+
const isEnv = basename6(file3).startsWith(".env");
|
|
68221
68274
|
const lines = text2.split("\n");
|
|
68222
68275
|
const found = [];
|
|
68223
68276
|
for (let i = 0; i < lines.length; i++) {
|
|
@@ -68305,7 +68358,7 @@ function fileSignals(dir, project) {
|
|
|
68305
68358
|
}
|
|
68306
68359
|
function localCandidates(root, dir, project, isRegistered) {
|
|
68307
68360
|
const out = [];
|
|
68308
|
-
const prefix = project ? `${slugify2(
|
|
68361
|
+
const prefix = project ? `${slugify2(basename6(dir))}-` : "";
|
|
68309
68362
|
const rel = (abs) => relative15(root, abs).split("\\").join("/");
|
|
68310
68363
|
const push = (c) => {
|
|
68311
68364
|
if (!c.files) return;
|
|
@@ -68329,7 +68382,7 @@ function localCandidates(root, dir, project, isRegistered) {
|
|
|
68329
68382
|
push({
|
|
68330
68383
|
name: `${prefix}readme`,
|
|
68331
68384
|
path: rel(dir) || ".",
|
|
68332
|
-
glob: guides.map((g) =>
|
|
68385
|
+
glob: guides.map((g) => basename6(g)),
|
|
68333
68386
|
recursive: false,
|
|
68334
68387
|
files: guides.length,
|
|
68335
68388
|
bytes: sizeOf2(guides),
|
|
@@ -68430,7 +68483,7 @@ function localCandidates(root, dir, project, isRegistered) {
|
|
|
68430
68483
|
push({
|
|
68431
68484
|
name: `${prefix}env-example`,
|
|
68432
68485
|
path: rel(dir) || ".",
|
|
68433
|
-
glob: env.map((f) =>
|
|
68486
|
+
glob: env.map((f) => basename6(f)),
|
|
68434
68487
|
recursive: false,
|
|
68435
68488
|
files: env.length,
|
|
68436
68489
|
bytes: sizeOf2(env),
|
|
@@ -69483,14 +69536,14 @@ import {
|
|
|
69483
69536
|
} from "fs";
|
|
69484
69537
|
import { connect } from "net";
|
|
69485
69538
|
import { homedir as homedir3 } from "os";
|
|
69486
|
-
import { basename as
|
|
69539
|
+
import { basename as basename8, dirname as dirname14, join as join26 } from "path";
|
|
69487
69540
|
import { parseArgs } from "util";
|
|
69488
69541
|
|
|
69489
69542
|
// src/adjudicator/eval.ts
|
|
69490
69543
|
init_esm_shims();
|
|
69491
69544
|
import { createHash as createHash11 } from "crypto";
|
|
69492
69545
|
import { readFile } from "fs/promises";
|
|
69493
|
-
import { basename as
|
|
69546
|
+
import { basename as basename7, extname as extname3, resolve as resolvePath } from "path";
|
|
69494
69547
|
import { pathToFileURL } from "url";
|
|
69495
69548
|
|
|
69496
69549
|
// src/adjudicator/data/evalset.ts
|
|
@@ -72259,7 +72312,7 @@ ${swarm.instructions}`] : []
|
|
|
72259
72312
|
init_esm_shims();
|
|
72260
72313
|
import { execFileSync } from "child_process";
|
|
72261
72314
|
import { readFileSync as readFileSync25, realpathSync as realpathSync11, statSync as statSync18 } from "fs";
|
|
72262
|
-
import { basename as
|
|
72315
|
+
import { basename as basename9, dirname as dirname16, join as join33, resolve as resolve14 } from "path";
|
|
72263
72316
|
|
|
72264
72317
|
// src/hooks/log.ts
|
|
72265
72318
|
init_esm_shims();
|
|
@@ -72335,7 +72388,7 @@ function coordinationRoot(root) {
|
|
|
72335
72388
|
} catch {
|
|
72336
72389
|
return root;
|
|
72337
72390
|
}
|
|
72338
|
-
if (
|
|
72391
|
+
if (basename9(common) === ".git") return realpathSync11(dirname16(common));
|
|
72339
72392
|
const out = execFileSync("git", ["worktree", "list", "--porcelain"], {
|
|
72340
72393
|
cwd: root,
|
|
72341
72394
|
encoding: "utf8",
|
|
@@ -72973,8 +73026,8 @@ for (const tool of listed) {
|
|
|
72973
73026
|
tool.name,
|
|
72974
73027
|
{
|
|
72975
73028
|
description: tool.description,
|
|
72976
|
-
// Every tool accepts an optional project_root
|
|
72977
|
-
//
|
|
73029
|
+
// Every tool accepts an optional project_root, for a caller whose project is not the
|
|
73030
|
+
// server's own (the em_swarm stamp hook names the session's); without it, the server's.
|
|
72978
73031
|
inputSchema: { ...tool.schema, project_root: external_exports.string().optional() }
|
|
72979
73032
|
},
|
|
72980
73033
|
async (args) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eminiar",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.4",
|
|
4
4
|
"description": "Local-first context, memory and knowledge-graph plugin for Claude Code and Cursor. Sandboxed execution, FTS5 + vector search, session continuity, and a code graph — nothing leaves your machine.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -70,6 +70,7 @@
|
|
|
70
70
|
"better-sqlite3": "^13.0.3",
|
|
71
71
|
"fast-glob": "^3.3.3",
|
|
72
72
|
"ignore": "^7.0.12",
|
|
73
|
+
"micromatch": "^4.0.8",
|
|
73
74
|
"sqlite-vec": "^0.1.9",
|
|
74
75
|
"tsx": "^4.23.15",
|
|
75
76
|
"turndown": "^7.2.4",
|
|
@@ -81,6 +82,7 @@
|
|
|
81
82
|
"@biomejs/biome": "^2.5.15",
|
|
82
83
|
"@types/better-sqlite3": "^9.6.0",
|
|
83
84
|
"@types/d3-force": "^3.0.10",
|
|
85
|
+
"@types/micromatch": "^4.0.10",
|
|
84
86
|
"@types/node": "^24.0.0",
|
|
85
87
|
"@types/prismjs": "^1.26.6",
|
|
86
88
|
"@types/turndown": "^5.0.5",
|