dimples 1.6.0__tar.gz → 1.6.2__tar.gz

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 (189) hide show
  1. {dimples-1.6.0 → dimples-1.6.2}/PKG-INFO +10 -10
  2. {dimples-1.6.0 → dimples-1.6.2}/README.md +9 -9
  3. {dimples-1.6.0 → dimples-1.6.2}/dimples/__init__.py +100 -54
  4. {dimples-1.6.0 → dimples-1.6.2}/dimples/client/checker.py +2 -2
  5. dimples-1.6.2/dimples/client/compat/__init__.py +35 -0
  6. dimples-1.6.2/dimples/client/compat/loader.py +72 -0
  7. {dimples-1.6.0 → dimples-1.6.2}/dimples/client/cpu/__init__.py +2 -2
  8. {dimples-1.6.0 → dimples-1.6.2}/dimples/client/cpu/app/__init__.py +2 -2
  9. {dimples-1.6.0 → dimples-1.6.2}/dimples/client/cpu/app/filter.py +12 -3
  10. {dimples-1.6.0 → dimples-1.6.2}/dimples/client/cpu/app/group.py +1 -1
  11. {dimples-1.6.0 → dimples-1.6.2}/dimples/client/cpu/customized.py +3 -9
  12. {dimples-1.6.0 → dimples-1.6.2}/dimples/client/facebook.py +2 -2
  13. {dimples-1.6.0 → dimples-1.6.2}/dimples/client/messenger.py +1 -1
  14. {dimples-1.6.0 → dimples-1.6.2}/dimples/client/packer.py +2 -2
  15. {dimples-1.6.0 → dimples-1.6.2}/dimples/common/archivist.py +3 -2
  16. {dimples-1.6.0 → dimples-1.6.2}/dimples/common/compat/__init__.py +0 -5
  17. {dimples-1.6.0 → dimples-1.6.2}/dimples/common/compat/address.py +1 -7
  18. {dimples-1.6.0 → dimples-1.6.2}/dimples/common/compat/compatible.py +7 -7
  19. {dimples-1.6.0 → dimples-1.6.2}/dimples/common/compat/entity.py +1 -7
  20. {dimples-1.6.0 → dimples-1.6.2}/dimples/common/compat/loader.py +40 -5
  21. {dimples-1.6.0 → dimples-1.6.2}/dimples/common/compat/meta.py +4 -10
  22. {dimples-1.6.0 → dimples-1.6.2}/dimples/common/dbi/account.py +2 -1
  23. {dimples-1.6.0 → dimples-1.6.2}/dimples/common/facebook.py +1 -1
  24. {dimples-1.6.0 → dimples-1.6.2}/dimples/common/mkm/utils.py +29 -13
  25. {dimples-1.6.0 → dimples-1.6.2}/dimples/common/packer.py +5 -12
  26. {dimples-1.6.0 → dimples-1.6.2}/dimples/common/protocol/login.py +2 -1
  27. {dimples-1.6.0 → dimples-1.6.2}/dimples/common/protocol/password.py +1 -1
  28. {dimples-1.6.0 → dimples-1.6.2}/dimples/conn/gate.py +3 -4
  29. {dimples-1.6.0 → dimples-1.6.2}/dimples/conn/gatekeeper.py +14 -13
  30. {dimples-1.6.0 → dimples-1.6.2}/dimples/database/account.py +1 -1
  31. {dimples-1.6.0 → dimples-1.6.2}/dimples/database/dos/document.py +5 -3
  32. {dimples-1.6.0 → dimples-1.6.2}/dimples/database/dos/group_history.py +2 -2
  33. {dimples-1.6.0 → dimples-1.6.2}/dimples/database/dos/login.py +6 -2
  34. {dimples-1.6.0 → dimples-1.6.2}/dimples/database/dos/meta.py +2 -1
  35. {dimples-1.6.0 → dimples-1.6.2}/dimples/database/dos/private.py +3 -2
  36. {dimples-1.6.0 → dimples-1.6.2}/dimples/database/redis/document.py +2 -1
  37. {dimples-1.6.0 → dimples-1.6.2}/dimples/database/redis/grp_history.py +2 -2
  38. {dimples-1.6.0 → dimples-1.6.2}/dimples/database/redis/login.py +2 -2
  39. {dimples-1.6.0 → dimples-1.6.2}/dimples/database/redis/message.py +2 -1
  40. {dimples-1.6.0 → dimples-1.6.2}/dimples/database/redis/meta.py +2 -2
  41. {dimples-1.6.0 → dimples-1.6.2}/dimples/database/t_document.py +2 -3
  42. {dimples-1.6.0 → dimples-1.6.2}/dimples/edge/shared.py +3 -3
  43. {dimples-1.6.0 → dimples-1.6.2}/dimples/emitter.py +2 -2
  44. {dimples-1.6.0 → dimples-1.6.2}/dimples/group/admin.py +3 -3
  45. {dimples-1.6.0 → dimples-1.6.2}/dimples/group/emitter.py +1 -1
  46. {dimples-1.6.0 → dimples-1.6.2}/dimples/group/manager.py +2 -2
  47. {dimples-1.6.0 → dimples-1.6.2}/dimples/group/packer.py +3 -3
  48. {dimples-1.6.0 → dimples-1.6.2}/dimples/register/base.py +2 -3
  49. {dimples-1.6.0 → dimples-1.6.2}/dimples/server/checker.py +2 -2
  50. {dimples-1.6.0 → dimples-1.6.2}/dimples/server/cpu/document.py +1 -1
  51. {dimples-1.6.0 → dimples-1.6.2}/dimples/server/deliver.py +1 -1
  52. {dimples-1.6.0 → dimples-1.6.2}/dimples/server/trace.py +1 -1
  53. {dimples-1.6.0 → dimples-1.6.2}/dimples/station/shared.py +1 -1
  54. {dimples-1.6.0 → dimples-1.6.2}/dimples/utils/__init__.py +0 -3
  55. {dimples-1.6.0 → dimples-1.6.2}/dimples/utils/config.py +6 -6
  56. {dimples-1.6.0 → dimples-1.6.2}/dimples.egg-info/PKG-INFO +10 -10
  57. {dimples-1.6.0 → dimples-1.6.2}/dimples.egg-info/SOURCES.txt +2 -0
  58. dimples-1.6.2/dimples.egg-info/requires.txt +10 -0
  59. {dimples-1.6.0 → dimples-1.6.2}/setup.py +10 -10
  60. {dimples-1.6.0 → dimples-1.6.2}/tests/test.py +8 -8
  61. dimples-1.6.0/dimples.egg-info/requires.txt +0 -7
  62. {dimples-1.6.0 → dimples-1.6.2}/LICENSE +0 -0
  63. {dimples-1.6.0 → dimples-1.6.2}/dimples/client/__init__.py +0 -0
  64. {dimples-1.6.0 → dimples-1.6.2}/dimples/client/checkpoint.py +0 -0
  65. {dimples-1.6.0 → dimples-1.6.2}/dimples/client/cpu/app/handler.py +0 -0
  66. {dimples-1.6.0 → dimples-1.6.2}/dimples/client/cpu/commands.py +0 -0
  67. {dimples-1.6.0 → dimples-1.6.2}/dimples/client/cpu/creator.py +0 -0
  68. {dimples-1.6.0 → dimples-1.6.2}/dimples/client/cpu/group.py +0 -0
  69. {dimples-1.6.0 → dimples-1.6.2}/dimples/client/cpu/grp_expel.py +0 -0
  70. {dimples-1.6.0 → dimples-1.6.2}/dimples/client/cpu/grp_invite.py +0 -0
  71. {dimples-1.6.0 → dimples-1.6.2}/dimples/client/cpu/grp_join.py +0 -0
  72. {dimples-1.6.0 → dimples-1.6.2}/dimples/client/cpu/grp_query.py +0 -0
  73. {dimples-1.6.0 → dimples-1.6.2}/dimples/client/cpu/grp_quit.py +0 -0
  74. {dimples-1.6.0 → dimples-1.6.2}/dimples/client/cpu/grp_reset.py +0 -0
  75. {dimples-1.6.0 → dimples-1.6.2}/dimples/client/cpu/grp_resign.py +0 -0
  76. {dimples-1.6.0 → dimples-1.6.2}/dimples/client/cpu/handshake.py +0 -0
  77. {dimples-1.6.0 → dimples-1.6.2}/dimples/client/network/__init__.py +0 -0
  78. {dimples-1.6.0 → dimples-1.6.2}/dimples/client/network/session.py +0 -0
  79. {dimples-1.6.0 → dimples-1.6.2}/dimples/client/network/state.py +0 -0
  80. {dimples-1.6.0 → dimples-1.6.2}/dimples/client/network/transition.py +0 -0
  81. {dimples-1.6.0 → dimples-1.6.2}/dimples/client/processor.py +0 -0
  82. {dimples-1.6.0 → dimples-1.6.2}/dimples/client/terminal.py +0 -0
  83. {dimples-1.6.0 → dimples-1.6.2}/dimples/common/__init__.py +0 -0
  84. {dimples-1.6.0 → dimples-1.6.2}/dimples/common/anonymous.py +0 -0
  85. {dimples-1.6.0 → dimples-1.6.2}/dimples/common/ans.py +0 -0
  86. {dimples-1.6.0 → dimples-1.6.2}/dimples/common/checker.py +0 -0
  87. {dimples-1.6.0 → dimples-1.6.2}/dimples/common/compat/compressor.py +0 -0
  88. {dimples-1.6.0 → dimples-1.6.2}/dimples/common/compat/network.py +0 -0
  89. {dimples-1.6.0 → dimples-1.6.2}/dimples/common/dbi/__init__.py +0 -0
  90. {dimples-1.6.0 → dimples-1.6.2}/dimples/common/dbi/message.py +0 -0
  91. {dimples-1.6.0 → dimples-1.6.2}/dimples/common/dbi/session.py +0 -0
  92. {dimples-1.6.0 → dimples-1.6.2}/dimples/common/messenger.py +0 -0
  93. {dimples-1.6.0 → dimples-1.6.2}/dimples/common/mkm/__init__.py +0 -0
  94. {dimples-1.6.0 → dimples-1.6.2}/dimples/common/mkm/bot.py +0 -0
  95. {dimples-1.6.0 → dimples-1.6.2}/dimples/common/mkm/station.py +0 -0
  96. {dimples-1.6.0 → dimples-1.6.2}/dimples/common/processer.py +0 -0
  97. {dimples-1.6.0 → dimples-1.6.2}/dimples/common/protocol/__init__.py +0 -0
  98. {dimples-1.6.0 → dimples-1.6.2}/dimples/common/protocol/ans.py +0 -0
  99. {dimples-1.6.0 → dimples-1.6.2}/dimples/common/protocol/app.py +0 -0
  100. {dimples-1.6.0 → dimples-1.6.2}/dimples/common/protocol/block.py +0 -0
  101. {dimples-1.6.0 → dimples-1.6.2}/dimples/common/protocol/groups.py +0 -0
  102. {dimples-1.6.0 → dimples-1.6.2}/dimples/common/protocol/grp_admin.py +0 -0
  103. {dimples-1.6.0 → dimples-1.6.2}/dimples/common/protocol/handshake.py +0 -0
  104. {dimples-1.6.0 → dimples-1.6.2}/dimples/common/protocol/mute.py +0 -0
  105. {dimples-1.6.0 → dimples-1.6.2}/dimples/common/protocol/report.py +0 -0
  106. {dimples-1.6.0 → dimples-1.6.2}/dimples/common/protocol/roles.py +0 -0
  107. {dimples-1.6.0 → dimples-1.6.2}/dimples/common/protocol/utils.py +0 -0
  108. {dimples-1.6.0 → dimples-1.6.2}/dimples/common/protocol/version.py +0 -0
  109. {dimples-1.6.0 → dimples-1.6.2}/dimples/common/queue.py +0 -0
  110. {dimples-1.6.0 → dimples-1.6.2}/dimples/common/register.py +0 -0
  111. {dimples-1.6.0 → dimples-1.6.2}/dimples/common/session.py +0 -0
  112. {dimples-1.6.0 → dimples-1.6.2}/dimples/conn/__init__.py +0 -0
  113. {dimples-1.6.0 → dimples-1.6.2}/dimples/conn/flexible.py +0 -0
  114. {dimples-1.6.0 → dimples-1.6.2}/dimples/conn/mars.py +0 -0
  115. {dimples-1.6.0 → dimples-1.6.2}/dimples/conn/mtp.py +0 -0
  116. {dimples-1.6.0 → dimples-1.6.2}/dimples/conn/protocol/__init__.py +0 -0
  117. {dimples-1.6.0 → dimples-1.6.2}/dimples/conn/protocol/mars.py +0 -0
  118. {dimples-1.6.0 → dimples-1.6.2}/dimples/conn/protocol/ws.py +0 -0
  119. {dimples-1.6.0 → dimples-1.6.2}/dimples/conn/queue.py +0 -0
  120. {dimples-1.6.0 → dimples-1.6.2}/dimples/conn/seeker.py +0 -0
  121. {dimples-1.6.0 → dimples-1.6.2}/dimples/conn/session.py +0 -0
  122. {dimples-1.6.0 → dimples-1.6.2}/dimples/conn/ws.py +0 -0
  123. {dimples-1.6.0 → dimples-1.6.2}/dimples/database/__init__.py +0 -0
  124. {dimples-1.6.0 → dimples-1.6.2}/dimples/database/dos/__init__.py +0 -0
  125. {dimples-1.6.0 → dimples-1.6.2}/dimples/database/dos/base.py +0 -0
  126. {dimples-1.6.0 → dimples-1.6.2}/dimples/database/dos/group.py +0 -0
  127. {dimples-1.6.0 → dimples-1.6.2}/dimples/database/dos/group_keys.py +0 -0
  128. {dimples-1.6.0 → dimples-1.6.2}/dimples/database/dos/station.py +0 -0
  129. {dimples-1.6.0 → dimples-1.6.2}/dimples/database/dos/user.py +0 -0
  130. {dimples-1.6.0 → dimples-1.6.2}/dimples/database/message.py +0 -0
  131. {dimples-1.6.0 → dimples-1.6.2}/dimples/database/redis/__init__.py +0 -0
  132. {dimples-1.6.0 → dimples-1.6.2}/dimples/database/redis/base.py +0 -0
  133. {dimples-1.6.0 → dimples-1.6.2}/dimples/database/redis/group.py +0 -0
  134. {dimples-1.6.0 → dimples-1.6.2}/dimples/database/redis/grp_keys.py +0 -0
  135. {dimples-1.6.0 → dimples-1.6.2}/dimples/database/redis/station.py +0 -0
  136. {dimples-1.6.0 → dimples-1.6.2}/dimples/database/redis/user.py +0 -0
  137. {dimples-1.6.0 → dimples-1.6.2}/dimples/database/session.py +0 -0
  138. {dimples-1.6.0 → dimples-1.6.2}/dimples/database/t_base.py +0 -0
  139. {dimples-1.6.0 → dimples-1.6.2}/dimples/database/t_cipherkey.py +0 -0
  140. {dimples-1.6.0 → dimples-1.6.2}/dimples/database/t_group.py +0 -0
  141. {dimples-1.6.0 → dimples-1.6.2}/dimples/database/t_group_history.py +0 -0
  142. {dimples-1.6.0 → dimples-1.6.2}/dimples/database/t_group_keys.py +0 -0
  143. {dimples-1.6.0 → dimples-1.6.2}/dimples/database/t_login.py +0 -0
  144. {dimples-1.6.0 → dimples-1.6.2}/dimples/database/t_message.py +0 -0
  145. {dimples-1.6.0 → dimples-1.6.2}/dimples/database/t_meta.py +0 -0
  146. {dimples-1.6.0 → dimples-1.6.2}/dimples/database/t_private.py +0 -0
  147. {dimples-1.6.0 → dimples-1.6.2}/dimples/database/t_station.py +0 -0
  148. {dimples-1.6.0 → dimples-1.6.2}/dimples/database/t_user.py +0 -0
  149. {dimples-1.6.0 → dimples-1.6.2}/dimples/edge/__init__.py +0 -0
  150. {dimples-1.6.0 → dimples-1.6.2}/dimples/edge/messenger.py +0 -0
  151. {dimples-1.6.0 → dimples-1.6.2}/dimples/edge/octopus.py +0 -0
  152. {dimples-1.6.0 → dimples-1.6.2}/dimples/edge/start.py +0 -0
  153. {dimples-1.6.0 → dimples-1.6.2}/dimples/group/__init__.py +0 -0
  154. {dimples-1.6.0 → dimples-1.6.2}/dimples/group/builder.py +0 -0
  155. {dimples-1.6.0 → dimples-1.6.2}/dimples/group/delegate.py +0 -0
  156. {dimples-1.6.0 → dimples-1.6.2}/dimples/group/helper.py +0 -0
  157. {dimples-1.6.0 → dimples-1.6.2}/dimples/group/shared.py +0 -0
  158. {dimples-1.6.0 → dimples-1.6.2}/dimples/register/__init__.py +0 -0
  159. {dimples-1.6.0 → dimples-1.6.2}/dimples/register/ext.py +0 -0
  160. {dimples-1.6.0 → dimples-1.6.2}/dimples/register/run.py +0 -0
  161. {dimples-1.6.0 → dimples-1.6.2}/dimples/register/shared.py +0 -0
  162. {dimples-1.6.0 → dimples-1.6.2}/dimples/server/__init__.py +0 -0
  163. {dimples-1.6.0 → dimples-1.6.2}/dimples/server/cpu/__init__.py +0 -0
  164. {dimples-1.6.0 → dimples-1.6.2}/dimples/server/cpu/ans.py +0 -0
  165. {dimples-1.6.0 → dimples-1.6.2}/dimples/server/cpu/creator.py +0 -0
  166. {dimples-1.6.0 → dimples-1.6.2}/dimples/server/cpu/handshake.py +0 -0
  167. {dimples-1.6.0 → dimples-1.6.2}/dimples/server/cpu/login.py +0 -0
  168. {dimples-1.6.0 → dimples-1.6.2}/dimples/server/cpu/report.py +0 -0
  169. {dimples-1.6.0 → dimples-1.6.2}/dimples/server/dis_roamer.py +0 -0
  170. {dimples-1.6.0 → dimples-1.6.2}/dimples/server/dispatcher.py +0 -0
  171. {dimples-1.6.0 → dimples-1.6.2}/dimples/server/facebook.py +0 -0
  172. {dimples-1.6.0 → dimples-1.6.2}/dimples/server/messenger.py +0 -0
  173. {dimples-1.6.0 → dimples-1.6.2}/dimples/server/packer.py +0 -0
  174. {dimples-1.6.0 → dimples-1.6.2}/dimples/server/processor.py +0 -0
  175. {dimples-1.6.0 → dimples-1.6.2}/dimples/server/push.py +0 -0
  176. {dimples-1.6.0 → dimples-1.6.2}/dimples/server/session.py +0 -0
  177. {dimples-1.6.0 → dimples-1.6.2}/dimples/server/session_center.py +0 -0
  178. {dimples-1.6.0 → dimples-1.6.2}/dimples/station/__init__.py +0 -0
  179. {dimples-1.6.0 → dimples-1.6.2}/dimples/station/handler.py +0 -0
  180. {dimples-1.6.0 → dimples-1.6.2}/dimples/station/start.py +0 -0
  181. {dimples-1.6.0 → dimples-1.6.2}/dimples/utils/cache.py +0 -0
  182. {dimples-1.6.0 → dimples-1.6.2}/dimples/utils/checker.py +0 -0
  183. {dimples-1.6.0 → dimples-1.6.2}/dimples/utils/digest.py +0 -0
  184. {dimples-1.6.0 → dimples-1.6.2}/dimples/utils/http.py +0 -0
  185. {dimples-1.6.0 → dimples-1.6.2}/dimples/utils/log.py +0 -0
  186. {dimples-1.6.0 → dimples-1.6.2}/dimples.egg-info/dependency_links.txt +0 -0
  187. {dimples-1.6.0 → dimples-1.6.2}/dimples.egg-info/entry_points.txt +0 -0
  188. {dimples-1.6.0 → dimples-1.6.2}/dimples.egg-info/top_level.txt +0 -0
  189. {dimples-1.6.0 → dimples-1.6.2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dimples
3
- Version: 1.6.0
3
+ Version: 1.6.2
4
4
  Summary: DIMP Library for Edges and Stations
5
5
  Home-page: https://github.com/dimchat/demo-py
6
6
  Author: Albert Moky
@@ -47,20 +47,20 @@ License-File: LICENSE
47
47
  # 'pycryptodome', # 3.14.1
48
48
  # 'base58', # 1.0.3
49
49
  # 'ecdsa', # 0.16.1
50
- 'dimplugins>=2.3.3',
50
+ 'dimplugins>=2.4.0',
51
51
 
52
- 'dimsdk>=2.3.3',
53
- # 'dimp>=2.3.3',
54
- # 'dkd>=2.3.3',
55
- # 'mkm>=2.3.3',
52
+ 'dimsdk>=2.4.0',
53
+ # 'dimp>=2.4.0',
54
+ # 'dkd>=2.4.0',
55
+ # 'mkm>=2.4.0',
56
56
 
57
- 'startrek>=2.2.2',
58
- 'tcp>=2.2.2',
59
- 'udp>=2.2.2',
57
+ 'startrek>=2.3.0',
58
+ 'tcp>=2.3.0',
59
+ 'udp>=2.3.0',
60
60
 
61
61
  'aiou>=1.1.0',
62
62
  ]
63
63
  ```
64
64
 
65
- Copyright © 2018-2025 Albert Moky
65
+ Copyright © 2018-2026 Albert Moky
66
66
  [![Followers](https://img.shields.io/github/followers/moky)](https://github.com/moky?tab=followers)
@@ -33,20 +33,20 @@
33
33
  # 'pycryptodome', # 3.14.1
34
34
  # 'base58', # 1.0.3
35
35
  # 'ecdsa', # 0.16.1
36
- 'dimplugins>=2.3.3',
36
+ 'dimplugins>=2.4.0',
37
37
 
38
- 'dimsdk>=2.3.3',
39
- # 'dimp>=2.3.3',
40
- # 'dkd>=2.3.3',
41
- # 'mkm>=2.3.3',
38
+ 'dimsdk>=2.4.0',
39
+ # 'dimp>=2.4.0',
40
+ # 'dkd>=2.4.0',
41
+ # 'mkm>=2.4.0',
42
42
 
43
- 'startrek>=2.2.2',
44
- 'tcp>=2.2.2',
45
- 'udp>=2.2.2',
43
+ 'startrek>=2.3.0',
44
+ 'tcp>=2.3.0',
45
+ 'udp>=2.3.0',
46
46
 
47
47
  'aiou>=1.1.0',
48
48
  ]
49
49
  ```
50
50
 
51
- Copyright © 2018-2025 Albert Moky
51
+ Copyright © 2018-2026 Albert Moky
52
52
  [![Followers](https://img.shields.io/github/followers/moky)](https://github.com/moky?tab=followers)
@@ -29,9 +29,11 @@
29
29
  # ==============================================================================
30
30
 
31
31
  from dimsdk import *
32
- from dimsdk.cpu import *
33
32
  from dimplugins import *
34
33
 
34
+ from dimplugins.ext_core import crypto_extensions, format_extensions
35
+ from dimplugins.ext_core import account_extensions, message_extensions, command_extensions
36
+
35
37
  from .utils import md5, sha1
36
38
 
37
39
  from .common import *
@@ -49,14 +51,6 @@ __author__ = 'Albert Moky'
49
51
 
50
52
  __all__ = [
51
53
 
52
- 'Emitter',
53
-
54
- ####################################
55
- #
56
- # SDK
57
- #
58
- ####################################
59
-
60
54
  'Singleton',
61
55
 
62
56
  'URI', 'DateTime',
@@ -96,6 +90,7 @@ __all__ = [
96
90
  #
97
91
  # TED
98
92
  #
93
+
99
94
  'EncodeAlgorithms',
100
95
 
101
96
  'BaseString', 'BaseData',
@@ -106,9 +101,11 @@ __all__ = [
106
101
  #
107
102
  # PNF
108
103
  #
104
+
109
105
  'TransportableFile', 'TransportableFileFactory',
110
- 'TransportableFileHelper',
106
+ # 'TransportableFileHelper', 'TransportableFileExtension',
111
107
  'TransportableFileWrapper', 'TransportableFileWrapperFactory',
108
+ # 'TransportableFileWrapperExtension',
112
109
 
113
110
  'PortableNetworkFile',
114
111
  'PortableNetworkFileWrapper',
@@ -133,11 +130,14 @@ __all__ = [
133
130
  'SymmetricKeyFactory', 'PrivateKeyFactory', 'PublicKeyFactory',
134
131
 
135
132
  'SymmetricKeyHelper', 'PublicKeyHelper', 'PrivateKeyHelper',
133
+
134
+ 'SymmetricKeyExtension', 'PublicKeyExtension', 'PrivateKeyExtension',
136
135
  'CryptoExtensions', 'shared_crypto_extensions',
137
136
 
138
137
  #
139
138
  # Algorithms
140
139
  #
140
+
141
141
  'AsymmetricAlgorithms', 'SymmetricAlgorithms',
142
142
 
143
143
  #
@@ -157,18 +157,10 @@ __all__ = [
157
157
 
158
158
  'AddressHelper', 'IDHelper',
159
159
  'MetaHelper', 'DocumentHelper',
160
- 'AccountExtensions', 'shared_account_extensions',
161
-
162
- #
163
- # Account Extends
164
- #
165
-
166
- 'GeneralCryptoHelper',
167
- 'GeneralAccountHelper',
168
160
 
169
- 'MetaType',
170
- 'DocumentType',
171
- 'Visa', 'Bulletin',
161
+ 'AddressExtension', 'IDExtension',
162
+ 'MetaExtension', 'DocumentExtension',
163
+ 'AccountExtensions', 'shared_account_extensions',
172
164
 
173
165
  #
174
166
  # Dao-Ke-Dao
@@ -183,18 +175,25 @@ __all__ = [
183
175
 
184
176
  'ContentHelper', 'EnvelopeHelper',
185
177
  'InstantMessageHelper', 'SecureMessageHelper', 'ReliableMessageHelper',
178
+
179
+ 'ContentExtension',
180
+ 'InstantMessageExtension', 'SecureMessageExtension', 'ReliableMessageExtension',
186
181
  'MessageExtensions', 'shared_message_extensions',
187
182
 
188
183
  #
189
- # Message Extends
184
+ # Core Protocols
190
185
  #
191
186
 
192
- 'GeneralMessageHelper',
187
+ 'MetaType',
188
+ 'DocumentType',
189
+ 'Visa', 'Bulletin',
193
190
 
194
191
  'ContentType',
195
192
 
196
193
  'Command', 'CommandFactory',
197
- 'CommandHelper', 'GeneralCommandHelper',
194
+
195
+ # 'CommandHelper', 'GeneralCommandHelper',
196
+ # 'CommandExtension', 'CmdExtension',
198
197
 
199
198
  #
200
199
  # Contents
@@ -205,7 +204,7 @@ __all__ = [
205
204
  'FileContent', 'ImageContent', 'AudioContent', 'VideoContent',
206
205
  'ForwardContent', 'CombineContent', 'ArrayContent',
207
206
  'QuoteContent',
208
- 'QuoteHelper', 'QuotePurifier',
207
+ # 'QuoteHelper', 'QuotePurifier', 'QuoteExtension',
209
208
 
210
209
  #
211
210
  # Commands
@@ -218,22 +217,26 @@ __all__ = [
218
217
  'InviteCommand', 'ExpelCommand', 'JoinCommand', 'QuitCommand', 'ResetCommand',
219
218
 
220
219
  #
221
- # Implementations
220
+ # Account Implementations
222
221
  #
223
222
 
224
223
  'BaseMeta',
225
224
  'BaseDocument', 'BaseVisa', 'BaseBulletin',
226
225
 
227
226
  #
228
- # Contents
227
+ # Content Implementations
228
+ #
229
229
 
230
230
  'BaseContent', 'BaseCommand',
231
+ # 'CommandHelper', 'GeneralCommandHelper',
232
+ # 'CommandExtension', 'CmdExtension',
231
233
 
232
234
  'BaseTextContent', 'WebPageContent', 'NameCardContent',
233
235
  'BaseMoneyContent', 'TransferMoneyContent',
234
236
  'BaseFileContent', 'ImageFileContent', 'AudioFileContent', 'VideoFileContent',
235
237
  'SecretContent', 'CombineForwardContent', 'ListContent',
236
238
  'BaseQuoteContent',
239
+ # 'QuoteHelper', 'QuotePurifier', 'QuoteExtension',
237
240
 
238
241
  'BaseMetaCommand', 'BaseDocumentCommand',
239
242
  'BaseReceiptCommand',
@@ -241,19 +244,41 @@ __all__ = [
241
244
  'InviteGroupCommand', 'ExpelGroupCommand', 'JoinGroupCommand', 'QuitGroupCommand', 'ResetGroupCommand',
242
245
 
243
246
  #
244
- # Messages
247
+ # Message Implementations
245
248
  #
246
249
 
247
250
  'MessageEnvelope',
248
251
  'BaseMessage',
249
252
  'PlainMessage', 'EncryptedMessage', 'NetworkMessage',
250
253
 
254
+ 'GeneralCryptoHelper', 'GeneralCryptoExtension',
255
+ 'GeneralAccountHelper', 'GeneralAccountExtension',
256
+
257
+ 'GeneralMessageHelper', 'GeneralMessageExtension',
258
+
259
+ 'TransportableFileHelper',
260
+ 'TransportableFileExtension',
261
+ 'TransportableFileWrapperExtension',
262
+
263
+ 'CommandHelper', 'GeneralCommandHelper',
264
+ 'CommandExtension', 'CmdExtension',
265
+
266
+ 'QuoteHelper', 'QuotePurifier',
267
+ 'QuoteExtension',
268
+
269
+
270
+ ################################################################
271
+ #
272
+ # Software Development Kits
273
+ #
251
274
  ################################################################
252
275
 
253
276
  'EncryptedBundle', 'UserEncryptedBundle',
254
277
  'EncryptedBundleHelper', 'DefaultBundleHelper',
278
+ 'EncryptedBundleExtension',
255
279
 
256
280
  'VisaAgent', 'DefaultVisaAgent',
281
+ 'VisaAgentExtension',
257
282
 
258
283
  #
259
284
  # Entities (MingKeMing)
@@ -282,7 +307,7 @@ __all__ = [
282
307
  'ReliableMessagePacker',
283
308
 
284
309
  'MessagePackerFactory',
285
- 'PackerExtensions',
310
+ 'MessagePackerExtension',
286
311
 
287
312
  #
288
313
  # Content Processors (DaoKeDao)
@@ -322,61 +347,63 @@ __all__ = [
322
347
  'MessageProcessor',
323
348
  'MessagePacker',
324
349
 
325
- ####################################
326
350
  #
327
- # SDK CPU
351
+ # CPU - Content Processing Units
328
352
  #
329
- ####################################
330
353
 
331
354
  'ContentProcessor',
332
355
  'ContentProcessorCreator',
333
356
  'ContentProcessorFactory',
334
357
  'GeneralContentProcessorFactory',
335
358
 
336
- #
337
- # CPU
338
- #
339
-
340
- 'BaseContentProcessor',
341
- 'BaseCommandProcessor',
342
-
343
- 'ArrayContentProcessor',
344
- 'ForwardContentProcessor',
345
-
346
- 'MetaCommandProcessor',
347
- 'DocumentCommandProcessor',
348
-
359
+ 'BaseContentProcessor', 'BaseCommandProcessor',
360
+ 'ArrayContentProcessor', 'ForwardContentProcessor',
361
+ 'MetaCommandProcessor', 'DocumentCommandProcessor',
349
362
  'BaseContentProcessorCreator',
350
363
 
351
- ####################################
364
+
365
+ ################################################################
352
366
  #
353
367
  # Plugins
354
368
  #
355
- ####################################
369
+ ################################################################
356
370
 
357
371
  'TransportableDataHelper',
358
372
  'FormatExtensions', 'shared_format_extensions',
359
373
 
360
374
  'SymmetricKeyHelper', 'PublicKeyHelper', 'PrivateKeyHelper',
375
+
376
+ 'SymmetricKeyExtension', 'PublicKeyExtension', 'PrivateKeyExtension',
361
377
  'CryptoExtensions', 'shared_crypto_extensions',
362
378
 
363
379
  'AddressHelper', 'IDHelper',
364
380
  'MetaHelper', 'DocumentHelper',
381
+
382
+ 'AddressExtension', 'IDExtension',
383
+ 'MetaExtension', 'DocumentExtension',
365
384
  'AccountExtensions', 'shared_account_extensions',
366
385
 
367
- 'GeneralCryptoHelper',
368
- 'GeneralAccountHelper',
386
+ 'GeneralCryptoHelper', 'GeneralCryptoExtension',
387
+ 'GeneralAccountHelper', 'GeneralAccountExtension',
369
388
 
370
389
  'ContentHelper', 'EnvelopeHelper',
371
390
  'InstantMessageHelper', 'SecureMessageHelper', 'ReliableMessageHelper',
391
+
392
+ 'ContentExtension',
393
+ 'InstantMessageExtension', 'SecureMessageExtension', 'ReliableMessageExtension',
372
394
  'MessageExtensions', 'shared_message_extensions',
373
395
 
374
- 'GeneralMessageHelper',
396
+ 'GeneralMessageHelper', 'GeneralMessageExtension',
375
397
 
376
398
  'TransportableFileHelper',
399
+ 'TransportableFileExtension',
400
+ 'TransportableFileWrapperExtension',
377
401
 
378
402
  'CommandHelper', 'GeneralCommandHelper',
403
+ 'CommandExtension', 'CmdExtension',
404
+
379
405
  'QuoteHelper', 'QuotePurifier',
406
+ 'QuoteExtension',
380
407
 
381
408
  #
382
409
  # Memory Cache
@@ -385,6 +412,8 @@ __all__ = [
385
412
  'MemoryCache',
386
413
  'ThanosCache',
387
414
 
415
+ 'MemoryCacheExtension',
416
+
388
417
  #
389
418
  # Crypto
390
419
  #
@@ -421,7 +450,7 @@ __all__ = [
421
450
  # 'TransportableMixIn',
422
451
 
423
452
  #
424
- # MingKeMing
453
+ # Ming-Ke-Ming
425
454
  #
426
455
 
427
456
  'BTCAddress', 'ETHAddress',
@@ -435,7 +464,7 @@ __all__ = [
435
464
  'GeneralDocumentFactory',
436
465
 
437
466
  #
438
- # DaoKeDao
467
+ # Dao-Ke-Dao
439
468
  #
440
469
 
441
470
  'GeneralCommandFactory',
@@ -456,15 +485,19 @@ __all__ = [
456
485
  # Loaders
457
486
  #
458
487
 
488
+ # 'CoreMixIn', 'EntityMixIn', 'MessageFactoryMixIn',
489
+ # 'CryptoMixIn',
490
+
459
491
  'ContentParser', 'CommandParser',
460
492
  'ExtensionLoader',
461
493
  'PluginLoader',
462
494
 
463
- ####################################
495
+
496
+ ################################################################
464
497
  #
465
498
  # Common
466
499
  #
467
- ####################################
500
+ ################################################################
468
501
 
469
502
  'MetaVersion',
470
503
  'Password',
@@ -689,4 +722,17 @@ __all__ = [
689
722
 
690
723
  'SharedGroupManager',
691
724
 
725
+ ####################################
726
+ #
727
+ # Others
728
+ #
729
+ ####################################
730
+
731
+ 'crypto_extensions', 'format_extensions',
732
+ 'account_extensions', 'message_extensions', 'command_extensions',
733
+
734
+ 'md5', 'sha1',
735
+
736
+ 'Emitter',
737
+
692
738
  ]
@@ -36,6 +36,7 @@ from dimsdk import Content
36
36
  from dimsdk import MetaCommand, DocumentCommand
37
37
 
38
38
  from ..utils import Logging
39
+ from ..common import DocumentUtils
39
40
  from ..common import Station
40
41
  from ..common import QueryCommand
41
42
  from ..common import EntityChecker
@@ -198,8 +199,7 @@ class ClientChecker(EntityChecker, Logging):
198
199
 
199
200
  # Override
200
201
  async def send_visa(self, visa: Visa, receiver: ID, updated: bool = False) -> bool:
201
- did = visa.get('did')
202
- me = ID.parse(identifier=did)
202
+ me = DocumentUtils.get_document_id(document=visa)
203
203
  if me == receiver:
204
204
  self.warning(msg='skip cycled message: %s, %s' % (receiver, visa))
205
205
  return False
@@ -0,0 +1,35 @@
1
+ # -*- coding: utf-8 -*-
2
+ # ==============================================================================
3
+ # MIT License
4
+ #
5
+ # Copyright (c) 2026 Albert Moky
6
+ #
7
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ # of this software and associated documentation files (the "Software"), to deal
9
+ # in the Software without restriction, including without limitation the rights
10
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ # copies of the Software, and to permit persons to whom the Software is
12
+ # furnished to do so, subject to the following conditions:
13
+ #
14
+ # The above copyright notice and this permission notice shall be included in all
15
+ # copies or substantial portions of the Software.
16
+ #
17
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ # SOFTWARE.
24
+ # ==============================================================================
25
+
26
+ from .loader import ClientLibraryLoader
27
+ from .loader import ClientExtensionLoader
28
+
29
+
30
+ __all__ = [
31
+
32
+ 'ClientLibraryLoader',
33
+ 'ClientExtensionLoader',
34
+
35
+ ]
@@ -0,0 +1,72 @@
1
+ # -*- coding: utf-8 -*-
2
+ # ==============================================================================
3
+ # MIT License
4
+ #
5
+ # Copyright (c) 2026 Albert Moky
6
+ #
7
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ # of this software and associated documentation files (the "Software"), to deal
9
+ # in the Software without restriction, including without limitation the rights
10
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ # copies of the Software, and to permit persons to whom the Software is
12
+ # furnished to do so, subject to the following conditions:
13
+ #
14
+ # The above copyright notice and this permission notice shall be included in all
15
+ # copies or substantial portions of the Software.
16
+ #
17
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ # SOFTWARE.
24
+ # ==============================================================================
25
+
26
+ from dimplugins import ExtensionLoader, PluginLoader
27
+
28
+ from ...common.compat import CommonExtensionLoader, CommonPluginLoader
29
+ from ...common import GroupHistory
30
+
31
+ from ..cpu.app.filter import get_app_filter
32
+ from ..cpu import GroupHistoryHandler
33
+
34
+
35
+ class ClientLibraryLoader:
36
+
37
+ def __init__(self, extensions: ExtensionLoader = None, plugins: PluginLoader = None):
38
+ super().__init__()
39
+ self.__extensions = ClientExtensionLoader() if extensions is None else extensions
40
+ self.__plugins = CommonPluginLoader() if plugins is None else plugins
41
+ self.__loaded = False
42
+
43
+ def run(self):
44
+ if self.__loaded:
45
+ # no need to load it again
46
+ return
47
+ else:
48
+ # mark it to loaded
49
+ self.__loaded = True
50
+ # try to load all plugins
51
+ self.load()
52
+
53
+ def load(self):
54
+ self.__extensions.load()
55
+ self.__plugins.load()
56
+
57
+
58
+ class ClientExtensionLoader(CommonExtensionLoader):
59
+
60
+ # Override
61
+ def load(self):
62
+ super().load()
63
+ self._register_customized_handlers()
64
+
65
+ # noinspection PyMethodMayBeStatic
66
+ def _register_customized_handlers(self):
67
+ app_filter = get_app_filter()
68
+ # 'chat.dim.group:history'
69
+ app_filter.set_content_handler(app=GroupHistory.APP,
70
+ mod=GroupHistory.MOD,
71
+ handler=GroupHistoryHandler()
72
+ )
@@ -47,7 +47,7 @@ from .grp_resign import ResignCommandProcessor
47
47
 
48
48
  from .app import CustomizedContentHandler, BaseCustomizedContentHandler
49
49
  from .app import CustomizedContentFilter, AppCustomizedFilter
50
- from .app import CustomizedFilterExtensions
50
+ from .app import CustomizedFilterExtension
51
51
  from .app import GroupHistoryHandler
52
52
 
53
53
  from .customized import CustomizedContentProcessor
@@ -81,7 +81,7 @@ __all__ = [
81
81
 
82
82
  'CustomizedContentHandler', 'BaseCustomizedContentHandler',
83
83
  'CustomizedContentFilter', 'AppCustomizedFilter',
84
- 'CustomizedFilterExtensions',
84
+ 'CustomizedFilterExtension',
85
85
  'GroupHistoryHandler',
86
86
 
87
87
  'CustomizedContentProcessor',
@@ -31,7 +31,7 @@
31
31
  from .handler import CustomizedContentHandler, BaseCustomizedContentHandler
32
32
 
33
33
  from .filter import CustomizedContentFilter, AppCustomizedFilter
34
- from .filter import CustomizedFilterExtensions
34
+ from .filter import CustomizedFilterExtension
35
35
 
36
36
  from .group import GroupHistoryHandler
37
37
 
@@ -41,7 +41,7 @@ __all__ = [
41
41
  'CustomizedContentHandler', 'BaseCustomizedContentHandler',
42
42
 
43
43
  'CustomizedContentFilter', 'AppCustomizedFilter',
44
- 'CustomizedFilterExtensions',
44
+ 'CustomizedFilterExtension',
45
45
 
46
46
  'GroupHistoryHandler',
47
47
 
@@ -81,7 +81,7 @@ class AppCustomizedFilter(CustomizedContentFilter):
81
81
  # -----------------------------------------------------------------------------
82
82
 
83
83
 
84
- class CustomizedFilterExtensions:
84
+ class CustomizedFilterExtension:
85
85
 
86
86
  @property
87
87
  def customized_filter(self) -> CustomizedContentFilter:
@@ -95,5 +95,14 @@ class CustomizedFilterExtensions:
95
95
  shared_message_extensions.customized_filter = AppCustomizedFilter()
96
96
 
97
97
 
98
- # def message_extensions() -> Union[MessageExtensions, CustomizedFilterExtensions]:
99
- # return shared_message_extensions
98
+ def customized_extensions() -> CustomizedFilterExtension:
99
+ return shared_message_extensions
100
+
101
+
102
+ def get_app_filter() -> AppCustomizedFilter:
103
+ ext = customized_extensions()
104
+ customized_filter = ext.customized_filter
105
+ if not isinstance(customized_filter, AppCustomizedFilter):
106
+ customized_filter = AppCustomizedFilter()
107
+ ext.customized_filter = customized_filter
108
+ return customized_filter
@@ -76,7 +76,7 @@ class GroupHistoryHandler(BaseCustomizedContentHandler):
76
76
 
77
77
  async def __transform_query_command(self, content: CustomizedContent, msg: ReliableMessage,
78
78
  messenger: Messenger) -> List[Content]:
79
- info = content.copy_dictionary()
79
+ info = content.copy_dict()
80
80
  info['type'] = ContentType.COMMAND
81
81
  info['command'] = QueryCommand.QUERY
82
82
  query = Content.parse(content=info)
@@ -28,16 +28,15 @@
28
28
  # SOFTWARE.
29
29
  # ==============================================================================
30
30
 
31
- from typing import Union, List
31
+ from typing import List
32
32
 
33
33
  from dimsdk import ReliableMessage
34
34
  from dimsdk import Content
35
- from dimsdk import MessageExtensions, shared_message_extensions
36
35
  from dimsdk.cpu import BaseContentProcessor
37
36
 
38
37
  from ...common import CustomizedContent
39
38
 
40
- from .app import CustomizedFilterExtensions
39
+ from .app.filter import get_app_filter
41
40
 
42
41
 
43
42
  class CustomizedContentProcessor(BaseContentProcessor):
@@ -53,12 +52,7 @@ class CustomizedContentProcessor(BaseContentProcessor):
53
52
  # Override
54
53
  async def process_content(self, content: Content, r_msg: ReliableMessage) -> List[Content]:
55
54
  assert isinstance(content, CustomizedContent), 'customized content error: %s' % content
56
- ext = message_extensions()
57
- customized_filter = ext.customized_filter
55
+ customized_filter = get_app_filter()
58
56
  # get handler for 'app' & 'mod'
59
57
  handler = customized_filter.filter_content(content=content, msg=r_msg)
60
58
  return await handler.handle_action(content=content, msg=r_msg, messenger=self.messenger)
61
-
62
-
63
- def message_extensions() -> Union[MessageExtensions, CustomizedFilterExtensions]:
64
- return shared_message_extensions
@@ -37,6 +37,7 @@ from dimsdk import ID, Document, Bulletin
37
37
  from dimsdk import Group
38
38
 
39
39
  from ..utils import Runner
40
+ from ..common import DocumentUtils
40
41
  from ..common import BroadcastUtils
41
42
  from ..common import CommonFacebook
42
43
  from ..common import CommonArchivist
@@ -57,8 +58,7 @@ class ClientArchivist(CommonArchivist):
57
58
  # check administrators
58
59
  array = document.get_property(name='administrators')
59
60
  if array is not None:
60
- did = document.get('did')
61
- group = ID.parse(identifier=did)
61
+ group = DocumentUtils.get_document_id(document=document)
62
62
  assert group.is_group, 'group ID error: %s' % group
63
63
  admins = ID.convert(array=array)
64
64
  db = self.database
@@ -199,7 +199,7 @@ class ClientMessenger(CommonMessenger):
199
199
  return None
200
200
  else:
201
201
  # clone for modifying
202
- visa = Document.parse(document=visa.copy_dictionary())
202
+ visa = Document.parse(document=visa.copy_dict())
203
203
  if not isinstance(visa, Visa):
204
204
  self.error(msg='visa error: %s' % visa)
205
205
  return None