@aidapt/caity-chat 3.0.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.
Files changed (62) hide show
  1. package/README.md +73 -0
  2. package/dist/lib/_baseUniq-BVCT-t6P.js +477 -0
  3. package/dist/lib/arc-Kj6ZmwPS.js +83 -0
  4. package/dist/lib/architectureDiagram-Q4EWVU46-DA4kYaz_.js +4690 -0
  5. package/dist/lib/blockDiagram-DXYQGD6D-BWT5yya1.js +2295 -0
  6. package/dist/lib/c4Diagram-AHTNJAMY-BjY6DW3U.js +1577 -0
  7. package/dist/lib/caity-chat.tgz +0 -0
  8. package/dist/lib/channel-BjraetTo.js +5 -0
  9. package/dist/lib/chunk-4BX2VUAB-iSPZGgxQ.js +8 -0
  10. package/dist/lib/chunk-4TB4RGXK-DvnUcLoe.js +1465 -0
  11. package/dist/lib/chunk-55IACEB6-Mw25YX9j.js +8 -0
  12. package/dist/lib/chunk-EDXVE4YY-Dtbxz7df.js +19 -0
  13. package/dist/lib/chunk-FMBD7UC4-OCIy3top.js +19 -0
  14. package/dist/lib/chunk-OYMX7WX6-DFW9El2C.js +1383 -0
  15. package/dist/lib/chunk-QZHKN3VN-BYFTfk7k.js +15 -0
  16. package/dist/lib/chunk-YZCP3GAM-Cs-HTcyJ.js +68 -0
  17. package/dist/lib/classDiagram-6PBFFD2Q-CrDUlIYr.js +16 -0
  18. package/dist/lib/classDiagram-v2-HSJHXN6E-CrDUlIYr.js +16 -0
  19. package/dist/lib/clone-C0qEGPCz.js +8 -0
  20. package/dist/lib/cose-bilkent-S5V4N54A-H1-YbKvI.js +2609 -0
  21. package/dist/lib/cytoscape.esm-D_3MZVO6.js +18707 -0
  22. package/dist/lib/dagre-KV5264BT-DhEnTJ4D.js +443 -0
  23. package/dist/lib/defaultLocale-BgPVtth8.js +171 -0
  24. package/dist/lib/diagram-5BDNPKRD-CK6wgKxI.js +123 -0
  25. package/dist/lib/diagram-G4DWMVQ6-IhA_MJ0t.js +528 -0
  26. package/dist/lib/diagram-MMDJMWI5-DDuA1rYY.js +217 -0
  27. package/dist/lib/diagram-TYMM5635-_VI1en0S.js +142 -0
  28. package/dist/lib/erDiagram-SMLLAGMA-B1REwW7y.js +899 -0
  29. package/dist/lib/flowDiagram-DWJPFMVM-rWzOGDlg.js +1628 -0
  30. package/dist/lib/ganttDiagram-T4ZO3ILL-UhSvbAmM.js +2701 -0
  31. package/dist/lib/gitGraphDiagram-UUTBAWPF-DrsSMMoJ.js +815 -0
  32. package/dist/lib/graph-DMr8NrNW.js +738 -0
  33. package/dist/lib/index.d.ts +665 -0
  34. package/dist/lib/index.js +52 -0
  35. package/dist/lib/infoDiagram-42DDH7IO-CPF3XCNj.js +24 -0
  36. package/dist/lib/init-DjUOC4st.js +16 -0
  37. package/dist/lib/ishikawaDiagram-UXIWVN3A-B4Nt1TdW.js +621 -0
  38. package/dist/lib/journeyDiagram-VCZTEJTY-DW5yRsOM.js +834 -0
  39. package/dist/lib/kanban-definition-6JOO6SKY-5DmJRubo.js +724 -0
  40. package/dist/lib/layout-B00IQLgh.js +1441 -0
  41. package/dist/lib/linear-LLab47WO.js +259 -0
  42. package/dist/lib/main-C9dvh9CT.js +88771 -0
  43. package/dist/lib/mermaid.core-BrBkhL9h.js +15967 -0
  44. package/dist/lib/min-CJFyJhXg.js +38 -0
  45. package/dist/lib/mindmap-definition-QFDTVHPH-doqZCFNi.js +833 -0
  46. package/dist/lib/ordinal-B6-f3MAq.js +61 -0
  47. package/dist/lib/pieDiagram-DEJITSTG-DKi5GKup.js +163 -0
  48. package/dist/lib/quadrantDiagram-34T5L4WZ-COYWmEhy.js +1022 -0
  49. package/dist/lib/requirementDiagram-MS252O5E-D3odK6YH.js +882 -0
  50. package/dist/lib/sankeyDiagram-XADWPNL6-D36eaMCx.js +810 -0
  51. package/dist/lib/sequenceDiagram-FGHM5R23-NpESTwMk.js +2883 -0
  52. package/dist/lib/standalone.js +4 -0
  53. package/dist/lib/stateDiagram-FHFEXIEX-kXZ_Bn-a.js +263 -0
  54. package/dist/lib/stateDiagram-v2-QKLJ7IA2-B5xMdEuE.js +16 -0
  55. package/dist/lib/timeline-definition-GMOUNBTQ-DZDdcJwy.js +1055 -0
  56. package/dist/lib/vennDiagram-DHZGUBPP-Clhb6EGF.js +1557 -0
  57. package/dist/lib/wardley-RL74JXVD-CwSnyVu7.js +18396 -0
  58. package/dist/lib/wardleyDiagram-NUSXRM2D-DnXL4F04.js +594 -0
  59. package/dist/lib/xychartDiagram-5P7HB3ND-CweIkrg3.js +1342 -0
  60. package/package.json +95 -0
  61. package/src/types/caity-chat.d.ts +213 -0
  62. package/src/types/template-slots.d.ts +167 -0
@@ -0,0 +1,4 @@
1
+ import { C } from "./main-C9dvh9CT.js";
2
+ export {
3
+ C as CaitySkillChat
4
+ };
@@ -0,0 +1,263 @@
1
+ import { s as A, a as W, S as N } from "./chunk-OYMX7WX6-DFW9El2C.js";
2
+ import { _ as f, c as t, d as H, l as S, e as P, k as z, R as _, S as U, O as C, u as F } from "./mermaid.core-BrBkhL9h.js";
3
+ import { G as O } from "./graph-DMr8NrNW.js";
4
+ import { l as J } from "./layout-B00IQLgh.js";
5
+ var X = /* @__PURE__ */ f((e) => e.append("circle").attr("class", "start-state").attr("r", t().state.sizeUnit).attr("cx", t().state.padding + t().state.sizeUnit).attr("cy", t().state.padding + t().state.sizeUnit), "drawStartState"), D = /* @__PURE__ */ f((e) => e.append("line").style("stroke", "grey").style("stroke-dasharray", "3").attr("x1", t().state.textHeight).attr("class", "divider").attr("x2", t().state.textHeight * 2).attr("y1", 0).attr("y2", 0), "drawDivider"), Y = /* @__PURE__ */ f((e, i) => {
6
+ const d = e.append("text").attr("x", 2 * t().state.padding).attr("y", t().state.textHeight + 2 * t().state.padding).attr("font-size", t().state.fontSize).attr("class", "state-title").text(i.id), c = d.node().getBBox();
7
+ return e.insert("rect", ":first-child").attr("x", t().state.padding).attr("y", t().state.padding).attr("width", c.width + 2 * t().state.padding).attr("height", c.height + 2 * t().state.padding).attr("rx", t().state.radius), d;
8
+ }, "drawSimpleState"), I = /* @__PURE__ */ f((e, i) => {
9
+ const d = /* @__PURE__ */ f(function(o, m, y) {
10
+ const v = o.append("tspan").attr("x", 2 * t().state.padding).text(m);
11
+ y || v.attr("dy", t().state.textHeight);
12
+ }, "addTspan"), n = e.append("text").attr("x", 2 * t().state.padding).attr("y", t().state.textHeight + 1.3 * t().state.padding).attr("font-size", t().state.fontSize).attr("class", "state-title").text(i.descriptions[0]).node().getBBox(), l = n.height, p = e.append("text").attr("x", t().state.padding).attr(
13
+ "y",
14
+ l + t().state.padding * 0.4 + t().state.dividerMargin + t().state.textHeight
15
+ ).attr("class", "state-description");
16
+ let a = !0, s = !0;
17
+ i.descriptions.forEach(function(o) {
18
+ a || (d(p, o, s), s = !1), a = !1;
19
+ });
20
+ const B = e.append("line").attr("x1", t().state.padding).attr("y1", t().state.padding + l + t().state.dividerMargin / 2).attr("y2", t().state.padding + l + t().state.dividerMargin / 2).attr("class", "descr-divider"), x = p.node().getBBox(), g = Math.max(x.width, n.width);
21
+ return B.attr("x2", g + 3 * t().state.padding), e.insert("rect", ":first-child").attr("x", t().state.padding).attr("y", t().state.padding).attr("width", g + 2 * t().state.padding).attr("height", x.height + l + 2 * t().state.padding).attr("rx", t().state.radius), e;
22
+ }, "drawDescrState"), $ = /* @__PURE__ */ f((e, i, d) => {
23
+ const c = t().state.padding, n = 2 * t().state.padding, l = e.node().getBBox(), p = l.width, a = l.x, s = e.append("text").attr("x", 0).attr("y", t().state.titleShift).attr("font-size", t().state.fontSize).attr("class", "state-title").text(i.id), x = s.node().getBBox().width + n;
24
+ let g = Math.max(x, p);
25
+ g === p && (g = g + n);
26
+ let o;
27
+ const m = e.node().getBBox();
28
+ i.doc, o = a - c, x > p && (o = (p - g) / 2 + c), Math.abs(a - m.x) < c && x > p && (o = a - (x - p) / 2);
29
+ const y = 1 - t().state.textHeight;
30
+ return e.insert("rect", ":first-child").attr("x", o).attr("y", y).attr("class", d ? "alt-composit" : "composit").attr("width", g).attr(
31
+ "height",
32
+ m.height + t().state.textHeight + t().state.titleShift + 1
33
+ ).attr("rx", "0"), s.attr("x", o + c), x <= p && s.attr("x", a + (g - n) / 2 - x / 2 + c), e.insert("rect", ":first-child").attr("x", o).attr(
34
+ "y",
35
+ t().state.titleShift - t().state.textHeight - t().state.padding
36
+ ).attr("width", g).attr("height", t().state.textHeight * 3).attr("rx", t().state.radius), e.insert("rect", ":first-child").attr("x", o).attr(
37
+ "y",
38
+ t().state.titleShift - t().state.textHeight - t().state.padding
39
+ ).attr("width", g).attr("height", m.height + 3 + 2 * t().state.textHeight).attr("rx", t().state.radius), e;
40
+ }, "addTitleAndBox"), q = /* @__PURE__ */ f((e) => (e.append("circle").attr("class", "end-state-outer").attr("r", t().state.sizeUnit + t().state.miniPadding).attr(
41
+ "cx",
42
+ t().state.padding + t().state.sizeUnit + t().state.miniPadding
43
+ ).attr(
44
+ "cy",
45
+ t().state.padding + t().state.sizeUnit + t().state.miniPadding
46
+ ), e.append("circle").attr("class", "end-state-inner").attr("r", t().state.sizeUnit).attr("cx", t().state.padding + t().state.sizeUnit + 2).attr("cy", t().state.padding + t().state.sizeUnit + 2)), "drawEndState"), Z = /* @__PURE__ */ f((e, i) => {
47
+ let d = t().state.forkWidth, c = t().state.forkHeight;
48
+ if (i.parentId) {
49
+ let n = d;
50
+ d = c, c = n;
51
+ }
52
+ return e.append("rect").style("stroke", "black").style("fill", "black").attr("width", d).attr("height", c).attr("x", t().state.padding).attr("y", t().state.padding);
53
+ }, "drawForkJoinState"), j = /* @__PURE__ */ f((e, i, d, c) => {
54
+ let n = 0;
55
+ const l = c.append("text");
56
+ l.style("text-anchor", "start"), l.attr("class", "noteText");
57
+ let p = e.replace(/\r\n/g, "<br/>");
58
+ p = p.replace(/\n/g, "<br/>");
59
+ const a = p.split(z.lineBreakRegex);
60
+ let s = 1.25 * t().state.noteMargin;
61
+ for (const B of a) {
62
+ const x = B.trim();
63
+ if (x.length > 0) {
64
+ const g = l.append("tspan");
65
+ if (g.text(x), s === 0) {
66
+ const o = g.node().getBBox();
67
+ s += o.height;
68
+ }
69
+ n += s, g.attr("x", i + t().state.noteMargin), g.attr("y", d + n + 1.25 * t().state.noteMargin);
70
+ }
71
+ }
72
+ return { textWidth: l.node().getBBox().width, textHeight: n };
73
+ }, "_drawLongText"), K = /* @__PURE__ */ f((e, i) => {
74
+ i.attr("class", "state-note");
75
+ const d = i.append("rect").attr("x", 0).attr("y", t().state.padding), c = i.append("g"), { textWidth: n, textHeight: l } = j(e, 0, 0, c);
76
+ return d.attr("height", l + 2 * t().state.noteMargin), d.attr("width", n + t().state.noteMargin * 2), d;
77
+ }, "drawNote"), L = /* @__PURE__ */ f(function(e, i) {
78
+ const d = i.id, c = {
79
+ id: d,
80
+ label: i.id,
81
+ width: 0,
82
+ height: 0
83
+ }, n = e.append("g").attr("id", d).attr("class", "stateGroup");
84
+ i.type === "start" && X(n), i.type === "end" && q(n), (i.type === "fork" || i.type === "join") && Z(n, i), i.type === "note" && K(i.note.text, n), i.type === "divider" && D(n), i.type === "default" && i.descriptions.length === 0 && Y(n, i), i.type === "default" && i.descriptions.length > 0 && I(n, i);
85
+ const l = n.node().getBBox();
86
+ return c.width = l.width + 2 * t().state.padding, c.height = l.height + 2 * t().state.padding, c;
87
+ }, "drawState"), G = 0, Q = /* @__PURE__ */ f(function(e, i, d) {
88
+ const c = /* @__PURE__ */ f(function(s) {
89
+ switch (s) {
90
+ case N.relationType.AGGREGATION:
91
+ return "aggregation";
92
+ case N.relationType.EXTENSION:
93
+ return "extension";
94
+ case N.relationType.COMPOSITION:
95
+ return "composition";
96
+ case N.relationType.DEPENDENCY:
97
+ return "dependency";
98
+ }
99
+ }, "getRelationType");
100
+ i.points = i.points.filter((s) => !Number.isNaN(s.y));
101
+ const n = i.points, l = _().x(function(s) {
102
+ return s.x;
103
+ }).y(function(s) {
104
+ return s.y;
105
+ }).curve(U), p = e.append("path").attr("d", l(n)).attr("id", "edge" + G).attr("class", "transition");
106
+ let a = "";
107
+ if (t().state.arrowMarkerAbsolute && (a = C(!0)), p.attr(
108
+ "marker-end",
109
+ "url(" + a + "#" + c(N.relationType.DEPENDENCY) + "End)"
110
+ ), d.title !== void 0) {
111
+ const s = e.append("g").attr("class", "stateLabel"), { x: B, y: x } = F.calcLabelPosition(i.points), g = z.getRows(d.title);
112
+ let o = 0;
113
+ const m = [];
114
+ let y = 0, v = 0;
115
+ for (let u = 0; u <= g.length; u++) {
116
+ const h = s.append("text").attr("text-anchor", "middle").text(g[u]).attr("x", B).attr("y", x + o), w = h.node().getBBox();
117
+ y = Math.max(y, w.width), v = Math.min(v, w.x), S.info(w.x, B, x + o), o === 0 && (o = h.node().getBBox().height, S.info("Title height", o, x)), m.push(h);
118
+ }
119
+ let k = o * g.length;
120
+ if (g.length > 1) {
121
+ const u = (g.length - 1) * o * 0.5;
122
+ m.forEach((h, w) => h.attr("y", x + w * o - u)), k = o * g.length;
123
+ }
124
+ const r = s.node().getBBox();
125
+ s.insert("rect", ":first-child").attr("class", "box").attr("x", B - y / 2 - t().state.padding / 2).attr("y", x - k / 2 - t().state.padding / 2 - 3.5).attr("width", y + t().state.padding).attr("height", k + t().state.padding), S.info(r);
126
+ }
127
+ G++;
128
+ }, "drawEdge"), b, T = {}, V = /* @__PURE__ */ f(function() {
129
+ }, "setConf"), tt = /* @__PURE__ */ f(function(e) {
130
+ e.append("defs").append("marker").attr("id", "dependencyEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 19,7 L9,13 L14,7 L9,1 Z");
131
+ }, "insertMarkers"), et = /* @__PURE__ */ f(function(e, i, d, c) {
132
+ b = t().state;
133
+ const n = t().securityLevel;
134
+ let l;
135
+ n === "sandbox" && (l = H("#i" + i));
136
+ const p = n === "sandbox" ? H(l.nodes()[0].contentDocument.body) : H("body"), a = n === "sandbox" ? l.nodes()[0].contentDocument : document;
137
+ S.debug("Rendering diagram " + e);
138
+ const s = p.select(`[id='${i}']`);
139
+ tt(s);
140
+ const B = c.db.getRootDoc(), x = s.append("g").attr("id", i + "-root");
141
+ R(B, x, void 0, !1, p, a, c);
142
+ const g = b.padding, o = s.node().getBBox(), m = o.width + g * 2, y = o.height + g * 2, v = m * 1.75;
143
+ P(s, y, v, b.useMaxWidth), s.attr(
144
+ "viewBox",
145
+ `${o.x - b.padding} ${o.y - b.padding} ` + m + " " + y
146
+ );
147
+ }, "draw"), at = /* @__PURE__ */ f((e) => e ? e.length * b.fontSizeFactor : 1, "getLabelWidth"), R = /* @__PURE__ */ f((e, i, d, c, n, l, p) => {
148
+ const a = new O({
149
+ compound: !0,
150
+ multigraph: !0
151
+ });
152
+ let s, B = !0;
153
+ for (s = 0; s < e.length; s++)
154
+ if (e[s].stmt === "relation") {
155
+ B = !1;
156
+ break;
157
+ }
158
+ d ? a.setGraph({
159
+ rankdir: "LR",
160
+ multigraph: !0,
161
+ compound: !0,
162
+ // acyclicer: 'greedy',
163
+ ranker: "tight-tree",
164
+ ranksep: B ? 1 : b.edgeLengthFactor,
165
+ nodeSep: B ? 1 : 50,
166
+ isMultiGraph: !0
167
+ // ranksep: 5,
168
+ // nodesep: 1
169
+ }) : a.setGraph({
170
+ rankdir: "TB",
171
+ multigraph: !0,
172
+ compound: !0,
173
+ // isCompound: true,
174
+ // acyclicer: 'greedy',
175
+ // ranker: 'longest-path'
176
+ ranksep: B ? 1 : b.edgeLengthFactor,
177
+ nodeSep: B ? 1 : 50,
178
+ ranker: "tight-tree",
179
+ // ranker: 'network-simplex'
180
+ isMultiGraph: !0
181
+ }), a.setDefaultEdgeLabel(function() {
182
+ return {};
183
+ });
184
+ const x = p.db.getStates(), g = p.db.getRelations(), o = Object.keys(x);
185
+ for (const r of o) {
186
+ const u = x[r];
187
+ d && (u.parentId = d);
188
+ let h;
189
+ if (u.doc) {
190
+ let w = i.append("g").attr("id", u.id).attr("class", "stateGroup");
191
+ h = R(u.doc, w, u.id, !c, n, l, p);
192
+ {
193
+ w = $(w, u, c);
194
+ let E = w.node().getBBox();
195
+ h.width = E.width, h.height = E.height + b.padding / 2, T[u.id] = { y: b.compositTitleSize };
196
+ }
197
+ } else
198
+ h = L(i, u, a);
199
+ if (u.note) {
200
+ const w = {
201
+ descriptions: [],
202
+ id: u.id + "-note",
203
+ note: u.note,
204
+ type: "note"
205
+ }, E = L(i, w, a);
206
+ u.note.position === "left of" ? (a.setNode(h.id + "-note", E), a.setNode(h.id, h)) : (a.setNode(h.id, h), a.setNode(h.id + "-note", E)), a.setParent(h.id, h.id + "-group"), a.setParent(h.id + "-note", h.id + "-group");
207
+ } else
208
+ a.setNode(h.id, h);
209
+ }
210
+ S.debug("Count=", a.nodeCount(), a);
211
+ let m = 0;
212
+ g.forEach(function(r) {
213
+ m++, S.debug("Setting edge", r), a.setEdge(
214
+ r.id1,
215
+ r.id2,
216
+ {
217
+ relation: r,
218
+ width: at(r.title),
219
+ height: b.labelHeight * z.getRows(r.title).length,
220
+ labelpos: "c"
221
+ },
222
+ "id" + m
223
+ );
224
+ }), J(a), S.debug("Graph after layout", a.nodes());
225
+ const y = i.node();
226
+ a.nodes().forEach(function(r) {
227
+ r !== void 0 && a.node(r) !== void 0 ? (S.warn("Node " + r + ": " + JSON.stringify(a.node(r))), n.select("#" + y.id + " #" + r).attr(
228
+ "transform",
229
+ "translate(" + (a.node(r).x - a.node(r).width / 2) + "," + (a.node(r).y + (T[r] ? T[r].y : 0) - a.node(r).height / 2) + " )"
230
+ ), n.select("#" + y.id + " #" + r).attr("data-x-shift", a.node(r).x - a.node(r).width / 2), l.querySelectorAll("#" + y.id + " #" + r + " .divider").forEach((h) => {
231
+ const w = h.parentElement;
232
+ let E = 0, M = 0;
233
+ w && (w.parentElement && (E = w.parentElement.getBBox().width), M = parseInt(w.getAttribute("data-x-shift"), 10), Number.isNaN(M) && (M = 0)), h.setAttribute("x1", 0 - M + 8), h.setAttribute("x2", E - M - 8);
234
+ })) : S.debug("No Node " + r + ": " + JSON.stringify(a.node(r)));
235
+ });
236
+ let v = y.getBBox();
237
+ a.edges().forEach(function(r) {
238
+ r !== void 0 && a.edge(r) !== void 0 && (S.debug("Edge " + r.v + " -> " + r.w + ": " + JSON.stringify(a.edge(r))), Q(i, a.edge(r), a.edge(r).relation));
239
+ }), v = y.getBBox();
240
+ const k = {
241
+ id: d || "root",
242
+ label: d || "root",
243
+ width: 0,
244
+ height: 0
245
+ };
246
+ return k.width = v.width + 2 * b.padding, k.height = v.height + 2 * b.padding, S.debug("Doc rendered", k, a), k;
247
+ }, "renderDoc"), it = {
248
+ setConf: V,
249
+ draw: et
250
+ }, ot = {
251
+ parser: W,
252
+ get db() {
253
+ return new N(1);
254
+ },
255
+ renderer: it,
256
+ styles: A,
257
+ init: /* @__PURE__ */ f((e) => {
258
+ e.state || (e.state = {}), e.state.arrowMarkerAbsolute = e.arrowMarkerAbsolute;
259
+ }, "init")
260
+ };
261
+ export {
262
+ ot as diagram
263
+ };
@@ -0,0 +1,16 @@
1
+ import { s as a, b as t, a as r, S as s } from "./chunk-OYMX7WX6-DFW9El2C.js";
2
+ import { _ as i } from "./mermaid.core-BrBkhL9h.js";
3
+ var _ = {
4
+ parser: r,
5
+ get db() {
6
+ return new s(2);
7
+ },
8
+ renderer: t,
9
+ styles: a,
10
+ init: /* @__PURE__ */ i((e) => {
11
+ e.state || (e.state = {}), e.state.arrowMarkerAbsolute = e.arrowMarkerAbsolute;
12
+ }, "init")
13
+ };
14
+ export {
15
+ _ as diagram
16
+ };