@invect/ui 0.0.3 → 0.0.5
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/dist/{Invect-CJSKm2Aq.js → Invect-CUR_K7mH.js} +22899 -22871
- package/dist/api/node-data.api.d.ts +1 -1
- package/dist/demo.js +47 -48
- package/dist/index.js +157 -157
- package/package.json +4 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SubmitSQLQueryRequest } from '@invect/core/types';
|
|
2
2
|
export declare function useListQueryDatabases(): import('@tanstack/react-query').UseQueryResult<{
|
|
3
3
|
connectionString: string;
|
|
4
|
-
type: "
|
|
4
|
+
type: "sqlite" | "mysql" | "postgresql";
|
|
5
5
|
name?: string | undefined;
|
|
6
6
|
driver?: "pg" | "postgres" | "neon-serverless" | "better-sqlite3" | "libsql" | "mysql2" | undefined;
|
|
7
7
|
}[], Error>;
|
package/dist/demo.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { B as e, Ft as t,
|
|
3
|
-
import { useCallback as
|
|
4
|
-
import { QueryClient as
|
|
5
|
-
import { jsx as
|
|
6
|
-
import { GraphNodeType as w } from "@invect/core/types";
|
|
2
|
+
import { B as e, Ft as t, Gt as n, H as r, Jt as i, L as a, Nt as o, R as s, V as c, Xt as l, Yt as u, a as d, o as f, t as p, tn as m, z as h } from "./Invect-CUR_K7mH.js";
|
|
3
|
+
import { useCallback as g, useEffect as _, useMemo as v, useRef as y, useState as b } from "react";
|
|
4
|
+
import { QueryClient as x, QueryClientProvider as S } from "@tanstack/react-query";
|
|
5
|
+
import { jsx as C, jsxs as w } from "react/jsx-runtime";
|
|
7
6
|
import { Background as T, BackgroundVariant as E, Controls as ee, ReactFlow as te, ReactFlowProvider as D } from "@xyflow/react";
|
|
8
7
|
//#region src/demo/demo-api-client.ts
|
|
9
8
|
var O = (e = []) => ({
|
|
@@ -139,13 +138,13 @@ function j(e = {}) {
|
|
|
139
138
|
//#endregion
|
|
140
139
|
//#region src/demo/DemoInvect.tsx
|
|
141
140
|
function M({ data: e, useMemoryRouter: t = !0, ...n }) {
|
|
142
|
-
let r =
|
|
143
|
-
return
|
|
141
|
+
let r = v(() => j(e), [e]), i = d((e) => e.setOpen), a = d((e) => e.updateSettings);
|
|
142
|
+
return _(() => {
|
|
144
143
|
i(!0), a({
|
|
145
144
|
credentialId: "cred-anthropic",
|
|
146
145
|
model: "claude-sonnet-4-6"
|
|
147
146
|
});
|
|
148
|
-
}, [i, a]), /* @__PURE__ */
|
|
147
|
+
}, [i, a]), /* @__PURE__ */ C(p, {
|
|
149
148
|
apiClient: r,
|
|
150
149
|
useMemoryRouter: t,
|
|
151
150
|
...n
|
|
@@ -157,9 +156,9 @@ var N = { default: e }, P = {
|
|
|
157
156
|
duration: 0,
|
|
158
157
|
padding: .2
|
|
159
158
|
}, F = () => {};
|
|
160
|
-
function I({ nodes: e, edges: t, nodeDefinitions:
|
|
161
|
-
let { resolvedTheme:
|
|
162
|
-
|
|
159
|
+
function I({ nodes: e, edges: t, nodeDefinitions: i = [], agentTools: o = [], interactive: l = !0, showControls: d = !0 }) {
|
|
160
|
+
let { resolvedTheme: p } = u(), m = y(null), [x, S] = b(!1), [D, O] = b(null), k = r((e) => e.syncFromServer), A = r((e) => e.setFlowId);
|
|
161
|
+
_(() => {
|
|
163
162
|
A("demo-flow", void 0), k(e, t, "demo-flow:1", "Demo Flow");
|
|
164
163
|
}, [
|
|
165
164
|
e,
|
|
@@ -167,14 +166,14 @@ function I({ nodes: e, edges: t, nodeDefinitions: a = [], agentTools: c = [], in
|
|
|
167
166
|
k,
|
|
168
167
|
A
|
|
169
168
|
]);
|
|
170
|
-
let j =
|
|
169
|
+
let j = v(() => {
|
|
171
170
|
let e = {
|
|
172
|
-
[
|
|
173
|
-
default:
|
|
171
|
+
[n.AGENT]: a,
|
|
172
|
+
default: h
|
|
174
173
|
};
|
|
175
|
-
for (let t of
|
|
174
|
+
for (let t of i) t.type in e || (e[t.type] = h);
|
|
176
175
|
return e;
|
|
177
|
-
}, [
|
|
176
|
+
}, [i]), M = v(() => o.filter((e) => e.provider?.id !== "triggers" && !e.id.startsWith("trigger.")).map((e) => ({
|
|
178
177
|
id: e.id,
|
|
179
178
|
name: e.name,
|
|
180
179
|
description: e.description,
|
|
@@ -183,7 +182,7 @@ function I({ nodes: e, edges: t, nodeDefinitions: a = [], agentTools: c = [], in
|
|
|
183
182
|
inputSchema: e.inputSchema,
|
|
184
183
|
nodeType: e.nodeType,
|
|
185
184
|
provider: e.provider
|
|
186
|
-
})), [
|
|
185
|
+
})), [o]), I = v(() => ({
|
|
187
186
|
onOpenToolSelector: F,
|
|
188
187
|
onShowMoreTools: F,
|
|
189
188
|
onRemoveTool: F,
|
|
@@ -191,27 +190,27 @@ function I({ nodes: e, edges: t, nodeDefinitions: a = [], agentTools: c = [], in
|
|
|
191
190
|
availableTools: M,
|
|
192
191
|
selectedToolNodeId: null,
|
|
193
192
|
selectedToolInstanceId: null
|
|
194
|
-
}), [M]), L =
|
|
195
|
-
l && (O(t.id),
|
|
196
|
-
}, [l]), R =
|
|
197
|
-
e || (
|
|
193
|
+
}), [M]), L = g((e, t) => {
|
|
194
|
+
l && (O(t.id), S(!0));
|
|
195
|
+
}, [l]), R = g((e) => {
|
|
196
|
+
e || (S(!1), O(null));
|
|
198
197
|
}, []);
|
|
199
|
-
return /* @__PURE__ */
|
|
200
|
-
ref:
|
|
198
|
+
return /* @__PURE__ */ w("div", {
|
|
199
|
+
ref: m,
|
|
201
200
|
style: {
|
|
202
201
|
width: "100%",
|
|
203
202
|
height: "100%",
|
|
204
203
|
background: "var(--canvas-background)"
|
|
205
204
|
},
|
|
206
|
-
children: [/* @__PURE__ */
|
|
205
|
+
children: [/* @__PURE__ */ C(s, {
|
|
207
206
|
value: I,
|
|
208
|
-
children: /* @__PURE__ */
|
|
207
|
+
children: /* @__PURE__ */ w(te, {
|
|
209
208
|
nodes: e,
|
|
210
209
|
edges: t,
|
|
211
210
|
nodeTypes: j,
|
|
212
211
|
edgeTypes: N,
|
|
213
|
-
defaultEdgeOptions:
|
|
214
|
-
colorMode:
|
|
212
|
+
defaultEdgeOptions: c,
|
|
213
|
+
colorMode: p,
|
|
215
214
|
fitView: !0,
|
|
216
215
|
fitViewOptions: P,
|
|
217
216
|
onNodeDoubleClick: l ? L : void 0,
|
|
@@ -223,51 +222,51 @@ function I({ nodes: e, edges: t, nodeDefinitions: a = [], agentTools: c = [], in
|
|
|
223
222
|
zoomOnScroll: !0,
|
|
224
223
|
zoomOnPinch: !0,
|
|
225
224
|
zoomOnDoubleClick: !1,
|
|
226
|
-
children: [
|
|
225
|
+
children: [d && /* @__PURE__ */ C(ee, {}), /* @__PURE__ */ C(T, {
|
|
227
226
|
variant: E.Dots,
|
|
228
227
|
gap: 20,
|
|
229
228
|
size: 1.2
|
|
230
229
|
})]
|
|
231
230
|
})
|
|
232
|
-
}), l && /* @__PURE__ */
|
|
233
|
-
open:
|
|
231
|
+
}), l && /* @__PURE__ */ C(f, {
|
|
232
|
+
open: x,
|
|
234
233
|
nodeId: D,
|
|
235
234
|
flowId: "demo-flow",
|
|
236
235
|
onOpenChange: R,
|
|
237
|
-
portalContainer:
|
|
236
|
+
portalContainer: m.current,
|
|
238
237
|
availableTools: M
|
|
239
238
|
})]
|
|
240
239
|
});
|
|
241
240
|
}
|
|
242
|
-
function L({ theme: e = "dark", className: n, style: r, containerClassName:
|
|
243
|
-
let d =
|
|
241
|
+
function L({ theme: e = "dark", className: n, style: r, containerClassName: a, nodeDefinitions: s = [], agentTools: c = [], ...u }) {
|
|
242
|
+
let d = v(() => new x({ defaultOptions: { queries: {
|
|
244
243
|
staleTime: Infinity,
|
|
245
244
|
retry: !1
|
|
246
|
-
} } }), []),
|
|
247
|
-
nodeDefinitions:
|
|
248
|
-
agentTools:
|
|
249
|
-
}), [
|
|
250
|
-
return /* @__PURE__ */
|
|
251
|
-
className:
|
|
245
|
+
} } }), []), f = v(() => j({
|
|
246
|
+
nodeDefinitions: s,
|
|
247
|
+
agentTools: c
|
|
248
|
+
}), [s, c]);
|
|
249
|
+
return /* @__PURE__ */ C("div", {
|
|
250
|
+
className: a,
|
|
252
251
|
style: {
|
|
253
252
|
position: "relative",
|
|
254
253
|
overflow: "hidden",
|
|
255
254
|
...r
|
|
256
255
|
},
|
|
257
|
-
children: /* @__PURE__ */
|
|
256
|
+
children: /* @__PURE__ */ C(i, {
|
|
258
257
|
defaultTheme: e,
|
|
259
258
|
storageKey: "invect-viewer-theme",
|
|
260
259
|
className: n,
|
|
261
|
-
children: /* @__PURE__ */ S
|
|
260
|
+
children: /* @__PURE__ */ C(S, {
|
|
262
261
|
client: d,
|
|
263
|
-
children: /* @__PURE__ */
|
|
264
|
-
apiClient:
|
|
265
|
-
children: /* @__PURE__ */
|
|
262
|
+
children: /* @__PURE__ */ C(l, {
|
|
263
|
+
apiClient: f,
|
|
264
|
+
children: /* @__PURE__ */ C(o, {
|
|
266
265
|
plugins: [],
|
|
267
|
-
children: /* @__PURE__ */
|
|
268
|
-
nodeDefinitions:
|
|
269
|
-
agentTools:
|
|
270
|
-
...
|
|
266
|
+
children: /* @__PURE__ */ C(m, { children: /* @__PURE__ */ C(t, { children: /* @__PURE__ */ C(D, { children: /* @__PURE__ */ C(I, {
|
|
267
|
+
nodeDefinitions: s,
|
|
268
|
+
agentTools: c,
|
|
269
|
+
...u
|
|
271
270
|
}) }) }) })
|
|
272
271
|
})
|
|
273
272
|
})
|