dscord 0.2.0-alpha.1 → 0.4.0-alpha.2

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 (209) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +22 -0
  3. package/README.md +70 -49
  4. package/bin/dscord.mjs +5 -4
  5. package/cordis.patch.yml +3 -0
  6. package/deploy/synapse/dscord_guard.py +212 -0
  7. package/dist/admin/assets/index-DXyc54Ce.css +1 -0
  8. package/dist/admin/assets/index-vZ7hJNEU.js +10 -0
  9. package/dist/admin/assets/mark-128-C4ed4p0U.png +0 -0
  10. package/dist/admin/index.html +13 -0
  11. package/dist/admin/licenses/bundled-dependencies.txt +421 -0
  12. package/dist/admin/licenses/lucide.txt +43 -0
  13. package/dist/admin/licenses/ui-foundation.txt +336 -0
  14. package/dist/admin/theme.js +66 -0
  15. package/dist/web/assets/apple-touch-icon-C_qAgjR1.png +0 -0
  16. package/dist/web/assets/common-DGlCXKV6.js +5 -0
  17. package/dist/web/assets/favicon-32-CEKpvmlx.png +0 -0
  18. package/dist/web/assets/favicon-6aWeKmcy.ico +0 -0
  19. package/dist/web/assets/index-62nMLjE0.css +1 -0
  20. package/dist/web/assets/index-OaWUoxQD.js +55 -0
  21. package/dist/web/assets/{manifest-eq_1S_IC.webmanifest → manifest-Ca-bIZpP.webmanifest} +2 -8
  22. package/dist/web/assets/mark-128-C4ed4p0U.png +0 -0
  23. package/dist/web/assets/rolldown-runtime-XKyaHtl9.js +1 -0
  24. package/dist/web/client-config.json +3 -0
  25. package/dist/web/icons/apple-touch-icon.png +0 -0
  26. package/dist/web/icons/favicon-32.png +0 -0
  27. package/dist/web/icons/favicon.ico +0 -0
  28. package/dist/web/icons/icon-192.png +0 -0
  29. package/dist/web/icons/icon-512.png +0 -0
  30. package/dist/web/icons/mark-128.png +0 -0
  31. package/dist/web/index.html +9 -7
  32. package/dist/web/licenses/bundled-dependencies.txt +2452 -0
  33. package/dist/web/licenses/ui-foundation.txt +336 -0
  34. package/dist/web/manifest.webmanifest +2 -8
  35. package/dist/web/sw.js +233 -79
  36. package/dist/web/theme.js +27 -5
  37. package/dsh-connect/KERNEL.md +70 -0
  38. package/dsh-connect/client.js +28821 -0
  39. package/dsh-connect/controller.mjs +450 -0
  40. package/dsh-connect/decision-settings.mjs +66 -0
  41. package/dsh-connect/index.mjs +40 -0
  42. package/dsh-connect/kernel-runtime.mjs +120 -0
  43. package/dsh-connect/models.mjs +64 -0
  44. package/dsh-connect/native-bots.mjs +97 -0
  45. package/dsh-connect/native-bridge.mjs +482 -0
  46. package/dsh-connect/native-connections.mjs +160 -0
  47. package/dsh-connect/native-team.mjs +63 -0
  48. package/dsh-connect/processes.mjs +119 -0
  49. package/dsh-connect/work-core.mjs +573 -0
  50. package/dsh-plugin/README.md +32 -31
  51. package/dsh-plugin/index.mjs +18 -11
  52. package/dsh-plugin/model-profile.mjs +73 -0
  53. package/dsh-plugin/runtime-dependencies-lock.json +696 -6
  54. package/dsh-plugin/runtime-dependencies-pnpm-lock.yaml +489 -0
  55. package/dsh-plugin/runtime-dependencies.json +7 -2
  56. package/dsh-plugin/runtime-rules.mjs +9 -0
  57. package/dsh-plugin/runtime.mjs +330 -45
  58. package/dsh-plugin/scoped-work.mjs +73 -0
  59. package/dsh-plugin/work-files.mjs +24 -5
  60. package/memory/contacts.mjs +36 -0
  61. package/memory/ingress.mjs +57 -0
  62. package/memory/model-options.mjs +9 -0
  63. package/memory/native.mjs +374 -0
  64. package/memory/observation-policy.mjs +67 -0
  65. package/memory/ombre.mjs +165 -0
  66. package/memory/panel.mjs +88 -0
  67. package/memory/review.mjs +90 -0
  68. package/memory/service.mjs +429 -0
  69. package/memory/snapshot-context.mjs +95 -0
  70. package/memory/source-query.mjs +87 -0
  71. package/memory/store.mjs +339 -0
  72. package/memory/views.mjs +304 -0
  73. package/memory//345/244/215/347/224/250/344/270/216/350/277/220/350/241/214.md +47 -0
  74. package/memory//345/275/223/345/211/215/344/270/212/344/270/213/346/226/207/344/270/216/345/233/236/351/241/276.md +73 -0
  75. package/package.json +46 -6
  76. package/scripts/admin.mjs +41 -0
  77. package/scripts/central-init.mjs +39 -0
  78. package/scripts/dsh-node.mjs +92 -54
  79. package/scripts/memory-setup.mjs +21 -0
  80. package/scripts/runtime-config.mjs +55 -23
  81. package/scripts/runtime-dependencies.mjs +79 -0
  82. package/scripts/server-admin.mjs +25 -3
  83. package/scripts/server-bootstrap.mjs +55 -9
  84. package/scripts/server-init.mjs +88 -10
  85. package/scripts/service.mjs +39 -14
  86. package/service/ombre/LICENSE +21 -0
  87. package/service/ombre/SOURCE.json +15 -0
  88. package/service/ombre/controlled_store.py +295 -0
  89. package/service/ombre/harrier_profile.py +320 -0
  90. package/service/ombre/protocol.py +67 -0
  91. package/service/ombre/requirements.lock.txt +1100 -0
  92. package/service/ombre/semantic.py +449 -0
  93. package/service/ombre/service.py +204 -0
  94. package/src/accounts.mjs +373 -0
  95. package/src/admin-auth.mjs +246 -0
  96. package/src/admin.mjs +285 -0
  97. package/src/attachment-access.mjs +57 -0
  98. package/src/attention.mjs +140 -0
  99. package/src/bot-node.mjs +839 -48
  100. package/src/bot-work-policy.mjs +77 -0
  101. package/src/bot-work.mjs +276 -0
  102. package/src/budget.mjs +22 -7
  103. package/src/collaboration.mjs +178 -0
  104. package/src/contact-book.mjs +206 -0
  105. package/src/core/attachment-routes.mjs +43 -0
  106. package/src/core/bot-routes.mjs +37 -0
  107. package/src/core/node-routes.mjs +51 -0
  108. package/src/core/room-routes.mjs +285 -0
  109. package/src/core/router.mjs +31 -0
  110. package/src/core/session-routes.mjs +58 -0
  111. package/src/core.mjs +139 -356
  112. package/src/decision-provider.mjs +128 -0
  113. package/src/file-formats.mjs +1 -1
  114. package/src/governance.mjs +350 -0
  115. package/src/http-json.mjs +19 -0
  116. package/src/identity.mjs +100 -0
  117. package/src/kernel-control.mjs +374 -0
  118. package/src/kernel-node-client.mjs +162 -0
  119. package/src/matrix-client.mjs +70 -13
  120. package/src/media.mjs +50 -28
  121. package/src/mentions.mjs +28 -8
  122. package/src/message-context.mjs +105 -0
  123. package/src/model-config.mjs +51 -0
  124. package/src/model-failure.mjs +5 -0
  125. package/src/native-bot-catalog.mjs +75 -0
  126. package/src/native-request.mjs +42 -0
  127. package/src/node-auth.mjs +60 -0
  128. package/src/node-delivery.mjs +2 -2
  129. package/src/node-files.mjs +29 -7
  130. package/src/node-store.mjs +581 -13
  131. package/src/node-work.mjs +43 -0
  132. package/src/participant-labels.mjs +9 -0
  133. package/src/push.mjs +23 -3
  134. package/src/room-media.mjs +122 -0
  135. package/src/synapse-control.mjs +409 -0
  136. package/src/tasks.mjs +19 -5
  137. package/src/verified-media.mjs +283 -0
  138. package/src/web-mode.mjs +9 -0
  139. package/vendor/ds-bot/NOTICE +86 -0
  140. package/vendor/ds-bot/UPSTREAM.json +83 -5
  141. package/vendor/ds-bot/client.js +15079 -9868
  142. package/vendor/ds-bot/index.js +6 -2
  143. package/vendor/ds-bot/package.json +9 -4
  144. package/vendor/ds-bot/src/host/approvals.js +54 -7
  145. package/vendor/ds-bot/src/host/browser/script-child.js +136 -0
  146. package/vendor/ds-bot/src/host/browser/script-runner.js +77 -0
  147. package/vendor/ds-bot/src/host/browser/script.js +1 -0
  148. package/vendor/ds-bot/src/host/browser/session.js +19 -29
  149. package/vendor/ds-bot/src/host/capabilities.js +6 -3
  150. package/vendor/ds-bot/src/host/channel.js +214 -54
  151. package/vendor/ds-bot/src/host/computer/catalog.js +91 -0
  152. package/vendor/ds-bot/src/host/computer/index.js +1213 -0
  153. package/vendor/ds-bot/src/host/computer/leases.js +71 -0
  154. package/vendor/ds-bot/src/host/connectors/catalog.js +96 -0
  155. package/vendor/ds-bot/src/host/connectors/gateway.js +264 -0
  156. package/vendor/ds-bot/src/host/connectors/index.js +863 -0
  157. package/vendor/ds-bot/src/host/connectors/mail/index.js +613 -0
  158. package/vendor/ds-bot/src/host/connectors/mail/presets.js +23 -0
  159. package/vendor/ds-bot/src/host/connectors/mail/transport.js +306 -0
  160. package/vendor/ds-bot/src/host/connectors/oauth.js +191 -0
  161. package/vendor/ds-bot/src/host/constants.js +1 -1
  162. package/vendor/ds-bot/src/host/context-failure.js +11 -0
  163. package/vendor/ds-bot/src/host/delivery.js +6 -3
  164. package/vendor/ds-bot/src/host/feed.js +10 -3
  165. package/vendor/ds-bot/src/host/groups.js +58 -16
  166. package/vendor/ds-bot/src/host/home-lock.js +103 -35
  167. package/vendor/ds-bot/src/host/im/format.js +190 -0
  168. package/vendor/ds-bot/src/host/im/index.js +943 -0
  169. package/vendor/ds-bot/src/host/im/platforms/dingtalk.js +207 -0
  170. package/vendor/ds-bot/src/host/im/platforms/discord.js +234 -0
  171. package/vendor/ds-bot/src/host/im/platforms/feishu.js +352 -0
  172. package/vendor/ds-bot/src/host/im/platforms/index.js +12 -0
  173. package/vendor/ds-bot/src/host/im/platforms/qq.js +216 -0
  174. package/vendor/ds-bot/src/host/im/platforms/slack.js +210 -0
  175. package/vendor/ds-bot/src/host/im/platforms/telegram.js +249 -0
  176. package/vendor/ds-bot/src/host/im/platforms/wecom.js +217 -0
  177. package/vendor/ds-bot/src/host/im/platforms/weixin.js +256 -0
  178. package/vendor/ds-bot/src/host/images.js +22 -7
  179. package/vendor/ds-bot/src/host/learning.js +27 -7
  180. package/vendor/ds-bot/src/host/legacy.mjs +4 -0
  181. package/vendor/ds-bot/src/host/local-agents/acp.js +232 -0
  182. package/vendor/ds-bot/src/host/local-agents/adapter.js +540 -0
  183. package/vendor/ds-bot/src/host/local-agents/claude.js +179 -0
  184. package/vendor/ds-bot/src/host/local-agents/codex.js +175 -0
  185. package/vendor/ds-bot/src/host/local-agents/discover.js +99 -0
  186. package/vendor/ds-bot/src/host/local-agents/engines.js +65 -0
  187. package/vendor/ds-bot/src/host/local-agents/index.js +235 -0
  188. package/vendor/ds-bot/src/host/local-agents/jsonrpc.js +111 -0
  189. package/vendor/ds-bot/src/host/local-agents/mcp.js +141 -0
  190. package/vendor/ds-bot/src/host/memory.js +14 -1
  191. package/vendor/ds-bot/src/host/message-source.js +56 -0
  192. package/vendor/ds-bot/src/host/parts.js +259 -48
  193. package/vendor/ds-bot/src/host/providers.js +142 -17
  194. package/vendor/ds-bot/src/host/resume.js +54 -4
  195. package/vendor/ds-bot/src/host/roster.js +25 -3
  196. package/vendor/ds-bot/src/host/schedules.js +101 -7
  197. package/vendor/ds-bot/src/host/steward.js +2 -1
  198. package/vendor/ds-bot/src/host/store.js +52 -5
  199. package/vendor/ds-bot/src/host/tools.js +102 -15
  200. package/vendor/ds-bot/src/host/turns.js +28 -5
  201. package/vendor/ds-bot/src/host/update.js +3 -0
  202. package/vendor/ds-bot/src/shared/im-platforms.js +86 -0
  203. package//346/250/241/345/236/213/351/205/215/347/275/256/344/270/216/350/277/201/347/247/273.md +66 -0
  204. package/dist/web/assets/apple-touch-icon-BVvy03qx.png +0 -0
  205. package/dist/web/assets/icon-C8lhqe5n.svg +0 -6
  206. package/dist/web/assets/index-D2MsIF_C.js +0 -20
  207. package/dist/web/assets/index-DpwihgYi.css +0 -1
  208. package/dist/web/icons/icon.svg +0 -6
  209. package/vendor/ds-bot/README.md +0 -258
@@ -0,0 +1,336 @@
1
+ DSCord UI foundation third-party notices
2
+
3
+ Adapted registry components: ui/controls.tsx and ui/overlays.tsx.
4
+ Generated Tailwind utilities and Base UI code are included in the web and administration bundles.
5
+
6
+ ========================================================================
7
+ shadcn/ui source, commit 8a3536678a528cc012b9e62484290e79d0be410f, MIT
8
+ ========================================================================
9
+ MIT License
10
+
11
+ Copyright (c) 2023 shadcn
12
+
13
+ Permission is hereby granted, free of charge, to any person obtaining a copy
14
+ of this software and associated documentation files (the "Software"), to deal
15
+ in the Software without restriction, including without limitation the rights
16
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17
+ copies of the Software, and to permit persons to whom the Software is
18
+ furnished to do so, subject to the following conditions:
19
+
20
+ The above copyright notice and this permission notice shall be included in all
21
+ copies or substantial portions of the Software.
22
+
23
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29
+ SOFTWARE.
30
+
31
+ ========================================================================
32
+ @base-ui/react 1.9.0, MIT
33
+ ========================================================================
34
+ MIT License
35
+
36
+ Copyright (c) 2019 Material-UI SAS
37
+
38
+ Permission is hereby granted, free of charge, to any person obtaining a copy
39
+ of this software and associated documentation files (the "Software"), to deal
40
+ in the Software without restriction, including without limitation the rights
41
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
42
+ copies of the Software, and to permit persons to whom the Software is
43
+ furnished to do so, subject to the following conditions:
44
+
45
+ The above copyright notice and this permission notice shall be included in all
46
+ copies or substantial portions of the Software.
47
+
48
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
49
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
50
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
51
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
52
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
53
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
54
+ SOFTWARE.
55
+
56
+ ========================================================================
57
+ tailwindcss 4.3.4, MIT
58
+ ========================================================================
59
+ MIT License
60
+
61
+ Copyright (c) Tailwind Labs, Inc.
62
+
63
+ Permission is hereby granted, free of charge, to any person obtaining a copy
64
+ of this software and associated documentation files (the "Software"), to deal
65
+ in the Software without restriction, including without limitation the rights
66
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
67
+ copies of the Software, and to permit persons to whom the Software is
68
+ furnished to do so, subject to the following conditions:
69
+
70
+ The above copyright notice and this permission notice shall be included in all
71
+ copies or substantial portions of the Software.
72
+
73
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
74
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
75
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
76
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
77
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
78
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
79
+ SOFTWARE.
80
+
81
+ ========================================================================
82
+ @tailwindcss/vite 4.3.4, MIT
83
+ ========================================================================
84
+ MIT License
85
+
86
+ Copyright (c) Tailwind Labs, Inc.
87
+
88
+ Permission is hereby granted, free of charge, to any person obtaining a copy
89
+ of this software and associated documentation files (the "Software"), to deal
90
+ in the Software without restriction, including without limitation the rights
91
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
92
+ copies of the Software, and to permit persons to whom the Software is
93
+ furnished to do so, subject to the following conditions:
94
+
95
+ The above copyright notice and this permission notice shall be included in all
96
+ copies or substantial portions of the Software.
97
+
98
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
99
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
100
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
101
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
102
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
103
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
104
+ SOFTWARE.
105
+
106
+ ========================================================================
107
+ class-variance-authority 0.7.1, Apache-2.0
108
+ ========================================================================
109
+ Apache License
110
+ Version 2.0, January 2004
111
+ http://www.apache.org/licenses/
112
+
113
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
114
+
115
+ 1. Definitions.
116
+
117
+ "License" shall mean the terms and conditions for use, reproduction,
118
+ and distribution as defined by Sections 1 through 9 of this document.
119
+
120
+ "Licensor" shall mean the copyright owner or entity authorized by
121
+ the copyright owner that is granting the License.
122
+
123
+ "Legal Entity" shall mean the union of the acting entity and all
124
+ other entities that control, are controlled by, or are under common
125
+ control with that entity. For the purposes of this definition,
126
+ "control" means (i) the power, direct or indirect, to cause the
127
+ direction or management of such entity, whether by contract or
128
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
129
+ outstanding shares, or (iii) beneficial ownership of such entity.
130
+
131
+ "You" (or "Your") shall mean an individual or Legal Entity
132
+ exercising permissions granted by this License.
133
+
134
+ "Source" form shall mean the preferred form for making modifications,
135
+ including but not limited to software source code, documentation
136
+ source, and configuration files.
137
+
138
+ "Object" form shall mean any form resulting from mechanical
139
+ transformation or translation of a Source form, including but
140
+ not limited to compiled object code, generated documentation,
141
+ and conversions to other media types.
142
+
143
+ "Work" shall mean the work of authorship, whether in Source or
144
+ Object form, made available under the License, as indicated by a
145
+ copyright notice that is included in or attached to the work
146
+ (an example is provided in the Appendix below).
147
+
148
+ "Derivative Works" shall mean any work, whether in Source or Object
149
+ form, that is based on (or derived from) the Work and for which the
150
+ editorial revisions, annotations, elaborations, or other modifications
151
+ represent, as a whole, an original work of authorship. For the purposes
152
+ of this License, Derivative Works shall not include works that remain
153
+ separable from, or merely link (or bind by name) to the interfaces of,
154
+ the Work and Derivative Works thereof.
155
+
156
+ "Contribution" shall mean any work of authorship, including
157
+ the original version of the Work and any modifications or additions
158
+ to that Work or Derivative Works thereof, that is intentionally
159
+ submitted to Licensor for inclusion in the Work by the copyright owner
160
+ or by an individual or Legal Entity authorized to submit on behalf of
161
+ the copyright owner. For the purposes of this definition, "submitted"
162
+ means any form of electronic, verbal, or written communication sent
163
+ to the Licensor or its representatives, including but not limited to
164
+ communication on electronic mailing lists, source code control systems,
165
+ and issue tracking systems that are managed by, or on behalf of, the
166
+ Licensor for the purpose of discussing and improving the Work, but
167
+ excluding communication that is conspicuously marked or otherwise
168
+ designated in writing by the copyright owner as "Not a Contribution."
169
+
170
+ "Contributor" shall mean Licensor and any individual or Legal Entity
171
+ on behalf of whom a Contribution has been received by Licensor and
172
+ subsequently incorporated within the Work.
173
+
174
+ 2. Grant of Copyright License. Subject to the terms and conditions of
175
+ this License, each Contributor hereby grants to You a perpetual,
176
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
177
+ copyright license to reproduce, prepare Derivative Works of,
178
+ publicly display, publicly perform, sublicense, and distribute the
179
+ Work and such Derivative Works in Source or Object form.
180
+
181
+ 3. Grant of Patent License. Subject to the terms and conditions of
182
+ this License, each Contributor hereby grants to You a perpetual,
183
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
184
+ (except as stated in this section) patent license to make, have made,
185
+ use, offer to sell, sell, import, and otherwise transfer the Work,
186
+ where such license applies only to those patent claims licensable
187
+ by such Contributor that are necessarily infringed by their
188
+ Contribution(s) alone or by combination of their Contribution(s)
189
+ with the Work to which such Contribution(s) was submitted. If You
190
+ institute patent litigation against any entity (including a
191
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
192
+ or a Contribution incorporated within the Work constitutes direct
193
+ or contributory patent infringement, then any patent licenses
194
+ granted to You under this License for that Work shall terminate
195
+ as of the date such litigation is filed.
196
+
197
+ 4. Redistribution. You may reproduce and distribute copies of the
198
+ Work or Derivative Works thereof in any medium, with or without
199
+ modifications, and in Source or Object form, provided that You
200
+ meet the following conditions:
201
+
202
+ (a) You must give any other recipients of the Work or
203
+ Derivative Works a copy of this License; and
204
+
205
+ (b) You must cause any modified files to carry prominent notices
206
+ stating that You changed the files; and
207
+
208
+ (c) You must retain, in the Source form of any Derivative Works
209
+ that You distribute, all copyright, patent, trademark, and
210
+ attribution notices from the Source form of the Work,
211
+ excluding those notices that do not pertain to any part of
212
+ the Derivative Works; and
213
+
214
+ (d) If the Work includes a "NOTICE" text file as part of its
215
+ distribution, then any Derivative Works that You distribute must
216
+ include a readable copy of the attribution notices contained
217
+ within such NOTICE file, excluding those notices that do not
218
+ pertain to any part of the Derivative Works, in at least one
219
+ of the following places: within a NOTICE text file distributed
220
+ as part of the Derivative Works; within the Source form or
221
+ documentation, if provided along with the Derivative Works; or,
222
+ within a display generated by the Derivative Works, if and
223
+ wherever such third-party notices normally appear. The contents
224
+ of the NOTICE file are for informational purposes only and
225
+ do not modify the License. You may add Your own attribution
226
+ notices within Derivative Works that You distribute, alongside
227
+ or as an addendum to the NOTICE text from the Work, provided
228
+ that such additional attribution notices cannot be construed
229
+ as modifying the License.
230
+
231
+ You may add Your own copyright statement to Your modifications and
232
+ may provide additional or different license terms and conditions
233
+ for use, reproduction, or distribution of Your modifications, or
234
+ for any such Derivative Works as a whole, provided Your use,
235
+ reproduction, and distribution of the Work otherwise complies with
236
+ the conditions stated in this License.
237
+
238
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
239
+ any Contribution intentionally submitted for inclusion in the Work
240
+ by You to the Licensor shall be under the terms and conditions of
241
+ this License, without any additional terms or conditions.
242
+ Notwithstanding the above, nothing herein shall supersede or modify
243
+ the terms of any separate license agreement you may have executed
244
+ with Licensor regarding such Contributions.
245
+
246
+ 6. Trademarks. This License does not grant permission to use the trade
247
+ names, trademarks, service marks, or product names of the Licensor,
248
+ except as required for reasonable and customary use in describing the
249
+ origin of the Work and reproducing the content of the NOTICE file.
250
+
251
+ 7. Disclaimer of Warranty. Unless required by applicable law or
252
+ agreed to in writing, Licensor provides the Work (and each
253
+ Contributor provides its Contributions) on an "AS IS" BASIS,
254
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
255
+ implied, including, without limitation, any warranties or conditions
256
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
257
+ PARTICULAR PURPOSE. You are solely responsible for determining the
258
+ appropriateness of using or redistributing the Work and assume any
259
+ risks associated with Your exercise of permissions under this License.
260
+
261
+ 8. Limitation of Liability. In no event and under no legal theory,
262
+ whether in tort (including negligence), contract, or otherwise,
263
+ unless required by applicable law (such as deliberate and grossly
264
+ negligent acts) or agreed to in writing, shall any Contributor be
265
+ liable to You for damages, including any direct, indirect, special,
266
+ incidental, or consequential damages of any character arising as a
267
+ result of this License or out of the use or inability to use the
268
+ Work (including but not limited to damages for loss of goodwill,
269
+ work stoppage, computer failure or malfunction, or any and all
270
+ other commercial damages or losses), even if such Contributor
271
+ has been advised of the possibility of such damages.
272
+
273
+ 9. Accepting Warranty or Additional Liability. While redistributing
274
+ the Work or Derivative Works thereof, You may choose to offer,
275
+ and charge a fee for, acceptance of support, warranty, indemnity,
276
+ or other liability obligations and/or rights consistent with this
277
+ License. However, in accepting such obligations, You may act only
278
+ on Your own behalf and on Your sole responsibility, not on behalf
279
+ of any other Contributor, and only if You agree to indemnify,
280
+ defend, and hold each Contributor harmless for any liability
281
+ incurred by, or claims asserted against, such Contributor by reason
282
+ of your accepting any such warranty or additional liability.
283
+
284
+ END OF TERMS AND CONDITIONS
285
+
286
+ Copyright 2022 Joe Bell
287
+
288
+ Licensed under the Apache License, Version 2.0 (the "License");
289
+ you may not use this file except in compliance with the License.
290
+ You may obtain a copy of the License at
291
+
292
+ http://www.apache.org/licenses/LICENSE-2.0
293
+
294
+ Unless required by applicable law or agreed to in writing, software
295
+ distributed under the License is distributed on an "AS IS" BASIS,
296
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
297
+ See the License for the specific language governing permissions and
298
+ limitations under the License.
299
+
300
+ ========================================================================
301
+ clsx 2.1.1, MIT
302
+ ========================================================================
303
+ MIT License
304
+
305
+ Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com)
306
+
307
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
308
+
309
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
310
+
311
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
312
+
313
+ ========================================================================
314
+ tailwind-merge 3.7.0, MIT
315
+ ========================================================================
316
+ MIT License
317
+
318
+ Copyright (c) 2021 Dany Castillo
319
+
320
+ Permission is hereby granted, free of charge, to any person obtaining a copy
321
+ of this software and associated documentation files (the "Software"), to deal
322
+ in the Software without restriction, including without limitation the rights
323
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
324
+ copies of the Software, and to permit persons to whom the Software is
325
+ furnished to do so, subject to the following conditions:
326
+
327
+ The above copyright notice and this permission notice shall be included in all
328
+ copies or substantial portions of the Software.
329
+
330
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
331
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
332
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
333
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
334
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
335
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
336
+ SOFTWARE.
@@ -0,0 +1,66 @@
1
+ (() => {
2
+ const storageKey = 'ds-group.theme';
3
+ const colorStorageKey = 'ds-group.theme-color';
4
+ const preferences = new Set(['system', 'dark', 'light']);
5
+ const colors = new Set(['indigo', 'blue', 'teal', 'rose', 'amber']);
6
+ const system = window.matchMedia('(prefers-color-scheme: dark)');
7
+ let preference = 'system';
8
+ let color = 'indigo';
9
+ try {
10
+ const stored = localStorage.getItem(storageKey);
11
+ if (preferences.has(stored)) preference = stored;
12
+ const storedColor = localStorage.getItem(colorStorageKey);
13
+ if (colors.has(storedColor)) color = storedColor;
14
+ } catch { /* System appearance remains available when storage is disabled. */ }
15
+
16
+ function resolvedTheme() {
17
+ return preference === 'system' ? (system.matches ? 'dark' : 'light') : preference;
18
+ }
19
+
20
+ function apply() {
21
+ const theme = resolvedTheme();
22
+ document.documentElement.dataset.theme = theme;
23
+ document.documentElement.dataset.themePreference = preference;
24
+ document.documentElement.dataset.accent = color;
25
+ const meta = document.querySelector('meta[name="theme-color"]');
26
+ if (meta) meta.content = theme === 'dark' ? '#313338' : '#ffffff';
27
+ window.dispatchEvent(new CustomEvent('ds-group:theme', { detail: { preference, theme, color } }));
28
+ }
29
+
30
+ function setPreference(value) {
31
+ if (!preferences.has(value)) throw new Error('Unknown theme preference');
32
+ preference = value;
33
+ try { localStorage.setItem(storageKey, value); }
34
+ catch { /* The selected appearance still applies to the current window. */ }
35
+ apply();
36
+ }
37
+
38
+ function setColor(value) {
39
+ if (!colors.has(value)) throw new Error('Unknown theme color');
40
+ color = value;
41
+ try { localStorage.setItem(colorStorageKey, value); }
42
+ catch { /* The selected color still applies to the current window. */ }
43
+ apply();
44
+ }
45
+
46
+ system.addEventListener('change', () => { if (preference === 'system') apply(); });
47
+ window.addEventListener('storage', event => {
48
+ if (event.key === storageKey) {
49
+ preference = preferences.has(event.newValue) ? event.newValue : 'system';
50
+ } else if (event.key === colorStorageKey) {
51
+ color = colors.has(event.newValue) ? event.newValue : 'indigo';
52
+ } else if (event.key === null) {
53
+ preference = 'system';
54
+ color = 'indigo';
55
+ } else return;
56
+ apply();
57
+ });
58
+ window.DSGroupTheme = Object.freeze({
59
+ getPreference: () => preference,
60
+ getResolvedTheme: resolvedTheme,
61
+ setPreference,
62
+ getColor: () => color,
63
+ setColor,
64
+ });
65
+ apply();
66
+ })();