@swarmvaultai/engine 0.1.17 → 0.1.19
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 +20 -4
- package/dist/chunk-NCSZ4AKP.js +1057 -0
- package/dist/index.d.ts +111 -5
- package/dist/index.js +2787 -1059
- package/dist/registry-JFEW5RUP.js +12 -0
- package/dist/viewer/assets/index-DWUwoLny.js +330 -0
- package/dist/viewer/index.html +1 -1
- package/dist/viewer/lib.d.ts +60 -1
- package/dist/viewer/lib.js +33 -0
- package/package.json +3 -1
- package/dist/viewer/assets/index-sMKSYq5V.js +0 -330
package/dist/viewer/index.html
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>SwarmVault Graph</title>
|
|
7
|
-
<script type="module" crossorigin src="/assets/index-
|
|
7
|
+
<script type="module" crossorigin src="/assets/index-DWUwoLny.js"></script>
|
|
8
8
|
<link rel="stylesheet" crossorigin href="/assets/index-mRA-6D-Z.css">
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
package/dist/viewer/lib.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ type ViewerGraphEdge = {
|
|
|
29
29
|
target: string;
|
|
30
30
|
relation: string;
|
|
31
31
|
status: string;
|
|
32
|
+
evidenceClass?: string;
|
|
32
33
|
confidence?: number;
|
|
33
34
|
};
|
|
34
35
|
type ViewerGraphPage = {
|
|
@@ -79,6 +80,58 @@ type ViewerPagePayload = {
|
|
|
79
80
|
content: string;
|
|
80
81
|
assets: ViewerOutputAsset[];
|
|
81
82
|
};
|
|
83
|
+
type ViewerGraphQueryResult = {
|
|
84
|
+
question: string;
|
|
85
|
+
traversal: "bfs" | "dfs";
|
|
86
|
+
seedNodeIds: string[];
|
|
87
|
+
seedPageIds: string[];
|
|
88
|
+
visitedNodeIds: string[];
|
|
89
|
+
visitedEdgeIds: string[];
|
|
90
|
+
pageIds: string[];
|
|
91
|
+
communities: string[];
|
|
92
|
+
summary: string;
|
|
93
|
+
matches: Array<{
|
|
94
|
+
type: "node" | "page";
|
|
95
|
+
id: string;
|
|
96
|
+
label: string;
|
|
97
|
+
score: number;
|
|
98
|
+
}>;
|
|
99
|
+
};
|
|
100
|
+
type ViewerGraphPathResult = {
|
|
101
|
+
from: string;
|
|
102
|
+
to: string;
|
|
103
|
+
resolvedFromNodeId?: string;
|
|
104
|
+
resolvedToNodeId?: string;
|
|
105
|
+
found: boolean;
|
|
106
|
+
nodeIds: string[];
|
|
107
|
+
edgeIds: string[];
|
|
108
|
+
pageIds: string[];
|
|
109
|
+
summary: string;
|
|
110
|
+
};
|
|
111
|
+
type ViewerGraphExplainResult = {
|
|
112
|
+
target: string;
|
|
113
|
+
node: ViewerGraphNode;
|
|
114
|
+
page?: {
|
|
115
|
+
id: string;
|
|
116
|
+
path: string;
|
|
117
|
+
title: string;
|
|
118
|
+
};
|
|
119
|
+
community?: {
|
|
120
|
+
id: string;
|
|
121
|
+
label: string;
|
|
122
|
+
};
|
|
123
|
+
neighbors: Array<{
|
|
124
|
+
nodeId: string;
|
|
125
|
+
label: string;
|
|
126
|
+
type: string;
|
|
127
|
+
pageId?: string;
|
|
128
|
+
relation: string;
|
|
129
|
+
direction: "incoming" | "outgoing";
|
|
130
|
+
confidence: number;
|
|
131
|
+
evidenceClass: string;
|
|
132
|
+
}>;
|
|
133
|
+
summary: string;
|
|
134
|
+
};
|
|
82
135
|
type ViewerApprovalSummary = {
|
|
83
136
|
approvalId: string;
|
|
84
137
|
createdAt: string;
|
|
@@ -132,10 +185,16 @@ type ViewerSearchOptions = {
|
|
|
132
185
|
declare function fetchGraphArtifact(input?: string, init?: RequestInit): Promise<ViewerGraphArtifact>;
|
|
133
186
|
declare function searchViewerPages(query: string, options?: ViewerSearchOptions): Promise<ViewerSearchResult[]>;
|
|
134
187
|
declare function fetchViewerPage(path: string): Promise<ViewerPagePayload>;
|
|
188
|
+
declare function fetchGraphQuery(question: string, options?: {
|
|
189
|
+
traversal?: "bfs" | "dfs";
|
|
190
|
+
budget?: number;
|
|
191
|
+
}): Promise<ViewerGraphQueryResult>;
|
|
192
|
+
declare function fetchGraphPath(from: string, to: string): Promise<ViewerGraphPathResult>;
|
|
193
|
+
declare function fetchGraphExplain(target: string): Promise<ViewerGraphExplainResult>;
|
|
135
194
|
declare function fetchApprovals(): Promise<ViewerApprovalSummary[]>;
|
|
136
195
|
declare function fetchApprovalDetail(approvalId: string): Promise<ViewerApprovalDetail>;
|
|
137
196
|
declare function applyReviewAction(approvalId: string, action: "accept" | "reject", targets?: string[]): Promise<ViewerReviewActionResult>;
|
|
138
197
|
declare function fetchCandidates(): Promise<ViewerCandidateRecord[]>;
|
|
139
198
|
declare function applyCandidateAction(target: string, action: "promote" | "archive"): Promise<ViewerCandidateRecord>;
|
|
140
199
|
|
|
141
|
-
export { type ViewerApprovalDetail, type ViewerApprovalEntry, type ViewerApprovalSummary, type ViewerCandidateRecord, type ViewerGraphArtifact, type ViewerGraphEdge, type ViewerGraphNode, type ViewerGraphPage, type ViewerOutputAsset, type ViewerPagePayload, type ViewerReviewActionResult, type ViewerSearchOptions, type ViewerSearchResult, applyCandidateAction, applyReviewAction, fetchApprovalDetail, fetchApprovals, fetchCandidates, fetchGraphArtifact, fetchViewerPage, searchViewerPages };
|
|
200
|
+
export { type ViewerApprovalDetail, type ViewerApprovalEntry, type ViewerApprovalSummary, type ViewerCandidateRecord, type ViewerGraphArtifact, type ViewerGraphEdge, type ViewerGraphExplainResult, type ViewerGraphNode, type ViewerGraphPage, type ViewerGraphPathResult, type ViewerGraphQueryResult, type ViewerOutputAsset, type ViewerPagePayload, type ViewerReviewActionResult, type ViewerSearchOptions, type ViewerSearchResult, applyCandidateAction, applyReviewAction, fetchApprovalDetail, fetchApprovals, fetchCandidates, fetchGraphArtifact, fetchGraphExplain, fetchGraphPath, fetchGraphQuery, fetchViewerPage, searchViewerPages };
|
package/dist/viewer/lib.js
CHANGED
|
@@ -94,6 +94,36 @@ async function fetchViewerPage(path) {
|
|
|
94
94
|
}
|
|
95
95
|
return response.json();
|
|
96
96
|
}
|
|
97
|
+
async function fetchGraphQuery(question, options = {}) {
|
|
98
|
+
const params = new URLSearchParams({
|
|
99
|
+
q: question,
|
|
100
|
+
traversal: options.traversal ?? "bfs",
|
|
101
|
+
budget: String(options.budget ?? 12)
|
|
102
|
+
});
|
|
103
|
+
const response = await fetch(`/api/graph/query?${params.toString()}`);
|
|
104
|
+
if (!response.ok) {
|
|
105
|
+
throw new Error(`Failed to query graph: ${response.status} ${response.statusText}`);
|
|
106
|
+
}
|
|
107
|
+
return response.json();
|
|
108
|
+
}
|
|
109
|
+
async function fetchGraphPath(from, to) {
|
|
110
|
+
const params = new URLSearchParams({
|
|
111
|
+
from,
|
|
112
|
+
to
|
|
113
|
+
});
|
|
114
|
+
const response = await fetch(`/api/graph/path?${params.toString()}`);
|
|
115
|
+
if (!response.ok) {
|
|
116
|
+
throw new Error(`Failed to find graph path: ${response.status} ${response.statusText}`);
|
|
117
|
+
}
|
|
118
|
+
return response.json();
|
|
119
|
+
}
|
|
120
|
+
async function fetchGraphExplain(target) {
|
|
121
|
+
const response = await fetch(`/api/graph/explain?target=${encodeURIComponent(target)}`);
|
|
122
|
+
if (!response.ok) {
|
|
123
|
+
throw new Error(`Failed to explain graph target: ${response.status} ${response.statusText}`);
|
|
124
|
+
}
|
|
125
|
+
return response.json();
|
|
126
|
+
}
|
|
97
127
|
async function fetchApprovals() {
|
|
98
128
|
if (embeddedData()) {
|
|
99
129
|
return [];
|
|
@@ -159,6 +189,9 @@ export {
|
|
|
159
189
|
fetchApprovals,
|
|
160
190
|
fetchCandidates,
|
|
161
191
|
fetchGraphArtifact,
|
|
192
|
+
fetchGraphExplain,
|
|
193
|
+
fetchGraphPath,
|
|
194
|
+
fetchGraphQuery,
|
|
162
195
|
fetchViewerPage,
|
|
163
196
|
searchViewerPages
|
|
164
197
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swarmvaultai/engine",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.19",
|
|
4
4
|
"description": "Core engine for SwarmVault: ingest, compile, query, lint, and provider abstractions.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -40,10 +40,12 @@
|
|
|
40
40
|
"node": ">=24.0.0"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
+
"@vscode/tree-sitter-wasm": "^0.3.1",
|
|
43
44
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
44
45
|
"@mozilla/readability": "^0.6.0",
|
|
45
46
|
"chokidar": "^4.0.3",
|
|
46
47
|
"gray-matter": "^4.0.3",
|
|
48
|
+
"ignore": "^7.0.5",
|
|
47
49
|
"jsdom": "^27.0.0",
|
|
48
50
|
"mime-types": "^3.0.1",
|
|
49
51
|
"typescript": "^5.9.3",
|