llmxray 0.2.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 (138) hide show
  1. package/LICENSE +190 -0
  2. package/NOTICE +7 -0
  3. package/README.md +244 -0
  4. package/bin/cli.mjs +37 -0
  5. package/dist/assets/AITrainingPage-BbRryhHe.js +1 -0
  6. package/dist/assets/BenchmarkPage-yZ1Kt8KK.js +2 -0
  7. package/dist/assets/ComparisonPage-BnBp-VsC.js +1 -0
  8. package/dist/assets/DashboardPage-DTXPIpEx.js +101 -0
  9. package/dist/assets/EmbeddingsPage-Bo3g8-qN.css +1 -0
  10. package/dist/assets/EmbeddingsPage-CghkdGEr.js +1 -0
  11. package/dist/assets/GoogleCallbackPage-DqfqxXhg.js +1 -0
  12. package/dist/assets/JsonTreeNode-BE6Ps90W.js +13 -0
  13. package/dist/assets/JsonTreeNode-o8On9YD6.css +1 -0
  14. package/dist/assets/ModelCapabilityIcons.vue_vue_type_script_setup_true_lang-CsL7aDHj.js +1 -0
  15. package/dist/assets/RAGPage-B_c1Nogo.js +1 -0
  16. package/dist/assets/SessionPage-lWGESxx3.js +14 -0
  17. package/dist/assets/SettingsPage-k9HWgy9B.js +1 -0
  18. package/dist/assets/StatusBadge.vue_vue_type_script_setup_true_lang-f9O-U2FX.js +1 -0
  19. package/dist/assets/StorageGauge-DN4vJnrl.css +1 -0
  20. package/dist/assets/StorageGauge.vue_vue_type_style_index_0_lang-hO4dId5t.js +1 -0
  21. package/dist/assets/SystemPage-BgwBHFJB.js +2 -0
  22. package/dist/assets/TabBar.vue_vue_type_script_setup_true_lang-CnQ8vq8x.js +1 -0
  23. package/dist/assets/TokenStreamDisplay.vue_vue_type_script_setup_true_lang-CJW7ndOY.js +1 -0
  24. package/dist/assets/ToolWorkshopPage-DoVwZp_3.js +376 -0
  25. package/dist/assets/ToolWorkshopPage-gO5DvECk.css +1 -0
  26. package/dist/assets/_commonjsHelpers-DsqdWQfm.js +1 -0
  27. package/dist/assets/_plugin-vue_export-helper-DlAUqK2U.js +1 -0
  28. package/dist/assets/agent-store-_RIMRfEn.js +1 -0
  29. package/dist/assets/base-CrPFMexR.js +1 -0
  30. package/dist/assets/benchmark-db-D8D5Wf9h.js +1 -0
  31. package/dist/assets/canvas-ai-db-BolM-_G7.js +2 -0
  32. package/dist/assets/fira-code-cyrillic-400-normal-UC0NFL4U.woff2 +0 -0
  33. package/dist/assets/fira-code-cyrillic-400-normal-dc1q3VD7.woff +0 -0
  34. package/dist/assets/fira-code-cyrillic-500-normal-Bu7VCL72.woff +0 -0
  35. package/dist/assets/fira-code-cyrillic-500-normal-CX35h3Mg.woff2 +0 -0
  36. package/dist/assets/fira-code-cyrillic-ext-400-normal-Buh61xzB.woff +0 -0
  37. package/dist/assets/fira-code-cyrillic-ext-400-normal-txZ9Fk_1.woff2 +0 -0
  38. package/dist/assets/fira-code-cyrillic-ext-500-normal-CYRspHgm.woff2 +0 -0
  39. package/dist/assets/fira-code-cyrillic-ext-500-normal-CwtLmSFD.woff +0 -0
  40. package/dist/assets/fira-code-greek-400-normal-B2Gh_Y8s.woff2 +0 -0
  41. package/dist/assets/fira-code-greek-400-normal-DobhaxvF.woff +0 -0
  42. package/dist/assets/fira-code-greek-500-normal-CVO0IRNt.woff2 +0 -0
  43. package/dist/assets/fira-code-greek-500-normal-DEXIWiey.woff +0 -0
  44. package/dist/assets/fira-code-greek-ext-400-normal-DR7mBgIM.woff2 +0 -0
  45. package/dist/assets/fira-code-greek-ext-400-normal-DSPUheWg.woff +0 -0
  46. package/dist/assets/fira-code-greek-ext-500-normal-BO3iq16n.woff2 +0 -0
  47. package/dist/assets/fira-code-greek-ext-500-normal-CMiNLXER.woff +0 -0
  48. package/dist/assets/fira-code-latin-400-normal-C-QZfXAs.woff +0 -0
  49. package/dist/assets/fira-code-latin-400-normal-DGosTW8U.woff2 +0 -0
  50. package/dist/assets/fira-code-latin-500-normal-B6gioGu8.woff2 +0 -0
  51. package/dist/assets/fira-code-latin-500-normal-aMLC2AMm.woff +0 -0
  52. package/dist/assets/fira-code-latin-ext-400-normal-DG73JjOf.woff +0 -0
  53. package/dist/assets/fira-code-latin-ext-400-normal-KSMg0QLl.woff2 +0 -0
  54. package/dist/assets/fira-code-latin-ext-500-normal-CaANqXjI.woff +0 -0
  55. package/dist/assets/fira-code-latin-ext-500-normal-Crd9e_oI.woff2 +0 -0
  56. package/dist/assets/fira-code-symbols2-400-normal-_QEZCEwe.woff +0 -0
  57. package/dist/assets/fira-code-symbols2-500-normal-DwsgbIjQ.woff +0 -0
  58. package/dist/assets/format-BqVZ9rwM.js +1 -0
  59. package/dist/assets/generate-service-mPYQA7Xh.js +3 -0
  60. package/dist/assets/google-auth-CfEcVMA7.js +1 -0
  61. package/dist/assets/google-auth-store-BnEs-xLw.js +1 -0
  62. package/dist/assets/index-BqB3FY2M.js +4 -0
  63. package/dist/assets/index-C0qd34Zo.css +1 -0
  64. package/dist/assets/index-D87kMEMb.js +3 -0
  65. package/dist/assets/index-DoAHVxX6.js +221 -0
  66. package/dist/assets/inter-cyrillic-400-normal-HOLc17fK.woff +0 -0
  67. package/dist/assets/inter-cyrillic-400-normal-obahsSVq.woff2 +0 -0
  68. package/dist/assets/inter-cyrillic-500-normal-BasfLYem.woff2 +0 -0
  69. package/dist/assets/inter-cyrillic-500-normal-CxZf_p3X.woff +0 -0
  70. package/dist/assets/inter-cyrillic-600-normal-4D_pXhcN.woff +0 -0
  71. package/dist/assets/inter-cyrillic-600-normal-CWCymEST.woff2 +0 -0
  72. package/dist/assets/inter-cyrillic-700-normal-CjBOestx.woff2 +0 -0
  73. package/dist/assets/inter-cyrillic-700-normal-DrXBdSj3.woff +0 -0
  74. package/dist/assets/inter-cyrillic-ext-400-normal-BQZuk6qB.woff2 +0 -0
  75. package/dist/assets/inter-cyrillic-ext-400-normal-DQukG94-.woff +0 -0
  76. package/dist/assets/inter-cyrillic-ext-500-normal-B0yAr1jD.woff2 +0 -0
  77. package/dist/assets/inter-cyrillic-ext-500-normal-BmqWE9Dz.woff +0 -0
  78. package/dist/assets/inter-cyrillic-ext-600-normal-Bcila6Z-.woff +0 -0
  79. package/dist/assets/inter-cyrillic-ext-600-normal-Dfes3d0z.woff2 +0 -0
  80. package/dist/assets/inter-cyrillic-ext-700-normal-BjwYoWNd.woff2 +0 -0
  81. package/dist/assets/inter-cyrillic-ext-700-normal-LO58E6JB.woff +0 -0
  82. package/dist/assets/inter-greek-400-normal-B4URO6DV.woff2 +0 -0
  83. package/dist/assets/inter-greek-400-normal-q2sYcFCs.woff +0 -0
  84. package/dist/assets/inter-greek-500-normal-BIZE56-Y.woff2 +0 -0
  85. package/dist/assets/inter-greek-500-normal-Xzm54t5V.woff +0 -0
  86. package/dist/assets/inter-greek-600-normal-BZpKdvQh.woff +0 -0
  87. package/dist/assets/inter-greek-600-normal-plRanbMR.woff2 +0 -0
  88. package/dist/assets/inter-greek-700-normal-BUv2fZ6O.woff +0 -0
  89. package/dist/assets/inter-greek-700-normal-C3JjAnD8.woff2 +0 -0
  90. package/dist/assets/inter-greek-ext-400-normal-DGGRlc-M.woff2 +0 -0
  91. package/dist/assets/inter-greek-ext-400-normal-KugGGMne.woff +0 -0
  92. package/dist/assets/inter-greek-ext-500-normal-2j5mBUwD.woff +0 -0
  93. package/dist/assets/inter-greek-ext-500-normal-C4iEst2y.woff2 +0 -0
  94. package/dist/assets/inter-greek-ext-600-normal-B8X0CLgF.woff +0 -0
  95. package/dist/assets/inter-greek-ext-600-normal-DRtmH8MT.woff2 +0 -0
  96. package/dist/assets/inter-greek-ext-700-normal-BoQ6DsYi.woff +0 -0
  97. package/dist/assets/inter-greek-ext-700-normal-qfdV9bQt.woff2 +0 -0
  98. package/dist/assets/inter-latin-400-normal-C38fXH4l.woff2 +0 -0
  99. package/dist/assets/inter-latin-400-normal-CyCys3Eg.woff +0 -0
  100. package/dist/assets/inter-latin-500-normal-BL9OpVg8.woff +0 -0
  101. package/dist/assets/inter-latin-500-normal-Cerq10X2.woff2 +0 -0
  102. package/dist/assets/inter-latin-600-normal-CiBQ2DWP.woff +0 -0
  103. package/dist/assets/inter-latin-600-normal-LgqL8muc.woff2 +0 -0
  104. package/dist/assets/inter-latin-700-normal-BLAVimhd.woff +0 -0
  105. package/dist/assets/inter-latin-700-normal-Yt3aPRUw.woff2 +0 -0
  106. package/dist/assets/inter-latin-ext-400-normal-77YHD8bZ.woff +0 -0
  107. package/dist/assets/inter-latin-ext-400-normal-C1nco2VV.woff2 +0 -0
  108. package/dist/assets/inter-latin-ext-500-normal-BxGbmqWO.woff +0 -0
  109. package/dist/assets/inter-latin-ext-500-normal-CV4jyFjo.woff2 +0 -0
  110. package/dist/assets/inter-latin-ext-600-normal-CIVaiw4L.woff +0 -0
  111. package/dist/assets/inter-latin-ext-600-normal-D2bJ5OIk.woff2 +0 -0
  112. package/dist/assets/inter-latin-ext-700-normal-Ca8adRJv.woff2 +0 -0
  113. package/dist/assets/inter-latin-ext-700-normal-TidjK2hL.woff +0 -0
  114. package/dist/assets/inter-vietnamese-400-normal-Bbgyi5SW.woff +0 -0
  115. package/dist/assets/inter-vietnamese-400-normal-DMkecbls.woff2 +0 -0
  116. package/dist/assets/inter-vietnamese-500-normal-DOriooB6.woff2 +0 -0
  117. package/dist/assets/inter-vietnamese-500-normal-mJboJaSs.woff +0 -0
  118. package/dist/assets/inter-vietnamese-600-normal-BuLX-rYi.woff +0 -0
  119. package/dist/assets/inter-vietnamese-600-normal-Cc8MFFhd.woff2 +0 -0
  120. package/dist/assets/inter-vietnamese-700-normal-BZaoP0fm.woff +0 -0
  121. package/dist/assets/inter-vietnamese-700-normal-DlLaEgI2.woff2 +0 -0
  122. package/dist/assets/message-memory-db-C3Ifhs2B.js +1 -0
  123. package/dist/assets/metrics-store-HzdMIV8O.js +1 -0
  124. package/dist/assets/papaparse.min-3s4OkBbM.js +10 -0
  125. package/dist/assets/pdf-vkbVaD7t.js +12 -0
  126. package/dist/assets/pdf.worker-CliDBb4N.mjs +63057 -0
  127. package/dist/assets/rag-store-VWnttX_x.js +18 -0
  128. package/dist/assets/storage-store-B1XevdC4.js +1 -0
  129. package/dist/assets/stream-handler-29OjEvbo.js +4 -0
  130. package/dist/assets/tool-workshop-store-Btx8DDqg.js +1 -0
  131. package/dist/assets/toolcall-store-BumXt8DE.js +1 -0
  132. package/dist/assets/vector-db-ChAzHl5A.js +1 -0
  133. package/dist/favicon.svg +4 -0
  134. package/dist/index.html +23 -0
  135. package/package.json +83 -0
  136. package/server/api-probe.mjs +71 -0
  137. package/server/index.mjs +76 -0
  138. package/server/system-info.mjs +120 -0
package/LICENSE ADDED
@@ -0,0 +1,190 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to the Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by the Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding any notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ Copyright 2026 Ivan Stankovic (LogneBudo)
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
package/NOTICE ADDED
@@ -0,0 +1,7 @@
1
+ LLMxRay — Local LLM Observatory
2
+ Copyright 2026 Ivan Stankovic (https://github.com/LogneBudo)
3
+
4
+ This product includes software developed by Ivan Stankovic.
5
+
6
+ LLMxRay is a trademark of Ivan Stankovic. The trademark is not licensed
7
+ under the Apache License 2.0. See TRADEMARK.md for usage guidelines.
package/README.md ADDED
@@ -0,0 +1,244 @@
1
+ <p align="center">
2
+ <img src="public/favicon.svg" alt="LLMxRay" width="80" />
3
+ </p>
4
+
5
+ <h1 align="center">LLMxRay</h1>
6
+ <p align="center"><strong>Local LLM Observatory</strong></p>
7
+ <p align="center">
8
+ See what your AI is <em>actually</em> doing &mdash; token by token, layer by layer.
9
+ </p>
10
+
11
+ <p align="center">
12
+ <img src="https://img.shields.io/badge/vue-3.5-42b883?logo=vuedotjs&logoColor=white" alt="Vue 3.5" />
13
+ <img src="https://img.shields.io/badge/vite-7.3-646cff?logo=vite&logoColor=white" alt="Vite 7.3" />
14
+ <img src="https://img.shields.io/badge/typescript-5.9-3178c6?logo=typescript&logoColor=white" alt="TypeScript 5.9" />
15
+ <img src="https://img.shields.io/badge/tailwind-4.2-06b6d4?logo=tailwindcss&logoColor=white" alt="Tailwind 4.2" />
16
+ <img src="https://img.shields.io/badge/ollama-local-000?logo=ollama&logoColor=white" alt="Ollama" />
17
+ </p>
18
+
19
+ ---
20
+
21
+ ## What is LLMxRay?
22
+
23
+ LLMxRay is a **free, local-first** dashboard that connects to [Ollama](https://ollama.com) running on your machine. It lets you chat with any model you've downloaded and then **inspect everything that happened behind the scenes**: how fast each token arrived, what the model might have been "thinking", how different settings change the output, and much more.
24
+
25
+ **No cloud. No API keys. No cost.** Everything runs on your hardware.
26
+
27
+ ### Who is this for?
28
+
29
+ | You are... | LLMxRay helps you... |
30
+ |---|---|
31
+ | **Curious beginner** | See AI responses form in real-time and learn what "temperature" or "tokens" actually mean |
32
+ | **Student / educator** | Explore model behavior visually &mdash; great for AI/ML coursework and demos |
33
+ | **Developer** | Debug prompts, compare models, profile latency, inspect tool calls |
34
+ | **Researcher** | Run controlled experiments: same prompt, different settings, side-by-side results |
35
+
36
+ ---
37
+
38
+ ## Features at a Glance
39
+
40
+ ### Chat with Real-Time Token Streaming
41
+ Start a conversation with any Ollama model. Watch tokens appear one by one with **confidence coloring** &mdash; each token is tinted based on how quickly the model produced it (faster = more confident). Supports markdown rendering, multi-turn conversation, file attachments, and slash commands.
42
+
43
+ ### Session Deep Dive
44
+ Click any past session to explore six tabs of detail:
45
+
46
+ - **Stream** &mdash; Every token with timing data, plus a metrics dashboard (time-to-first-token, tokens/sec, latency chart)
47
+ - **Reasoning** &mdash; If you're running a reasoning model like DeepSeek-R1, the `<think>` blocks are parsed and displayed step-by-step
48
+ - **Introspection** &mdash; Visualizations of layer activations, attention heatmaps, and model architecture (illustrative)
49
+ - **Tools** &mdash; Timeline of any tool calls the model made, with parameters and results
50
+ - **Agent** &mdash; State-flow graph showing how an agent-style prompt progressed
51
+ - **Prompt** &mdash; Anatomy breakdown of your prompt: sections, token counts, structure
52
+
53
+ ### Compare Models (and Settings)
54
+ The comparison workbench goes beyond "Model A vs Model B". Create up to **4 slots**, each with its own model, temperature, system prompt, and sampling parameters. Compare the *same* model at different temperatures to see how creativity changes. Features include:
55
+
56
+ - **Grid view** &mdash; Side-by-side streaming results with per-slot settings pills
57
+ - **Diff view** &mdash; Word-level highlighting of what changed between two outputs
58
+ - **Metrics bar** &mdash; Visual comparison of TTFT, tokens/sec, and total tokens
59
+ - **Quick presets** &mdash; "Temperature Sweep" (3 temps) and "Deterministic Pair" (same seed) one-click setups
60
+ - Embedding models are automatically filtered out &mdash; only chat-capable models appear
61
+
62
+ ### Embeddings Lab
63
+ Embed any text and visualize the resulting vector. Compare two texts with a **cosine similarity meter** to see how semantically close they are. A hands-on way to understand what embeddings actually represent.
64
+
65
+ ### RAG Pipeline
66
+ Build a local knowledge base from your documents:
67
+
68
+ 1. **Upload** PDFs, Word docs (.docx), or CSVs
69
+ 2. **Chunk & embed** automatically using your chosen embedding model
70
+ 3. **Search** with natural language &mdash; results ranked by semantic similarity
71
+
72
+ Everything is stored in **IndexedDB** (your browser's built-in database). Zero cost, zero setup, zero external services.
73
+
74
+ ### Tool Workshop (Visual Canvas)
75
+ Build, edit, and test tool definitions on an interactive **node-based canvas** powered by Vue Flow:
76
+
77
+ - **Drag-and-drop nodes** &mdash; Each tool is a visual node showing name, description, parameters, and implementation body
78
+ - **Inline code editing** &mdash; Full CodeMirror 6 editors with TypeScript syntax highlighting directly on each node
79
+ - **Bidirectional code sync** &mdash; Open the Code Panel to see all tools as combined TypeScript source. Edit code, nodes update. Edit nodes, code updates. Powered by a Recast AST parser
80
+ - **Schema viewer** &mdash; Auto-generated OpenAI-compatible JSON schemas with one-click copy
81
+ - **Probe & Pick** &mdash; Point at any API URL, inspect the response JSON tree, and auto-generate fetch code + parameter mappings
82
+ - **OpenAPI discovery** &mdash; Auto-detect and parse OpenAPI/Swagger specs to pick endpoints visually
83
+ - **Live execution overlays** &mdash; During chat, tool nodes pulse when the model calls them and show results inline
84
+ - **Templates** &mdash; Start from 15+ built-in templates (web fetch, calculator, Google Calendar/Gmail, regex tester, and more)
85
+ - **Persistent layout** &mdash; Node positions, mappings, and probe configs survive across sessions
86
+
87
+ ### Tool Call Optimizer
88
+ When the model calls a tool during chat, an **"Optimize this Tool"** button appears on the result. Click it to open the Response Optimizer Drawer:
89
+
90
+ - Visualize the API response as an interactive JSON tree
91
+ - Select only the fields the model actually needs
92
+ - Auto-generate optimized fetch code with field extraction
93
+ - One click to create a new optimized tool in the Workshop
94
+
95
+ ### Model Browser
96
+ See every model installed in Ollama with details like parameter count, quantization level, family, and format. Includes architecture diagrams showing the model's structure.
97
+
98
+ ### System Monitor
99
+ Real hardware specs (not browser estimates) &mdash; CPU model, total RAM with live usage, GPU with driver version, storage. Plus live Ollama status: running models, memory allocation, inference settings.
100
+
101
+ ### Settings
102
+ Configure your Ollama connection URL with a live connection tester. Set default **temperature** and **context length** with visual scales and educational tooltips that explain what each setting does in plain language.
103
+
104
+ ---
105
+
106
+ ## Quick Start
107
+
108
+ ### Prerequisites
109
+
110
+ 1. **Node.js 18+** &mdash; [Download](https://nodejs.org)
111
+ 2. **Ollama** running locally &mdash; [Download](https://ollama.com/download)
112
+ 3. At least one model pulled:
113
+ ```bash
114
+ ollama pull llama3.2
115
+ ```
116
+
117
+ ### Install and Run
118
+
119
+ ```bash
120
+ git clone https://github.com/LogneBudo/llmxray.git
121
+ cd llmxray
122
+ npm install
123
+ npm run dev
124
+ ```
125
+
126
+ Open **http://localhost:5173** in your browser. That's it.
127
+
128
+ > LLMxRay's dev server automatically proxies API calls to Ollama at `localhost:11434`. If Ollama is running on a different port or machine, change it in **Settings**.
129
+
130
+ ### Build for Production
131
+
132
+ ```bash
133
+ npm run build # Output in dist/
134
+ npm run preview # Preview the build locally
135
+ ```
136
+
137
+ ---
138
+
139
+ ## Tech Stack
140
+
141
+ | Layer | Technology |
142
+ |---|---|
143
+ | Framework | Vue 3.5 + Composition API (`<script setup>`) |
144
+ | Language | TypeScript 5.9 (strict) |
145
+ | Build | Vite 7.3 |
146
+ | Styling | Tailwind CSS 4.2 (custom dark theme) |
147
+ | State | Pinia 3 (one store per concern) |
148
+ | Routing | Vue Router 5 |
149
+ | Charts | Chart.js 4 + vue-chartjs, D3.js 7 |
150
+ | Canvas | Vue Flow 1.x (node-based visual editor) |
151
+ | Code Editor | CodeMirror 6 (TypeScript + JSON highlighting) |
152
+ | AST Parser | Recast + @babel/parser (bidirectional code sync) |
153
+ | Markdown | marked |
154
+ | Diffing | diff (word-level) |
155
+ | Documents | pdfjs-dist (lazy), mammoth (DOCX), papaparse (CSV) |
156
+ | Storage | IndexedDB (browser-native, zero-cost) |
157
+ | IDs | nanoid |
158
+ | LLM Backend | Ollama (local, via `/api` proxy) |
159
+
160
+ ---
161
+
162
+ ## Architecture Highlights
163
+
164
+ **Streaming** &mdash; LLMxRay reads Ollama's NDJSON response streams via `fetch()` + `ReadableStream`. Tokens arrive one by one and update the UI reactively through Pinia stores.
165
+
166
+ **Token confidence** &mdash; Ollama doesn't expose logprobs, so confidence is approximated from inter-token latency. Faster tokens = higher confidence. This is labeled clearly in the UI as an approximation.
167
+
168
+ **Introspection data** &mdash; Layer activations and attention heatmaps are synthetic (illustrative). They demonstrate what these visualizations *would* look like with real data. Clearly labeled as "Illustrative" in the UI.
169
+
170
+ **Store-per-concern** &mdash; Each domain has its own Pinia store: tokens, sessions, metrics, reasoning, comparison, embeddings, RAG, models, and more. This keeps state management modular and testable.
171
+
172
+ **Hardware detection** &mdash; The System page uses a custom Vite plugin (`vite-plugin-system-info.ts`) that queries the OS directly via PowerShell (Windows), `/proc` + `lspci` (Linux), or `sysctl` (macOS) for accurate hardware specs.
173
+
174
+ ---
175
+
176
+ ## Development
177
+
178
+ ### Scripts
179
+
180
+ | Command | What it does |
181
+ |---|---|
182
+ | `npm run dev` | Start dev server (port 5173) |
183
+ | `npm run build` | Type-check + production build |
184
+ | `npm run preview` | Preview production build |
185
+ | `npm run test` | Run unit tests (Vitest) |
186
+ | `npm run test:watch` | Tests in watch mode |
187
+ | `npm run test:coverage` | Coverage report |
188
+ | `npm run test:e2e` | Playwright end-to-end tests |
189
+ | `npm run test:e2e:headed` | E2E with visible browser |
190
+ | `npm run test:e2e:live` | E2E against live Ollama |
191
+
192
+ ### Project Structure
193
+
194
+ ```
195
+ src/
196
+ pages/ 8 page components (Dashboard, Compare, RAG, etc.)
197
+ components/ 50+ components organized by feature
198
+ chat/ Chat UI, token stream, attachments
199
+ comparison/ Slot configurator, grid, diff view, metrics bar
200
+ metrics/ Dashboard, charts, session history
201
+ reasoning/ Think-block viewer
202
+ introspection/ Layer activations, attention, architecture
203
+ rag/ Document upload, search, ingest
204
+ embeddings/ Vector viz, similarity meter
205
+ tool-canvas/ Visual canvas, node editor, CodeMirror wrapper
206
+ tool-optimizer/ Response optimizer drawer, JSON tree
207
+ tool-calls/ Tool call timeline, definitions
208
+ agent-graph/ Agent state flow
209
+ common/ Layout, sidebar, shared components
210
+ stores/ Pinia stores (one per concern)
211
+ services/ Ollama client, streaming, generation, RAG, AST parser, probe
212
+ types/ TypeScript interfaces
213
+ utils/ Formatting, color scales, slot labels
214
+ composables/ Vue composables (markdown, etc.)
215
+ router/ Route definitions
216
+ ```
217
+
218
+ ---
219
+
220
+ ## Troubleshooting
221
+
222
+ | Problem | Solution |
223
+ |---|---|
224
+ | "Disconnected" in Settings | Make sure Ollama is running: `ollama serve` |
225
+ | No models in dropdowns | Pull a model first: `ollama pull llama3.2` |
226
+ | System page shows "Restart dev server" | Stop and restart `npm run dev` (the hardware plugin loads at startup) |
227
+ | Slow first response | Normal &mdash; Ollama loads the model into memory on first use |
228
+ | High RAM/VRAM usage | Use smaller quantized models (Q4) or reduce context length in Settings |
229
+
230
+ ---
231
+
232
+ ## License
233
+
234
+ Licensed under the [Apache License 2.0](LICENSE). You are free to use, modify, and distribute this software under the terms of the license.
235
+
236
+ ## Trademark
237
+
238
+ **LLMxRay** is a trademark of Ivan Stankovic ([LogneBudo](https://github.com/LogneBudo)). See [TRADEMARK.md](TRADEMARK.md) for usage guidelines.
239
+
240
+ ---
241
+
242
+ <p align="center">
243
+ Built with curiosity by <a href="https://github.com/LogneBudo">LogneBudo</a>
244
+ </p>
package/bin/cli.mjs ADDED
@@ -0,0 +1,37 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { startServer } from '../server/index.mjs'
4
+
5
+ const args = process.argv.slice(2)
6
+
7
+ function getFlag(name) {
8
+ const index = args.indexOf(name)
9
+ if (index === -1 || index + 1 >= args.length) return undefined
10
+ return args[index + 1]
11
+ }
12
+
13
+ if (args.includes('--help') || args.includes('-h')) {
14
+ console.log(`
15
+ LLMxRay — Local LLM Observatory
16
+
17
+ Usage:
18
+ npx llmxray [options]
19
+
20
+ Options:
21
+ --port <number> Port to serve on (default: 5174, env: PORT)
22
+ --ollama-url <url> Ollama instance URL (default: http://localhost:11434, env: OLLAMA_URL)
23
+ -h, --help Show this help message
24
+
25
+ Examples:
26
+ npx llmxray
27
+ npx llmxray --port 3000
28
+ npx llmxray --ollama-url http://192.168.1.50:11434
29
+ OLLAMA_URL=http://myserver:11434 npx llmxray
30
+ `)
31
+ process.exit(0)
32
+ }
33
+
34
+ startServer({
35
+ port: getFlag('--port'),
36
+ ollamaUrl: getFlag('--ollama-url'),
37
+ })
@@ -0,0 +1 @@
1
+ import{d as H,r as h,c as I,a as D,e as p,f as e,t as m,m as R,u,i as $,k as Q,F as A,j as S,b as c,g as w,h as j,B as E,C as L,p as N,v as X,M as V,A as Y,s as Z,ab as _}from"./index-BqB3FY2M.js";import{canvasAiDB as P}from"./canvas-ai-db-BolM-_G7.js";import{b as ee,d as z}from"./format-BqVZ9rwM.js";import{_ as te}from"./StorageGauge.vue_vue_type_style_index_0_lang-hO4dId5t.js";const se=H("training",()=>{const s=h([]),l=h(!1),g=h(new Set),o=h(null),f=h({phase:null,model:null,accepted:null,toolName:null,tag:null,search:"",sortBy:"timestamp",sortDir:"desc"}),n=I(()=>{let r=[...s.value];const i=f.value;if(i.phase&&(r=r.filter(x=>x.phase===i.phase)),i.model&&(r=r.filter(x=>x.model===i.model)),i.accepted!==null&&(r=r.filter(x=>x.accepted===i.accepted)),i.toolName&&(r=r.filter(x=>x.toolName===i.toolName)),i.tag&&(r=r.filter(x=>x.tags?.includes(i.tag)??!1)),i.search){const x=i.search.toLowerCase();r=r.filter(v=>v.userPrompt.toLowerCase().includes(x)||v.response.toLowerCase().includes(x)||v.toolName.toLowerCase().includes(x))}return r.sort((x,v)=>{let k=0;return i.sortBy==="timestamp"?k=x.timestamp-v.timestamp:i.sortBy==="phase"?k=x.phase.localeCompare(v.phase):i.sortBy==="model"&&(k=x.model.localeCompare(v.model)),i.sortDir==="desc"?-k:k}),r}),d=I(()=>{const r=s.value,i=new Map,x=new Map;let v=0,k=0;for(const T of r)T.accepted&&v++,i.set(T.phase,(i.get(T.phase)??0)+1),x.set(T.model,(x.get(T.model)??0)+1),k+=T.systemPrompt.length+T.userPrompt.length+T.response.length;return{total:r.length,accepted:v,rejected:r.length-v,phaseBreakdown:i,modelBreakdown:x,estimatedBytes:k*2}}),t=I(()=>{const r=new Set;for(const i of s.value)for(const x of i.tags??[])r.add(x);return[...r].sort()}),a=I(()=>[...new Set(s.value.map(r=>r.model))].sort()),b=I(()=>[...new Set(s.value.map(r=>r.toolName))].sort());async function C(){l.value=!0;try{s.value=await P.getAllPairs()}catch(r){console.error("Failed to load training pairs:",r)}finally{l.value=!1}}async function M(r,i){await P.updatePairResponse(r,i);const x=s.value.find(v=>v.id===r);x&&(x.response=i)}async function U(r,i){await P.updatePairTags(r,i);const x=s.value.find(v=>v.id===r);x&&(x.tags=i)}async function y(r){const i=s.value.find(v=>v.id===r);if(!i)return;const x=!i.accepted;await P.updateAccepted(r,x),i.accepted=x}async function B(r){await P.deletePairs(r);const i=new Set(r);s.value=s.value.filter(x=>!i.has(x.id));for(const x of r)g.value.delete(x);o.value&&i.has(o.value)&&(o.value=null)}async function F(r,i){for(const x of r){await P.updateAccepted(x,i);const v=s.value.find(k=>k.id===x);v&&(v.accepted=i)}}async function K(r,i){for(const x of r){const v=s.value.find(T=>T.id===x);if(!v)continue;const k=[...v.tags??[]];k.includes(i)||(k.push(i),await P.updatePairTags(x,k),v.tags=k)}}function J(r){P.exportSelectedAsJsonl(r)}function O(r){const i=new Set(g.value);i.has(r)?i.delete(r):i.add(r),g.value=i}function W(){g.value=new Set(n.value.map(r=>r.id))}function q(){g.value=new Set}function G(r){o.value=o.value===r?null:r}return{pairs:s,loading:l,selectedIds:g,expandedId:o,filters:f,filteredPairs:n,stats:d,allTags:t,allModels:a,allToolNames:b,loadPairs:C,updateResponse:M,updateTags:U,toggleAccepted:y,deletePairs:B,bulkSetAccepted:F,bulkAddTag:K,exportSelected:J,toggleSelection:O,selectAll:W,deselectAll:q,setExpanded:G}}),oe={class:"grid grid-cols-2 gap-3 lg:grid-cols-4"},ae={class:"rounded-lg border border-border-default bg-surface-raised p-3 space-y-2"},le={class:"text-xl font-bold text-text-primary"},ne={class:"rounded-lg border border-border-default bg-surface-raised p-3 space-y-2"},re={class:"text-xl font-bold text-text-primary"},de={class:"flex items-center gap-2 text-[10px]"},ie={class:"text-success"},ue={class:"text-error"},ce={key:0,class:"h-1.5 rounded-full bg-surface-overlay overflow-hidden"},xe={class:"rounded-lg border border-border-default bg-surface-raised p-3 space-y-2"},pe={class:"flex flex-wrap gap-1.5"},me={class:"rounded-lg border border-border-default bg-surface-raised p-3 space-y-2"},ge={key:0,class:"space-y-1"},fe={class:"text-text-secondary truncate"},ve={class:"text-text-muted shrink-0"},be={key:1,class:"text-[10px] text-text-muted italic"},ye=D({__name:"TrainingDashboard",props:{stats:{}},setup(s){const l=s,g=I(()=>["draft","insights","automap","fix"].map(t=>({key:t,count:l.stats.phaseBreakdown.get(t)??0}))),o=I(()=>[...l.stats.modelBreakdown.entries()].sort((d,t)=>t[1]-d[1]).slice(0,3)),f=I(()=>l.stats.total>0?Math.round(l.stats.accepted/l.stats.total*100):0),n={draft:"bg-blue-500/20 text-blue-400",insights:"bg-amber-500/20 text-amber-400",automap:"bg-emerald-500/20 text-emerald-400",fix:"bg-rose-500/20 text-rose-400"};return(d,t)=>(c(),p("div",oe,[e("div",ae,[t[0]||(t[0]=e("p",{class:"text-[10px] text-text-muted uppercase tracking-wider"},"Training Pairs",-1)),e("p",le,m(s.stats.total),1),s.stats.estimatedBytes>0?(c(),R(te,{key:0,used:s.stats.estimatedBytes,total:s.stats.estimatedBytes*5,compact:"",label:`~${u(ee)(s.stats.estimatedBytes)} dataset`},null,8,["used","total","label"])):$("",!0)]),e("div",ne,[t[2]||(t[2]=e("p",{class:"text-[10px] text-text-muted uppercase tracking-wider"},"Acceptance Rate",-1)),e("p",re,m(f.value)+"%",1),e("div",de,[e("span",ie,m(s.stats.accepted)+" accepted",1),t[1]||(t[1]=e("span",{class:"text-text-muted"},"/",-1)),e("span",ue,m(s.stats.rejected)+" rejected",1)]),s.stats.total>0?(c(),p("div",ce,[e("div",{class:"h-full rounded-full bg-success transition-all duration-500",style:Q({width:`${f.value}%`})},null,4)])):$("",!0)]),e("div",xe,[t[3]||(t[3]=e("p",{class:"text-[10px] text-text-muted uppercase tracking-wider"},"By Phase",-1)),e("div",pe,[(c(!0),p(A,null,S(g.value,a=>(c(),p("span",{key:a.key,class:w(["rounded-full px-2 py-0.5 text-[10px] font-medium",n[a.key]])},m(a.key)+" "+m(a.count),3))),128))])]),e("div",me,[t[4]||(t[4]=e("p",{class:"text-[10px] text-text-muted uppercase tracking-wider"},"Top Models",-1)),o.value.length>0?(c(),p("div",ge,[(c(!0),p(A,null,S(o.value,([a,b])=>(c(),p("div",{key:a,class:"flex items-center justify-between text-[10px]"},[e("span",fe,m(a),1),e("span",ve,m(b),1)]))),128))])):(c(),p("p",be,"No data"))])]))}}),ke={class:"flex flex-wrap items-center gap-2"},he=["value"],we=["value"],$e=["value"],Ce=["value"],Te=["value"],Ae=["value"],Se={class:"flex rounded-lg border border-border-default overflow-hidden"},Pe=["value"],Ie=["value"],Be=["value"],De=["value"],Ne=["title"],je=D({__name:"TrainingFilters",props:{filters:{},models:{},toolNames:{},tags:{}},emits:["update:filters"],setup(s,{emit:l}){const g=s,o=l;function f(d){o("update:filters",{...g.filters,...d})}const n=[{value:"",label:"All phases"},{value:"draft",label:"Draft"},{value:"insights",label:"Insights"},{value:"automap",label:"Auto-map"},{value:"fix",label:"Fix"}];return(d,t)=>(c(),p("div",ke,[e("select",{value:s.filters.phase??"",class:"rounded-lg border border-border-default bg-surface px-2.5 py-1.5 text-xs text-text-primary outline-none focus:border-accent",onChange:t[0]||(t[0]=a=>f({phase:a.target.value||null}))},[(c(),p(A,null,S(n,a=>e("option",{key:a.label,value:a.value},m(a.label),9,we)),64))],40,he),e("select",{value:s.filters.model??"",class:"rounded-lg border border-border-default bg-surface px-2.5 py-1.5 text-xs text-text-primary outline-none focus:border-accent",onChange:t[1]||(t[1]=a=>f({model:a.target.value||null}))},[t[10]||(t[10]=e("option",{value:""},"All models",-1)),(c(!0),p(A,null,S(s.models,a=>(c(),p("option",{key:a,value:a},m(a),9,Ce))),128))],40,$e),e("select",{value:s.filters.toolName??"",class:"rounded-lg border border-border-default bg-surface px-2.5 py-1.5 text-xs text-text-primary outline-none focus:border-accent",onChange:t[2]||(t[2]=a=>f({toolName:a.target.value||null}))},[t[11]||(t[11]=e("option",{value:""},"All tools",-1)),(c(!0),p(A,null,S(s.toolNames,a=>(c(),p("option",{key:a,value:a},m(a),9,Ae))),128))],40,Te),e("div",Se,[e("button",{class:w(["px-2.5 py-1.5 text-[10px] transition-colors",s.filters.accepted===null?"bg-accent/10 text-accent":"bg-surface text-text-muted hover:text-text-primary"]),onClick:t[3]||(t[3]=a=>f({accepted:null}))},"All",2),e("button",{class:w(["px-2.5 py-1.5 text-[10px] transition-colors border-l border-border-default",s.filters.accepted===!0?"bg-success/10 text-success":"bg-surface text-text-muted hover:text-text-primary"]),onClick:t[4]||(t[4]=a=>f({accepted:!0}))},"Accepted",2),e("button",{class:w(["px-2.5 py-1.5 text-[10px] transition-colors border-l border-border-default",s.filters.accepted===!1?"bg-error/10 text-error":"bg-surface text-text-muted hover:text-text-primary"]),onClick:t[5]||(t[5]=a=>f({accepted:!1}))},"Rejected",2)]),s.tags.length>0?(c(),p("select",{key:0,value:s.filters.tag??"",class:"rounded-lg border border-border-default bg-surface px-2.5 py-1.5 text-xs text-text-primary outline-none focus:border-accent",onChange:t[6]||(t[6]=a=>f({tag:a.target.value||null}))},[t[12]||(t[12]=e("option",{value:""},"All tags",-1)),(c(!0),p(A,null,S(s.tags,a=>(c(),p("option",{key:a,value:a},m(a),9,Ie))),128))],40,Pe)):$("",!0),e("input",{value:s.filters.search,type:"text",placeholder:"Search prompts...",class:"flex-1 min-w-[150px] rounded-lg border border-border-default bg-surface px-2.5 py-1.5 text-xs text-text-primary placeholder-text-muted outline-none focus:border-accent",onInput:t[7]||(t[7]=a=>f({search:a.target.value}))},null,40,Be),e("select",{value:s.filters.sortBy,class:"rounded-lg border border-border-default bg-surface px-2.5 py-1.5 text-xs text-text-primary outline-none focus:border-accent",onChange:t[8]||(t[8]=a=>f({sortBy:a.target.value}))},[...t[13]||(t[13]=[e("option",{value:"timestamp"},"Sort by time",-1),e("option",{value:"phase"},"Sort by phase",-1),e("option",{value:"model"},"Sort by model",-1)])],40,De),e("button",{class:"rounded-lg border border-border-default bg-surface px-2 py-1.5 text-xs text-text-muted hover:text-text-primary transition-colors",title:s.filters.sortDir==="desc"?"Newest first":"Oldest first",onClick:t[9]||(t[9]=a=>f({sortDir:s.filters.sortDir==="desc"?"asc":"desc"}))},m(s.filters.sortDir==="desc"?"↓":"↑"),9,Ne)]))}}),Me={class:"flex flex-wrap items-center gap-1.5"},Re=["onClick"],Ee=D({__name:"TrainingTagEditor",props:{tags:{},allTags:{}},emits:["update:tags"],setup(s,{emit:l}){const g=l,o=h("");function f(d,t){if(d.key==="Enter"||d.key===","){d.preventDefault();const a=o.value.trim().toLowerCase();a&&!t.includes(a)&&g("update:tags",[...t,a]),o.value=""}}function n(d,t){g("update:tags",d.filter(a=>a!==t))}return(d,t)=>(c(),p("div",Me,[(c(!0),p(A,null,S(s.tags,a=>(c(),p("span",{key:a,class:"flex items-center gap-1 rounded-full bg-accent/10 px-2 py-0.5 text-[10px] text-accent"},[j(m(a)+" ",1),e("button",{class:"text-accent/60 hover:text-accent transition-colors",onClick:b=>n(s.tags,a)},[...t[2]||(t[2]=[e("svg",{class:"h-2.5 w-2.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3"},[e("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])],8,Re)]))),128)),E(e("input",{"onUpdate:modelValue":t[0]||(t[0]=a=>o.value=a),type:"text",placeholder:"Add tag...",class:"w-20 bg-transparent text-[10px] text-text-primary placeholder-text-muted outline-none",onKeydown:t[1]||(t[1]=a=>f(a,s.tags))},null,544),[[L,o.value]])]))}}),Le={class:"rounded-lg border border-accent/30 bg-surface-raised p-4 space-y-4"},Ue={class:"flex items-center justify-between"},Ve={class:"flex items-center gap-2"},ze={class:"text-xs text-text-secondary"},Fe={class:"text-[10px] text-text-muted"},Ke={class:"text-[10px] text-text-muted"},Je={class:"flex items-center gap-2"},Oe={class:"max-h-32 overflow-auto rounded-lg bg-surface p-3 text-xs text-text-secondary whitespace-pre-wrap font-mono"},We={class:"max-h-32 overflow-auto rounded-lg bg-surface p-3 text-xs text-text-secondary whitespace-pre-wrap font-mono"},qe={key:0},Ge={class:"max-h-40 overflow-auto rounded-lg bg-accent/5 border border-accent/20 p-3 text-xs text-text-secondary whitespace-pre-wrap font-mono italic"},He={class:"mb-1 flex items-center justify-between"},Qe={key:1,class:"max-h-64 overflow-auto rounded-lg bg-surface p-3 text-xs text-text-secondary whitespace-pre-wrap font-mono"},Xe={key:2,class:"mt-2 flex gap-2"},Ye={class:"flex items-center justify-end border-t border-border-default pt-3"},Ze=D({__name:"TrainingDetailPanel",props:{pair:{},allTags:{}},emits:["close","update:response","update:tags","toggle-accepted","delete"],setup(s,{emit:l}){const g=s,o=l,f=h(!1),n=h(""),d=h(!1);function t(){n.value=g.pair.response,f.value=!0}function a(){o("update:response",g.pair.id,n.value),f.value=!1}function b(){f.value=!1}function C(){d.value?(o("delete",g.pair.id),d.value=!1):(d.value=!0,setTimeout(()=>{d.value=!1},3e3))}const M={draft:"bg-blue-500/20 text-blue-400",insights:"bg-amber-500/20 text-amber-400",automap:"bg-emerald-500/20 text-emerald-400",fix:"bg-rose-500/20 text-rose-400"};return(U,y)=>(c(),p("div",Le,[e("div",Ue,[e("div",Ve,[e("span",{class:w(["rounded-full px-2 py-0.5 text-[10px] font-medium",M[s.pair.phase]])},m(s.pair.phase),3),e("span",ze,m(s.pair.toolName),1),e("span",Fe,m(s.pair.model),1),e("span",Ke,m(u(z)(s.pair.timestamp)),1)]),e("div",Je,[e("button",{class:w(["rounded px-2 py-1 text-[10px] transition-colors",s.pair.accepted?"bg-success/10 text-success":"bg-error/10 text-error"]),onClick:y[0]||(y[0]=B=>o("toggle-accepted",s.pair.id))},m(s.pair.accepted?"Accepted":"Rejected"),3),e("button",{class:"text-text-muted hover:text-text-primary transition-colors text-xs",onClick:y[1]||(y[1]=B=>o("close"))}," ✕ ")])]),e("div",null,[y[4]||(y[4]=e("p",{class:"mb-1 text-[10px] font-medium uppercase tracking-wider text-text-muted"},"System Prompt",-1)),e("pre",Oe,m(s.pair.systemPrompt),1)]),e("div",null,[y[5]||(y[5]=e("p",{class:"mb-1 text-[10px] font-medium uppercase tracking-wider text-text-muted"},"User Prompt",-1)),e("pre",We,m(s.pair.userPrompt),1)]),s.pair.reasoning?(c(),p("div",qe,[y[6]||(y[6]=e("p",{class:"mb-1 text-[10px] font-medium uppercase tracking-wider text-accent"},"Reasoning",-1)),e("pre",Ge,m(s.pair.reasoning),1)])):$("",!0),e("div",null,[e("div",He,[y[7]||(y[7]=e("p",{class:"text-[10px] font-medium uppercase tracking-wider text-text-muted"},"AI Response",-1)),f.value?$("",!0):(c(),p("button",{key:0,class:"text-[10px] text-accent hover:underline",onClick:t}," Edit response "))]),f.value?E((c(),p("textarea",{key:0,"onUpdate:modelValue":y[2]||(y[2]=B=>n.value=B),rows:"8",class:"w-full rounded-lg border border-accent bg-surface px-3 py-2 text-xs text-text-primary font-mono outline-none resize-y"},null,512)),[[L,n.value]]):(c(),p("pre",Qe,m(s.pair.response),1)),f.value?(c(),p("div",Xe,[e("button",{class:"rounded-lg bg-accent px-3 py-1 text-xs text-white hover:bg-accent-hover transition-colors",onClick:a}," Save "),e("button",{class:"rounded-lg px-3 py-1 text-xs text-text-muted hover:text-text-primary transition-colors",onClick:b}," Cancel ")])):$("",!0)]),e("div",null,[y[8]||(y[8]=e("p",{class:"mb-1.5 text-[10px] font-medium uppercase tracking-wider text-text-muted"},"Tags",-1)),N(Ee,{tags:s.pair.tags??[],"all-tags":s.allTags,"onUpdate:tags":y[3]||(y[3]=B=>o("update:tags",s.pair.id,B))},null,8,["tags","all-tags"])]),e("div",Ye,[e("button",{class:w(["rounded-lg px-3 py-1 text-xs transition-colors",d.value?"bg-error/10 text-error":"text-text-muted hover:text-error"]),onClick:C},m(d.value?"Confirm delete?":"Delete pair"),3)])]))}}),_e={key:0,class:"rounded-lg bg-surface-overlay p-8 text-center"},et={key:1,class:"space-y-1"},tt=["onClick"],st=["onClick"],ot={key:0,class:"text-[8px]"},at={class:"shrink-0 text-text-secondary w-24 truncate"},lt={class:"shrink-0 text-text-muted w-28 truncate"},nt={class:"flex items-center gap-1 shrink-0"},rt={key:0,class:"text-[8px] text-text-muted"},dt={class:"flex-1 min-w-0 truncate text-text-muted"},it={class:"shrink-0 text-[10px] text-text-muted"},ut=D({__name:"TrainingTable",props:{pairs:{},selectedIds:{},expandedId:{},allTags:{}},emits:["toggle-selection","set-expanded","update:response","update:tags","toggle-accepted","delete"],setup(s,{emit:l}){const g=l,o={draft:"bg-blue-500/20 text-blue-400",insights:"bg-amber-500/20 text-amber-400",automap:"bg-emerald-500/20 text-emerald-400",fix:"bg-rose-500/20 text-rose-400"};return(f,n)=>s.pairs.length===0?(c(),p("div",_e,[...n[5]||(n[5]=[e("p",{class:"text-sm text-text-muted"},"No training pairs match your filters.",-1)])])):(c(),p("div",et,[(c(!0),p(A,null,S(s.pairs,d=>(c(),p("div",{key:d.id},[e("div",{class:w(["flex items-center gap-3 rounded-lg border border-border-default bg-surface-raised px-3 py-2.5 text-xs transition-colors cursor-pointer hover:border-accent/30",s.expandedId===d.id?"border-accent/50":""]),onClick:t=>g("set-expanded",d.id)},[e("button",{class:w(["flex h-4 w-4 shrink-0 items-center justify-center rounded border transition-colors",s.selectedIds.has(d.id)?"border-accent bg-accent text-white":"border-border-default hover:border-accent"]),onClick:X(t=>g("toggle-selection",d.id),["stop"])},[s.selectedIds.has(d.id)?(c(),p("span",ot,"✓")):$("",!0)],10,st),e("span",{class:w(["shrink-0 rounded-full px-2 py-0.5 text-[9px] font-medium",o[d.phase]])},m(d.phase),3),e("span",at,m(d.toolName),1),e("span",lt,m(d.model),1),e("span",{class:w(["shrink-0 rounded-full px-1.5 py-0.5 text-[9px]",d.accepted?"bg-success/10 text-success":"bg-error/10 text-error"])},m(d.accepted?"accepted":"rejected"),3),e("div",nt,[(c(!0),p(A,null,S((d.tags??[]).slice(0,2),t=>(c(),p("span",{key:t,class:"rounded-full bg-accent/10 px-1.5 py-0.5 text-[8px] text-accent"},m(t),1))),128)),(d.tags??[]).length>2?(c(),p("span",rt,"+"+m((d.tags??[]).length-2),1)):$("",!0)]),e("span",dt,m(d.userPrompt.slice(0,80))+m(d.userPrompt.length>80?"...":""),1),e("span",it,m(u(z)(d.timestamp)),1)],10,tt),s.expandedId===d.id?(c(),R(Ze,{key:0,pair:d,"all-tags":s.allTags,class:"mt-1 ml-7",onClose:n[0]||(n[0]=t=>g("set-expanded",null)),"onUpdate:response":n[1]||(n[1]=(t,a)=>g("update:response",t,a)),"onUpdate:tags":n[2]||(n[2]=(t,a)=>g("update:tags",t,a)),onToggleAccepted:n[3]||(n[3]=t=>g("toggle-accepted",t)),onDelete:n[4]||(n[4]=t=>g("delete",t))},null,8,["pair","all-tags"])):$("",!0)]))),128))]))}}),ct={class:"flex items-center gap-2 rounded-lg border border-accent/30 bg-surface-raised px-4 py-2.5"},xt={class:"text-xs font-medium text-accent"},pt={class:"ml-auto flex items-center gap-2"},mt={key:0,class:"flex items-center gap-1"},gt=D({__name:"TrainingBulkActions",props:{selectedCount:{}},emits:["export","mark-accepted","mark-rejected","add-tag","delete","deselect-all"],setup(s,{emit:l}){const g=l,o=h(!1),f=h(""),n=h(!1);function d(){const a=f.value.trim().toLowerCase();a&&(g("add-tag",a),f.value="",o.value=!1)}function t(){n.value?(g("delete"),n.value=!1):(n.value=!0,setTimeout(()=>{n.value=!1},3e3))}return(a,b)=>(c(),p("div",ct,[e("span",xt,m(s.selectedCount)+" selected",1),e("div",pt,[e("button",{class:"rounded-lg bg-surface-overlay px-3 py-1 text-[10px] text-text-secondary hover:text-text-primary transition-colors",onClick:b[0]||(b[0]=C=>g("export"))}," Export JSONL "),e("button",{class:"rounded-lg bg-success/10 px-3 py-1 text-[10px] text-success hover:bg-success/20 transition-colors",onClick:b[1]||(b[1]=C=>g("mark-accepted"))}," Mark Accepted "),e("button",{class:"rounded-lg bg-error/10 px-3 py-1 text-[10px] text-error hover:bg-error/20 transition-colors",onClick:b[2]||(b[2]=C=>g("mark-rejected"))}," Mark Rejected "),o.value?(c(),p("div",mt,[E(e("input",{"onUpdate:modelValue":b[3]||(b[3]=C=>f.value=C),type:"text",placeholder:"Tag name...",class:"w-24 rounded border border-accent bg-surface px-2 py-0.5 text-[10px] text-text-primary outline-none",onKeydown:[V(d,["enter"]),b[4]||(b[4]=V(C=>o.value=!1,["escape"]))]},null,544),[[L,f.value]]),e("button",{class:"text-[10px] text-accent hover:underline",onClick:d},"Add")])):(c(),p("button",{key:1,class:"rounded-lg bg-accent/10 px-3 py-1 text-[10px] text-accent hover:bg-accent/20 transition-colors",onClick:b[5]||(b[5]=C=>o.value=!0)}," Add Tag ")),e("button",{class:w(["rounded-lg px-3 py-1 text-[10px] transition-colors",n.value?"bg-error/10 text-error":"text-text-muted hover:text-error"]),onClick:t},m(n.value?"Confirm?":"Delete"),3),e("button",{class:"text-[10px] text-text-muted hover:text-text-primary transition-colors",onClick:b[6]||(b[6]=C=>g("deselect-all"))}," Deselect ")])]))}}),ft={class:"mx-auto max-w-6xl space-y-6"},vt={key:1,class:"flex items-center gap-3"},bt={class:"text-[10px] text-text-muted"},yt={key:2,class:"rounded-lg border border-border-default bg-surface-raised p-8 text-center"},kt={class:"text-xs text-text-muted"},Tt=D({__name:"AITrainingPage",setup(s){const l=se();return Y(()=>{l.loadPairs()}),(g,o)=>{const f=_("RouterLink");return c(),p("div",ft,[o[18]||(o[18]=e("div",null,[e("h2",{class:"text-lg font-semibold text-text-primary"},"AI Training"),e("p",{class:"text-sm text-text-muted"},"Browse, curate, and export your training data from the Tool Workshop.")],-1)),N(ye,{stats:u(l).stats},null,8,["stats"]),N(je,{filters:u(l).filters,models:u(l).allModels,"tool-names":u(l).allToolNames,tags:u(l).allTags,"onUpdate:filters":o[0]||(o[0]=n=>u(l).filters=n)},null,8,["filters","models","tool-names","tags"]),u(l).selectedIds.size>0?(c(),R(gt,{key:0,"selected-count":u(l).selectedIds.size,onExport:o[1]||(o[1]=n=>u(l).exportSelected([...u(l).selectedIds])),onMarkAccepted:o[2]||(o[2]=n=>u(l).bulkSetAccepted([...u(l).selectedIds],!0)),onMarkRejected:o[3]||(o[3]=n=>u(l).bulkSetAccepted([...u(l).selectedIds],!1)),onAddTag:o[4]||(o[4]=n=>u(l).bulkAddTag([...u(l).selectedIds],n)),onDelete:o[5]||(o[5]=n=>u(l).deletePairs([...u(l).selectedIds])),onDeselectAll:o[6]||(o[6]=n=>u(l).deselectAll())},null,8,["selected-count"])):$("",!0),u(l).filteredPairs.length>0?(c(),p("div",vt,[e("button",{class:"text-[10px] text-text-muted hover:text-accent transition-colors",onClick:o[7]||(o[7]=n=>u(l).selectedIds.size===u(l).filteredPairs.length?u(l).deselectAll():u(l).selectAll())},m(u(l).selectedIds.size===u(l).filteredPairs.length?"Deselect all":`Select all ${u(l).filteredPairs.length}`),1),e("span",bt,m(u(l).filteredPairs.length)+" of "+m(u(l).pairs.length)+" pairs shown ",1)])):$("",!0),N(ut,{pairs:u(l).filteredPairs,"selected-ids":u(l).selectedIds,"expanded-id":u(l).expandedId,"all-tags":u(l).allTags,onToggleSelection:o[8]||(o[8]=n=>u(l).toggleSelection(n)),onSetExpanded:o[9]||(o[9]=n=>u(l).setExpanded(n)),"onUpdate:response":o[10]||(o[10]=(n,d)=>u(l).updateResponse(n,d)),"onUpdate:tags":o[11]||(o[11]=(n,d)=>u(l).updateTags(n,d)),onToggleAccepted:o[12]||(o[12]=n=>u(l).toggleAccepted(n)),onDelete:o[13]||(o[13]=n=>u(l).deletePairs([n]))},null,8,["pairs","selected-ids","expanded-id","all-tags"]),u(l).pairs.length===0&&!u(l).loading?(c(),p("div",yt,[o[17]||(o[17]=e("p",{class:"text-sm text-text-muted mb-2"},"No training data collected yet.",-1)),e("p",kt,[o[15]||(o[15]=j(" Training pairs are generated automatically when you use AI features in the ",-1)),N(f,{to:"/tools",class:"text-accent hover:underline"},{default:Z(()=>[...o[14]||(o[14]=[j("Tool Workshop",-1)])]),_:1}),o[16]||(o[16]=j(" (draft generation, code analysis, auto-mapping, and AI fix). ",-1))])])):$("",!0)])}}});export{Tt as default};