@camunda/copilot-chat 0.4.2 → 0.4.4

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 (222) hide show
  1. package/dist/index.css +1 -1
  2. package/dist/index.js +5423 -28
  3. package/dist/package.json +6 -2
  4. package/package.json +6 -2
  5. package/dist/ConversationHistoryPanel/ConversationHistoryPanel.d.ts +0 -19
  6. package/dist/ConversationHistoryPanel/ConversationHistoryPanel.d.ts.map +0 -1
  7. package/dist/ConversationHistoryPanel/ConversationHistoryRow.d.ts +0 -14
  8. package/dist/ConversationHistoryPanel/ConversationHistoryRow.d.ts.map +0 -1
  9. package/dist/ConversationHistoryPanel/index.d.ts +0 -2
  10. package/dist/ConversationHistoryPanel/index.d.ts.map +0 -1
  11. package/dist/CopilotChat.d.ts +0 -18
  12. package/dist/CopilotChat.d.ts.map +0 -1
  13. package/dist/CopilotSidecar.d.ts +0 -12
  14. package/dist/CopilotSidecar.d.ts.map +0 -1
  15. package/dist/apl-B2DGVGxc.mjs +0 -76
  16. package/dist/asciiarmor-2LVJmxlE.mjs +0 -34
  17. package/dist/asn1-jKiBa2Ya.mjs +0 -95
  18. package/dist/asterisk-DS281yxp.mjs +0 -271
  19. package/dist/clike-BMALKCNj.mjs +0 -620
  20. package/dist/clojure-CCKyeQKf.mjs +0 -800
  21. package/dist/cmake-CuaCgAKt.mjs +0 -28
  22. package/dist/cobol-BlTKFDRj.mjs +0 -72
  23. package/dist/codemirror-runtime-DN57DLqx.mjs +0 -14620
  24. package/dist/coffeescript-BVCvwO8I.mjs +0 -179
  25. package/dist/commonlisp-D_kxz07b.mjs +0 -75
  26. package/dist/crystal-D309uH6_.mjs +0 -217
  27. package/dist/css-BkF-NPzE.mjs +0 -1553
  28. package/dist/cypher-BMq4Fwjl.mjs +0 -68
  29. package/dist/d-BZcgY6La.mjs +0 -127
  30. package/dist/diff-Cg9d_RX2.mjs +0 -18
  31. package/dist/dockerfile-BmicwmnY.mjs +0 -194
  32. package/dist/dtd-CtLokQ-U.mjs +0 -84
  33. package/dist/dylan-QYeExnWK.mjs +0 -234
  34. package/dist/ebnf-DUPDuY4r.mjs +0 -78
  35. package/dist/ecl-CiXN-g_D.mjs +0 -121
  36. package/dist/eiffel-yQhjl4T1.mjs +0 -110
  37. package/dist/elm-CNT9vbN0.mjs +0 -108
  38. package/dist/erlang-CFOYdy9e.mjs +0 -487
  39. package/dist/factor-CYi8BYN3.mjs +0 -65
  40. package/dist/fcl-CPC2WYrI.mjs +0 -103
  41. package/dist/forth-BmxRyE9S.mjs +0 -60
  42. package/dist/fortran-9bvPyrOW.mjs +0 -442
  43. package/dist/gas-cpmYfFX2.mjs +0 -183
  44. package/dist/gherkin-CJuwpceU.mjs +0 -34
  45. package/dist/groovy-DZeT_VM-.mjs +0 -146
  46. package/dist/haskell-CxiO_7JL.mjs +0 -375
  47. package/dist/haxe-70NVW1pR.mjs +0 -359
  48. package/dist/hooks/index.d.ts +0 -7
  49. package/dist/hooks/index.d.ts.map +0 -1
  50. package/dist/hooks/useAgentAdapter.d.ts +0 -3
  51. package/dist/hooks/useAgentAdapter.d.ts.map +0 -1
  52. package/dist/hooks/useConversationLifecycle.d.ts +0 -16
  53. package/dist/hooks/useConversationLifecycle.d.ts.map +0 -1
  54. package/dist/hooks/useCopilotSidecar.d.ts +0 -6
  55. package/dist/hooks/useCopilotSidecar.d.ts.map +0 -1
  56. package/dist/hooks/useEventProcessing.d.ts +0 -26
  57. package/dist/hooks/useEventProcessing.d.ts.map +0 -1
  58. package/dist/hooks/useToolExecution.d.ts +0 -11
  59. package/dist/hooks/useToolExecution.d.ts.map +0 -1
  60. package/dist/hooks/useTransportSubscription.d.ts +0 -6
  61. package/dist/hooks/useTransportSubscription.d.ts.map +0 -1
  62. package/dist/http-D9LttvKF.mjs +0 -44
  63. package/dist/idl-B6TRFYjl.mjs +0 -947
  64. package/dist/index-61nyxvLt.mjs +0 -138
  65. package/dist/index-9DDv9i4k.mjs +0 -555
  66. package/dist/index-9LzGM3Tf.mjs +0 -101
  67. package/dist/index-B68tiRpB.mjs +0 -342
  68. package/dist/index-BFfuxTl0.mjs +0 -248
  69. package/dist/index-BN1g2LCp.mjs +0 -270
  70. package/dist/index-BZylef8t.mjs +0 -612
  71. package/dist/index-BsJOd3yN.mjs +0 -253
  72. package/dist/index-BvOoeB_X.mjs +0 -310
  73. package/dist/index-C2BPUXNG.mjs +0 -946
  74. package/dist/index-CNSMHaJL.mjs +0 -302
  75. package/dist/index-CWVsn7Ik.mjs +0 -1918
  76. package/dist/index-CYJusi0T.mjs +0 -565
  77. package/dist/index-CYMOKrFz.mjs +0 -157
  78. package/dist/index-Cu_bl2ol.mjs +0 -1307
  79. package/dist/index-Ddm1PyM_.mjs +0 -289
  80. package/dist/index-DfGa1EZ6.mjs +0 -960
  81. package/dist/index-FIfj5vEl.mjs +0 -94
  82. package/dist/index-K8lyX8F9.mjs +0 -76
  83. package/dist/index-TBOAg0OP.mjs +0 -21326
  84. package/dist/index-bxhTUN49.mjs +0 -74
  85. package/dist/index-mqjp_-mu.mjs +0 -59
  86. package/dist/index-snW0nLB3.mjs +0 -136
  87. package/dist/index.d.ts +0 -20
  88. package/dist/index.d.ts.map +0 -1
  89. package/dist/javascript-DOuB9oqA.mjs +0 -691
  90. package/dist/julia-DpvXAuO6.mjs +0 -241
  91. package/dist/layout/attachSidecarLayout.d.ts +0 -4
  92. package/dist/layout/attachSidecarLayout.d.ts.map +0 -1
  93. package/dist/layout/index.d.ts +0 -2
  94. package/dist/layout/index.d.ts.map +0 -1
  95. package/dist/layout/sidecarDom.d.ts +0 -10
  96. package/dist/layout/sidecarDom.d.ts.map +0 -1
  97. package/dist/layout/sidecarMediaQuery.d.ts +0 -3
  98. package/dist/layout/sidecarMediaQuery.d.ts.map +0 -1
  99. package/dist/layout/sidecarState.d.ts +0 -29
  100. package/dist/layout/sidecarState.d.ts.map +0 -1
  101. package/dist/layout/sidecarTypes.d.ts +0 -14
  102. package/dist/layout/sidecarTypes.d.ts.map +0 -1
  103. package/dist/livescript-CanGTf8u.mjs +0 -272
  104. package/dist/lua-XplVlWi_.mjs +0 -217
  105. package/dist/mathematica-jaRHnSxC.mjs +0 -35
  106. package/dist/mbox-BctzC1hL.mjs +0 -76
  107. package/dist/mirc-CFBPAOaF.mjs +0 -72
  108. package/dist/mllike-BSnXJBGA.mjs +0 -272
  109. package/dist/modelica-vUgVs--1.mjs +0 -93
  110. package/dist/mscgen-Cpl0NYLN.mjs +0 -104
  111. package/dist/mumps-CQoS1kWX.mjs +0 -25
  112. package/dist/nginx-zDPm3Z74.mjs +0 -89
  113. package/dist/nsis-DYWPgAyk.mjs +0 -62
  114. package/dist/ntriples-CsNjv2QF.mjs +0 -79
  115. package/dist/octave-C8PmmSRH.mjs +0 -143
  116. package/dist/oz-Ce8aN8oE.mjs +0 -151
  117. package/dist/pascal-De0D6mP7.mjs +0 -77
  118. package/dist/perl-B4bSCe1C.mjs +0 -915
  119. package/dist/pig-D24Z8EXi.mjs +0 -54
  120. package/dist/powershell-DkYVfTzP.mjs +0 -249
  121. package/dist/properties-Dn9wna3M.mjs +0 -26
  122. package/dist/protobuf-BPIjwpzm.mjs +0 -49
  123. package/dist/pug-Bz8aeT0D.mjs +0 -248
  124. package/dist/puppet-nyd4dhjf.mjs +0 -45
  125. package/dist/python-BkR3uSy8.mjs +0 -313
  126. package/dist/q-DyHZGnqm.mjs +0 -86
  127. package/dist/r-LKEuhEGI.mjs +0 -104
  128. package/dist/registry/index.d.ts +0 -2
  129. package/dist/registry/index.d.ts.map +0 -1
  130. package/dist/registry/toolDefinitions.d.ts +0 -10
  131. package/dist/registry/toolDefinitions.d.ts.map +0 -1
  132. package/dist/registry/toolRegistry.d.ts +0 -29
  133. package/dist/registry/toolRegistry.d.ts.map +0 -1
  134. package/dist/rpm-IznJm2Xc.mjs +0 -57
  135. package/dist/ruby-CcYfvIk6.mjs +0 -228
  136. package/dist/sas-7E8yHoCW.mjs +0 -105
  137. package/dist/scheme-DjibxsNh.mjs +0 -124
  138. package/dist/shell-C0C2sNA_.mjs +0 -182
  139. package/dist/sidecar-api.d.ts +0 -5
  140. package/dist/sidecar-api.d.ts.map +0 -1
  141. package/dist/sieve-Bwz7vjP5.mjs +0 -72
  142. package/dist/simple-mode-mNVtnu0l.mjs +0 -89
  143. package/dist/smalltalk-Bhddl2pB.mjs +0 -48
  144. package/dist/solr-BNlsLglM.mjs +0 -41
  145. package/dist/sparql-FarWu_Gb.mjs +0 -197
  146. package/dist/spreadsheet-C-cy4P5N.mjs +0 -49
  147. package/dist/sql-CfG5lQ3l.mjs +0 -282
  148. package/dist/stex-Du4h4KAU.mjs +0 -129
  149. package/dist/store/agentStore.d.ts +0 -27
  150. package/dist/store/agentStore.d.ts.map +0 -1
  151. package/dist/store/agentStoreEventProcessor.d.ts +0 -21
  152. package/dist/store/agentStoreEventProcessor.d.ts.map +0 -1
  153. package/dist/store/chatStore.d.ts +0 -36
  154. package/dist/store/chatStore.d.ts.map +0 -1
  155. package/dist/store/historyStore.d.ts +0 -25
  156. package/dist/store/historyStore.d.ts.map +0 -1
  157. package/dist/store/index.d.ts +0 -5
  158. package/dist/store/index.d.ts.map +0 -1
  159. package/dist/store/sidecarStore.d.ts +0 -9
  160. package/dist/store/sidecarStore.d.ts.map +0 -1
  161. package/dist/styles/ensureSidecarStyles.d.ts +0 -2
  162. package/dist/styles/ensureSidecarStyles.d.ts.map +0 -1
  163. package/dist/stylus-CAdqWld3.mjs +0 -250
  164. package/dist/swift-DSxqR9R6.mjs +0 -230
  165. package/dist/sync-ottB0RsS.mjs +0 -1251
  166. package/dist/table-runtime-eW_FiMnH.mjs +0 -3606
  167. package/dist/tcl-xfoLljhY.mjs +0 -81
  168. package/dist/test-setup.d.ts +0 -1
  169. package/dist/test-setup.d.ts.map +0 -1
  170. package/dist/textile-D1AWE-pc.mjs +0 -295
  171. package/dist/tiddlywiki-5wqsXtSk.mjs +0 -155
  172. package/dist/tiki-__Kn3CeS.mjs +0 -181
  173. package/dist/toml-DWAmxCjl.mjs +0 -58
  174. package/dist/tools/kapaAi/KapaSearchBridge.d.ts +0 -7
  175. package/dist/tools/kapaAi/KapaSearchBridge.d.ts.map +0 -1
  176. package/dist/tools/kapaAi/kapaSearchExecutor.d.ts +0 -35
  177. package/dist/tools/kapaAi/kapaSearchExecutor.d.ts.map +0 -1
  178. package/dist/tools/kapaAi/kapaSearchTool.d.ts +0 -24
  179. package/dist/tools/kapaAi/kapaSearchTool.d.ts.map +0 -1
  180. package/dist/troff-D2UO-fKf.mjs +0 -35
  181. package/dist/ttcn-Bsa4sfRm.mjs +0 -123
  182. package/dist/ttcn-cfg-Bac_acMi.mjs +0 -88
  183. package/dist/turtle-xwJUxoPV.mjs +0 -80
  184. package/dist/types/agentTypes.d.ts +0 -11
  185. package/dist/types/agentTypes.d.ts.map +0 -1
  186. package/dist/types/chatTypes.d.ts +0 -45
  187. package/dist/types/chatTypes.d.ts.map +0 -1
  188. package/dist/types/eventTypes.d.ts +0 -28
  189. package/dist/types/eventTypes.d.ts.map +0 -1
  190. package/dist/types/historyTypes.d.ts +0 -34
  191. package/dist/types/historyTypes.d.ts.map +0 -1
  192. package/dist/types/index.d.ts +0 -5
  193. package/dist/types/index.d.ts.map +0 -1
  194. package/dist/types/toolTypes.d.ts +0 -51
  195. package/dist/types/toolTypes.d.ts.map +0 -1
  196. package/dist/types/transportTypes.d.ts +0 -49
  197. package/dist/types/transportTypes.d.ts.map +0 -1
  198. package/dist/utils/eventHandlers.d.ts +0 -34
  199. package/dist/utils/eventHandlers.d.ts.map +0 -1
  200. package/dist/utils/eventPredicates.d.ts +0 -10
  201. package/dist/utils/eventPredicates.d.ts.map +0 -1
  202. package/dist/utils/index.d.ts +0 -7
  203. package/dist/utils/index.d.ts.map +0 -1
  204. package/dist/utils/mapConversationMessages.d.ts +0 -12
  205. package/dist/utils/mapConversationMessages.d.ts.map +0 -1
  206. package/dist/utils/parseToolArguments.d.ts +0 -6
  207. package/dist/utils/parseToolArguments.d.ts.map +0 -1
  208. package/dist/utils/statusLabels.d.ts +0 -3
  209. package/dist/utils/statusLabels.d.ts.map +0 -1
  210. package/dist/utils/thinkingBlockUtils.d.ts +0 -18
  211. package/dist/utils/thinkingBlockUtils.d.ts.map +0 -1
  212. package/dist/utils/toolResultFormatter.d.ts +0 -6
  213. package/dist/utils/toolResultFormatter.d.ts.map +0 -1
  214. package/dist/vb-c2kQGd6-.mjs +0 -74
  215. package/dist/vbscript-1f_Dhg5H.mjs +0 -324
  216. package/dist/velocity-DJd0pTTC.mjs +0 -96
  217. package/dist/verilog-CiS1jyi5.mjs +0 -262
  218. package/dist/vhdl-T9HkrbI2.mjs +0 -106
  219. package/dist/webidl-CjfDENEo.mjs +0 -155
  220. package/dist/xquery-Ct6lEb4B.mjs +0 -422
  221. package/dist/yacas-C0absKBh.mjs +0 -73
  222. package/dist/z80-Pki2zAjW.mjs +0 -61
@@ -1,179 +0,0 @@
1
- var k = "error";
2
- function p(e) {
3
- return new RegExp("^((" + e.join(")|(") + "))\\b");
4
- }
5
- var g = /^(?:->|=>|\+[+=]?|-[\-=]?|\*[\*=]?|\/[\/=]?|[=!]=|<[><]?=?|>>?=?|%=?|&=?|\|=?|\^=?|\~|!|\?|(or|and|\|\||&&|\?)=)/, y = /^(?:[()\[\]{},:`=;]|\.\.?\.?)/, h = /^[_A-Za-z$][_A-Za-z$0-9]*/, w = /^@[_A-Za-z$][_A-Za-z$0-9]*/, z = p([
6
- "and",
7
- "or",
8
- "not",
9
- "is",
10
- "isnt",
11
- "in",
12
- "instanceof",
13
- "typeof"
14
- ]), l = [
15
- "for",
16
- "while",
17
- "loop",
18
- "if",
19
- "unless",
20
- "else",
21
- "switch",
22
- "try",
23
- "catch",
24
- "finally",
25
- "class"
26
- ], a = [
27
- "break",
28
- "by",
29
- "continue",
30
- "debugger",
31
- "delete",
32
- "do",
33
- "in",
34
- "of",
35
- "new",
36
- "return",
37
- "then",
38
- "this",
39
- "@",
40
- "throw",
41
- "when",
42
- "until",
43
- "extends"
44
- ], x = p(l.concat(a));
45
- l = p(l);
46
- var b = /^('{3}|\"{3}|['\"])/, A = /^(\/{3}|\/)/, S = ["Infinity", "NaN", "undefined", "null", "true", "false", "on", "off", "yes", "no"], O = p(S);
47
- function u(e, n) {
48
- if (e.sol()) {
49
- n.scope.align === null && (n.scope.align = !1);
50
- var i = n.scope.offset;
51
- if (e.eatSpace()) {
52
- var f = e.indentation();
53
- return f > i && n.scope.type == "coffee" ? "indent" : f < i ? "dedent" : null;
54
- } else
55
- i > 0 && v(e, n);
56
- }
57
- if (e.eatSpace())
58
- return null;
59
- var r = e.peek();
60
- if (e.match("####"))
61
- return e.skipToEnd(), "comment";
62
- if (e.match("###"))
63
- return n.tokenize = R, n.tokenize(e, n);
64
- if (r === "#")
65
- return e.skipToEnd(), "comment";
66
- if (e.match(/^-?[0-9\.]/, !1)) {
67
- var c = !1;
68
- if (e.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i) && (c = !0), e.match(/^-?\d+\.\d*/) && (c = !0), e.match(/^-?\.\d+/) && (c = !0), c)
69
- return e.peek() == "." && e.backUp(1), "number";
70
- var o = !1;
71
- if (e.match(/^-?0x[0-9a-f]+/i) && (o = !0), e.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/) && (o = !0), e.match(/^-?0(?![\dx])/i) && (o = !0), o)
72
- return "number";
73
- }
74
- if (e.match(b))
75
- return n.tokenize = t(e.current(), !1, "string"), n.tokenize(e, n);
76
- if (e.match(A)) {
77
- if (e.current() != "/" || e.match(/^.*\//, !1))
78
- return n.tokenize = t(e.current(), !0, "string.special"), n.tokenize(e, n);
79
- e.backUp(1);
80
- }
81
- return e.match(g) || e.match(z) ? "operator" : e.match(y) ? "punctuation" : e.match(O) ? "atom" : e.match(w) || n.prop && e.match(h) ? "property" : e.match(x) ? "keyword" : e.match(h) ? "variable" : (e.next(), k);
82
- }
83
- function t(e, n, i) {
84
- return function(f, r) {
85
- for (; !f.eol(); )
86
- if (f.eatWhile(/[^'"\/\\]/), f.eat("\\")) {
87
- if (f.next(), n && f.eol())
88
- return i;
89
- } else {
90
- if (f.match(e))
91
- return r.tokenize = u, i;
92
- f.eat(/['"\/]/);
93
- }
94
- return n && (r.tokenize = u), i;
95
- };
96
- }
97
- function R(e, n) {
98
- for (; !e.eol(); ) {
99
- if (e.eatWhile(/[^#]/), e.match("###")) {
100
- n.tokenize = u;
101
- break;
102
- }
103
- e.eatWhile("#");
104
- }
105
- return "comment";
106
- }
107
- function d(e, n, i = "coffee") {
108
- for (var f = 0, r = !1, c = null, o = n.scope; o; o = o.prev)
109
- if (o.type === "coffee" || o.type == "}") {
110
- f = o.offset + e.indentUnit;
111
- break;
112
- }
113
- i !== "coffee" ? (r = null, c = e.column() + e.current().length) : n.scope.align && (n.scope.align = !1), n.scope = {
114
- offset: f,
115
- type: i,
116
- prev: n.scope,
117
- align: r,
118
- alignOffset: c
119
- };
120
- }
121
- function v(e, n) {
122
- if (n.scope.prev)
123
- if (n.scope.type === "coffee") {
124
- for (var i = e.indentation(), f = !1, r = n.scope; r; r = r.prev)
125
- if (i === r.offset) {
126
- f = !0;
127
- break;
128
- }
129
- if (!f)
130
- return !0;
131
- for (; n.scope.prev && n.scope.offset !== i; )
132
- n.scope = n.scope.prev;
133
- return !1;
134
- } else
135
- return n.scope = n.scope.prev, !1;
136
- }
137
- function E(e, n) {
138
- var i = n.tokenize(e, n), f = e.current();
139
- f === "return" && (n.dedent = !0), ((f === "->" || f === "=>") && e.eol() || i === "indent") && d(e, n);
140
- var r = "[({".indexOf(f);
141
- if (r !== -1 && d(e, n, "])}".slice(r, r + 1)), l.exec(f) && d(e, n), f == "then" && v(e, n), i === "dedent" && v(e, n))
142
- return k;
143
- if (r = "])}".indexOf(f), r !== -1) {
144
- for (; n.scope.type == "coffee" && n.scope.prev; )
145
- n.scope = n.scope.prev;
146
- n.scope.type == f && (n.scope = n.scope.prev);
147
- }
148
- return n.dedent && e.eol() && (n.scope.type == "coffee" && n.scope.prev && (n.scope = n.scope.prev), n.dedent = !1), i == "indent" || i == "dedent" ? null : i;
149
- }
150
- const Z = {
151
- name: "coffeescript",
152
- startState: function() {
153
- return {
154
- tokenize: u,
155
- scope: { offset: 0, type: "coffee", prev: null, align: !1 },
156
- prop: !1,
157
- dedent: 0
158
- };
159
- },
160
- token: function(e, n) {
161
- var i = n.scope.align === null && n.scope;
162
- i && e.sol() && (i.align = !1);
163
- var f = E(e, n);
164
- return f && f != "comment" && (i && (i.align = !0), n.prop = f == "punctuation" && e.current() == "."), f;
165
- },
166
- indent: function(e, n) {
167
- if (e.tokenize != u) return 0;
168
- var i = e.scope, f = n && "])}".indexOf(n.charAt(0)) > -1;
169
- if (f) for (; i.type == "coffee" && i.prev; ) i = i.prev;
170
- var r = f && i.type === n.charAt(0);
171
- return i.align ? i.alignOffset - (r ? 1 : 0) : (r ? i.prev : i).offset;
172
- },
173
- languageData: {
174
- commentTokens: { line: "#" }
175
- }
176
- };
177
- export {
178
- Z as coffeeScript
179
- };
@@ -1,75 +0,0 @@
1
- var u = /^(block|let*|return-from|catch|load-time-value|setq|eval-when|locally|symbol-macrolet|flet|macrolet|tagbody|function|multiple-value-call|the|go|multiple-value-prog1|throw|if|progn|unwind-protect|labels|progv|let|quote)$/, c = /^with|^def|^do|^prog|case$|^cond$|bind$|when$|unless$/, f = /^(?:[+\-]?(?:\d+|\d*\.\d+)(?:[efd][+\-]?\d+)?|[+\-]?\d+(?:\/[+\-]?\d+)?|#b[+\-]?[01]+|#o[+\-]?[0-7]+|#x[+\-]?[\da-f]+)/, d = /[^\s'`,@()\[\]";]/, l;
2
- function i(e) {
3
- for (var n; n = e.next(); )
4
- if (n == "\\") e.next();
5
- else if (!d.test(n)) {
6
- e.backUp(1);
7
- break;
8
- }
9
- return e.current();
10
- }
11
- function o(e, n) {
12
- if (e.eatSpace())
13
- return l = "ws", null;
14
- if (e.match(f)) return "number";
15
- var t = e.next();
16
- if (t == "\\" && (t = e.next()), t == '"') return (n.tokenize = p)(e, n);
17
- if (t == "(")
18
- return l = "open", "bracket";
19
- if (t == ")")
20
- return l = "close", "bracket";
21
- if (t == ";")
22
- return e.skipToEnd(), l = "ws", "comment";
23
- if (/['`,@]/.test(t)) return null;
24
- if (t == "|")
25
- return e.skipTo("|") ? (e.next(), "variableName") : (e.skipToEnd(), "error");
26
- if (t == "#") {
27
- var t = e.next();
28
- return t == "(" ? (l = "open", "bracket") : /[+\-=\.']/.test(t) || /\d/.test(t) && e.match(/^\d*#/) ? null : t == "|" ? (n.tokenize = x)(e, n) : t == ":" ? (i(e), "meta") : t == "\\" ? (e.next(), i(e), "string.special") : "error";
29
- } else {
30
- var r = i(e);
31
- return r == "." ? null : (l = "symbol", r == "nil" || r == "t" || r.charAt(0) == ":" ? "atom" : n.lastType == "open" && (u.test(r) || c.test(r)) ? "keyword" : r.charAt(0) == "&" ? "variableName.special" : "variableName");
32
- }
33
- }
34
- function p(e, n) {
35
- for (var t = !1, r; r = e.next(); ) {
36
- if (r == '"' && !t) {
37
- n.tokenize = o;
38
- break;
39
- }
40
- t = !t && r == "\\";
41
- }
42
- return "string";
43
- }
44
- function x(e, n) {
45
- for (var t, r; t = e.next(); ) {
46
- if (t == "#" && r == "|") {
47
- n.tokenize = o;
48
- break;
49
- }
50
- r = t;
51
- }
52
- return l = "ws", "comment";
53
- }
54
- const s = {
55
- name: "commonlisp",
56
- startState: function() {
57
- return { ctx: { prev: null, start: 0, indentTo: 0 }, lastType: null, tokenize: o };
58
- },
59
- token: function(e, n) {
60
- e.sol() && typeof n.ctx.indentTo != "number" && (n.ctx.indentTo = n.ctx.start + 1), l = null;
61
- var t = n.tokenize(e, n);
62
- return l != "ws" && (n.ctx.indentTo == null ? l == "symbol" && c.test(e.current()) ? n.ctx.indentTo = n.ctx.start + e.indentUnit : n.ctx.indentTo = "next" : n.ctx.indentTo == "next" && (n.ctx.indentTo = e.column()), n.lastType = l), l == "open" ? n.ctx = { prev: n.ctx, start: e.column(), indentTo: null } : l == "close" && (n.ctx = n.ctx.prev || n.ctx), t;
63
- },
64
- indent: function(e) {
65
- var n = e.ctx.indentTo;
66
- return typeof n == "number" ? n : e.ctx.start + 1;
67
- },
68
- languageData: {
69
- commentTokens: { line: ";;", block: { open: "#|", close: "|#" } },
70
- closeBrackets: { brackets: ["(", "[", "{", '"'] }
71
- }
72
- };
73
- export {
74
- s as commonLisp
75
- };
@@ -1,217 +0,0 @@
1
- function l(n, e) {
2
- return new RegExp((e ? "" : "^") + "(?:" + n.join("|") + ")" + (e ? "$" : "\\b"));
3
- }
4
- function o(n, e, r) {
5
- return r.tokenize.push(n), n(e, r);
6
- }
7
- var v = /^(?:[-+/%|&^]|\*\*?|[<>]{2})/, z = /^(?:[=!]~|===|<=>|[<>=!]=?|[|&]{2}|~)/, g = /^(?:\[\][?=]?)/, b = /^(?:\.(?:\.{2})?|->|[?:])/, p = /^[a-z_\u009F-\uFFFF][a-zA-Z0-9_\u009F-\uFFFF]*/, d = /^[A-Z_\u009F-\uFFFF][a-zA-Z0-9_\u009F-\uFFFF]*/, E = l([
8
- "abstract",
9
- "alias",
10
- "as",
11
- "asm",
12
- "begin",
13
- "break",
14
- "case",
15
- "class",
16
- "def",
17
- "do",
18
- "else",
19
- "elsif",
20
- "end",
21
- "ensure",
22
- "enum",
23
- "extend",
24
- "for",
25
- "fun",
26
- "if",
27
- "include",
28
- "instance_sizeof",
29
- "lib",
30
- "macro",
31
- "module",
32
- "next",
33
- "of",
34
- "out",
35
- "pointerof",
36
- "private",
37
- "protected",
38
- "rescue",
39
- "return",
40
- "require",
41
- "select",
42
- "sizeof",
43
- "struct",
44
- "super",
45
- "then",
46
- "type",
47
- "typeof",
48
- "uninitialized",
49
- "union",
50
- "unless",
51
- "until",
52
- "when",
53
- "while",
54
- "with",
55
- "yield",
56
- "__DIR__",
57
- "__END_LINE__",
58
- "__FILE__",
59
- "__LINE__"
60
- ]), S = l(["true", "false", "nil", "self"]), T = [
61
- "def",
62
- "fun",
63
- "macro",
64
- "class",
65
- "module",
66
- "struct",
67
- "lib",
68
- "enum",
69
- "union",
70
- "do",
71
- "for"
72
- ], A = l(T), s = ["if", "unless", "case", "while", "until", "begin", "then"], O = l(s), x = ["end", "else", "elsif", "rescue", "ensure"], K = l(x), I = ["\\)", "\\}", "\\]"], D = new RegExp("^(?:" + I.join("|") + ")$"), w = {
73
- def: y,
74
- fun: y,
75
- macro: N,
76
- class: c,
77
- module: c,
78
- struct: c,
79
- lib: c,
80
- enum: c,
81
- union: c
82
- }, k = { "[": "]", "{": "}", "(": ")", "<": ">" };
83
- function _(n, e) {
84
- if (n.eatSpace())
85
- return null;
86
- if (e.lastToken != "\\" && n.match("{%", !1))
87
- return o(f("%", "%"), n, e);
88
- if (e.lastToken != "\\" && n.match("{{", !1))
89
- return o(f("{", "}"), n, e);
90
- if (n.peek() == "#")
91
- return n.skipToEnd(), "comment";
92
- var r;
93
- if (n.match(p))
94
- return n.eat(/[?!]/), r = n.current(), n.eat(":") ? "atom" : e.lastToken == "." ? "property" : E.test(r) ? (A.test(r) ? !(r == "fun" && e.blocks.indexOf("lib") >= 0) && !(r == "def" && e.lastToken == "abstract") && (e.blocks.push(r), e.currentIndent += 1) : (e.lastStyle == "operator" || !e.lastStyle) && O.test(r) ? (e.blocks.push(r), e.currentIndent += 1) : r == "end" && (e.blocks.pop(), e.currentIndent -= 1), w.hasOwnProperty(r) && e.tokenize.push(w[r]), "keyword") : S.test(r) ? "atom" : "variable";
95
- if (n.eat("@"))
96
- return n.peek() == "[" ? o(h("[", "]", "meta"), n, e) : (n.eat("@"), n.match(p) || n.match(d), "propertyName");
97
- if (n.match(d))
98
- return "tag";
99
- if (n.eat(":"))
100
- return n.eat('"') ? o(F('"', "atom", !1), n, e) : n.match(p) || n.match(d) || n.match(v) || n.match(z) || n.match(g) ? "atom" : (n.eat(":"), "operator");
101
- if (n.eat('"'))
102
- return o(F('"', "string", !0), n, e);
103
- if (n.peek() == "%") {
104
- var t = "string", u = !0, i;
105
- if (n.match("%r"))
106
- t = "string.special", i = n.next();
107
- else if (n.match("%w"))
108
- u = !1, i = n.next();
109
- else if (n.match("%q"))
110
- u = !1, i = n.next();
111
- else if (i = n.match(/^%([^\w\s=])/))
112
- i = i[1];
113
- else {
114
- if (n.match(/^%[a-zA-Z_\u009F-\uFFFF][\w\u009F-\uFFFF]*/))
115
- return "meta";
116
- if (n.eat("%"))
117
- return "operator";
118
- }
119
- return k.hasOwnProperty(i) && (i = k[i]), o(F(i, t, u), n, e);
120
- }
121
- return (r = n.match(/^<<-('?)([A-Z]\w*)\1/)) ? o(Z(r[2], !r[1]), n, e) : n.eat("'") ? (n.match(/^(?:[^']|\\(?:[befnrtv0'"]|[0-7]{3}|u(?:[0-9a-fA-F]{4}|\{[0-9a-fA-F]{1,6}\})))/), n.eat("'"), "atom") : n.eat("0") ? (n.eat("x") ? n.match(/^[0-9a-fA-F_]+/) : n.eat("o") ? n.match(/^[0-7_]+/) : n.eat("b") && n.match(/^[01_]+/), "number") : n.eat(/^\d/) ? (n.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+-]?\d+)?/), "number") : n.match(v) ? (n.eat("="), "operator") : n.match(z) || n.match(b) ? "operator" : (r = n.match(/[({[]/, !1)) ? (r = r[0], o(h(r, k[r], null), n, e)) : n.eat("\\") ? (n.next(), "meta") : (n.next(), null);
122
- }
123
- function h(n, e, r, t) {
124
- return function(u, i) {
125
- if (!t && u.match(n))
126
- return i.tokenize[i.tokenize.length - 1] = h(n, e, r, !0), i.currentIndent += 1, r;
127
- var a = _(u, i);
128
- return u.current() === e && (i.tokenize.pop(), i.currentIndent -= 1, a = r), a;
129
- };
130
- }
131
- function f(n, e, r) {
132
- return function(t, u) {
133
- return !r && t.match("{" + n) ? (u.currentIndent += 1, u.tokenize[u.tokenize.length - 1] = f(n, e, !0), "meta") : t.match(e + "}") ? (u.currentIndent -= 1, u.tokenize.pop(), "meta") : _(t, u);
134
- };
135
- }
136
- function N(n, e) {
137
- if (n.eatSpace())
138
- return null;
139
- var r;
140
- if (r = n.match(p)) {
141
- if (r == "def")
142
- return "keyword";
143
- n.eat(/[?!]/);
144
- }
145
- return e.tokenize.pop(), "def";
146
- }
147
- function y(n, e) {
148
- return n.eatSpace() ? null : (n.match(p) ? n.eat(/[!?]/) : n.match(v) || n.match(z) || n.match(g), e.tokenize.pop(), "def");
149
- }
150
- function c(n, e) {
151
- return n.eatSpace() ? null : (n.match(d), e.tokenize.pop(), "def");
152
- }
153
- function F(n, e, r) {
154
- return function(t, u) {
155
- for (var i = !1; t.peek(); )
156
- if (i)
157
- t.next(), i = !1;
158
- else {
159
- if (t.match("{%", !1))
160
- return u.tokenize.push(f("%", "%")), e;
161
- if (t.match("{{", !1))
162
- return u.tokenize.push(f("{", "}")), e;
163
- if (r && t.match("#{", !1))
164
- return u.tokenize.push(h("#{", "}", "meta")), e;
165
- var a = t.next();
166
- if (a == n)
167
- return u.tokenize.pop(), e;
168
- i = r && a == "\\";
169
- }
170
- return e;
171
- };
172
- }
173
- function Z(n, e) {
174
- return function(r, t) {
175
- if (r.sol() && (r.eatSpace(), r.match(n)))
176
- return t.tokenize.pop(), "string";
177
- for (var u = !1; r.peek(); )
178
- if (u)
179
- r.next(), u = !1;
180
- else {
181
- if (r.match("{%", !1))
182
- return t.tokenize.push(f("%", "%")), "string";
183
- if (r.match("{{", !1))
184
- return t.tokenize.push(f("{", "}")), "string";
185
- if (e && r.match("#{", !1))
186
- return t.tokenize.push(h("#{", "}", "meta")), "string";
187
- u = r.next() == "\\" && e;
188
- }
189
- return "string";
190
- };
191
- }
192
- const P = {
193
- name: "crystal",
194
- startState: function() {
195
- return {
196
- tokenize: [_],
197
- currentIndent: 0,
198
- lastToken: null,
199
- lastStyle: null,
200
- blocks: []
201
- };
202
- },
203
- token: function(n, e) {
204
- var r = e.tokenize[e.tokenize.length - 1](n, e), t = n.current();
205
- return r && r != "comment" && (e.lastToken = t, e.lastStyle = r), r;
206
- },
207
- indent: function(n, e, r) {
208
- return e = e.replace(/^\s*(?:\{%)?\s*|\s*(?:%\})?\s*$/g, ""), K.test(e) || D.test(e) ? r.unit * (n.currentIndent - 1) : r.unit * n.currentIndent;
209
- },
210
- languageData: {
211
- indentOnInput: l(I.concat(x), !0),
212
- commentTokens: { line: "#" }
213
- }
214
- };
215
- export {
216
- P as crystal
217
- };