@swarmvaultai/engine 0.1.26 → 0.1.27

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 SwarmVault
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/index.js CHANGED
@@ -663,6 +663,7 @@ async function uninstallGitHooks(rootDir) {
663
663
  // src/ingest.ts
664
664
  import fs9 from "fs/promises";
665
665
  import path10 from "path";
666
+ import { pathToFileURL } from "url";
666
667
  import { Readability } from "@mozilla/readability";
667
668
  import matter3 from "gray-matter";
668
669
  import ignore from "ignore";
@@ -3342,6 +3343,9 @@ function inferKind(mimeType, filePath) {
3342
3343
  if (mimeType.includes("markdown")) {
3343
3344
  return "markdown";
3344
3345
  }
3346
+ if (mimeType.includes("html")) {
3347
+ return "html";
3348
+ }
3345
3349
  if (mimeType.startsWith("text/")) {
3346
3350
  return "text";
3347
3351
  }
@@ -3351,9 +3355,6 @@ function inferKind(mimeType, filePath) {
3351
3355
  if (mimeType.startsWith("image/")) {
3352
3356
  return "image";
3353
3357
  }
3354
- if (mimeType.includes("html")) {
3355
- return "html";
3356
- }
3357
3358
  return "binary";
3358
3359
  }
3359
3360
  function titleFromText(fallback, content) {
@@ -4429,6 +4430,12 @@ async function prepareFileInput(rootDir, absoluteInput, repoRoot, sourceClass) {
4429
4430
  extractedText = payloadBytes.toString("utf8");
4430
4431
  title = titleFromText(path10.basename(absoluteInput, path10.extname(absoluteInput)), extractedText);
4431
4432
  extractionArtifact = createPlainTextExtractionArtifact(sourceKind, mimeType);
4433
+ } else if (sourceKind === "html") {
4434
+ const html = payloadBytes.toString("utf8");
4435
+ const converted = await convertHtmlToMarkdown(html, pathToFileURL(absoluteInput).toString());
4436
+ title = converted.title;
4437
+ extractedText = converted.markdown;
4438
+ extractionArtifact = createHtmlReadabilityExtractionArtifact(sourceKind, mimeType);
4432
4439
  } else if (sourceKind === "pdf") {
4433
4440
  title = path10.basename(absoluteInput, path10.extname(absoluteInput));
4434
4441
  const extracted = await extractPdfText({ mimeType, bytes: payloadBytes });
@@ -5681,7 +5688,7 @@ function summarizeRoleQuestions(results) {
5681
5688
 
5682
5689
  // src/web-search/registry.ts
5683
5690
  import path14 from "path";
5684
- import { pathToFileURL } from "url";
5691
+ import { pathToFileURL as pathToFileURL2 } from "url";
5685
5692
  import { z as z4 } from "zod";
5686
5693
 
5687
5694
  // src/web-search/http-json.ts
@@ -5779,7 +5786,7 @@ async function createWebSearchAdapter(id, config, rootDir) {
5779
5786
  throw new Error(`Web search provider ${id} is type "custom" but no module path was configured.`);
5780
5787
  }
5781
5788
  const resolvedModule = path14.isAbsolute(config.module) ? config.module : path14.resolve(rootDir, config.module);
5782
- const loaded = await import(pathToFileURL(resolvedModule).href);
5789
+ const loaded = await import(pathToFileURL2(resolvedModule).href);
5783
5790
  const parsed = customWebSearchModuleSchema.parse(loaded);
5784
5791
  return parsed.createAdapter(id, config, rootDir);
5785
5792
  }
@@ -12475,7 +12482,7 @@ async function bootstrapDemo(rootDir, input) {
12475
12482
  }
12476
12483
 
12477
12484
  // src/mcp.ts
12478
- var SERVER_VERSION = "0.1.26";
12485
+ var SERVER_VERSION = "0.1.27";
12479
12486
  async function createMcpServer(rootDir) {
12480
12487
  const server = new McpServer({
12481
12488
  name: "swarmvault",