@swarmvaultai/viewer 0.1.1
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 +21 -0
- package/README.md +33 -0
- package/dist/assets/index-9TSXS8Kg.css +1 -0
- package/dist/assets/index-DJuffpAB.js +329 -0
- package/dist/index.html +13 -0
- package/dist/lib.d.ts +21 -0
- package/dist/lib.js +11 -0
- package/package.json +61 -0
package/dist/index.html
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>SwarmVault Graph</title>
|
|
7
|
+
<script type="module" crossorigin src="/assets/index-DJuffpAB.js"></script>
|
|
8
|
+
<link rel="stylesheet" crossorigin href="/assets/index-9TSXS8Kg.css">
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
<div id="root"></div>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
package/dist/lib.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
type ViewerGraphNode = {
|
|
2
|
+
id: string;
|
|
3
|
+
type: string;
|
|
4
|
+
label: string;
|
|
5
|
+
sourceIds: string[];
|
|
6
|
+
};
|
|
7
|
+
type ViewerGraphEdge = {
|
|
8
|
+
id: string;
|
|
9
|
+
source: string;
|
|
10
|
+
target: string;
|
|
11
|
+
relation: string;
|
|
12
|
+
status: string;
|
|
13
|
+
};
|
|
14
|
+
type ViewerGraphArtifact = {
|
|
15
|
+
generatedAt: string;
|
|
16
|
+
nodes: ViewerGraphNode[];
|
|
17
|
+
edges: ViewerGraphEdge[];
|
|
18
|
+
};
|
|
19
|
+
declare function fetchGraphArtifact(input?: string, init?: RequestInit): Promise<ViewerGraphArtifact>;
|
|
20
|
+
|
|
21
|
+
export { type ViewerGraphArtifact, type ViewerGraphEdge, type ViewerGraphNode, fetchGraphArtifact };
|
package/dist/lib.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// src/lib.ts
|
|
2
|
+
async function fetchGraphArtifact(input = "/api/graph", init) {
|
|
3
|
+
const response = await fetch(input, init);
|
|
4
|
+
if (!response.ok) {
|
|
5
|
+
throw new Error(`Failed to load graph artifact: ${response.status} ${response.statusText}`);
|
|
6
|
+
}
|
|
7
|
+
return response.json();
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
fetchGraphArtifact
|
|
11
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@swarmvaultai/viewer",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Graph viewer package for SwarmVault graph artifacts.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/lib.js",
|
|
7
|
+
"types": "dist/lib.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/lib.d.ts",
|
|
14
|
+
"import": "./dist/lib.js"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/swarmclawai/swarmvault.git"
|
|
20
|
+
},
|
|
21
|
+
"homepage": "https://swarmvault.ai",
|
|
22
|
+
"bugs": {
|
|
23
|
+
"url": "https://github.com/swarmclawai/swarmvault/issues"
|
|
24
|
+
},
|
|
25
|
+
"keywords": [
|
|
26
|
+
"swarmvault",
|
|
27
|
+
"viewer",
|
|
28
|
+
"graph",
|
|
29
|
+
"cytoscape",
|
|
30
|
+
"knowledge-base",
|
|
31
|
+
"local-first"
|
|
32
|
+
],
|
|
33
|
+
"license": "MIT",
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"access": "public"
|
|
36
|
+
},
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": ">=24.0.0"
|
|
39
|
+
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"cytoscape": "^3.33.1",
|
|
42
|
+
"react": "^19.1.1",
|
|
43
|
+
"react-dom": "^19.1.1"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@types/node": "^24.6.0",
|
|
47
|
+
"@types/react": "^19.1.13",
|
|
48
|
+
"@types/react-dom": "^19.1.9",
|
|
49
|
+
"@vitejs/plugin-react": "^5.0.4",
|
|
50
|
+
"tsup": "^8.5.0",
|
|
51
|
+
"typescript": "^5.9.2",
|
|
52
|
+
"vite": "^7.1.7"
|
|
53
|
+
},
|
|
54
|
+
"scripts": {
|
|
55
|
+
"build": "pnpm run build:lib && pnpm run build:app",
|
|
56
|
+
"build:lib": "tsup src/lib.ts --format esm --dts --out-dir dist --clean",
|
|
57
|
+
"build:app": "vite build",
|
|
58
|
+
"test": "node -e \"process.exit(0)\"",
|
|
59
|
+
"lint": "tsc --noEmit"
|
|
60
|
+
}
|
|
61
|
+
}
|