latticesql 2.2.4 → 2.3.0
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/cli.js +20 -7
- package/dist/index.cjs +10 -1
- package/dist/index.js +10 -1
- package/package.json +8 -9
package/dist/cli.js
CHANGED
|
@@ -21571,10 +21571,14 @@ var textDecoder = new TextDecoder("utf-8");
|
|
|
21571
21571
|
function decodeUtf8(bytes) {
|
|
21572
21572
|
return textDecoder.decode(bytes);
|
|
21573
21573
|
}
|
|
21574
|
-
async function
|
|
21574
|
+
async function loadParser(specifier) {
|
|
21575
21575
|
try {
|
|
21576
21576
|
return await import(specifier);
|
|
21577
|
-
} catch {
|
|
21577
|
+
} catch (err) {
|
|
21578
|
+
console.error(
|
|
21579
|
+
`[latticesql] document parser "${specifier}" failed to load \u2014 document extraction is degraded (likely a broken/partial install or incompatible build). Reinstall dependencies (\`npm install\`). Cause:`,
|
|
21580
|
+
err
|
|
21581
|
+
);
|
|
21578
21582
|
return null;
|
|
21579
21583
|
}
|
|
21580
21584
|
}
|
|
@@ -21716,7 +21720,7 @@ function stripHtml(html) {
|
|
|
21716
21720
|
return text.replace(/[ \t\f\r]+/g, " ").replace(/ *\n */g, "\n").replace(/\n{3,}/g, "\n\n").trim();
|
|
21717
21721
|
}
|
|
21718
21722
|
async function unzip(path2) {
|
|
21719
|
-
const fflate = await
|
|
21723
|
+
const fflate = await loadParser("fflate");
|
|
21720
21724
|
if (!fflate || typeof fflate.unzipSync !== "function") return null;
|
|
21721
21725
|
try {
|
|
21722
21726
|
const buf = await readFile(path2);
|
|
@@ -21735,7 +21739,7 @@ async function unzip(path2) {
|
|
|
21735
21739
|
}
|
|
21736
21740
|
}
|
|
21737
21741
|
async function extractDocx(path2) {
|
|
21738
|
-
const mod = await
|
|
21742
|
+
const mod = await loadParser("mammoth");
|
|
21739
21743
|
const lib = mod?.default ?? mod;
|
|
21740
21744
|
if (!lib || typeof lib.extractRawText !== "function") return null;
|
|
21741
21745
|
try {
|
|
@@ -21746,7 +21750,7 @@ async function extractDocx(path2) {
|
|
|
21746
21750
|
}
|
|
21747
21751
|
}
|
|
21748
21752
|
async function extractDoc(path2) {
|
|
21749
|
-
const mod = await
|
|
21753
|
+
const mod = await loadParser(
|
|
21750
21754
|
"word-extractor"
|
|
21751
21755
|
);
|
|
21752
21756
|
const Ctor = mod && "default" in mod ? mod.default : mod;
|
|
@@ -21759,7 +21763,7 @@ async function extractDoc(path2) {
|
|
|
21759
21763
|
}
|
|
21760
21764
|
}
|
|
21761
21765
|
async function extractPdf(path2) {
|
|
21762
|
-
const unpdf = await
|
|
21766
|
+
const unpdf = await loadParser("unpdf");
|
|
21763
21767
|
if (!unpdf || typeof unpdf.getDocumentProxy !== "function") return null;
|
|
21764
21768
|
try {
|
|
21765
21769
|
const buf = await readFile(path2);
|
|
@@ -22461,8 +22465,17 @@ function titleFromUrl(rawUrl) {
|
|
|
22461
22465
|
}
|
|
22462
22466
|
}
|
|
22463
22467
|
async function sniffMime(body) {
|
|
22468
|
+
let ft;
|
|
22469
|
+
try {
|
|
22470
|
+
ft = await import("file-type");
|
|
22471
|
+
} catch (err) {
|
|
22472
|
+
console.error(
|
|
22473
|
+
`[latticesql] mime sniffer "file-type" failed to load \u2014 crawl mime detection is degraded (likely a broken/partial install). Reinstall dependencies (\`npm install\`). Cause:`,
|
|
22474
|
+
err
|
|
22475
|
+
);
|
|
22476
|
+
return "";
|
|
22477
|
+
}
|
|
22464
22478
|
try {
|
|
22465
|
-
const ft = await import("file-type");
|
|
22466
22479
|
const result = await ft.fileTypeFromBuffer(body);
|
|
22467
22480
|
return result?.mime ?? "";
|
|
22468
22481
|
} catch {
|
package/dist/index.cjs
CHANGED
|
@@ -9607,8 +9607,17 @@ function titleFromUrl(rawUrl) {
|
|
|
9607
9607
|
}
|
|
9608
9608
|
}
|
|
9609
9609
|
async function sniffMime(body) {
|
|
9610
|
+
let ft;
|
|
9611
|
+
try {
|
|
9612
|
+
ft = await import("file-type");
|
|
9613
|
+
} catch (err) {
|
|
9614
|
+
console.error(
|
|
9615
|
+
`[latticesql] mime sniffer "file-type" failed to load \u2014 crawl mime detection is degraded (likely a broken/partial install). Reinstall dependencies (\`npm install\`). Cause:`,
|
|
9616
|
+
err
|
|
9617
|
+
);
|
|
9618
|
+
return "";
|
|
9619
|
+
}
|
|
9610
9620
|
try {
|
|
9611
|
-
const ft = await import("file-type");
|
|
9612
9621
|
const result = await ft.fileTypeFromBuffer(body);
|
|
9613
9622
|
return result?.mime ?? "";
|
|
9614
9623
|
} catch {
|
package/dist/index.js
CHANGED
|
@@ -9472,8 +9472,17 @@ function titleFromUrl(rawUrl) {
|
|
|
9472
9472
|
}
|
|
9473
9473
|
}
|
|
9474
9474
|
async function sniffMime(body) {
|
|
9475
|
+
let ft;
|
|
9476
|
+
try {
|
|
9477
|
+
ft = await import("file-type");
|
|
9478
|
+
} catch (err) {
|
|
9479
|
+
console.error(
|
|
9480
|
+
`[latticesql] mime sniffer "file-type" failed to load \u2014 crawl mime detection is degraded (likely a broken/partial install). Reinstall dependencies (\`npm install\`). Cause:`,
|
|
9481
|
+
err
|
|
9482
|
+
);
|
|
9483
|
+
return "";
|
|
9484
|
+
}
|
|
9475
9485
|
try {
|
|
9476
|
-
const ft = await import("file-type");
|
|
9477
9486
|
const result = await ft.fileTypeFromBuffer(body);
|
|
9478
9487
|
return result?.mime ?? "";
|
|
9479
9488
|
} catch {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "latticesql",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "Persistent structured memory for AI agent systems — pluggable SQLite or Postgres backend, LLM context bridge",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -43,10 +43,16 @@
|
|
|
43
43
|
"prepublishOnly": "npm run check:generic && npm run build && npm run typecheck && npm test"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
+
"@anthropic-ai/sdk": "^0.71.2",
|
|
46
47
|
"@mozilla/readability": "^0.5.0",
|
|
47
48
|
"@scarf/scarf": "^1.4.0",
|
|
49
|
+
"fflate": "^0.8.3",
|
|
50
|
+
"file-type": "^19.6.0",
|
|
48
51
|
"jsdom": "^25.0.1",
|
|
52
|
+
"mammoth": "^1.12.0",
|
|
53
|
+
"unpdf": "^1.6.2",
|
|
49
54
|
"uuid": "^13.0.0",
|
|
55
|
+
"word-extractor": "^1.0.4",
|
|
50
56
|
"yaml": "^2.8.3"
|
|
51
57
|
},
|
|
52
58
|
"scarfSettings": {
|
|
@@ -56,18 +62,11 @@
|
|
|
56
62
|
"better-sqlite3": ">=11 <13"
|
|
57
63
|
},
|
|
58
64
|
"optionalDependencies": {
|
|
59
|
-
"@anthropic-ai/sdk": "^0.71.2",
|
|
60
|
-
"fflate": "^0.8.3",
|
|
61
|
-
"file-type": "^19.6.0",
|
|
62
|
-
"mammoth": "^1.12.0",
|
|
63
65
|
"pg": "^8.11.0",
|
|
64
66
|
"playwright": "^1.48.0",
|
|
65
|
-
"sharp": "^0.33.5"
|
|
66
|
-
"unpdf": "^1.6.2",
|
|
67
|
-
"word-extractor": "^1.0.4"
|
|
67
|
+
"sharp": "^0.33.5"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
|
-
"@anthropic-ai/sdk": "^0.71.0",
|
|
71
70
|
"@eslint/js": "^9.0.0",
|
|
72
71
|
"@playwright/test": "^1.48.0",
|
|
73
72
|
"@types/better-sqlite3": "^7.6.12",
|