agentsbestfriend 0.1.2 → 0.1.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/index.js +15 -13
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -5,16 +5,10 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
9
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
10
|
-
}) : x)(function(x) {
|
|
11
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
12
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
13
|
-
});
|
|
14
8
|
var __esm = (fn, res) => function __init() {
|
|
15
9
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
16
10
|
};
|
|
17
|
-
var __commonJS = (cb, mod) => function
|
|
11
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
18
12
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
19
13
|
};
|
|
20
14
|
var __export = (target, all) => {
|
|
@@ -18177,7 +18171,7 @@ var init_search = __esm({
|
|
|
18177
18171
|
|
|
18178
18172
|
// ../core/dist/utils/index.js
|
|
18179
18173
|
import { createHash } from "crypto";
|
|
18180
|
-
import { readFileSync as readFileSync3 } from "fs";
|
|
18174
|
+
import { readFileSync as readFileSync3, openSync, readSync, closeSync } from "fs";
|
|
18181
18175
|
import { extname } from "path";
|
|
18182
18176
|
function hashFileContent(content) {
|
|
18183
18177
|
return createHash("sha256").update(content, "utf-8").digest("hex");
|
|
@@ -18267,9 +18261,9 @@ function countLines(content) {
|
|
|
18267
18261
|
function isBinaryFile(filePath) {
|
|
18268
18262
|
try {
|
|
18269
18263
|
const buffer = Buffer.alloc(8192);
|
|
18270
|
-
const fd =
|
|
18271
|
-
const bytesRead =
|
|
18272
|
-
|
|
18264
|
+
const fd = openSync(filePath, "r");
|
|
18265
|
+
const bytesRead = readSync(fd, buffer, 0, 8192, 0);
|
|
18266
|
+
closeSync(fd);
|
|
18273
18267
|
for (let i = 0; i < bytesRead; i++) {
|
|
18274
18268
|
if (buffer[i] === 0)
|
|
18275
18269
|
return true;
|
|
@@ -19062,7 +19056,15 @@ async function initCommand(projectPath) {
|
|
|
19062
19056
|
}
|
|
19063
19057
|
const s = clack.spinner();
|
|
19064
19058
|
s.start("Running initial index...");
|
|
19065
|
-
|
|
19059
|
+
let stats;
|
|
19060
|
+
try {
|
|
19061
|
+
stats = await runIndexPipeline(root);
|
|
19062
|
+
} catch (err) {
|
|
19063
|
+
s.stop("Indexing failed");
|
|
19064
|
+
const msg = err instanceof Error ? err.stack ?? err.message : String(err);
|
|
19065
|
+
clack.log.error(msg);
|
|
19066
|
+
process.exit(1);
|
|
19067
|
+
}
|
|
19066
19068
|
s.stop("Indexing complete");
|
|
19067
19069
|
clack.log.info(
|
|
19068
19070
|
[
|
|
@@ -44803,6 +44805,7 @@ function buildChunks(symbols2, totalLines) {
|
|
|
44803
44805
|
import { readFileSync as readFileSync8 } from "fs";
|
|
44804
44806
|
import { join as join11, dirname, resolve } from "path";
|
|
44805
44807
|
import { existsSync as existsSync4 } from "fs";
|
|
44808
|
+
import { execFileSync } from "child_process";
|
|
44806
44809
|
function registerDependenciesTool(server) {
|
|
44807
44810
|
server.tool("abf_dependencies", "Show imports and reverse dependencies (imported_by) for a file.", {
|
|
44808
44811
|
file_path: external_exports3.string().describe("Path to the file"),
|
|
@@ -44875,7 +44878,6 @@ function tryResolve(importPath, fromDir) {
|
|
|
44875
44878
|
return null;
|
|
44876
44879
|
}
|
|
44877
44880
|
function findImportedBy(cwd, targetRelPath) {
|
|
44878
|
-
const { execFileSync } = __require("child_process");
|
|
44879
44881
|
let filePaths;
|
|
44880
44882
|
try {
|
|
44881
44883
|
const stdout = execFileSync("git", ["ls-files", "--cached", "--others", "--exclude-standard"], { cwd, maxBuffer: 10 * 1024 * 1024 }).toString();
|