drizzle-cube 0.5.0 → 0.5.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.
@@ -1,5 +1,5 @@
1
1
  import { d as e, h as t, p as n } from "./utils-DOg9oGdt.js";
2
- import { d as r, f as i, n as a, o, t as s, u as c } from "./mcp-transport-Bxpc4mRy.js";
2
+ import { d as r, f as i, n as a, p as o, s, t as c } from "./mcp-transport-C7VLf4T5.js";
3
3
  //#region src/adapters/mcp-tools.ts
4
4
  function l(e) {
5
5
  return {
@@ -19,41 +19,41 @@ function u(e) {
19
19
  isError: !0
20
20
  };
21
21
  }
22
- function d(i) {
23
- let { semanticLayer: a, getSecurityContext: s, toolPrefix: d = "drizzle_cube_", tools: p = [
22
+ function d(a) {
23
+ let { semanticLayer: o, getSecurityContext: c, toolPrefix: d = "drizzle_cube_", tools: p = [
24
24
  "discover",
25
25
  "validate",
26
26
  "load",
27
27
  "chart"
28
- ], prompts: m = c(), resources: h, app: g = !1 } = i, _ = h ?? r(), v = g ? [..._, ...f()] : _, y = o({ appEnabled: g }), b = new Map(y.map((e) => [e.name, e])), x = p.filter((e) => b.has(e)).map((e) => {
29
- let t = b.get(e), n = {
28
+ ], prompts: m = r(), resources: h, app: g = !1 } = a, _ = !!g, v = typeof g == "object" ? g : void 0, y = h ?? i(), b = _ ? [...y, ...f(v)] : y, x = s({ appEnabled: _ }), S = new Map(x.map((e) => [e.name, e])), C = p.filter((e) => S.has(e)).map((e) => {
29
+ let t = S.get(e), n = {
30
30
  name: `${d}${e}`,
31
31
  description: t.description,
32
32
  inputSchema: t.inputSchema
33
33
  }, r = t._meta;
34
34
  return r && (n._meta = r), n;
35
- }), S = x.map((e) => e.name), C = /* @__PURE__ */ new Set();
36
- for (let e of p) C.add(e), C.add(`${d}${e}`);
37
- function w(e) {
38
- return C.has(e);
35
+ }), w = C.map((e) => e.name), T = /* @__PURE__ */ new Set();
36
+ for (let e of p) T.add(e), T.add(`${d}${e}`);
37
+ function E(e) {
38
+ return T.has(e);
39
39
  }
40
- async function T(r, i, o) {
41
- let c = r.startsWith(d) ? r.slice(d.length) : r;
42
- if (!p.includes(c)) return u(`Unknown tool: ${r}`);
40
+ async function D(r, i, a) {
41
+ let s = r.startsWith(d) ? r.slice(d.length) : r;
42
+ if (!p.includes(s)) return u(`Unknown tool: ${r}`);
43
43
  try {
44
- switch (c) {
45
- case "discover": return l(await e(a, i || {}));
44
+ switch (s) {
45
+ case "discover": return l(await e(o, i || {}));
46
46
  case "validate": {
47
47
  let e = i || {};
48
- return e.query ? l(await t(a, e)) : u("query is required");
48
+ return e.query ? l(await t(o, e)) : u("query is required");
49
49
  }
50
50
  case "load": {
51
51
  let e = i || {};
52
- return e.query ? l(await n(a, await s(o), e)) : u("query is required");
52
+ return e.query ? l(await n(o, await c(a), e)) : u("query is required");
53
53
  }
54
54
  case "chart": {
55
55
  let e = i || {};
56
- return e.query ? l(await n(a, await s(o), e)) : u("query is required");
56
+ return e.query ? l(await n(o, await c(a), e)) : u("query is required");
57
57
  }
58
58
  default: return u(`Unknown tool: ${r}`);
59
59
  }
@@ -62,22 +62,22 @@ function d(i) {
62
62
  }
63
63
  }
64
64
  return {
65
- definitions: x,
66
- handle: T,
67
- handles: w,
65
+ definitions: C,
66
+ handle: D,
67
+ handles: E,
68
68
  prompts: m,
69
- resources: v,
70
- toolNames: S
69
+ resources: b,
70
+ toolNames: w
71
71
  };
72
72
  }
73
- function f() {
74
- let e = i();
75
- return e ? [{
73
+ function f(e) {
74
+ let t = o(e);
75
+ return t ? [{
76
76
  uri: a,
77
77
  name: "Drizzle Cube Visualization",
78
78
  description: "Interactive chart visualization for query results",
79
- mimeType: s,
80
- text: e
79
+ mimeType: c,
80
+ text: t
81
81
  }] : [];
82
82
  }
83
83
  //#endregion