@swarmvaultai/engine 0.1.1 → 0.1.2

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.
@@ -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>
@@ -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 };
@@ -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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swarmvaultai/engine",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Core engine for SwarmVault: ingest, compile, query, lint, and provider abstractions.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -45,8 +45,7 @@
45
45
  "jsdom": "^27.0.0",
46
46
  "mime-types": "^3.0.1",
47
47
  "turndown": "^7.2.1",
48
- "zod": "^4.1.8",
49
- "@swarmvaultai/viewer": "0.1.1"
48
+ "zod": "^4.1.8"
50
49
  },
51
50
  "devDependencies": {
52
51
  "@types/jsdom": "^27.0.0",
@@ -57,7 +56,7 @@
57
56
  "vitest": "^3.2.4"
58
57
  },
59
58
  "scripts": {
60
- "build": "tsup src/index.ts --format esm --dts",
59
+ "build": "test -f ../viewer/dist/index.html || pnpm --dir ../viewer build; tsup src/index.ts --format esm --dts && rm -rf dist/viewer && mkdir -p dist/viewer && cp -R ../viewer/dist/. dist/viewer/",
61
60
  "test": "vitest run",
62
61
  "lint": "tsc --noEmit"
63
62
  }