@harness-engineering/graph 0.2.2 → 0.2.3

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 CHANGED
@@ -550,7 +550,7 @@ var CodeIngestor = class {
550
550
  const fileContents = /* @__PURE__ */ new Map();
551
551
  for (const filePath of files) {
552
552
  try {
553
- const relativePath = path.relative(rootDir, filePath);
553
+ const relativePath = path.relative(rootDir, filePath).replace(/\\/g, "/");
554
554
  const content = await fs.readFile(filePath, "utf-8");
555
555
  const stat2 = await fs.stat(filePath);
556
556
  const fileId = `file:${relativePath}`;
@@ -840,7 +840,7 @@ var CodeIngestor = class {
840
840
  }
841
841
  async resolveImportPath(fromFile, importPath, rootDir) {
842
842
  const fromDir = path.dirname(fromFile);
843
- const resolved = path.normalize(path.join(fromDir, importPath));
843
+ const resolved = path.normalize(path.join(fromDir, importPath)).replace(/\\/g, "/");
844
844
  const extensions = [".ts", ".tsx", ".js", ".jsx"];
845
845
  for (const ext of extensions) {
846
846
  const candidate = resolved.replace(/\.js$/, "") + ext;
@@ -852,7 +852,7 @@ var CodeIngestor = class {
852
852
  }
853
853
  }
854
854
  for (const ext of extensions) {
855
- const candidate = path.join(resolved, `index${ext}`);
855
+ const candidate = path.join(resolved, `index${ext}`).replace(/\\/g, "/");
856
856
  const fullPath = path.join(rootDir, candidate);
857
857
  try {
858
858
  await fs.access(fullPath);
@@ -1172,7 +1172,7 @@ var path3 = __toESM(require("path"));
1172
1172
  // src/ingest/ingestUtils.ts
1173
1173
  var crypto = __toESM(require("crypto"));
1174
1174
  function hash(text) {
1175
- return crypto.createHash("md5").update(text).digest("hex").slice(0, 8);
1175
+ return crypto.createHash("sha256").update(text).digest("hex").slice(0, 8);
1176
1176
  }
1177
1177
  function mergeResults(...results) {
1178
1178
  return {
package/dist/index.mjs CHANGED
@@ -483,7 +483,7 @@ var CodeIngestor = class {
483
483
  const fileContents = /* @__PURE__ */ new Map();
484
484
  for (const filePath of files) {
485
485
  try {
486
- const relativePath = path.relative(rootDir, filePath);
486
+ const relativePath = path.relative(rootDir, filePath).replace(/\\/g, "/");
487
487
  const content = await fs.readFile(filePath, "utf-8");
488
488
  const stat2 = await fs.stat(filePath);
489
489
  const fileId = `file:${relativePath}`;
@@ -773,7 +773,7 @@ var CodeIngestor = class {
773
773
  }
774
774
  async resolveImportPath(fromFile, importPath, rootDir) {
775
775
  const fromDir = path.dirname(fromFile);
776
- const resolved = path.normalize(path.join(fromDir, importPath));
776
+ const resolved = path.normalize(path.join(fromDir, importPath)).replace(/\\/g, "/");
777
777
  const extensions = [".ts", ".tsx", ".js", ".jsx"];
778
778
  for (const ext of extensions) {
779
779
  const candidate = resolved.replace(/\.js$/, "") + ext;
@@ -785,7 +785,7 @@ var CodeIngestor = class {
785
785
  }
786
786
  }
787
787
  for (const ext of extensions) {
788
- const candidate = path.join(resolved, `index${ext}`);
788
+ const candidate = path.join(resolved, `index${ext}`).replace(/\\/g, "/");
789
789
  const fullPath = path.join(rootDir, candidate);
790
790
  try {
791
791
  await fs.access(fullPath);
@@ -1105,7 +1105,7 @@ import * as path3 from "path";
1105
1105
  // src/ingest/ingestUtils.ts
1106
1106
  import * as crypto from "crypto";
1107
1107
  function hash(text) {
1108
- return crypto.createHash("md5").update(text).digest("hex").slice(0, 8);
1108
+ return crypto.createHash("sha256").update(text).digest("hex").slice(0, 8);
1109
1109
  }
1110
1110
  function mergeResults(...results) {
1111
1111
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harness-engineering/graph",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "license": "MIT",
5
5
  "description": "Knowledge graph for context assembly in Harness Engineering",
6
6
  "main": "./dist/index.js",
@@ -21,7 +21,7 @@
21
21
  "lokijs": "^1.5.12",
22
22
  "minimatch": "^10.2.4",
23
23
  "zod": "^3.24.1",
24
- "@harness-engineering/types": "0.1.0"
24
+ "@harness-engineering/types": "0.2.0"
25
25
  },
26
26
  "optionalDependencies": {
27
27
  "hnswlib-node": "^3.0.0",
@@ -52,7 +52,7 @@
52
52
  "dev": "tsup src/index.ts --format cjs,esm --dts --watch",
53
53
  "lint": "eslint src",
54
54
  "typecheck": "tsc --noEmit",
55
- "clean": "rm -rf dist",
55
+ "clean": "node ../../scripts/clean.mjs dist",
56
56
  "test": "vitest run",
57
57
  "test:watch": "vitest",
58
58
  "test:coverage": "vitest run --coverage"