@swarmvaultai/engine 0.6.3 → 0.6.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/README.md +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +49 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -292,7 +292,7 @@ Compile and repo-refresh runs also keep benchmark artifacts current by default,
|
|
|
292
292
|
## Notes
|
|
293
293
|
|
|
294
294
|
- The engine expects Node `>=24`
|
|
295
|
-
- The local search layer
|
|
295
|
+
- The local search layer uses the built-in `node:sqlite` module on Node `>=24`; current CLI releases suppress the upstream experimental warning during normal runs
|
|
296
296
|
- The viewer source lives in the companion `@swarmvaultai/viewer` package, and the built assets are bundled into the engine package for CLI installs
|
|
297
297
|
|
|
298
298
|
## Links
|
package/dist/index.d.ts
CHANGED
|
@@ -46,7 +46,7 @@ type Freshness = "fresh" | "stale";
|
|
|
46
46
|
type ClaimStatus = "extracted" | "inferred" | "conflicted" | "stale";
|
|
47
47
|
type EvidenceClass = "extracted" | "inferred" | "ambiguous";
|
|
48
48
|
type Polarity = "positive" | "negative" | "neutral";
|
|
49
|
-
type OutputOrigin = "query" | "explore";
|
|
49
|
+
type OutputOrigin = "query" | "explore" | "source_brief" | "source_review" | "source_guide" | "source_session";
|
|
50
50
|
type OutputFormat = "markdown" | "report" | "slides" | "chart" | "image";
|
|
51
51
|
type OutputAssetRole = "primary" | "preview" | "manifest" | "poster";
|
|
52
52
|
type GraphExportFormat = "html" | "svg" | "graphml" | "cypher";
|
package/dist/index.js
CHANGED
|
@@ -13019,8 +13019,37 @@ async function loadSavedOutputPages(wikiDir) {
|
|
|
13019
13019
|
import fs17 from "fs/promises";
|
|
13020
13020
|
import path21 from "path";
|
|
13021
13021
|
import matter8 from "gray-matter";
|
|
13022
|
+
function warningMessage(warning) {
|
|
13023
|
+
return warning instanceof Error ? warning.message : String(warning);
|
|
13024
|
+
}
|
|
13025
|
+
function warningType(warning, type) {
|
|
13026
|
+
if (warning instanceof Error) {
|
|
13027
|
+
return warning.name;
|
|
13028
|
+
}
|
|
13029
|
+
return typeof type === "string" ? type : void 0;
|
|
13030
|
+
}
|
|
13031
|
+
function isSqliteExperimentalWarning(warning, type) {
|
|
13032
|
+
return warningType(warning, type) === "ExperimentalWarning" && warningMessage(warning).includes("SQLite is an experimental feature");
|
|
13033
|
+
}
|
|
13034
|
+
function withSuppressedSqliteExperimentalWarning(run) {
|
|
13035
|
+
const originalEmitWarning = process.emitWarning.bind(process);
|
|
13036
|
+
process.emitWarning = ((warning, options, ...args) => {
|
|
13037
|
+
const type = typeof options === "string" ? options : typeof options?.type === "string" ? options.type ?? void 0 : void 0;
|
|
13038
|
+
if (isSqliteExperimentalWarning(warning, type)) {
|
|
13039
|
+
return;
|
|
13040
|
+
}
|
|
13041
|
+
return originalEmitWarning(warning, options, ...args);
|
|
13042
|
+
});
|
|
13043
|
+
try {
|
|
13044
|
+
return run();
|
|
13045
|
+
} finally {
|
|
13046
|
+
process.emitWarning = originalEmitWarning;
|
|
13047
|
+
}
|
|
13048
|
+
}
|
|
13022
13049
|
function getDatabaseSync() {
|
|
13023
|
-
const builtin =
|
|
13050
|
+
const builtin = withSuppressedSqliteExperimentalWarning(
|
|
13051
|
+
() => process.getBuiltinModule?.("node:sqlite")
|
|
13052
|
+
);
|
|
13024
13053
|
if (!builtin?.DatabaseSync) {
|
|
13025
13054
|
throw new Error("node:sqlite is unavailable in this Node runtime.");
|
|
13026
13055
|
}
|
|
@@ -13045,7 +13074,7 @@ function normalizeSourceClass2(value) {
|
|
|
13045
13074
|
async function rebuildSearchIndex(dbPath, pages, wikiDir) {
|
|
13046
13075
|
await ensureDir(path21.dirname(dbPath));
|
|
13047
13076
|
const DatabaseSync = getDatabaseSync();
|
|
13048
|
-
const db = new DatabaseSync(dbPath);
|
|
13077
|
+
const db = withSuppressedSqliteExperimentalWarning(() => new DatabaseSync(dbPath));
|
|
13049
13078
|
db.exec("PRAGMA journal_mode = WAL;");
|
|
13050
13079
|
db.exec(`
|
|
13051
13080
|
DROP TABLE IF EXISTS page_search;
|
|
@@ -13123,7 +13152,7 @@ function searchPages(dbPath, query, limitOrOptions = 5) {
|
|
|
13123
13152
|
return [];
|
|
13124
13153
|
}
|
|
13125
13154
|
const DatabaseSync = getDatabaseSync();
|
|
13126
|
-
const db = new DatabaseSync(dbPath, { readOnly: true });
|
|
13155
|
+
const db = withSuppressedSqliteExperimentalWarning(() => new DatabaseSync(dbPath, { readOnly: true }));
|
|
13127
13156
|
const clauses = ["page_search MATCH ?"];
|
|
13128
13157
|
const params = [ftsQuery];
|
|
13129
13158
|
if (options.kind && options.kind !== "all") {
|
|
@@ -17688,7 +17717,7 @@ async function bootstrapDemo(rootDir, input) {
|
|
|
17688
17717
|
}
|
|
17689
17718
|
|
|
17690
17719
|
// src/mcp.ts
|
|
17691
|
-
var SERVER_VERSION = "0.6.
|
|
17720
|
+
var SERVER_VERSION = "0.6.4";
|
|
17692
17721
|
async function createMcpServer(rootDir) {
|
|
17693
17722
|
const server = new McpServer({
|
|
17694
17723
|
name: "swarmvault",
|
|
@@ -18365,6 +18394,15 @@ function uniqueStrings4(values) {
|
|
|
18365
18394
|
function normalizeManagedStatus(value) {
|
|
18366
18395
|
return value === "missing" || value === "error" ? value : "ready";
|
|
18367
18396
|
}
|
|
18397
|
+
function emptyManagedSourceSyncCounts() {
|
|
18398
|
+
return {
|
|
18399
|
+
scannedCount: 0,
|
|
18400
|
+
importedCount: 0,
|
|
18401
|
+
updatedCount: 0,
|
|
18402
|
+
removedCount: 0,
|
|
18403
|
+
skippedCount: 0
|
|
18404
|
+
};
|
|
18405
|
+
}
|
|
18368
18406
|
function withinRoot2(rootPath, targetPath) {
|
|
18369
18407
|
const relative = path26.relative(rootPath, targetPath);
|
|
18370
18408
|
return relative === "" || !relative.startsWith("..") && !path26.isAbsolute(relative);
|
|
@@ -18740,6 +18778,7 @@ async function syncManagedSource(rootDir, entry, options) {
|
|
|
18740
18778
|
updatedAt: now,
|
|
18741
18779
|
lastSyncAt: now,
|
|
18742
18780
|
lastSyncStatus: "error",
|
|
18781
|
+
lastSyncCounts: emptyManagedSourceSyncCounts(),
|
|
18743
18782
|
lastError: `Directory not found: ${entry.path}`,
|
|
18744
18783
|
changed: false
|
|
18745
18784
|
};
|
|
@@ -18756,6 +18795,7 @@ async function syncManagedSource(rootDir, entry, options) {
|
|
|
18756
18795
|
updatedAt: now,
|
|
18757
18796
|
lastSyncAt: now,
|
|
18758
18797
|
lastSyncStatus: "error",
|
|
18798
|
+
lastSyncCounts: emptyManagedSourceSyncCounts(),
|
|
18759
18799
|
lastError: `File not found: ${entry.path}`,
|
|
18760
18800
|
changed: false
|
|
18761
18801
|
};
|
|
@@ -18785,6 +18825,7 @@ async function syncManagedSource(rootDir, entry, options) {
|
|
|
18785
18825
|
updatedAt: now,
|
|
18786
18826
|
lastSyncAt: now,
|
|
18787
18827
|
lastSyncStatus: "error",
|
|
18828
|
+
lastSyncCounts: emptyManagedSourceSyncCounts(),
|
|
18788
18829
|
lastError: error instanceof Error ? error.message : String(error),
|
|
18789
18830
|
changed: false
|
|
18790
18831
|
};
|
|
@@ -18950,7 +18991,7 @@ async function writeSourceBriefForScope(rootDir, source) {
|
|
|
18950
18991
|
relatedSourceIds: source.sourceIds,
|
|
18951
18992
|
projectIds,
|
|
18952
18993
|
extraTags: ["source-brief"],
|
|
18953
|
-
origin: "
|
|
18994
|
+
origin: "source_brief",
|
|
18954
18995
|
slug: `source-briefs/${source.id}`,
|
|
18955
18996
|
metadata: {
|
|
18956
18997
|
status: "active",
|
|
@@ -19196,7 +19237,7 @@ async function buildSourceReviewStagedPage(rootDir, scope) {
|
|
|
19196
19237
|
relatedSourceIds: scope.sourceIds,
|
|
19197
19238
|
projectIds,
|
|
19198
19239
|
extraTags: ["source-review"],
|
|
19199
|
-
origin: "
|
|
19240
|
+
origin: "source_review",
|
|
19200
19241
|
slug: `source-reviews/${scope.id}`,
|
|
19201
19242
|
metadata: {
|
|
19202
19243
|
status: "draft",
|
|
@@ -19443,7 +19484,7 @@ async function buildSourceGuideStagedPage(rootDir, scope) {
|
|
|
19443
19484
|
relatedSourceIds: scope.sourceIds,
|
|
19444
19485
|
projectIds,
|
|
19445
19486
|
extraTags: ["source-guide", "guided-ingest"],
|
|
19446
|
-
origin: "
|
|
19487
|
+
origin: "source_guide",
|
|
19447
19488
|
slug: `source-guides/${scope.id}`,
|
|
19448
19489
|
metadata: {
|
|
19449
19490
|
status: "draft",
|
|
@@ -19597,7 +19638,7 @@ async function buildSourceSessionSavedPage(rootDir, scope, session) {
|
|
|
19597
19638
|
relatedSourceIds: scope.sourceIds,
|
|
19598
19639
|
projectIds,
|
|
19599
19640
|
extraTags: ["source-session", "guided-session"],
|
|
19600
|
-
origin: "
|
|
19641
|
+
origin: "source_session",
|
|
19601
19642
|
slug: `source-sessions/${scope.id}`,
|
|
19602
19643
|
metadata: {
|
|
19603
19644
|
status: "active",
|