mindroot 9.3.0__py3-none-any.whl → 9.5.0__py3-none-any.whl

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 (183) hide show
  1. mindroot/coreplugins/admin/__init__.py +3 -1
  2. mindroot/coreplugins/admin/agent_router.py +250 -7
  3. mindroot/coreplugins/admin/asset_manager.py +164 -0
  4. mindroot/coreplugins/admin/command_router.py +236 -1
  5. mindroot/coreplugins/admin/mcp_catalog_routes.py +156 -0
  6. mindroot/coreplugins/admin/mcp_publish_routes.py +450 -0
  7. mindroot/coreplugins/admin/mcp_registry_routes.py +495 -0
  8. mindroot/coreplugins/admin/mcp_routes.py +216 -0
  9. mindroot/coreplugins/admin/mod.py +62 -0
  10. mindroot/coreplugins/admin/oauth_callback_router.py +84 -0
  11. mindroot/coreplugins/admin/persona_handler.py +15 -6
  12. mindroot/coreplugins/admin/persona_router.py +158 -2
  13. mindroot/coreplugins/admin/plugin_manager.py +63 -0
  14. mindroot/coreplugins/admin/plugin_router_fixed.py +23 -0
  15. mindroot/coreplugins/admin/plugin_router_new_not_working.py +145 -0
  16. mindroot/coreplugins/admin/plugin_routes.py +114 -0
  17. mindroot/coreplugins/admin/registry_settings_routes.py +140 -0
  18. mindroot/coreplugins/admin/router.py +116 -15
  19. mindroot/coreplugins/admin/service_models.py +1 -1
  20. mindroot/coreplugins/admin/settings_router.py +1 -0
  21. mindroot/coreplugins/admin/static/css/admin-custom.css +357 -2
  22. mindroot/coreplugins/admin/static/css/dark.css +1 -0
  23. mindroot/coreplugins/admin/static/css/default.css +4 -0
  24. mindroot/coreplugins/admin/static/js/about-info.js +367 -0
  25. mindroot/coreplugins/admin/static/js/agent-form.js +83 -3
  26. mindroot/coreplugins/admin/static/js/api-key-script.js +307 -0
  27. mindroot/coreplugins/admin/static/js/mcp-manager.js +348 -0
  28. mindroot/coreplugins/admin/static/js/mcp-publisher.js +780 -0
  29. mindroot/coreplugins/admin/static/js/persona-editor.js +34 -5
  30. mindroot/coreplugins/admin/static/js/plugin-toggle.js +1 -1
  31. mindroot/coreplugins/admin/static/js/recommended-plugin-install.js +63 -0
  32. mindroot/coreplugins/admin/static/js/registry-auth-section.js +132 -0
  33. mindroot/coreplugins/admin/static/js/registry-manager-base.js +613 -0
  34. mindroot/coreplugins/admin/static/js/registry-manager-old.js +385 -0
  35. mindroot/coreplugins/admin/static/js/registry-manager-publish-old-delete.js +166 -0
  36. mindroot/coreplugins/admin/static/js/registry-manager.js +351 -0
  37. mindroot/coreplugins/admin/static/js/registry-publish-section.js +377 -0
  38. mindroot/coreplugins/admin/static/js/registry-search-section.js +400 -0
  39. mindroot/coreplugins/admin/static/js/registry-search-section.js.bak +3 -0
  40. mindroot/coreplugins/admin/static/js/registry-settings.js +69 -0
  41. mindroot/coreplugins/admin/static/js/registry-shared-services.js +857 -0
  42. mindroot/coreplugins/admin/static/js/registry-simple-sections.js +85 -0
  43. mindroot/coreplugins/admin/static/js/secure-widget-manager.js +438 -0
  44. mindroot/coreplugins/admin/static/logo.png +0 -0
  45. mindroot/coreplugins/admin/templates/admin.jinja2 +275 -110
  46. mindroot/coreplugins/agent/Assistant/agent.json +27 -11
  47. mindroot/coreplugins/agent/agent.py +2 -2
  48. mindroot/coreplugins/agent/command_parser.py +25 -10
  49. mindroot/coreplugins/agent/templates/system.jinja2 +0 -12
  50. mindroot/coreplugins/chat/__init__.py +4 -1
  51. mindroot/coreplugins/chat/router.py +132 -20
  52. mindroot/coreplugins/chat/router_dedup_patch.py +20 -0
  53. mindroot/coreplugins/chat/services.py +31 -1
  54. mindroot/coreplugins/chat/static/css/action-fix.css +32 -0
  55. mindroot/coreplugins/chat/static/css/admin-custom.css +5 -3
  56. mindroot/coreplugins/chat/static/css/dark.css +24 -3
  57. mindroot/coreplugins/chat/static/css/default.css +24 -3
  58. mindroot/coreplugins/chat/static/css/main.css +1 -0
  59. mindroot/coreplugins/chat/static/js/action.js +137 -60
  60. mindroot/coreplugins/chat/static/js/chat-history.js +3 -0
  61. mindroot/coreplugins/chat/static/js/chat.js +59 -16
  62. mindroot/coreplugins/chat/static/js/chat.js.diff +221 -0
  63. mindroot/coreplugins/chat/static/js/chatform.js +2 -2
  64. mindroot/coreplugins/chat/static/site.webmanifest +1 -1
  65. mindroot/coreplugins/chat/templates/chat.jinja2 +3 -3
  66. mindroot/coreplugins/chat/widget_manager.py +139 -0
  67. mindroot/coreplugins/chat/widget_routes.py +287 -0
  68. mindroot/coreplugins/check_list/inject/admin.jinja2 +1 -1
  69. mindroot/coreplugins/email/__init__.py +2 -0
  70. mindroot/coreplugins/email/email_provider.py +2 -2
  71. mindroot/coreplugins/email/mod.py +100 -0
  72. mindroot/coreplugins/email/services.py +5 -3
  73. mindroot/coreplugins/email/smtp_handler.py +9 -3
  74. mindroot/coreplugins/email/test_email_service.py +75 -0
  75. mindroot/coreplugins/env_manager/mod.py +61 -25
  76. mindroot/coreplugins/home/router.py +37 -2
  77. mindroot/coreplugins/home/static/imgs/logo.png +0 -0
  78. mindroot/coreplugins/home/static/imgs/logo.png.bak +0 -0
  79. mindroot/coreplugins/home/static/imgs/logo_teal.png +0 -0
  80. mindroot/coreplugins/home/static/imgs/logo_teal2.png +0 -0
  81. mindroot/coreplugins/home/static/imgs/logo_teal_detailed.png +0 -0
  82. mindroot/coreplugins/home/static/imgs/logo_teal_python.png +0 -0
  83. mindroot/coreplugins/home/templates/home.jinja2 +15 -6
  84. mindroot/coreplugins/index/indices/default/index.json +6 -6
  85. mindroot/coreplugins/jwt_auth/middleware.py +47 -2
  86. mindroot/coreplugins/jwt_auth/mod.py +40 -17
  87. mindroot/coreplugins/l8n/__init__.py +6 -0
  88. mindroot/coreplugins/l8n/debug_loader.py +85 -0
  89. mindroot/coreplugins/l8n/debug_middleware.py +74 -0
  90. mindroot/coreplugins/l8n/l8n_constants.py +19 -0
  91. mindroot/coreplugins/l8n/language_detection.py +183 -0
  92. mindroot/coreplugins/l8n/middleware.py +151 -0
  93. mindroot/coreplugins/l8n/mod.py +277 -0
  94. mindroot/coreplugins/l8n/monkey_patch_to_delete.py +186 -0
  95. mindroot/coreplugins/l8n/test_enhanced.py +298 -0
  96. mindroot/coreplugins/l8n/test_l8n.py +95 -0
  97. mindroot/coreplugins/l8n/test_l8n_standalone.py +251 -0
  98. mindroot/coreplugins/l8n/test_middleware.py +272 -0
  99. mindroot/coreplugins/l8n/utils.py +232 -0
  100. mindroot/coreplugins/mcp_/__init__.py +14 -0
  101. mindroot/coreplugins/mcp_/catalog_commands.py +328 -0
  102. mindroot/coreplugins/mcp_/catalog_manager.py +263 -0
  103. mindroot/coreplugins/mcp_/dynamic_commands.py +154 -0
  104. mindroot/coreplugins/mcp_/mcp_manager.py +1031 -0
  105. mindroot/coreplugins/mcp_/mod.py +367 -0
  106. mindroot/coreplugins/mcp_/oauth_storage.py +144 -0
  107. mindroot/coreplugins/mcp_/server_installer.py +79 -0
  108. mindroot/coreplugins/mcp_/setup.py +26 -0
  109. mindroot/coreplugins/mcp_/test_dynamic_commands.py +134 -0
  110. mindroot/coreplugins/mcp_/testmcpclient.py +92 -0
  111. mindroot/coreplugins/persona/mod.py +12 -7
  112. mindroot/coreplugins/signup/templates/signup.jinja2 +1 -1
  113. mindroot/coreplugins/subscriptions/__init__.py +1 -0
  114. mindroot/coreplugins/subscriptions/mod.py +14 -3
  115. mindroot/coreplugins/subscriptions/router.py +3 -0
  116. mindroot/coreplugins/user_service/__init__.py +1 -2
  117. mindroot/coreplugins/user_service/admin_init.py +1 -0
  118. mindroot/coreplugins/user_service/email_service.py +72 -17
  119. mindroot/coreplugins/user_service/mod.py +10 -2
  120. mindroot/coreplugins/user_service/router.py +2 -0
  121. mindroot/lib/auth/api_key.py +28 -0
  122. mindroot/lib/cli/plugins.py +94 -0
  123. mindroot/lib/plugins/default_plugin_manifest.json +20 -0
  124. mindroot/lib/plugins/installation.py +5 -5
  125. mindroot/lib/plugins/l8n_static_handler.py +225 -0
  126. mindroot/lib/plugins/loader.py +33 -3
  127. mindroot/lib/plugins/loader_with_l8n.py +281 -0
  128. mindroot/lib/plugins/manifest.py +236 -24
  129. mindroot/lib/providers/commands.py +3 -1
  130. mindroot/lib/route_decorators.py +5 -5
  131. mindroot/lib/templates.py +183 -11
  132. mindroot/lib/utils/merge_arrays.py +1 -1
  133. mindroot/migrate.py +39 -20
  134. mindroot/registry/data_access.py +1 -1
  135. mindroot/server.py +42 -13
  136. mindroot/server_missing_normal_args.py +197 -0
  137. mindroot/server_prev.py +173 -0
  138. {mindroot-9.3.0.dist-info → mindroot-9.5.0.dist-info}/METADATA +7 -2
  139. {mindroot-9.3.0.dist-info → mindroot-9.5.0.dist-info}/RECORD +144 -112
  140. mindroot/coreplugins/admin/static/favicon/about.txt +0 -6
  141. mindroot/coreplugins/admin/static/favicon/android-chrome-512x512.png +0 -0
  142. mindroot/coreplugins/admin/static/favicon/apple-touch-icon.png +0 -0
  143. mindroot/coreplugins/admin/static/favicon/favicon-16x16.png +0 -0
  144. mindroot/coreplugins/admin/static/favicon/favicon-32x32.png +0 -0
  145. mindroot/coreplugins/admin/static/favicon/favicon.ico +0 -0
  146. mindroot/coreplugins/admin/static/favicon/favicon_io (1)/about.txt +0 -6
  147. mindroot/coreplugins/admin/static/favicon/favicon_io (1)/android-chrome-192x192.png +0 -0
  148. mindroot/coreplugins/admin/static/favicon/favicon_io (1)/android-chrome-512x512.png +0 -0
  149. mindroot/coreplugins/admin/static/favicon/favicon_io (1)/apple-touch-icon.png +0 -0
  150. mindroot/coreplugins/admin/static/favicon/favicon_io (1)/favicon-16x16.png +0 -0
  151. mindroot/coreplugins/admin/static/favicon/favicon_io (1)/favicon-32x32.png +0 -0
  152. mindroot/coreplugins/admin/static/favicon/favicon_io (1)/favicon.ico +0 -0
  153. mindroot/coreplugins/admin/static/favicon/favicon_io (1)/site.webmanifest +0 -1
  154. mindroot/coreplugins/admin/static/favicon/logo.png +0 -0
  155. mindroot/coreplugins/admin/static/favicon/site.webmanifest +0 -1
  156. mindroot/coreplugins/admin/static/js/backup/agent-editor.js +0 -186
  157. mindroot/coreplugins/admin/static/js/backup/agent-form.js +0 -1133
  158. mindroot/coreplugins/admin/static/js/backup/agent-list.js +0 -94
  159. mindroot/coreplugins/chat/static/favicon/about.txt +0 -6
  160. mindroot/coreplugins/chat/static/favicon/android-chrome-192x192.png +0 -0
  161. mindroot/coreplugins/chat/static/favicon/android-chrome-512x512.png +0 -0
  162. mindroot/coreplugins/chat/static/favicon/apple-touch-icon.png +0 -0
  163. mindroot/coreplugins/chat/static/favicon/favicon-16x16.png +0 -0
  164. mindroot/coreplugins/chat/static/favicon/favicon-32x32.png +0 -0
  165. mindroot/coreplugins/chat/static/favicon/favicon.ico +0 -0
  166. mindroot/coreplugins/chat/static/favicon/favicon_io (1)/about.txt +0 -6
  167. mindroot/coreplugins/chat/static/favicon/favicon_io (1)/android-chrome-192x192.png +0 -0
  168. mindroot/coreplugins/chat/static/favicon/favicon_io (1)/android-chrome-512x512.png +0 -0
  169. mindroot/coreplugins/chat/static/favicon/favicon_io (1)/apple-touch-icon.png +0 -0
  170. mindroot/coreplugins/chat/static/favicon/favicon_io (1)/favicon-16x16.png +0 -0
  171. mindroot/coreplugins/chat/static/favicon/favicon_io (1)/favicon-32x32.png +0 -0
  172. mindroot/coreplugins/chat/static/favicon/favicon_io (1)/favicon.ico +0 -0
  173. mindroot/coreplugins/chat/static/favicon/favicon_io (1)/site.webmanifest +0 -1
  174. mindroot/coreplugins/chat/static/favicon/logo.png +0 -0
  175. mindroot/coreplugins/chat/static/favicon/site.webmanifest +0 -1
  176. mindroot/coreplugins/index/default.json +0 -76
  177. mindroot/coreplugins/user_service/file_trigger_service.py +0 -12
  178. mindroot/coreplugins/user_service/hooks.py +0 -23
  179. /mindroot/coreplugins/{admin/static/favicon/android-chrome-192x192.png → home/static/imgs/backuplogo.png} +0 -0
  180. {mindroot-9.3.0.dist-info → mindroot-9.5.0.dist-info}/WHEEL +0 -0
  181. {mindroot-9.3.0.dist-info → mindroot-9.5.0.dist-info}/entry_points.txt +0 -0
  182. {mindroot-9.3.0.dist-info → mindroot-9.5.0.dist-info}/licenses/LICENSE +0 -0
  183. {mindroot-9.3.0.dist-info → mindroot-9.5.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,613 @@
1
+ import { LitElement, html, css } from '/admin/static/js/lit-core.min.js';
2
+ import { BaseEl } from '/admin/static/js/base.js';
3
+
4
+ class RegistryManagerBase extends BaseEl {
5
+ static properties = {
6
+ isLoggedIn: { type: Boolean },
7
+ searchResults: { type: Array },
8
+ registryUrl: { type: String },
9
+ currentUser: { type: Object },
10
+ authToken: { type: String },
11
+ searchQuery: { type: String },
12
+ selectedCategory: { type: String },
13
+ loading: { type: Boolean },
14
+ error: { type: String },
15
+ stats: { type: Object },
16
+ publishSuccess: { type: String },
17
+ showPublishForm: { type: Boolean },
18
+ localPlugins: { type: Array },
19
+ localAgents: { type: Array },
20
+ agentOwnership: { type: Object },
21
+ toasts: { type: Array },
22
+ activeTab: { type: String },
23
+ showRegisterForm: { type: Boolean },
24
+ installRecommendedPlugins: { type: Boolean }
25
+ };
26
+
27
+ static styles = css`
28
+ :host {
29
+ display: block;
30
+ width: 100%;
31
+ height: 100%;
32
+ }
33
+
34
+ .registry-manager {
35
+ display: flex;
36
+ flex-direction: column;
37
+ width: 100%;
38
+ max-width: 1200px;
39
+ margin: 0 auto;
40
+ gap: 20px;
41
+ padding: 1rem;
42
+ }
43
+
44
+ .section {
45
+ background: rgb(10, 10, 25);
46
+ border-radius: 8px;
47
+ padding: 1rem;
48
+ border: 1px solid rgba(255, 255, 255, 0.1);
49
+ }
50
+
51
+ .section h3, .section h4 {
52
+ margin-top: 0;
53
+ color: #fff;
54
+ display: flex;
55
+ align-items: center;
56
+ gap: 0.5rem;
57
+ }
58
+
59
+ .settings-section {
60
+ margin-bottom: 1rem;
61
+ }
62
+
63
+ .settings-section summary {
64
+ cursor: pointer;
65
+ padding: 0.5rem;
66
+ background: rgba(0, 0, 0, 0.2);
67
+ border-radius: 4px;
68
+ display: flex;
69
+ align-items: center;
70
+ gap: 0.5rem;
71
+ color: #fff;
72
+ }
73
+
74
+ .settings-section summary:hover {
75
+ background: rgba(0, 0, 0, 0.3);
76
+ }
77
+
78
+ .help-text {
79
+ font-size: 0.8rem;
80
+ color: #999;
81
+ margin-top: 0.5rem;
82
+ }
83
+
84
+ .registry-url-display {
85
+ font-size: 0.8rem;
86
+ color: #999;
87
+ margin-bottom: 0.5rem;
88
+ }
89
+
90
+ .login-form, .search-form, .publish-form {
91
+ display: flex;
92
+ flex-direction: column;
93
+ gap: 1rem;
94
+ max-width: 400px;
95
+ }
96
+
97
+ .form-row {
98
+ display: flex;
99
+ gap: 1rem;
100
+ align-items: center;
101
+ flex-wrap: wrap;
102
+ }
103
+
104
+ .form-row label {
105
+ color: #fff;
106
+ min-width: 100px;
107
+ }
108
+
109
+ input, select, textarea {
110
+ background: #2a2a40;
111
+ color: #fff;
112
+ border: 1px solid rgba(255, 255, 255, 0.1);
113
+ padding: 0.5rem;
114
+ border-radius: 4px;
115
+ flex: 1;
116
+ min-width: 200px;
117
+ }
118
+
119
+ input:focus, select:focus, textarea:focus {
120
+ outline: none;
121
+ border-color: #4a9eff;
122
+ }
123
+
124
+ button {
125
+ background: #2a2a40;
126
+ color: #fff;
127
+ border: 1px solid rgba(255, 255, 255, 0.1);
128
+ padding: 0.5rem 1rem;
129
+ border-radius: 4px;
130
+ cursor: pointer;
131
+ transition: background 0.2s;
132
+ white-space: nowrap;
133
+ }
134
+
135
+ button:hover {
136
+ background: #3a3a50;
137
+ }
138
+
139
+ button.primary {
140
+ background: #4a9eff;
141
+ }
142
+
143
+ button.primary:hover {
144
+ background: #3a8eef;
145
+ }
146
+
147
+ button.success {
148
+ background: #28a745;
149
+ color: #fff !important;
150
+ }
151
+
152
+ button.success:hover {
153
+ background: #218838;
154
+ color: #fff !important;
155
+ }
156
+
157
+ .search-results {
158
+ display: grid;
159
+ gap: 1rem;
160
+ margin-top: 1rem;
161
+ }
162
+
163
+ .result-item {
164
+ background: rgba(0, 0, 0, 0.2);
165
+ padding: 1rem;
166
+ border-radius: 4px;
167
+ border: 1px solid rgba(255, 255, 255, 0.1);
168
+ }
169
+
170
+ .result-item {
171
+ display: flex;
172
+ align-items: flex-start;
173
+ gap: 1rem;
174
+ }
175
+
176
+ .result-avatar {
177
+ flex-shrink: 0;
178
+ }
179
+
180
+ .agent-avatar-large {
181
+ width: 80px;
182
+ height: 80px;
183
+ border-radius: 50%;
184
+ object-fit: cover;
185
+ border: 2px solid rgba(74, 158, 255, 0.3);
186
+ background: rgba(0, 0, 0, 0.2);
187
+ }
188
+
189
+ .result-content {
190
+ flex: 1;
191
+ min-width: 0;
192
+ }
193
+
194
+ .agent-name-with-face {
195
+ font-size: 1.2rem;
196
+ font-weight: bold;
197
+ color: #4a9eff;
198
+ margin: 0;
199
+ }
200
+
201
+ .result-header {
202
+ display: flex;
203
+ justify-content: space-between;
204
+ align-items: flex-start;
205
+ margin-bottom: 0.5rem;
206
+ }
207
+
208
+ .result-title {
209
+ font-weight: bold;
210
+ color: #4a9eff;
211
+ margin: 0;
212
+ }
213
+
214
+ .result-version {
215
+ background: rgba(74, 158, 255, 0.2);
216
+ color: #4a9eff;
217
+ padding: 0.2rem 0.5rem;
218
+ border-radius: 3px;
219
+ font-size: 0.8rem;
220
+ }
221
+
222
+ .result-description {
223
+ color: #ccc;
224
+ margin: 0.5rem 0;
225
+ }
226
+
227
+ .result-meta {
228
+ display: flex;
229
+ gap: 1rem;
230
+ font-size: 0.8rem;
231
+ color: #999;
232
+ margin: 0.5rem 0;
233
+ }
234
+
235
+ .result-tags {
236
+ display: flex;
237
+ gap: 0.5rem;
238
+ flex-wrap: wrap;
239
+ margin: 0.5rem 0;
240
+ }
241
+
242
+ .tag {
243
+ background: rgba(255, 255, 255, 0.1);
244
+ padding: 0.2rem 0.5rem;
245
+ border-radius: 3px;
246
+ font-size: 0.7rem;
247
+ }
248
+
249
+ .result-actions {
250
+ display: flex;
251
+ gap: 0.5rem;
252
+ margin-top: 1rem;
253
+ }
254
+
255
+ .stats-grid {
256
+ display: grid;
257
+ grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
258
+ gap: 1rem;
259
+ margin: 1rem 0;
260
+ }
261
+
262
+ .stat-card {
263
+ background: rgba(0, 0, 0, 0.2);
264
+ padding: 1rem;
265
+ border-radius: 4px;
266
+ text-align: center;
267
+ }
268
+
269
+ .stat-number {
270
+ font-size: 2rem;
271
+ font-weight: bold;
272
+ color: #4a9eff;
273
+ }
274
+
275
+ .stat-label {
276
+ color: #ccc;
277
+ font-size: 0.9rem;
278
+ }
279
+
280
+ /* Toast notifications */
281
+ .toast-container {
282
+ position: fixed;
283
+ top: 20px;
284
+ right: 20px;
285
+ z-index: 1000;
286
+ display: flex;
287
+ flex-direction: column;
288
+ gap: 10px;
289
+ }
290
+
291
+ .toast {
292
+ background: rgba(0, 0, 0, 0.9);
293
+ color: white !important;
294
+ padding: 12px 20px;
295
+ border-radius: 6px;
296
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
297
+ max-width: 400px;
298
+ word-wrap: break-word;
299
+ animation: slideIn 0.3s ease-out;
300
+ border-left: 4px solid #4a9eff;
301
+ }
302
+
303
+ .toast.success {
304
+ border-left-color: #28a745;
305
+ background: rgba(40, 167, 69, 0.9);
306
+ color: white !important;
307
+ }
308
+
309
+ .toast.error {
310
+ border-left-color: #dc3545;
311
+ background: rgba(220, 53, 69, 0.9);
312
+ color: white !important;
313
+ }
314
+
315
+ @keyframes slideIn {
316
+ from { transform: translateX(100%); opacity: 0; }
317
+ to { transform: translateX(0); opacity: 1; }
318
+ }
319
+
320
+ .error {
321
+ background: rgba(220, 53, 69, 0.2);
322
+ color: #dc3545;
323
+ padding: 0.5rem;
324
+ border-radius: 4px;
325
+ margin: 0.5rem 0;
326
+ }
327
+
328
+ .success {
329
+ background: rgba(40, 167, 69, 0.2);
330
+ color: #28a745;
331
+ padding: 0.5rem;
332
+ border-radius: 4px;
333
+ margin: 0.5rem 0;
334
+ }
335
+
336
+ .loading {
337
+ text-align: center;
338
+ color: #ccc;
339
+ padding: 2rem;
340
+ }
341
+
342
+ .user-info {
343
+ display: flex;
344
+ justify-content: space-between;
345
+ align-items: center;
346
+ background: rgba(0, 0, 0, 0.2);
347
+ padding: 0.5rem 1rem;
348
+ border-radius: 4px;
349
+ margin-bottom: 1rem;
350
+ flex-wrap: wrap;
351
+ gap: 1rem;
352
+ }
353
+
354
+ .tabs {
355
+ display: flex;
356
+ gap: 0.5rem;
357
+ margin-bottom: 1rem;
358
+ }
359
+
360
+ .tab {
361
+ padding: 0.5rem 1rem;
362
+ background: rgba(0, 0, 0, 0.2);
363
+ border: 1px solid rgba(255, 255, 255, 0.1);
364
+ border-radius: 4px;
365
+ cursor: pointer;
366
+ transition: background 0.2s;
367
+ }
368
+
369
+ .tab.active {
370
+ background: #4a9eff;
371
+ }
372
+
373
+ .tab:hover {
374
+ background: rgba(74, 158, 255, 0.3);
375
+ }
376
+
377
+ .auth-toggle {
378
+ text-align: center;
379
+ margin-top: 1rem;
380
+ }
381
+
382
+ .category-tabs {
383
+ display: flex;
384
+ gap: 0.5rem;
385
+ margin-top: 1rem;
386
+ flex-wrap: wrap;
387
+ }
388
+
389
+ .category-tab {
390
+ display: flex;
391
+ align-items: center;
392
+ gap: 0.5rem;
393
+ padding: 0.75rem 1rem;
394
+ background: rgba(0, 0, 0, 0.2);
395
+ border: 1px solid rgba(255, 255, 255, 0.1);
396
+ border-radius: 6px;
397
+ cursor: pointer;
398
+ transition: all 0.2s;
399
+ color: #ccc;
400
+ font-size: 0.9rem;
401
+ }
402
+
403
+ .category-tab:hover {
404
+ background: rgba(74, 158, 255, 0.2);
405
+ border-color: rgba(74, 158, 255, 0.3);
406
+ color: #fff;
407
+ }
408
+
409
+ .category-tab.active {
410
+ background: #4a9eff;
411
+ border-color: #4a9eff;
412
+ color: #fff;
413
+ }
414
+
415
+ .category-tab .material-icons {
416
+ font-size: 1.1rem;
417
+ }
418
+
419
+ .no-results {
420
+ text-align: center;
421
+ padding: 2rem;
422
+ color: #999;
423
+ background: rgba(0, 0, 0, 0.1);
424
+ border-radius: 4px;
425
+ }
426
+
427
+ .semantic-badge {
428
+ display: inline-flex;
429
+ align-items: center;
430
+ gap: 0.25rem;
431
+ background: rgba(156, 39, 176, 0.2);
432
+ color: #9c27b0;
433
+ padding: 0.25rem 0.5rem;
434
+ border-radius: 12px;
435
+ font-size: 0.75rem;
436
+ margin-bottom: 0.5rem;
437
+ border: 1px solid rgba(156, 39, 176, 0.3);
438
+ }
439
+
440
+ .oauth-badge {
441
+ display: inline-flex;
442
+ align-items: center;
443
+ gap: 0.25rem;
444
+ background: rgba(255, 152, 0, 0.2);
445
+ color: #ff9800;
446
+ padding: 0.25rem 0.5rem;
447
+ border-radius: 12px;
448
+ font-size: 0.75rem;
449
+ margin-left: 0.5rem;
450
+ border: 1px solid rgba(255, 152, 0, 0.3);
451
+ }
452
+
453
+ .oauth-badge .material-icons {
454
+ font-size: 0.9rem;
455
+ }
456
+
457
+ .oauth-status {
458
+ display: inline-flex;
459
+ align-items: center;
460
+ margin-left: 0.5rem;
461
+ }
462
+
463
+ .oauth-status.needs-auth {
464
+ color: #ffc107;
465
+ }
466
+
467
+ .oauth-status .material-icons {
468
+ font-size: 1rem;
469
+ }
470
+
471
+ .installed-badge {
472
+ display: flex;
473
+ align-items: center;
474
+ gap: 0.25rem;
475
+ color: #28a745;
476
+ }
477
+ `;
478
+
479
+ constructor() {
480
+ super();
481
+ this.isLoggedIn = false;
482
+ this.searchResults = [];
483
+ this.registryUrl = this.loadRegistryUrl();
484
+ this.currentUser = null;
485
+ this.authToken = localStorage.getItem('registry_token');
486
+ this.searchQuery = '';
487
+ this.selectedCategory = 'all';
488
+ this.loading = false;
489
+ this.error = '';
490
+ this.stats = {};
491
+ this.publishSuccess = '';
492
+ this.toasts = [];
493
+ this.showPublishForm = false;
494
+ this.localPlugins = [];
495
+ this.localAgents = [];
496
+ this.agentOwnership = null;
497
+ this.activeTab = 'search';
498
+ this.showRegisterForm = false;
499
+ // Automatically install recommended plugins when installing agents
500
+ this.installRecommendedPlugins = true;
501
+
502
+ this.checkAuthStatus();
503
+ this.loadStats();
504
+ this.loadLocalContent();
505
+ }
506
+
507
+ loadRegistryUrl() {
508
+ return localStorage.getItem('registry_url') ||
509
+ (typeof window !== 'undefined' && window.MR_REGISTRY_URL) ||
510
+ 'https://registry.mindroot.io';
511
+ }
512
+
513
+ updateRegistryUrl(newUrl) {
514
+ this.registryUrl = newUrl;
515
+ localStorage.setItem('registry_url', newUrl);
516
+ this.logout();
517
+ this.loadStats();
518
+ this.requestUpdate();
519
+ }
520
+
521
+ async testConnection() {
522
+ try {
523
+ const response = await fetch(`${this.registryUrl}/stats`);
524
+ if (response.ok) {
525
+ this.error = '';
526
+ await this.loadStats();
527
+ const originalError = this.error;
528
+ this.error = 'Connection successful!';
529
+ this.requestUpdate();
530
+ setTimeout(() => {
531
+ this.error = originalError;
532
+ this.requestUpdate();
533
+ }, 2000);
534
+ } else {
535
+ this.error = `Connection failed: ${response.status}`;
536
+ }
537
+ } catch (error) {
538
+ this.error = `Connection failed: ${error.message}`;
539
+ }
540
+ this.requestUpdate();
541
+ }
542
+
543
+ async register(username, email, password) {
544
+ this.loading = true;
545
+
546
+ try {
547
+ const response = await fetch(`${this.registryUrl}/register`, {
548
+ method: 'POST',
549
+ headers: {
550
+ 'Content-Type': 'application/json'
551
+ },
552
+ body: JSON.stringify({
553
+ username: username,
554
+ email: email,
555
+ password: password
556
+ })
557
+ });
558
+
559
+ if (response.ok) {
560
+ this.showToast('Registration successful! You can now log in.', 'success');
561
+ this.showRegisterForm = false;
562
+ // Automatically install recommended plugins when installing agents
563
+ this.installRecommendedPlugins = true;
564
+ } else {
565
+ const errorData = await response.json();
566
+ this.showToast(errorData.detail || 'Registration failed', 'error');
567
+ }
568
+ } catch (error) {
569
+ this.showToast('Network error: ' + error.message, 'error');
570
+ }
571
+
572
+ this.loading = false;
573
+ this.requestUpdate();
574
+ }
575
+
576
+ showToast(message, type = 'info', duration = 5000) {
577
+ const toast = {
578
+ id: Date.now() + Math.random(),
579
+ message,
580
+ type,
581
+ duration
582
+ };
583
+
584
+ this.toasts = [...this.toasts, toast];
585
+ this.requestUpdate();
586
+
587
+ // Auto-remove toast after duration
588
+ setTimeout(() => {
589
+ this.removeToast(toast.id);
590
+ }, duration);
591
+ }
592
+
593
+ removeToast(toastId) {
594
+ this.toasts = this.toasts.filter(toast => toast.id !== toastId);
595
+ this.requestUpdate();
596
+ }
597
+
598
+ renderToasts() {
599
+ if (this.toasts.length === 0) return '';
600
+
601
+ return html`
602
+ <div class="toast-container">
603
+ ${this.toasts.map(toast => html`
604
+ <div class="toast ${toast.type}" @click=${() => this.removeToast(toast.id)}>
605
+ ${toast.message}
606
+ </div>
607
+ `)}
608
+ </div>
609
+ `;
610
+ }
611
+ }
612
+
613
+ export { RegistryManagerBase };