likec4 1.58.0 → 1.59.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.
Files changed (64) hide show
  1. package/__app__/codegen/webcomponent.mjs +14 -14
  2. package/__app__/src/chunks/AIChat.mjs +153 -156
  3. package/__app__/src/chunks/LikeC4Styles.mjs +1553 -1255
  4. package/__app__/src/chunks/ProjectsOverview.mjs +127 -130
  5. package/__app__/src/chunks/hooks.mjs +419 -106
  6. package/__app__/src/chunks/libs/@floating-ui.mjs +8 -8
  7. package/__app__/src/chunks/libs/@mantine.mjs +3039 -2135
  8. package/__app__/src/chunks/libs/@tanstack-ai.mjs +4 -4
  9. package/__app__/src/chunks/libs/@tanstack.mjs +93 -118
  10. package/__app__/src/chunks/libs/@xstate/react.mjs +30 -16
  11. package/__app__/src/chunks/libs/@xyflow/react.mjs +50 -26
  12. package/__app__/src/chunks/libs/bezier-js.mjs +11 -8
  13. package/__app__/src/chunks/libs/framer.mjs +1188 -1155
  14. package/__app__/src/chunks/libs/zod.mjs +191 -188
  15. package/__app__/src/chunks/rolldown-runtime.mjs +8 -1
  16. package/__app__/src/chunks/styled-system.mjs +23 -16
  17. package/__app__/src/main.mjs +23331 -10467
  18. package/__app__/src/style.css +1 -1
  19. package/dist/chunks/dist.mjs +10 -0
  20. package/dist/chunks/enableServer.mjs +1 -1
  21. package/dist/chunks/index.d.mts +9 -9
  22. package/dist/chunks/index2.d.mts +386 -229
  23. package/dist/chunks/libs/@chevrotain/gast.mjs +1 -1
  24. package/dist/chunks/libs/@chevrotain/regexp-to-ast.mjs +1 -1
  25. package/dist/chunks/libs/@logtape/logtape.mjs +3 -3
  26. package/dist/chunks/libs/@ts-graphviz/common.d.mts +1 -2
  27. package/dist/chunks/libs/@ts-graphviz/core.mjs +1 -1
  28. package/dist/chunks/libs/chevrotain-allstar.mjs +1 -1
  29. package/dist/chunks/libs/chevrotain.mjs +4 -4
  30. package/dist/chunks/libs/json5.mjs +1 -1
  31. package/dist/chunks/libs/langium.d.mts +2940 -2914
  32. package/dist/chunks/libs/langium.mjs +9 -9
  33. package/dist/chunks/libs/merge-error-cause.mjs +1 -1
  34. package/dist/chunks/libs/p-queue.mjs +1 -1
  35. package/dist/chunks/libs/package-manager-detector.mjs +1 -1
  36. package/dist/chunks/libs/pako.mjs +1 -1
  37. package/dist/chunks/libs/picomatch.mjs +1 -1
  38. package/dist/chunks/libs/remeda.mjs +1 -1
  39. package/dist/chunks/libs/ufo.mjs +1 -1
  40. package/dist/chunks/libs/unstorage.d.mts +1 -0
  41. package/dist/chunks/libs/which.mjs +1 -1
  42. package/dist/chunks/libs/zod.d.mts +48 -36
  43. package/dist/chunks/libs/zod.mjs +4 -4
  44. package/dist/chunks/logger.mjs +1 -0
  45. package/dist/chunks/node.mjs +57 -66
  46. package/dist/chunks/rolldown-runtime.mjs +1 -1
  47. package/dist/chunks/sequence-view.mjs +1 -1
  48. package/dist/chunks/vite-plugin.mjs +43 -43
  49. package/dist/cli/index.mjs +159 -157
  50. package/dist/index.d.mts +2 -3
  51. package/dist/index.mjs +1 -1
  52. package/dist/model/index.d.mts +5 -4
  53. package/dist/vite-plugin/index.d.mts +6 -9
  54. package/dist/vite-plugin/internal/index.d.mts +15 -10
  55. package/package.json +38 -38
  56. package/react/index.d.mts +761 -111
  57. package/react/index.mjs +13997 -10234
  58. package/__app__/src/chunks/DiagramActorProvider.mjs +0 -7638
  59. package/__app__/src/chunks/Markdown.mjs +0 -146
  60. package/__app__/src/chunks/NavigationPanel.mjs +0 -61
  61. package/__app__/src/chunks/adhoc-editor.mjs +0 -3386
  62. package/__app__/src/chunks/libs/@dagrejs/dagre.mjs +0 -1894
  63. package/__app__/src/chunks/libs/@tabler/icons-react.mjs +0 -252
  64. package/__app__/src/chunks/libs/remeda.mjs +0 -642
@@ -5,7 +5,7 @@ import { jsx as x } from "react/jsx-runtime";
5
5
  import { ComponentName as S } from "likec4:app-config";
6
6
  import { LikeC4View as C } from "likec4:react";
7
7
  //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/mini/schemas.js
8
- var w = /* @__PURE__ */ r("ZodMiniType", (t, n) => {
8
+ var w = /*@__PURE__*/ r("ZodMiniType", (t, n) => {
9
9
  if (!t._zod) throw Error("Uninitialized schema in ZodMiniType.");
10
10
  y.init(t, n), t.def = n, t.type = n.type, t.parse = (e, n) => s(t, e, n, { callee: t.parse }), t.safeParse = (e, n) => i(t, e, n), t.parseAsync = async (e, n) => v(t, e, n, { callee: t.parseAsync }), t.safeParseAsync = async (n, r) => e(t, n, r), t.check = (...e) => t.clone({
11
11
  ...n,
@@ -15,19 +15,19 @@ var w = /* @__PURE__ */ r("ZodMiniType", (t, n) => {
15
15
  onattach: []
16
16
  } } : e)]
17
17
  }, { parent: !0 }), t.with = t.check, t.clone = (e, n) => _(t, e, n), t.brand = () => t, t.register = ((e, n) => (e.add(t, n), t)), t.apply = (e) => e(t);
18
- }), T = /* @__PURE__ */ r("ZodMiniString", (e, t) => {
18
+ }), T = /*@__PURE__*/ r("ZodMiniString", (e, t) => {
19
19
  g.init(e, t), w.init(e, t);
20
20
  });
21
- /* @__NO_SIDE_EFFECTS__ */
21
+ // @__NO_SIDE_EFFECTS__
22
22
  function string(e) {
23
23
  return f(T, e);
24
24
  }
25
- var E = /* @__PURE__ */ r("ZodMiniBoolean", (e, t) => {
25
+ var E = /*@__PURE__*/ r("ZodMiniBoolean", (e, t) => {
26
26
  c.init(e, t), w.init(e, t);
27
- }), D = /* @__PURE__ */ r("ZodMiniObject", (e, t) => {
27
+ }), D = /*@__PURE__*/ r("ZodMiniObject", (e, t) => {
28
28
  d.init(e, t), w.init(e, t), a(e, "shape", () => t.shape);
29
29
  });
30
- /* @__NO_SIDE_EFFECTS__ */
30
+ // @__NO_SIDE_EFFECTS__
31
31
  function object(e, t) {
32
32
  return new D({
33
33
  type: "object",
@@ -35,10 +35,10 @@ function object(e, t) {
35
35
  ...n(t)
36
36
  });
37
37
  }
38
- var O = /* @__PURE__ */ r("ZodMiniLiteral", (e, t) => {
38
+ var O = /*@__PURE__*/ r("ZodMiniLiteral", (e, t) => {
39
39
  p.init(e, t), w.init(e, t);
40
40
  });
41
- /* @__NO_SIDE_EFFECTS__ */
41
+ // @__NO_SIDE_EFFECTS__
42
42
  function literal(e, t) {
43
43
  return new O({
44
44
  type: "literal",
@@ -46,20 +46,20 @@ function literal(e, t) {
46
46
  ...n(t)
47
47
  });
48
48
  }
49
- var k = /* @__PURE__ */ r("ZodMiniOptional", (e, t) => {
49
+ var k = /*@__PURE__*/ r("ZodMiniOptional", (e, t) => {
50
50
  u.init(e, t), w.init(e, t);
51
51
  });
52
- /* @__NO_SIDE_EFFECTS__ */
52
+ // @__NO_SIDE_EFFECTS__
53
53
  function optional(e) {
54
54
  return new k({
55
55
  type: "optional",
56
56
  innerType: e
57
57
  });
58
58
  }
59
- var A = /* @__PURE__ */ r("ZodMiniDefault", (e, t) => {
59
+ var A = /*@__PURE__*/ r("ZodMiniDefault", (e, t) => {
60
60
  m.init(e, t), w.init(e, t);
61
61
  });
62
- /* @__NO_SIDE_EFFECTS__ */
62
+ // @__NO_SIDE_EFFECTS__
63
63
  function _default(e, n) {
64
64
  return new A({
65
65
  type: "default",
@@ -69,9 +69,9 @@ function _default(e, n) {
69
69
  }
70
70
  });
71
71
  }
72
- var j = /* @__PURE__ */ r("ZodMiniPipe", (e, t) => {
72
+ var j = /*@__PURE__*/ r("ZodMiniPipe", (e, t) => {
73
73
  o.init(e, t), w.init(e, t);
74
- }), M = /* @__PURE__ */ r("ZodMiniCodec", (e, t) => {
74
+ }), M = /*@__PURE__*/ r("ZodMiniCodec", (e, t) => {
75
75
  j.init(e, t), l.init(e, t);
76
76
  }), stringbool = (...e) => h({
77
77
  Codec: M,
@@ -1,53 +1,50 @@
1
1
  import { i as e } from "./rolldown-runtime.mjs";
2
- import { u as t } from "./libs/@tanstack.mjs";
3
- import { W as n, h as r, z as i } from "./libs/remeda.mjs";
4
- import { M as a, Tt as o, X as s, Yt as c, _ as l, b as u, h as d, mt as f, pt as p, q as m, r as h, z as g } from "./libs/@mantine.mjs";
5
- import { C as _, N as v, _ as y, x as b } from "./styled-system.mjs";
6
- import { o as x, t as ee } from "./libs/@tabler/icons-react.mjs";
7
- import { i as S, n as C, r as w, t as te } from "./Markdown.mjs";
8
- import { f as ne, p as re, t as ie, u as T } from "./hooks.mjs";
9
- import { l as E, m as ae } from "./libs/framer.mjs";
10
- import { a as D, c as O, i as oe, n as k, o as A, r as j, s as M, t as N } from "./libs/zod.mjs";
11
- import { a as P, i as se, n as ce, r as le, t as ue } from "./libs/@tanstack-ai.mjs";
12
- import { createContext as de, use as fe, useEffect as pe, useRef as F, useState as me } from "react";
13
- import { c as I } from "react/compiler-runtime";
14
- import { Fragment as L, jsx as R, jsxs as z } from "react/jsx-runtime";
15
- import { RichText as he, nonNullable as ge, nonexhaustive as _e } from "@likec4/core";
2
+ import { l as t } from "./libs/@tanstack.mjs";
3
+ import { C as n, F as r, N as i, O as a, _ as o, b as s, c, j as l, k as u, m as d, t as f, v as p, y as m } from "./hooks.mjs";
4
+ import { B as h, Et as g, J as ee, N as te, Xt as ne, Z as _, g as re, ht as v, mt as ie, r as ae, v as y, x as b } from "./libs/@mantine.mjs";
5
+ import { C as x, N as S, _ as C, x as w } from "./styled-system.mjs";
6
+ import { i as oe, m as se } from "./libs/framer.mjs";
7
+ import { a as T, c as E, i as ce, n as D, o as O, r as k, s as A, t as j } from "./libs/zod.mjs";
8
+ import { a as M, i as le, n as ue, r as de, t as fe } from "./libs/@tanstack-ai.mjs";
9
+ import { createContext as pe, use as me, useEffect as he, useRef as N, useState as P } from "react";
10
+ import { c as F } from "react/compiler-runtime";
11
+ import { Fragment as I, jsx as L, jsxs as R } from "react/jsx-runtime";
12
+ import { RichText as ge, nonNullable as z, nonexhaustive as _e } from "@likec4/core";
16
13
  import { ElementShapes as ve } from "@likec4/core/styles";
17
14
  import { AIAdapter as ye } from "likec4:rpc";
18
15
  //#region ../../node_modules/.pnpm/nanostores@1.3.0/node_modules/nanostores/computed/index.js
19
16
  var computedStore = (e, t, n) => {
20
17
  Array.isArray(e) || (e = [e]);
21
18
  let r, i, set = () => {
22
- if (i === S.epoch) return;
23
- i = S.epoch;
19
+ if (i === s.epoch) return;
20
+ i = s.epoch;
24
21
  let n = e.map((e) => e.get());
25
22
  if (!r || n.some((e, t) => e !== r[t])) {
26
23
  r = n;
27
24
  let e = t(...n);
28
25
  e && e.then && e.t ? e.then((e) => {
29
26
  r === n && a.set(e);
30
- }) : (a.set(e), i = S.epoch);
27
+ }) : (a.set(e), i = s.epoch);
31
28
  }
32
- }, a = /* @__PURE__ */ w(void 0), o = a.get;
29
+ }, a = /* @__PURE__ */ m(void 0), o = a.get;
33
30
  a.get = () => (set(), o());
34
- let s, c = n ? () => {
35
- clearTimeout(s), s = setTimeout(set);
31
+ let c, l = n ? () => {
32
+ clearTimeout(c), c = setTimeout(set);
36
33
  } : set;
37
- return ne(a, () => {
38
- let t = e.map((e) => e.listen(c));
34
+ return p(a, () => {
35
+ let t = e.map((e) => e.listen(l));
39
36
  return set(), () => {
40
37
  for (let e of t) e();
41
38
  };
42
39
  }), a;
43
- }, batched = /* @__NO_SIDE_EFFECTS__ */ (e, t) => computedStore(e, t, !0), B = de(null);
40
+ }, batched = /* @__NO_SIDE_EFFECTS__ */ (e, t) => computedStore(e, t, !0), B = pe(null);
44
41
  function useChatContext() {
45
- return ge(fe(B), "useChatContext: ChatProvider is not provided");
42
+ return z(me(B), "useChatContext: ChatProvider is not provided");
46
43
  }
47
44
  //#endregion
48
45
  //#region src/aichat/ChatInput.tsx
49
46
  function ChatInput() {
50
- let e = I(22), { sendMessage: t, isLoading: n, messages: r, clear: i, stop: o } = useChatContext(), [s, c] = me(""), l = F(null), t0;
47
+ let e = F(22), { sendMessage: t, isLoading: n, messages: r, clear: i, stop: o } = useChatContext(), [s, c] = P(""), l = N(null), t0;
51
48
  e[0] !== n || e[1] !== t || e[2] !== s ? (t0 = () => {
52
49
  !s.trim() || n || (t(s), c(""));
53
50
  }, e[0] = n, e[1] = t, e[2] = s, e[3] = t0) : t0 = e[3];
@@ -58,7 +55,7 @@ function ChatInput() {
58
55
  e.key === "Enter" && !e.shiftKey && !e.ctrlKey && !e.metaKey && (e.preventDefault(), u());
59
56
  }, e[5] = u, e[6] = t2);
60
57
  let d;
61
- e[7] !== n || e[8] !== t2 || e[9] !== s ? (d = /* @__PURE__ */ R(a, {
58
+ e[7] !== n || e[8] !== t2 || e[9] !== s ? (d = /* @__PURE__ */ L(te, {
62
59
  flex: 1,
63
60
  className: "chat-input",
64
61
  placeholder: "Your question...",
@@ -71,40 +68,40 @@ function ChatInput() {
71
68
  autosize: !0,
72
69
  minRows: 1
73
70
  }), e[7] = n, e[8] = t2, e[9] = s, e[10] = d) : d = e[10];
74
- let p;
75
- e[11] !== i || e[12] !== n || e[13] !== r.length ? (p = r.length > 0 && !n && /* @__PURE__ */ R(m, {
71
+ let f;
72
+ e[11] !== i || e[12] !== n || e[13] !== r.length ? (f = r.length > 0 && !n && /* @__PURE__ */ L(ee, {
76
73
  size: "sm",
77
74
  color: "red",
78
75
  variant: "light",
79
76
  onClick: () => i(),
80
77
  children: "Clear"
81
- }), e[11] = i, e[12] = n, e[13] = r.length, e[14] = p) : p = e[14];
82
- let h;
83
- e[15] !== n || e[16] !== o ? (h = n && /* @__PURE__ */ R(f, {
78
+ }), e[11] = i, e[12] = n, e[13] = r.length, e[14] = f) : f = e[14];
79
+ let p;
80
+ e[15] !== n || e[16] !== o ? (p = n && /* @__PURE__ */ L(v, {
84
81
  color: "red",
85
82
  variant: "light",
86
83
  onClick: () => o(),
87
- children: /* @__PURE__ */ R(ee, {})
88
- }), e[15] = n, e[16] = o, e[17] = h) : h = e[17];
89
- let g;
90
- return e[18] !== d || e[19] !== p || e[20] !== h ? (g = /* @__PURE__ */ z(b, { children: [
84
+ children: /* @__PURE__ */ L(a, {})
85
+ }), e[15] = n, e[16] = o, e[17] = p) : p = e[17];
86
+ let m;
87
+ return e[18] !== d || e[19] !== f || e[20] !== p ? (m = /* @__PURE__ */ R(w, { children: [
91
88
  d,
92
- p,
93
- h
94
- ] }), e[18] = d, e[19] = p, e[20] = h, e[21] = g) : g = e[21], g;
89
+ f,
90
+ p
91
+ ] }), e[18] = d, e[19] = f, e[20] = p, e[21] = m) : m = e[21], m;
95
92
  }
96
93
  //#endregion
97
94
  //#region src/aichat/ChatMessage.tsx
98
95
  function ChatMessages() {
99
- let e = I(7), { messages: t, error: n } = useChatContext(), r;
96
+ let e = F(7), { messages: t, error: n } = useChatContext(), r;
100
97
  e[0] === t ? r = e[1] : (r = t.map(_temp), e[0] = t, e[1] = r);
101
98
  let i;
102
- e[2] === n ? i = e[3] : (i = n && /* @__PURE__ */ R(l, {
99
+ e[2] === n ? i = e[3] : (i = n && /* @__PURE__ */ L(y, {
103
100
  styles: { icon: { alignSelf: "flex-start" } },
104
101
  color: "red",
105
102
  title: "Oops, something went wrong",
106
103
  withCloseButton: !1,
107
- children: /* @__PURE__ */ z(y, {
104
+ children: /* @__PURE__ */ R(C, {
108
105
  fontSize: "sm",
109
106
  fontFamily: "mono",
110
107
  whiteSpace: "pre",
@@ -113,14 +110,14 @@ function ChatMessages() {
113
110
  })
114
111
  }), e[2] = n, e[3] = i);
115
112
  let a;
116
- return e[4] !== r || e[5] !== i ? (a = /* @__PURE__ */ z(L, { children: [r, i] }), e[4] = r, e[5] = i, e[6] = a) : a = e[6], a;
113
+ return e[4] !== r || e[5] !== i ? (a = /* @__PURE__ */ R(I, { children: [r, i] }), e[4] = r, e[5] = i, e[6] = a) : a = e[6], a;
117
114
  }
118
115
  function _temp(e) {
119
- return /* @__PURE__ */ R(ChatMessage, { message: e }, e.id);
116
+ return /* @__PURE__ */ L(ChatMessage, { message: e }, e.id);
120
117
  }
121
118
  var ChatMessage = (e) => {
122
- let t = I(4), { message: n } = e, r = n.role, i;
123
- t[0] === Symbol.for("react.memo_cache_sentinel") ? (i = v({
119
+ let t = F(4), { message: n } = e, r = n.role, i;
120
+ t[0] === Symbol.for("react.memo_cache_sentinel") ? (i = S({
124
121
  color: "text.bright",
125
122
  alignSelf: "flex-end",
126
123
  paddingInline: "2",
@@ -131,28 +128,28 @@ var ChatMessage = (e) => {
131
128
  whiteSpace: "pre-wrap"
132
129
  }), t[0] = i) : i = t[0];
133
130
  let a = r === "user" ? UserMessageTextPart : MarkdownTextPart, o;
134
- return t[1] !== n || t[2] !== a ? (o = /* @__PURE__ */ R(ue, {
131
+ return t[1] !== n || t[2] !== a ? (o = /* @__PURE__ */ L(fe, {
135
132
  message: n,
136
133
  userClassName: i,
137
134
  textPartRenderer: a
138
135
  }), t[1] = n, t[2] = a, t[3] = o) : o = t[3], o;
139
136
  }, UserMessageTextPart = (e) => {
140
- let t = I(2), { content: n } = e, r;
141
- return t[0] === n ? r = t[1] : (r = /* @__PURE__ */ R(L, { children: n }), t[0] = n, t[1] = r), r;
137
+ let t = F(2), { content: n } = e, r;
138
+ return t[0] === n ? r = t[1] : (r = /* @__PURE__ */ L(I, { children: n }), t[0] = n, t[1] = r), r;
142
139
  }, MarkdownTextPart = (e) => {
143
- let t = I(4), { content: n } = e, r;
144
- t[0] === n ? r = t[1] : (r = he.from({ md: n }), t[0] = n, t[1] = r);
140
+ let t = F(4), { content: n } = e, r;
141
+ t[0] === n ? r = t[1] : (r = ge.from({ md: n }), t[0] = n, t[1] = r);
145
142
  let i;
146
- return t[2] === r ? i = t[3] : (i = /* @__PURE__ */ R(te, {
143
+ return t[2] === r ? i = t[3] : (i = /* @__PURE__ */ L(c, {
147
144
  textScale: .95,
148
145
  value: r
149
146
  }), t[2] = r, t[3] = i), i;
150
- }, V = /* @__PURE__ */ w(""), H = /* @__PURE__ */ w("closed"), be = /* @__PURE__ */ batched([V, H], (e, t) => ({
147
+ }, V = /* @__PURE__ */ m(""), H = /* @__PURE__ */ m("closed"), be = /* @__PURE__ */ batched([V, H], (e, t) => ({
151
148
  log: e,
152
149
  status: t
153
150
  }));
154
151
  function useSemanticLayoutLog() {
155
- return C(be);
152
+ return o(be);
156
153
  }
157
154
  function closeSemanticLayoutLog() {
158
155
  H.set("closed"), V.set("");
@@ -160,20 +157,20 @@ function closeSemanticLayoutLog() {
160
157
  //#endregion
161
158
  //#region src/aichat/SemanticLayoutLog.tsx
162
159
  function SemanticLayoutLog() {
163
- let e = I(6), { log: t, status: n } = useSemanticLayoutLog();
160
+ let e = F(6), { log: t, status: n } = useSemanticLayoutLog();
164
161
  if (n === "closed") return null;
165
162
  let r = n === "completed", i;
166
- e[0] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ R(h, {
163
+ e[0] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ L(ae, {
167
164
  order: 4,
168
165
  children: "Semantic Layout"
169
166
  }), e[0] = i) : i = e[0];
170
167
  let a = t || "Waiting for response...", o;
171
- e[1] === a ? o = e[2] : (o = /* @__PURE__ */ R(y, {
168
+ e[1] === a ? o = e[2] : (o = /* @__PURE__ */ L(C, {
172
169
  whiteSpace: "pre-wrap",
173
170
  children: a
174
171
  }), e[1] = a, e[2] = o);
175
172
  let s;
176
- return e[3] !== r || e[4] !== o ? (s = /* @__PURE__ */ R(u, {
173
+ return e[3] !== r || e[4] !== o ? (s = /* @__PURE__ */ L(b, {
177
174
  size: "xl",
178
175
  opened: !0,
179
176
  onClose: closeSemanticLayoutLog,
@@ -186,57 +183,57 @@ function SemanticLayoutLog() {
186
183
  }
187
184
  //#endregion
188
185
  //#region ../vite-plugin/src/ai/tools.ts
189
- var U = M({
190
- id: O().meta({ description: "Node ID" }),
191
- title: O(),
192
- shape: N(ve),
193
- color: O().meta({ description: "Node color, from theme or custom" }),
194
- icon: O().nullish(),
195
- parentId: O().nullish().meta({ description: "Parent node ID (if node is nested)" }),
196
- children: k(O()).nullish().meta({ description: "Nested node IDs (if node is compound)" }),
197
- x: A(),
198
- y: A(),
199
- width: A(),
200
- height: A(),
201
- modelFqn: O().nullish().meta({ description: "Model element FQN (if node has reference)" })
202
- }), xe = P({
186
+ var U = A({
187
+ id: E().meta({ description: "Node ID" }),
188
+ title: E(),
189
+ shape: j(ve),
190
+ color: E().meta({ description: "Node color, from theme or custom" }),
191
+ icon: E().nullish(),
192
+ parentId: E().nullish().meta({ description: "Parent node ID (if node is nested)" }),
193
+ children: D(E()).nullish().meta({ description: "Nested node IDs (if node is compound)" }),
194
+ x: O(),
195
+ y: O(),
196
+ width: O(),
197
+ height: O(),
198
+ modelFqn: E().nullish().meta({ description: "Model element FQN (if node has reference)" })
199
+ }), xe = M({
203
200
  name: "read_ui",
204
201
  description: "Read current UI state. Use arguments to include additional data.",
205
202
  needsApproval: !1,
206
- inputSchema: M({
207
- selectedNode: j().default(!1).meta({ description: "Include selected node (if any)" }),
208
- nodes: j().default(!1).meta({ description: "Include all nodes from the view" })
203
+ inputSchema: A({
204
+ selectedNode: k().default(!1).meta({ description: "Include selected node (if any)" }),
205
+ nodes: k().default(!1).meta({ description: "Include all nodes from the view" })
209
206
  }),
210
- outputSchema: M({
211
- projectId: O(),
212
- editMode: j().meta({ description: "Whether the UI is in edit mode" }),
213
- view: M({
214
- id: O(),
215
- title: O(),
216
- type: N([
207
+ outputSchema: A({
208
+ projectId: E(),
209
+ editMode: k().meta({ description: "Whether the UI is in edit mode" }),
210
+ view: A({
211
+ id: E(),
212
+ title: E(),
213
+ type: j([
217
214
  "element",
218
215
  "deployment",
219
216
  "dynamic"
220
217
  ]).meta({ description: "Type of the current view" })
221
218
  }).meta({ description: "Current view" }),
222
- nodes: k(U).nullish(),
219
+ nodes: D(U).nullish(),
223
220
  selectedNode: U.nullish()
224
221
  })
225
- }), Se = P({
222
+ }), Se = M({
226
223
  name: "update_ui",
227
224
  description: "Update UI state by executing a command.",
228
225
  needsApproval: !1,
229
- inputSchema: M({ command: oe("type", [M({
230
- type: D("focus"),
231
- elementId: O().meta({ description: "Element ID (FQN)" })
232
- }).meta({ description: "Focus UI on an element by its FQN" }), M({ type: D("fitview") }).meta({ description: "Zoom out to fit all elements in the viewport, and clear any selection/focus" })]) }),
233
- outputSchema: M({})
234
- }), Ce = P({
226
+ inputSchema: A({ command: ce("type", [A({
227
+ type: T("focus"),
228
+ elementId: E().meta({ description: "Element ID (FQN)" })
229
+ }).meta({ description: "Focus UI on an element by its FQN" }), A({ type: T("fitview") }).meta({ description: "Zoom out to fit all elements in the viewport, and clear any selection/focus" })]) }),
230
+ outputSchema: A({})
231
+ }), Ce = M({
235
232
  name: "navigate_to",
236
233
  description: "Navigates UI to another view",
237
234
  needsApproval: !1,
238
- inputSchema: M({ viewId: O().meta({ description: "View ID" }) }),
239
- outputSchema: M({})
235
+ inputSchema: A({ viewId: E().meta({ description: "View ID" }) }),
236
+ outputSchema: A({})
240
237
  }), DoubleIndexedKV = class {
241
238
  constructor() {
242
239
  this.keyToValue = /* @__PURE__ */ new Map(), this.valueToKey = /* @__PURE__ */ new Map();
@@ -726,24 +723,24 @@ function mapToNodeData(e) {
726
723
  };
727
724
  }
728
725
  function useChatTools() {
729
- let e = I(11), { id: a } = ie(), o = t(), s = T(), c;
730
- if (e[0] !== s || e[1] !== o || e[2] !== a) {
726
+ let e = F(11), { id: n } = f(), a = t(), o = d(), s;
727
+ if (e[0] !== o || e[1] !== a || e[2] !== n) {
731
728
  let t1;
732
- e[4] === o ? t1 = e[5] : (t1 = (e) => {
729
+ e[4] === a ? t1 = e[5] : (t1 = (e) => {
733
730
  let { viewId: t } = e;
734
- return o({
731
+ return a({
735
732
  to: "./",
736
733
  params: (e) => ({
737
734
  ...e,
738
735
  viewId: t
739
736
  })
740
737
  }), {};
741
- }, e[4] = o, e[5] = t1);
738
+ }, e[4] = a, e[5] = t1);
742
739
  let t2;
743
- e[6] !== s || e[7] !== a ? (t2 = (e) => {
744
- let { view: t, focusedNode: o, xynodes: c, xystore: l, toggledFeatures: u, features: d } = s.getContext(), f = u.enableReadOnly ?? d.enableReadOnly, p = mapToNodeData(l.getState()), m = e.nodes === !0 && r(c, p) || void 0, h = e.selectedNode === !0 && n(c, i((e) => !!e.selected || e.id === o), (e) => e ? p(e) : void 0);
740
+ e[6] !== o || e[7] !== n ? (t2 = (e) => {
741
+ let { view: t, focusedNode: a, xynodes: s, xystore: c, toggledFeatures: u, features: d } = o.getContext(), f = u.enableReadOnly ?? d.enableReadOnly, p = mapToNodeData(c.getState()), m = e.nodes === !0 && l(s, p) || void 0, h = e.selectedNode === !0 && r(s, i((e) => !!e.selected || e.id === a), (e) => e ? p(e) : void 0);
745
742
  return {
746
- projectId: a,
743
+ projectId: n,
747
744
  editMode: !f,
748
745
  view: {
749
746
  id: t.id,
@@ -753,23 +750,23 @@ function useChatTools() {
753
750
  ...m && { nodes: m },
754
751
  ...h && { selectedNode: h }
755
752
  };
756
- }, e[6] = s, e[7] = a, e[8] = t2) : t2 = e[8];
753
+ }, e[6] = o, e[7] = n, e[8] = t2) : t2 = e[8];
757
754
  let t3;
758
- e[9] === s ? t3 = e[10] : (t3 = (e) => {
755
+ e[9] === o ? t3 = e[10] : (t3 = (e) => {
759
756
  let { command: t } = e;
760
757
  bb50: switch (t.type) {
761
758
  case "focus":
762
- s.focusOnElement(t.elementId);
759
+ o.focusOnElement(t.elementId);
763
760
  break bb50;
764
761
  case "fitview":
765
- s.fitDiagram();
762
+ o.fitDiagram();
766
763
  break bb50;
767
764
  default: _e(t);
768
765
  }
769
766
  return {};
770
- }, e[9] = s, e[10] = t3), c = le(Ce.client(t1), xe.client(t2), Se.client(t3)), e[0] = s, e[1] = o, e[2] = a, e[3] = c;
771
- } else c = e[3];
772
- return c;
767
+ }, e[9] = o, e[10] = t3), s = de(Ce.client(t1), xe.client(t2), Se.client(t3)), e[0] = o, e[1] = a, e[2] = n, e[3] = s;
768
+ } else s = e[3];
769
+ return s;
773
770
  }
774
771
  var Q = {
775
772
  key: "likec4.ai.chat.messages",
@@ -792,9 +789,9 @@ var Q = {
792
789
  }
793
790
  };
794
791
  function useChat(e) {
795
- let t = I(7), n;
792
+ let t = F(7), n;
796
793
  t[0] === Symbol.for("react.memo_cache_sentinel") ? (n = {
797
- connection: se("/__likec4_ai"),
794
+ connection: le("/__likec4_ai"),
798
795
  initialMessages: Q.read()
799
796
  }, t[0] = n) : n = t[0];
800
797
  let r = n, i = useChatTools(), a;
@@ -803,10 +800,10 @@ function useChat(e) {
803
800
  ...e,
804
801
  tools: i
805
802
  }, t[1] = e, t[2] = i, t[3] = a) : a = t[3];
806
- let o = ce(a), t3, s;
803
+ let o = ue(a), t3, s;
807
804
  return t[4] === o.messages ? (t3 = t[5], s = t[6]) : (t3 = () => {
808
805
  Q.write(o.messages);
809
- }, s = [o.messages], t[4] = o.messages, t[5] = t3, t[6] = s), pe(t3, s), o;
806
+ }, s = [o.messages], t[4] = o.messages, t[5] = t3, t[6] = s), he(t3, s), o;
810
807
  }
811
808
  //#endregion
812
809
  //#region src/aichat/AIChat.tsx
@@ -829,7 +826,7 @@ var $ = {
829
826
  }
830
827
  };
831
828
  function AIChatComponent() {
832
- let e = F(null);
829
+ let e = N(null);
833
830
  e.current ||= $.read() ?? {
834
831
  right: 16,
835
832
  bottom: 100
@@ -839,14 +836,14 @@ function AIChatComponent() {
839
836
  left: t.x,
840
837
  top: t.y
841
838
  });
842
- }, [t, n] = c({
839
+ }, [t, n] = ne({
843
840
  key: "likec4.ai.chat.collapsed",
844
841
  defaultValue: !0
845
842
  });
846
- return /* @__PURE__ */ z(L, { children: [/* @__PURE__ */ z(ae, { children: [!t && /* @__PURE__ */ R(g, {
843
+ return /* @__PURE__ */ R(I, { children: [/* @__PURE__ */ R(se, { children: [!t && /* @__PURE__ */ L(h, {
847
844
  w: 300,
848
845
  pos: "fixed",
849
- className: v({
846
+ className: S({
850
847
  rounded: "md",
851
848
  padding: "xs",
852
849
  shadow: "md",
@@ -857,8 +854,8 @@ function AIChatComponent() {
857
854
  excludeDragHandleSelector: ".chat-input",
858
855
  initialPosition: e.current,
859
856
  onPositionChange,
860
- children: /* @__PURE__ */ R(AIChatWindowContent, { onClose: () => n(!0) })
861
- }), t && /* @__PURE__ */ R(E.div, {
857
+ children: /* @__PURE__ */ L(AIChatWindowContent, { onClose: () => n(!0) })
858
+ }), t && /* @__PURE__ */ L(oe.div, {
862
859
  initial: {
863
860
  opacity: .1,
864
861
  translateX: "10%"
@@ -877,83 +874,83 @@ function AIChatComponent() {
877
874
  bottom: 60,
878
875
  zIndex: 1e3
879
876
  },
880
- children: /* @__PURE__ */ R(d, {
877
+ children: /* @__PURE__ */ L(re, {
881
878
  label: "Show AI Assistant",
882
879
  color: "dark",
883
880
  fz: "xs",
884
- children: /* @__PURE__ */ R(f, {
881
+ children: /* @__PURE__ */ L(v, {
885
882
  size: "lg",
886
883
  variant: "gradient",
887
884
  onClick: () => n(!1),
888
- children: /* @__PURE__ */ R(x, { stroke: 1.5 })
885
+ children: /* @__PURE__ */ L(u, { stroke: 1.5 })
889
886
  })
890
887
  })
891
- }, "collapsed")] }), /* @__PURE__ */ R(SemanticLayoutLog, {})] });
888
+ }, "collapsed")] }), /* @__PURE__ */ L(SemanticLayoutLog, {})] });
892
889
  }
893
890
  function AIChatWindowContent(e) {
894
- let t = I(15), { onClose: n } = e, r = F(null), t1;
891
+ let t = F(15), { onClose: r } = e, i = N(null), t1;
895
892
  t[0] === Symbol.for("react.memo_cache_sentinel") ? (t1 = () => {
896
- r.current?.scrollIntoView();
893
+ i.current?.scrollIntoView();
897
894
  }, t[0] = t1) : t1 = t[0];
898
- let i = t1, t2;
895
+ let a = t1, t2;
899
896
  t[1] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => {
900
- i();
901
- }, t[1] = t2) : t2 = t[1], re(t2, 100);
902
- let a;
903
- t[2] === Symbol.for("react.memo_cache_sentinel") ? (a = { onChunk: i }, t[2] = a) : a = t[2];
904
- let c = useChat(a), l;
905
- t[3] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ z(b, { children: [/* @__PURE__ */ R(y, {
897
+ a();
898
+ }, t[1] = t2) : t2 = t[1], n(t2, 100);
899
+ let o;
900
+ t[2] === Symbol.for("react.memo_cache_sentinel") ? (o = { onChunk: a }, t[2] = o) : o = t[2];
901
+ let s = useChat(o), c;
902
+ t[3] === Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ R(w, { children: [/* @__PURE__ */ L(C, {
906
903
  textStyle: "likec4.panel",
907
904
  noUserSelect: !0,
908
905
  children: "AI Assistant"
909
- }), /* @__PURE__ */ R(s, {
906
+ }), /* @__PURE__ */ L(_, {
910
907
  size: "xs",
911
908
  radius: "sm",
912
909
  variant: "light",
913
910
  children: ye
914
- })] }), t[3] = l) : l = t[3];
915
- let u;
916
- t[4] === n ? u = t[5] : (u = /* @__PURE__ */ z(b, {
911
+ })] }), t[3] = c) : c = t[3];
912
+ let l;
913
+ t[4] === r ? l = t[5] : (l = /* @__PURE__ */ R(w, {
917
914
  cursor: "move",
918
915
  justify: "space-between",
919
- children: [l, /* @__PURE__ */ R(p, {
916
+ children: [c, /* @__PURE__ */ L(ie, {
920
917
  size: "sm",
921
918
  onClick: (e) => {
922
- e.stopPropagation(), n();
919
+ e.stopPropagation(), r();
923
920
  }
924
921
  })]
925
- }), t[4] = n, t[5] = u);
922
+ }), t[4] = r, t[5] = l);
923
+ let u;
924
+ t[6] === Symbol.for("react.memo_cache_sentinel") ? (u = { content: S({ display: "contents" }) }, t[6] = u) : u = t[6];
926
925
  let d;
927
- t[6] === Symbol.for("react.memo_cache_sentinel") ? (d = { content: v({ display: "contents" }) }, t[6] = d) : d = t[6];
928
- let f;
929
- t[7] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ R(ChatMessages, {}), t[7] = f) : f = t[7];
930
- let m, h;
931
- t[8] === Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ R(o, {
926
+ t[7] === Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ L(ChatMessages, {}), t[7] = d) : d = t[7];
927
+ let f, p;
928
+ t[8] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ L(g, {
932
929
  scrollbars: "y",
933
930
  w: "100%",
934
931
  flex: 1,
935
932
  mih: 250,
936
933
  mah: 350,
937
- classNames: d,
938
- children: /* @__PURE__ */ z(_, { children: [f, /* @__PURE__ */ R("div", {
939
- ref: r,
934
+ classNames: u,
935
+ children: /* @__PURE__ */ R(x, { children: [d, /* @__PURE__ */ L("div", {
936
+ ref: i,
940
937
  style: { height: 2 }
941
938
  })] })
942
- }), h = /* @__PURE__ */ R(ChatInput, {}), t[8] = m, t[9] = h) : (m = t[8], h = t[9]);
943
- let g;
944
- t[10] === u ? g = t[11] : (g = /* @__PURE__ */ z(_, {
939
+ }), p = /* @__PURE__ */ L(ChatInput, {}), t[8] = f, t[9] = p) : (f = t[8], p = t[9]);
940
+ let m;
941
+ t[10] === l ? m = t[11] : (m = /* @__PURE__ */ R(x, {
945
942
  w: "100%",
946
943
  children: [
947
- u,
948
- m,
949
- h
944
+ l,
945
+ f,
946
+ p
950
947
  ]
951
- }), t[10] = u, t[11] = g);
952
- let x;
953
- return t[12] !== c || t[13] !== g ? (x = /* @__PURE__ */ R(B, {
954
- value: c,
955
- children: g
956
- }), t[12] = c, t[13] = g, t[14] = x) : x = t[14], x;
948
+ }), t[10] = l, t[11] = m);
949
+ let h;
950
+ return t[12] !== s || t[13] !== m ? (h = /* @__PURE__ */ L(B, {
951
+ value: s,
952
+ children: m
953
+ }), t[12] = s, t[13] = m, t[14] = h) : h = t[14], h;
957
954
  }
958
955
  //#endregion
959
956
  export { AIChatComponent as default };