@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.
@@ -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: "mysql" | "sqlite" | "postgresql";
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, H as n, Jt as r, L as i, Nt as a, R as o, V as s, Yt as c, a as l, en as u, o as d, qt as f, t as p, z as m } from "./Invect-CJSKm2Aq.js";
3
- import { useCallback as h, useEffect as g, useMemo as _, useRef as v, useState as y } from "react";
4
- import { QueryClient as b, QueryClientProvider as x } from "@tanstack/react-query";
5
- import { jsx as S, jsxs as C } from "react/jsx-runtime";
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 = _(() => j(e), [e]), i = l((e) => e.setOpen), a = l((e) => e.updateSettings);
143
- return g(() => {
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__ */ S(p, {
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: a = [], agentTools: c = [], interactive: l = !0, showControls: u = !0 }) {
161
- let { resolvedTheme: f } = r(), p = v(null), [b, x] = y(!1), [D, O] = y(null), k = n((e) => e.syncFromServer), A = n((e) => e.setFlowId);
162
- g(() => {
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
- [w.AGENT]: i,
173
- default: m
171
+ [n.AGENT]: a,
172
+ default: h
174
173
  };
175
- for (let t of a) t.type in e || (e[t.type] = m);
174
+ for (let t of i) t.type in e || (e[t.type] = h);
176
175
  return e;
177
- }, [a]), M = _(() => c.filter((e) => e.provider?.id !== "triggers" && !e.id.startsWith("trigger.")).map((e) => ({
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
- })), [c]), I = _(() => ({
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 = h((e, t) => {
195
- l && (O(t.id), x(!0));
196
- }, [l]), R = h((e) => {
197
- e || (x(!1), O(null));
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__ */ C("div", {
200
- ref: p,
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__ */ S(o, {
205
+ children: [/* @__PURE__ */ C(s, {
207
206
  value: I,
208
- children: /* @__PURE__ */ C(te, {
207
+ children: /* @__PURE__ */ w(te, {
209
208
  nodes: e,
210
209
  edges: t,
211
210
  nodeTypes: j,
212
211
  edgeTypes: N,
213
- defaultEdgeOptions: s,
214
- colorMode: f,
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: [u && /* @__PURE__ */ S(ee, {}), /* @__PURE__ */ S(T, {
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__ */ S(d, {
233
- open: b,
231
+ }), l && /* @__PURE__ */ C(f, {
232
+ open: x,
234
233
  nodeId: D,
235
234
  flowId: "demo-flow",
236
235
  onOpenChange: R,
237
- portalContainer: p.current,
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: i, nodeDefinitions: o = [], agentTools: s = [], ...l }) {
243
- let d = _(() => new b({ defaultOptions: { queries: {
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
- } } }), []), p = _(() => j({
247
- nodeDefinitions: o,
248
- agentTools: s
249
- }), [o, s]);
250
- return /* @__PURE__ */ S("div", {
251
- className: i,
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__ */ S(f, {
256
+ children: /* @__PURE__ */ C(i, {
258
257
  defaultTheme: e,
259
258
  storageKey: "invect-viewer-theme",
260
259
  className: n,
261
- children: /* @__PURE__ */ S(x, {
260
+ children: /* @__PURE__ */ C(S, {
262
261
  client: d,
263
- children: /* @__PURE__ */ S(c, {
264
- apiClient: p,
265
- children: /* @__PURE__ */ S(a, {
262
+ children: /* @__PURE__ */ C(l, {
263
+ apiClient: f,
264
+ children: /* @__PURE__ */ C(o, {
266
265
  plugins: [],
267
- children: /* @__PURE__ */ S(u, { children: /* @__PURE__ */ S(t, { children: /* @__PURE__ */ S(D, { children: /* @__PURE__ */ S(I, {
268
- nodeDefinitions: o,
269
- agentTools: s,
270
- ...l
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
  })