@graphty/graphty-element 2.3.0 → 2.4.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/AGENTS.md +4 -3
- package/dist/ai.js +115 -222
- package/dist/catalog.js +46 -44
- package/dist/chunks/{AiManager-Bd_r1Hei.js → AiManager-BD9XK30e.js} +793 -654
- package/dist/chunks/{DataSource-bt0DhBjG.js → DataSource-B8vf2uhW.js} +3 -3
- package/dist/chunks/{GraphSession-iNyKm7Ds.js → GraphSession-dcwOjGJh.js} +3028 -2918
- package/dist/chunks/{GraphStyle-D0PXnZKu.js → GraphStyle-Cwr55SAE.js} +5 -2
- package/dist/chunks/{GraphtyError-BwcnblTH.js → GraphtyError-B93WRH3e.js} +8 -6
- package/dist/chunks/{GraphtyLogger-5KEttFUo.js → GraphtyLogger-CqOVV13Y.js} +2 -2
- package/dist/chunks/{NodeStyle-DKj7HjMJ.js → NodeStyle-CtmA7dXi.js} +16 -14
- package/dist/chunks/{VoiceInputAdapter-DszYl6Ha.js → VoiceInputAdapter-D0tHHi9G.js} +1 -1
- package/dist/chunks/{XRPivotCameraController-XtxbbZ-D.js → XRPivotCameraController-DTfhvhHz.js} +2 -2
- package/dist/chunks/algorithms-BF0X6RPw.js +3627 -0
- package/dist/chunks/{capability-check-BqIEXcun.js → capability-check-BJzlK4oL.js} +1 -1
- package/dist/chunks/{detect-DM29BEaB.js → detect-vJxK7n0D.js} +2 -2
- package/dist/chunks/{format-detection-BEdmtvsy.js → format-detection-C80TLQ2e.js} +1 -1
- package/dist/chunks/{index-CD0_RJv-.js → index-2xkq7wyD.js} +11482 -10971
- package/dist/chunks/optionsFromZod-BuTOFgVM.js +2572 -0
- package/dist/chunks/paletteRegistry-A63C71Gn.js +1155 -0
- package/dist/chunks/{registry-CSba5QGJ.js → registry-jB46Gmeb.js} +1 -1
- package/dist/chunks/scales-B2d-7Bf0.js +3220 -0
- package/dist/chunks/{types-B7bX5c0K.js → types-C_c53VgR.js} +31 -26
- package/dist/commands.d.ts +4 -0
- package/dist/custom-elements.json +1 -1
- package/dist/extend.js +45 -45
- package/dist/graphty-catalog.json +245 -12
- package/dist/graphty.bundle.js +40762 -39403
- package/dist/graphty.js +33 -33
- package/dist/logging.js +2 -2
- package/dist/schema.d.ts +1 -1
- package/dist/schema.js +42 -40
- package/dist/session.d.ts +1 -1
- package/dist/session.js +29 -30
- package/dist/src/Graph.d.ts +112 -10
- package/dist/src/acceleration/AccelerationController.d.ts +14 -3
- package/dist/src/acceleration/types.d.ts +78 -0
- package/dist/src/algorithms/KCoreAlgorithm.d.ts +26 -0
- package/dist/src/algorithms/LinkPredictionAlgorithm.d.ts +41 -0
- package/dist/src/camera/builtins.d.ts +14 -1
- package/dist/src/camera/types.d.ts +7 -0
- package/dist/src/cameras/CameraManager.d.ts +13 -0
- package/dist/src/cameras/OrbitCameraController.d.ts +9 -0
- package/dist/src/catalog/algorithms.d.ts +5 -5
- package/dist/src/catalog/index.d.ts +2 -2
- package/dist/src/catalog/layouts.d.ts +7 -6
- package/dist/src/catalog/types.d.ts +87 -6
- package/dist/src/config/EdgeStyle.d.ts +35 -0
- package/dist/src/config/GraphStyle.d.ts +5 -1
- package/dist/src/config/StyleTemplate.d.ts +2 -2
- package/dist/src/config/index.d.ts +1 -1
- package/dist/src/data/GEXFDataSource.d.ts +23 -0
- package/dist/src/errors/codes.d.ts +14 -0
- package/dist/src/events.d.ts +30 -0
- package/dist/src/graphty-element.d.ts +77 -32
- package/dist/src/layout/GridLayoutEngine.d.ts +37 -0
- package/dist/src/layout/LayoutEngine.d.ts +7 -7
- package/dist/src/layout/NGraphLayoutEngine.d.ts +2 -0
- package/dist/src/layout/RadialLayoutEngine.d.ts +37 -0
- package/dist/src/layout/SimulationLayoutEngine.d.ts +12 -0
- package/dist/src/managers/DataManager.d.ts +69 -2
- package/dist/src/managers/EventManager.d.ts +10 -4
- package/dist/src/managers/GraphContext.d.ts +2 -1
- package/dist/src/managers/LayoutManager.d.ts +30 -3
- package/dist/src/managers/StylePainter.d.ts +9 -0
- package/dist/src/managers/UpdateManager.d.ts +5 -0
- package/dist/src/meshes/MeshCache.d.ts +18 -0
- package/dist/src/meshes/NodeEffects.d.ts +16 -11
- package/dist/src/meshes/NodeMesh.d.ts +2 -2
- package/dist/src/meshes/RichTextParser.d.ts +26 -0
- package/dist/src/meshes/RichTextRenderer.d.ts +0 -1
- package/dist/src/session/cost/estimate.d.ts +1 -1
- package/dist/src/session/layout.d.ts +3 -3
- package/dist/src/session/results/index.d.ts +1 -1
- package/dist/src/session/results/statistics.d.ts +8 -1
- package/dist/src/session/results/types.d.ts +33 -0
- package/dist/src/session/runs/RunsApi.d.ts +1 -1
- package/dist/src/session/selection/targets.d.ts +4 -1
- package/dist/src/session/styles/StylesApi.d.ts +6 -0
- package/dist/src/session/styles/intern.d.ts +26 -5
- package/dist/src/session/styles/predicate.d.ts +26 -1
- package/dist/src/session/styles/repaint.d.ts +13 -1
- package/dist/src/session/styles/selector.d.ts +13 -1
- package/dist/src/session/styles/sources.d.ts +9 -0
- package/dist/src/session/types.d.ts +6 -6
- package/dist/webgpu.js +2 -2
- package/package.json +6 -6
- package/dist/chunks/Algorithm-RQ629NLb.js +0 -494
- package/dist/chunks/cameras-ii4vngYY.js +0 -435
- package/dist/chunks/paletteRegistry-DnWHQsAD.js +0 -3166
- package/dist/chunks/scales-DyuwlJKI.js +0 -6087
package/AGENTS.md
CHANGED
|
@@ -68,7 +68,7 @@ needs no import map.
|
|
|
68
68
|
| Import | What it carries | Runs in Node |
|
|
69
69
|
| --- | --- | --- |
|
|
70
70
|
| `@graphty/graphty-element` | The custom element. Importing it defines the tag and registers the built-in layouts, data sources and algorithms. Pulls in Babylon.js and Lit. | No |
|
|
71
|
-
| `@graphty/graphty-element/schema` | Palettes, `NodeShapes`, `defaultNodeStyle`, `defaultEdgeStyle`, `defaultRichTextLabelStyle`, the style config types and the colour helpers (`interpolatePalette`, `hexToRgb`, the colour-vision simulators). | Yes |
|
|
71
|
+
| `@graphty/graphty-element/schema` | Palettes, `NodeShapes`, `EdgeLineTypes`, `EdgeArrowTypes`, `defaultNodeStyle`, `defaultEdgeStyle`, `defaultRichTextLabelStyle`, the style config types and the colour helpers (`interpolatePalette`, `hexToRgb`, the colour-vision simulators). | Yes |
|
|
72
72
|
| `@graphty/graphty-element/catalog` | Plain-JSON descriptors for every algorithm, layout, file format, palette and scale, with the options each accepts. Build an options form from these instead of hard-coding a list. | Yes |
|
|
73
73
|
| `@graphty/graphty-element/extend` | The registration surface: `Algorithm`, `LayoutEngine`, `DataSource`, `registerAccelerator`, `registerLogSink`, `GraphtyError`. | Yes |
|
|
74
74
|
| `@graphty/graphty-element/format` | The read-only half of the graph-format vocabulary: `isGraphSnapshot`, the mask helpers, `expandEdges`, `foldArcs`, the gather/scatter/remap helpers. | Yes |
|
|
@@ -117,8 +117,9 @@ silently do nothing:
|
|
|
117
117
|
rather than resolved, so "how many nodes would this selector pick" has no answer.
|
|
118
118
|
- **A time role.** Nothing infers that an attribute is a timestamp, so there is no way to ask
|
|
119
119
|
whether a graph can be played over time.
|
|
120
|
-
- **The command union and the journal.** `@graphty/graphty-element/commands`
|
|
121
|
-
|
|
120
|
+
- **The command union and the journal.** `@graphty/graphty-element/commands` exports nothing
|
|
121
|
+
and is deprecated: it is removed at the next major release unless the command union lands
|
|
122
|
+
there first. Do not import it; read `@graphty/graphty-element/catalog` for the vocabulary.
|
|
122
123
|
- **The React wrappers.** `@graphty/graphty-element/react` currently exports nothing. In React 19
|
|
123
124
|
use the tag directly, which assigns matching props as properties.
|
|
124
125
|
|
package/dist/ai.js
CHANGED
|
@@ -1,124 +1,17 @@
|
|
|
1
|
-
import { f as
|
|
2
|
-
import { A as
|
|
3
|
-
import { A as
|
|
4
|
-
import { V as
|
|
5
|
-
import { z as
|
|
6
|
-
|
|
7
|
-
const m = r.object({
|
|
8
|
-
namespace: r.string().describe("The namespace of the algorithm (e.g., 'graphty')"),
|
|
9
|
-
type: r.string().describe("The type of algorithm to run (e.g., 'degree', 'pagerank')")
|
|
10
|
-
}), h = r.object({
|
|
11
|
-
namespace: r.string().optional().describe("Optional namespace to filter algorithms by")
|
|
12
|
-
}), w = {
|
|
13
|
-
name: "runAlgorithm",
|
|
14
|
-
description: "Run a graph algorithm to analyze the graph structure. Available algorithms include degree centrality, pagerank, and others that compute metrics for nodes and edges.",
|
|
15
|
-
parameters: m,
|
|
16
|
-
examples: [
|
|
17
|
-
{
|
|
18
|
-
input: "Calculate the degree of each node",
|
|
19
|
-
params: { namespace: "graphty", type: "degree" }
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
input: "Run pagerank algorithm",
|
|
23
|
-
params: { namespace: "graphty", type: "pagerank" }
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
input: "Compute centrality metrics",
|
|
27
|
-
params: { namespace: "graphty", type: "degree" }
|
|
28
|
-
}
|
|
29
|
-
],
|
|
30
|
-
async execute(n, a) {
|
|
31
|
-
const e = m.safeParse(a);
|
|
32
|
-
if (!e.success)
|
|
33
|
-
return {
|
|
34
|
-
success: !1,
|
|
35
|
-
message: `Invalid parameters: ${e.error.message}`
|
|
36
|
-
};
|
|
37
|
-
const { namespace: t, type: s } = e.data;
|
|
38
|
-
try {
|
|
39
|
-
if (!u.get(n, t, s)) {
|
|
40
|
-
const i = u.getRegisteredAlgorithms(t), o = i.length > 0 ? `Available in namespace '${t}': ${i.map((l) => l.split(":")[1]).join(", ")}` : `No algorithms found in namespace '${t}'. Use listAlgorithms to see available options.`;
|
|
41
|
-
return {
|
|
42
|
-
success: !1,
|
|
43
|
-
message: `Algorithm not found: ${t}:${s}. ${o}`
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
return await n.runAlgorithm(t, s), {
|
|
47
|
-
success: !0,
|
|
48
|
-
message: `Successfully ran ${t}:${s} algorithm. Results are now available in node data.`,
|
|
49
|
-
data: {
|
|
50
|
-
namespace: t,
|
|
51
|
-
type: s,
|
|
52
|
-
nodeCount: n.getNodeCount()
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
} catch (c) {
|
|
56
|
-
return {
|
|
57
|
-
success: !1,
|
|
58
|
-
message: `Failed to run algorithm ${t}:${s}: ${c instanceof Error ? c.message : String(c)}`
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}, $ = {
|
|
63
|
-
name: "listAlgorithms",
|
|
64
|
-
description: "List all available graph algorithms that can be run on the graph. Optionally filter by namespace.",
|
|
65
|
-
parameters: h,
|
|
66
|
-
examples: [
|
|
67
|
-
{
|
|
68
|
-
input: "What algorithms are available?",
|
|
69
|
-
params: {}
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
input: "List graphty algorithms",
|
|
73
|
-
params: { namespace: "graphty" }
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
input: "Show me the available analysis tools",
|
|
77
|
-
params: {}
|
|
78
|
-
}
|
|
79
|
-
],
|
|
80
|
-
// eslint-disable-next-line @typescript-eslint/require-await
|
|
81
|
-
async execute(n, a) {
|
|
82
|
-
const e = h.safeParse(a);
|
|
83
|
-
if (!e.success)
|
|
84
|
-
return {
|
|
85
|
-
success: !1,
|
|
86
|
-
message: `Invalid parameters: ${e.error.message}`
|
|
87
|
-
};
|
|
88
|
-
const { namespace: t } = e.data;
|
|
89
|
-
try {
|
|
90
|
-
const s = u.getRegisteredAlgorithms(t);
|
|
91
|
-
return s.length === 0 ? {
|
|
92
|
-
success: !0,
|
|
93
|
-
message: t ? `No algorithms found in namespace '${t}'.` : "No algorithms are currently registered.",
|
|
94
|
-
data: {
|
|
95
|
-
algorithms: [],
|
|
96
|
-
count: 0
|
|
97
|
-
}
|
|
98
|
-
} : {
|
|
99
|
-
success: !0,
|
|
100
|
-
message: t ? `Found ${s.length} algorithm(s) in namespace '${t}': ${s.join(", ")}` : `Found ${s.length} available algorithm(s): ${s.join(", ")}`,
|
|
101
|
-
data: {
|
|
102
|
-
algorithms: s,
|
|
103
|
-
count: s.length
|
|
104
|
-
}
|
|
105
|
-
};
|
|
106
|
-
} catch (s) {
|
|
107
|
-
return {
|
|
108
|
-
success: !1,
|
|
109
|
-
message: `Failed to list algorithms: ${s instanceof Error ? s.message : String(s)}`
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}, x = {
|
|
1
|
+
import { f as d } from "./chunks/AiManager-BD9XK30e.js";
|
|
2
|
+
import { A as C, a as P, b as I, C as L, M as $, S as D, c as R, V as k, d as M, e as V, g as q, h as z, i as E, j as G, k as W, l as j, m as N, n as T, q as U, r as _, s as B, o as F, p as J, t as Y, u as H, z as Q } from "./chunks/AiManager-BD9XK30e.js";
|
|
3
|
+
import { A as O } from "./chunks/ApiKeyManager-C0ac91dE.js";
|
|
4
|
+
import { V as Z } from "./chunks/VoiceInputAdapter-D0tHHi9G.js";
|
|
5
|
+
import { z as o } from "zod";
|
|
6
|
+
const y = {
|
|
114
7
|
name: "captureScreenshot",
|
|
115
8
|
description: "Capture a screenshot of the current graph visualization. Returns a data URL that can be displayed or downloaded. Supports PNG and JPEG formats with configurable size and quality.",
|
|
116
|
-
parameters:
|
|
117
|
-
format:
|
|
118
|
-
width:
|
|
119
|
-
height:
|
|
120
|
-
quality:
|
|
121
|
-
download:
|
|
9
|
+
parameters: o.object({
|
|
10
|
+
format: o.enum(["png", "jpeg"]).optional().describe("Image format (default: png)"),
|
|
11
|
+
width: o.number().positive().optional().describe("Width of the screenshot in pixels"),
|
|
12
|
+
height: o.number().positive().optional().describe("Height of the screenshot in pixels"),
|
|
13
|
+
quality: o.number().min(0).max(1).optional().describe("JPEG quality 0-1 (default: 0.92)"),
|
|
14
|
+
download: o.boolean().optional().describe("Whether to trigger a download (default: false)")
|
|
122
15
|
}),
|
|
123
16
|
examples: [
|
|
124
17
|
{ input: "Take a screenshot", params: {} },
|
|
@@ -127,79 +20,79 @@ const m = r.object({
|
|
|
127
20
|
{ input: "High resolution screenshot", params: { width: 1920, height: 1080 } },
|
|
128
21
|
{ input: "Download screenshot", params: { download: !0 } }
|
|
129
22
|
],
|
|
130
|
-
async execute(
|
|
23
|
+
async execute(r, t) {
|
|
131
24
|
const {
|
|
132
25
|
format: e = "png",
|
|
133
|
-
width:
|
|
134
|
-
height:
|
|
135
|
-
quality:
|
|
136
|
-
download:
|
|
137
|
-
} =
|
|
26
|
+
width: a,
|
|
27
|
+
height: i,
|
|
28
|
+
quality: u,
|
|
29
|
+
download: n = !1
|
|
30
|
+
} = t;
|
|
138
31
|
try {
|
|
139
|
-
const
|
|
32
|
+
const s = await r.captureScreenshot({
|
|
140
33
|
format: e,
|
|
141
|
-
width:
|
|
142
|
-
height:
|
|
143
|
-
quality:
|
|
144
|
-
}),
|
|
145
|
-
if (
|
|
146
|
-
const
|
|
147
|
-
|
|
34
|
+
width: a,
|
|
35
|
+
height: i,
|
|
36
|
+
quality: u
|
|
37
|
+
}), c = await h(s.blob);
|
|
38
|
+
if (n && typeof document < "u") {
|
|
39
|
+
const l = `graph-screenshot-${(/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-")}.${e}`;
|
|
40
|
+
m(c, l);
|
|
148
41
|
}
|
|
149
42
|
return {
|
|
150
43
|
success: !0,
|
|
151
|
-
message: `Screenshot captured successfully${
|
|
44
|
+
message: `Screenshot captured successfully${n ? " and download initiated" : ""}.`,
|
|
152
45
|
data: {
|
|
153
|
-
dataUrl:
|
|
46
|
+
dataUrl: c,
|
|
154
47
|
format: e,
|
|
155
|
-
width:
|
|
156
|
-
height:
|
|
157
|
-
downloaded:
|
|
48
|
+
width: a,
|
|
49
|
+
height: i,
|
|
50
|
+
downloaded: n
|
|
158
51
|
}
|
|
159
52
|
};
|
|
160
|
-
} catch (
|
|
53
|
+
} catch (s) {
|
|
161
54
|
return {
|
|
162
55
|
success: !1,
|
|
163
|
-
message: `Failed to capture screenshot: ${
|
|
56
|
+
message: `Failed to capture screenshot: ${s.message}`
|
|
164
57
|
};
|
|
165
58
|
}
|
|
166
59
|
}
|
|
167
60
|
};
|
|
168
|
-
function
|
|
169
|
-
return new Promise((
|
|
170
|
-
const
|
|
171
|
-
|
|
172
|
-
a
|
|
173
|
-
},
|
|
61
|
+
function h(r) {
|
|
62
|
+
return new Promise((t, e) => {
|
|
63
|
+
const a = new FileReader();
|
|
64
|
+
a.onload = () => {
|
|
65
|
+
t(a.result);
|
|
66
|
+
}, a.onerror = () => {
|
|
174
67
|
e(new Error("Failed to convert blob to data URL"));
|
|
175
|
-
},
|
|
68
|
+
}, a.readAsDataURL(r);
|
|
176
69
|
});
|
|
177
70
|
}
|
|
178
|
-
function
|
|
71
|
+
function m(r, t) {
|
|
179
72
|
const e = document.createElement("a");
|
|
180
|
-
e.href =
|
|
73
|
+
e.href = r, e.download = t, document.body.appendChild(e), e.click(), document.body.removeChild(e);
|
|
181
74
|
}
|
|
182
|
-
const
|
|
75
|
+
const S = {
|
|
183
76
|
name: "captureVideo",
|
|
184
77
|
description: "Start or stop video recording of the graph visualization. Returns a video blob URL when stopped. Note: This is a browser-only feature that requires MediaRecorder API support.",
|
|
185
|
-
parameters:
|
|
186
|
-
action:
|
|
187
|
-
duration:
|
|
188
|
-
format:
|
|
78
|
+
parameters: o.object({
|
|
79
|
+
action: o.enum(["start", "stop"]).describe("Action to perform: start or stop recording"),
|
|
80
|
+
duration: o.number().positive().optional().describe("Auto-stop after this many seconds (only for start action)"),
|
|
81
|
+
format: o.enum(["webm", "mp4"]).optional().describe("Video format (default: webm, note: mp4 may not be supported in all browsers)")
|
|
189
82
|
}),
|
|
190
83
|
examples: [
|
|
191
84
|
{ input: "Start recording", params: { action: "start" } },
|
|
192
85
|
{ input: "Stop recording", params: { action: "stop" } },
|
|
193
86
|
{ input: "Record for 5 seconds", params: { action: "start", duration: 5 } }
|
|
194
87
|
],
|
|
195
|
-
execute(
|
|
196
|
-
const { action: e, duration:
|
|
88
|
+
execute(r, t) {
|
|
89
|
+
const { action: e, duration: a } = t;
|
|
197
90
|
return e === "start" ? Promise.resolve({
|
|
198
91
|
success: !0,
|
|
199
|
-
message: `Video recording started${
|
|
92
|
+
message: `Video recording started${a ? ` (will auto-stop in ${a}s)` : ""}.`,
|
|
200
93
|
data: {
|
|
201
94
|
action: "started",
|
|
202
|
-
duration:
|
|
95
|
+
duration: a,
|
|
203
96
|
note: "Video recording functionality requires additional canvas-level implementation."
|
|
204
97
|
}
|
|
205
98
|
}) : Promise.resolve({
|
|
@@ -212,7 +105,7 @@ const C = {
|
|
|
212
105
|
});
|
|
213
106
|
}
|
|
214
107
|
};
|
|
215
|
-
class
|
|
108
|
+
class p {
|
|
216
109
|
constructor() {
|
|
217
110
|
this.commands = [], this.graph = null, this.schemaSummary = null;
|
|
218
111
|
}
|
|
@@ -220,22 +113,22 @@ class y {
|
|
|
220
113
|
* Set the graph instance for context.
|
|
221
114
|
* @param graph - The graph instance
|
|
222
115
|
*/
|
|
223
|
-
setGraph(
|
|
224
|
-
this.graph =
|
|
116
|
+
setGraph(t) {
|
|
117
|
+
this.graph = t;
|
|
225
118
|
}
|
|
226
119
|
/**
|
|
227
120
|
* Set the available commands.
|
|
228
121
|
* @param commands - Array of registered commands
|
|
229
122
|
*/
|
|
230
|
-
setCommands(
|
|
231
|
-
this.commands =
|
|
123
|
+
setCommands(t) {
|
|
124
|
+
this.commands = t;
|
|
232
125
|
}
|
|
233
126
|
/**
|
|
234
127
|
* Set the schema summary for data context.
|
|
235
128
|
* @param schema - The schema summary to include in prompts
|
|
236
129
|
*/
|
|
237
|
-
setSchema(
|
|
238
|
-
this.schemaSummary =
|
|
130
|
+
setSchema(t) {
|
|
131
|
+
this.schemaSummary = t;
|
|
239
132
|
}
|
|
240
133
|
/**
|
|
241
134
|
* Clear the schema summary.
|
|
@@ -248,17 +141,17 @@ class y {
|
|
|
248
141
|
* @param options - Build options
|
|
249
142
|
* @returns The complete system prompt
|
|
250
143
|
*/
|
|
251
|
-
build(
|
|
144
|
+
build(t = {}) {
|
|
252
145
|
const {
|
|
253
146
|
includeStats: e = !0,
|
|
254
|
-
includeLayout:
|
|
255
|
-
includeCommands:
|
|
256
|
-
includeSchema:
|
|
257
|
-
additionalContext:
|
|
258
|
-
} =
|
|
259
|
-
return
|
|
147
|
+
includeLayout: a = !0,
|
|
148
|
+
includeCommands: i = !0,
|
|
149
|
+
includeSchema: u = !0,
|
|
150
|
+
additionalContext: n
|
|
151
|
+
} = t, s = [];
|
|
152
|
+
return s.push(this.buildBasePrompt()), e && this.graph && s.push(this.buildStatsSection()), u && this.schemaSummary && s.push(this.buildSchemaSection()), a && this.graph && s.push(this.buildLayoutSection()), i && this.commands.length > 0 && s.push(this.buildCommandsSection()), n && s.push(`
|
|
260
153
|
## Additional Context
|
|
261
|
-
${
|
|
154
|
+
${n}`), s.push(this.buildInstructionsSection()), s.join(`
|
|
262
155
|
|
|
263
156
|
`);
|
|
264
157
|
}
|
|
@@ -283,9 +176,9 @@ You can help users:
|
|
|
283
176
|
buildStatsSection() {
|
|
284
177
|
if (!this.graph)
|
|
285
178
|
return "";
|
|
286
|
-
const
|
|
179
|
+
const t = this.graph.getNodeCount(), e = this.graph.getEdgeCount();
|
|
287
180
|
return `## Current Graph State
|
|
288
|
-
- Total nodes: ${
|
|
181
|
+
- Total nodes: ${t}
|
|
289
182
|
- Total edges: ${e}
|
|
290
183
|
- Visualization mode: ${this.graph.getViewMode() === "2d" ? "2D" : "3D"}`;
|
|
291
184
|
}
|
|
@@ -294,7 +187,7 @@ You can help users:
|
|
|
294
187
|
* @returns Schema information text
|
|
295
188
|
*/
|
|
296
189
|
buildSchemaSection() {
|
|
297
|
-
return this.schemaSummary ?
|
|
190
|
+
return this.schemaSummary ? d(this.schemaSummary) : "";
|
|
298
191
|
}
|
|
299
192
|
/**
|
|
300
193
|
* Build the layout section.
|
|
@@ -312,9 +205,9 @@ You can help users:
|
|
|
312
205
|
buildCommandsSection() {
|
|
313
206
|
return `## Available Commands (Tools)
|
|
314
207
|
${this.commands.map((e) => {
|
|
315
|
-
const
|
|
316
|
-
Examples: ${e.examples.slice(0, 2).map((
|
|
317
|
-
return `- **${e.name}**: ${e.description}${
|
|
208
|
+
const a = e.examples.length > 0 ? `
|
|
209
|
+
Examples: ${e.examples.slice(0, 2).map((i) => `"${i.input}"`).join(", ")}` : "";
|
|
210
|
+
return `- **${e.name}**: ${e.description}${a}`;
|
|
318
211
|
}).join(`
|
|
319
212
|
`)}`;
|
|
320
213
|
}
|
|
@@ -349,10 +242,10 @@ When tools are available, use them to:
|
|
|
349
242
|
If no tools match the user's request, respond conversationally.`;
|
|
350
243
|
}
|
|
351
244
|
}
|
|
352
|
-
function
|
|
353
|
-
return new
|
|
245
|
+
function w() {
|
|
246
|
+
return new p();
|
|
354
247
|
}
|
|
355
|
-
class
|
|
248
|
+
class v {
|
|
356
249
|
constructor() {
|
|
357
250
|
this.type = "text", this.isSupported = !0, this._isActive = !1, this.callbacks = [];
|
|
358
251
|
}
|
|
@@ -379,26 +272,26 @@ class I {
|
|
|
379
272
|
* Register a callback for input events.
|
|
380
273
|
* @param callback - Function called when input is received
|
|
381
274
|
*/
|
|
382
|
-
onInput(
|
|
383
|
-
this.callbacks.push(
|
|
275
|
+
onInput(t) {
|
|
276
|
+
this.callbacks.push(t);
|
|
384
277
|
}
|
|
385
278
|
/**
|
|
386
279
|
* Submit final text input.
|
|
387
280
|
* @param text - The complete input text
|
|
388
281
|
*/
|
|
389
|
-
submitInput(
|
|
282
|
+
submitInput(t) {
|
|
390
283
|
if (this._isActive)
|
|
391
284
|
for (const e of this.callbacks)
|
|
392
|
-
e(
|
|
285
|
+
e(t, !0);
|
|
393
286
|
}
|
|
394
287
|
/**
|
|
395
288
|
* Submit interim (partial) text input.
|
|
396
289
|
* @param text - The partial input text
|
|
397
290
|
*/
|
|
398
|
-
submitInterim(
|
|
291
|
+
submitInterim(t) {
|
|
399
292
|
if (this._isActive)
|
|
400
293
|
for (const e of this.callbacks)
|
|
401
|
-
e(
|
|
294
|
+
e(t, !1);
|
|
402
295
|
}
|
|
403
296
|
/**
|
|
404
297
|
* Clean up resources and remove all callbacks.
|
|
@@ -408,38 +301,38 @@ class I {
|
|
|
408
301
|
}
|
|
409
302
|
}
|
|
410
303
|
export {
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
304
|
+
C as AiController,
|
|
305
|
+
P as AiManager,
|
|
306
|
+
I as AiStatusManager,
|
|
307
|
+
O as ApiKeyManager,
|
|
308
|
+
L as CommandRegistry,
|
|
309
|
+
$ as MockLlmProvider,
|
|
310
|
+
D as SchemaExtractor,
|
|
311
|
+
R as SchemaManager,
|
|
312
|
+
p as SystemPromptBuilder,
|
|
313
|
+
v as TextInputAdapter,
|
|
314
|
+
k as VercelAiProvider,
|
|
315
|
+
Z as VoiceInputAdapter,
|
|
316
|
+
y as captureScreenshot,
|
|
317
|
+
S as captureVideo,
|
|
318
|
+
M as clearStyles,
|
|
319
|
+
V as createAiManager,
|
|
320
|
+
q as createProvider,
|
|
321
|
+
w as createSystemPromptBuilder,
|
|
322
|
+
z as createWebLlmProvider,
|
|
323
|
+
E as describeProperty,
|
|
324
|
+
G as findAndStyleEdges,
|
|
325
|
+
W as findAndStyleNodes,
|
|
326
|
+
j as findNodes,
|
|
327
|
+
d as formatSchemaForPrompt,
|
|
328
|
+
N as getWebLlmProviderClass,
|
|
329
|
+
T as listAlgorithms,
|
|
330
|
+
U as queryGraph,
|
|
331
|
+
_ as runAlgorithm,
|
|
332
|
+
B as sampleData,
|
|
333
|
+
F as setCameraPosition,
|
|
334
|
+
J as setDimension,
|
|
335
|
+
Y as setImmersiveMode,
|
|
336
|
+
H as setLayout,
|
|
337
|
+
Q as zoomToNodes
|
|
445
338
|
};
|
package/dist/catalog.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { B as y,
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { F as
|
|
5
|
-
import { L as
|
|
6
|
-
import { A as
|
|
1
|
+
import { B as y, C as f, a as m, b as T, c as S, d as v, e as O, f as E, g as A, h as N } from "./chunks/algorithms-BF0X6RPw.js";
|
|
2
|
+
import { d as I, a as k } from "./chunks/detect-vJxK7n0D.js";
|
|
3
|
+
import { F as x, U as _, i as C, j as L } from "./chunks/paletteRegistry-A63C71Gn.js";
|
|
4
|
+
import { a as W, L as U, P as F, S as H, U as B, l as M, b as j, c as K, p as Y, d as G, s as z, e as V } from "./chunks/scales-B2d-7Bf0.js";
|
|
5
|
+
import { L as X, l as Z } from "./chunks/GraphtyLogger-CqOVV13Y.js";
|
|
6
|
+
import { A as J, C as Q, D as ee, f as te, K as ae, a as oe, b as ne, c as re, d as ie, g as se, O as he, R as le, h as de, j as ce, k as we, i as pe, e as ue } from "./chunks/types-C_c53VgR.js";
|
|
7
|
+
import { o as be } from "./chunks/optionsFromZod-BuTOFgVM.js";
|
|
7
8
|
const d = Object.keys({
|
|
8
9
|
enabled: 0,
|
|
9
10
|
font: 0,
|
|
@@ -136,7 +137,7 @@ const w = [
|
|
|
136
137
|
// caption and no channel could ask for one.
|
|
137
138
|
...t("edge", "arrowHead.text", e),
|
|
138
139
|
...t("edge", "arrowTail.text", e)
|
|
139
|
-
],
|
|
140
|
+
], p = [
|
|
140
141
|
{
|
|
141
142
|
kind: "by-design",
|
|
142
143
|
channel: "node.tooltip",
|
|
@@ -147,7 +148,7 @@ const w = [
|
|
|
147
148
|
channel: "node.tooltipStyle",
|
|
148
149
|
reason: "A NODE TOOLTIP IS DRAWN and its appearance reaches it, so this waiver is about the reading and not about the capability, exactly as `node.tooltip` above: the two channels are the words and the look of the same hover-only mesh, and this gate paints into a RESTING scene, which is the one moment a tooltip must not be on screen. `test/browser/node-tooltip-style-draws.test.ts` is where it is proved -- it hovers a node with a real pointer, reads the tooltip mesh the element built, and requires the typeface, the panel colour and the size a layer asked for to be the ones drawn."
|
|
149
150
|
}
|
|
150
|
-
],
|
|
151
|
+
], u = [
|
|
151
152
|
{
|
|
152
153
|
subject: "edge.tooltip",
|
|
153
154
|
withdrawnIn: "2.0",
|
|
@@ -168,13 +169,14 @@ const w = [
|
|
|
168
169
|
}
|
|
169
170
|
];
|
|
170
171
|
export {
|
|
171
|
-
|
|
172
|
+
J as ATTRIBUTE_TYPES,
|
|
172
173
|
y as BUILT_IN_ALGORITHMS,
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
174
|
+
f as CAMERA_DESCRIPTORS,
|
|
175
|
+
m as CHANNELS,
|
|
176
|
+
T as CHANNEL_DESCRIPTORS,
|
|
177
|
+
Q as COST_CLASSES,
|
|
178
|
+
ee as DEPRECATED_ALGORITHMS,
|
|
179
|
+
x as FORMAT_DESCRIPTORS,
|
|
178
180
|
te as KNOWN_ALGORITHMS,
|
|
179
181
|
ae as KNOWN_CAMERA_IDS,
|
|
180
182
|
oe as KNOWN_FORMAT_IDS,
|
|
@@ -182,44 +184,44 @@ export {
|
|
|
182
184
|
re as KNOWN_LOG_SINK_IDS,
|
|
183
185
|
ie as KNOWN_PALETTE_IDS,
|
|
184
186
|
d as LABEL_STYLE_FIELDS,
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
187
|
+
W as LAYOUT_CATALOG,
|
|
188
|
+
U as LAYOUT_DESCRIPTORS,
|
|
189
|
+
X as LOG_SINK_DESCRIPTORS,
|
|
188
190
|
se as OPTION_BOUND_SOURCES,
|
|
189
191
|
he as OPTION_TYPES,
|
|
190
|
-
|
|
192
|
+
F as PALETTE_DESCRIPTORS,
|
|
191
193
|
le as RESULT_SHAPES,
|
|
192
|
-
|
|
193
|
-
|
|
194
|
+
H as SCALE_DESCRIPTORS,
|
|
195
|
+
p as UNPAINTED_CHANNELS,
|
|
194
196
|
w as UNREACHABLE_STYLE_FIELDS,
|
|
195
|
-
|
|
196
|
-
|
|
197
|
+
_ as UNSERVED_FORMAT_IDS,
|
|
198
|
+
B as UNSERVED_LAYOUT_IDS,
|
|
197
199
|
l as WAIVER_EXPIRY_UNSET,
|
|
198
200
|
c as WAIVER_HORIZON_DAYS,
|
|
199
201
|
h as WAIVER_OWNER_UNASSIGNED,
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
202
|
+
u as WITHDRAWN_CAPABILITIES,
|
|
203
|
+
S as algorithmByKey,
|
|
204
|
+
v as algorithmByLegacyKey,
|
|
205
|
+
O as cameraDescriptor,
|
|
206
|
+
E as camerasForMode,
|
|
207
|
+
A as channelDescriptor,
|
|
208
|
+
N as channelsFor,
|
|
209
|
+
I as detectFormat,
|
|
210
|
+
k as detectFormats,
|
|
211
|
+
C as formatDescriptor,
|
|
212
|
+
L as formatsForExtension,
|
|
211
213
|
de as isAttributeType,
|
|
212
214
|
ce as isCostClass,
|
|
213
215
|
we as isOptionBound,
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
216
|
+
pe as isOptionType,
|
|
217
|
+
ue as isResultShape,
|
|
218
|
+
M as layoutDescriptor,
|
|
219
|
+
j as layoutEntry,
|
|
220
|
+
K as layoutIdForEngine,
|
|
221
|
+
Z as logSinkDescriptor,
|
|
222
|
+
be as optionsFromZod,
|
|
223
|
+
Y as paletteDescriptor,
|
|
224
|
+
G as palettesOfKind,
|
|
225
|
+
z as scaleDescriptor,
|
|
226
|
+
V as scalesForDomain
|
|
225
227
|
};
|