@songtonyli/dsh-cli 0.1.89 → 0.1.91

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 (625) hide show
  1. package/README.md +1 -1
  2. package/bin/dsh.mjs +1 -1
  3. package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.js +26 -13
  4. package/node_modules/@aws-sdk/core/dist-cjs/submodules/httpAuthSchemes/index.js +6 -3
  5. package/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +51 -1
  6. package/node_modules/@aws-sdk/core/dist-cjs/submodules/util/index.js +2 -1
  7. package/node_modules/@aws-sdk/core/dist-es/submodules/client/middleware-host-header/hostHeaderMiddleware.js +4 -2
  8. package/node_modules/@aws-sdk/core/dist-es/submodules/client/util-endpoints/lib/aws/parseArn.js +4 -2
  9. package/node_modules/@aws-sdk/core/dist-es/submodules/client/util-user-agent-browser/defaultUserAgent.js +18 -9
  10. package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/NODE_AUTH_SCHEME_PREFERENCE_OPTIONS.js +6 -3
  11. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/index.js +1 -0
  12. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsSmithyRpcV2JsonProtocol.js +51 -0
  13. package/node_modules/@aws-sdk/core/dist-es/submodules/util/util-arn-parser/arn.js +2 -1
  14. package/node_modules/@aws-sdk/core/package.json +2 -2
  15. package/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
  16. package/node_modules/@aws-sdk/credential-provider-http/package.json +2 -2
  17. package/node_modules/@aws-sdk/credential-provider-ini/package.json +9 -9
  18. package/node_modules/@aws-sdk/credential-provider-login/package.json +3 -3
  19. package/node_modules/@aws-sdk/credential-provider-node/package.json +7 -7
  20. package/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
  21. package/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
  22. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +3 -3
  23. package/node_modules/@aws-sdk/middleware-eventstream/dist-cjs/index.js +4 -2
  24. package/node_modules/@aws-sdk/middleware-eventstream/dist-es/eventStreamHandlingMiddleware.js +2 -1
  25. package/node_modules/@aws-sdk/middleware-eventstream/dist-es/eventStreamHeaderMiddleware.js +2 -1
  26. package/node_modules/@aws-sdk/middleware-eventstream/package.json +1 -1
  27. package/node_modules/@aws-sdk/middleware-websocket/package.json +2 -2
  28. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
  29. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +1 -1
  30. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
  31. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
  32. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
  33. package/node_modules/@aws-sdk/nested-clients/package.json +3 -3
  34. package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +1 -1
  35. package/node_modules/@aws-sdk/token-providers/package.json +3 -3
  36. package/node_modules/@aws-sdk/xml-builder/package.json +1 -1
  37. package/node_modules/@deepseek-ai/cordis/README.md +6 -2
  38. package/node_modules/@deepseek-ai/cordis/lib/index.js +955 -909
  39. package/node_modules/@deepseek-ai/cordis/src/context.ts +1 -1
  40. package/node_modules/@deepseek-ai/cordis/src/events.ts +81 -62
  41. package/node_modules/@deepseek-ai/cordis/src/fiber.ts +95 -58
  42. package/node_modules/@deepseek-ai/cordis/src/logger.ts +10 -5
  43. package/node_modules/@deepseek-ai/cordis/src/reflect.ts +37 -19
  44. package/node_modules/@deepseek-ai/cordis/src/utils.ts +28 -21
  45. package/node_modules/@deepseek-ai/cordis-plugin-include/lib/index.js +2 -2
  46. package/node_modules/@deepseek-ai/cordis-plugin-include/src/index.ts +2 -6
  47. package/node_modules/@deepseek-ai/cordis-plugin-loader/README.md +4 -0
  48. package/node_modules/@deepseek-ai/cordis-plugin-loader/lib/index.js +40 -39
  49. package/node_modules/@deepseek-ai/cordis-plugin-loader/src/config/entry.ts +13 -13
  50. package/node_modules/@deepseek-ai/cordis-plugin-loader/src/config/group.ts +1 -3
  51. package/node_modules/@deepseek-ai/cordis-plugin-loader/src/config/isolate.ts +10 -7
  52. package/node_modules/@deepseek-ai/cordis-plugin-loader/src/index.ts +17 -20
  53. package/node_modules/@deepseek-ai/dsh/package.json +0 -1
  54. package/node_modules/@deepseek-ai/dsh-action-cards/lib/typert.host.js +1 -1
  55. package/node_modules/@deepseek-ai/dsh-agent-preset/skills/cordis-composition-reference/references/packages.md +5 -3
  56. package/node_modules/@deepseek-ai/dsh-agent-preset/skills/cordis-plugin-development/references/host-plugin.md +13 -0
  57. package/node_modules/@deepseek-ai/dsh-agent-preset-registry/lib/index.js +2 -2
  58. package/node_modules/@deepseek-ai/dsh-agent-preset-registry/lib/typert.host.js +1 -1
  59. package/node_modules/@deepseek-ai/dsh-agent-preset-registry/lib/types/mount.js +2 -2
  60. package/node_modules/@deepseek-ai/dsh-api-gateway/lib/client.browser.js +1 -1
  61. package/node_modules/@deepseek-ai/dsh-api-gateway/lib/client.node.js +1 -1
  62. package/node_modules/@deepseek-ai/dsh-api-gateway/lib/types/client/remote-events.js +1 -1
  63. package/node_modules/@deepseek-ai/dsh-api-remotes/lib/client.js +7464 -2004
  64. package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/client.js +77 -92
  65. package/node_modules/@deepseek-ai/dsh-api-session-controller/lib/typert.host.js +47 -3
  66. package/node_modules/@deepseek-ai/dsh-api-terminal-controller/lib/typert.host.js +1 -1
  67. package/node_modules/@deepseek-ai/dsh-app-boot/lib/index.js +8 -19
  68. package/node_modules/@deepseek-ai/dsh-base/cordis.patch.yml +3 -0
  69. package/node_modules/@deepseek-ai/dsh-client-file-upload/lib/typert.host.js +1 -1
  70. package/node_modules/@deepseek-ai/dsh-client-modules/README.i18n.yaml +2 -2
  71. package/node_modules/@deepseek-ai/dsh-client-modules/README.md +3 -1
  72. package/node_modules/@deepseek-ai/dsh-client-modules/README.zh.md +3 -1
  73. package/node_modules/@deepseek-ai/dsh-client-modules/lib/client.js +1 -1
  74. package/node_modules/@deepseek-ai/dsh-client-modules/lib/index.js +37 -15
  75. package/node_modules/@deepseek-ai/dsh-client-ui-attachment/README.i18n.yaml +4 -4
  76. package/node_modules/@deepseek-ai/dsh-client-ui-attachment/README.md +3 -1
  77. package/node_modules/@deepseek-ai/dsh-client-ui-attachment/README.zh.md +3 -1
  78. package/node_modules/@deepseek-ai/dsh-client-ui-attachment/lib/client.js +19 -6
  79. package/node_modules/@deepseek-ai/dsh-client-ui-attachment/package.json +4 -2
  80. package/node_modules/@deepseek-ai/dsh-client-ui-chat/README.i18n.yaml +10 -10
  81. package/node_modules/@deepseek-ai/dsh-client-ui-chat/README.md +8 -2
  82. package/node_modules/@deepseek-ai/dsh-client-ui-chat/README.zh.md +8 -2
  83. package/node_modules/@deepseek-ai/dsh-client-ui-chat/lib/client.js +146 -30
  84. package/node_modules/@deepseek-ai/dsh-client-ui-chat/package.json +4 -2
  85. package/node_modules/@deepseek-ai/dsh-client-ui-commands/README.i18n.yaml +2 -2
  86. package/node_modules/@deepseek-ai/dsh-client-ui-commands/README.md +1 -1
  87. package/node_modules/@deepseek-ai/dsh-client-ui-commands/README.zh.md +1 -1
  88. package/node_modules/@deepseek-ai/dsh-client-ui-commands/lib/client.js +295 -274
  89. package/node_modules/@deepseek-ai/dsh-client-ui-context-menu/README.i18n.yaml +40 -0
  90. package/node_modules/@deepseek-ai/dsh-client-ui-context-menu/README.md +100 -0
  91. package/node_modules/@deepseek-ai/dsh-client-ui-context-menu/README.zh.md +100 -0
  92. package/node_modules/@deepseek-ai/dsh-client-ui-context-menu/lib/client.js +1445 -0
  93. package/node_modules/@deepseek-ai/dsh-client-ui-context-menu/lib/index.js +6 -0
  94. package/node_modules/@deepseek-ai/dsh-client-ui-context-menu/locale/de.json +5 -0
  95. package/node_modules/@deepseek-ai/dsh-client-ui-context-menu/locale/en.json +5 -0
  96. package/node_modules/@deepseek-ai/dsh-client-ui-context-menu/locale/es.json +5 -0
  97. package/node_modules/@deepseek-ai/dsh-client-ui-context-menu/locale/fr.json +5 -0
  98. package/node_modules/@deepseek-ai/dsh-client-ui-context-menu/locale/ja.json +5 -0
  99. package/node_modules/@deepseek-ai/dsh-client-ui-context-menu/locale/pt.json +5 -0
  100. package/node_modules/@deepseek-ai/dsh-client-ui-context-menu/locale/ru.json +5 -0
  101. package/node_modules/@deepseek-ai/dsh-client-ui-context-menu/locale/zh.json +5 -0
  102. package/node_modules/@deepseek-ai/dsh-client-ui-context-menu/package.json +61 -0
  103. package/node_modules/@deepseek-ai/dsh-client-ui-conversation/README.i18n.yaml +4 -4
  104. package/node_modules/@deepseek-ai/dsh-client-ui-conversation/README.md +4 -0
  105. package/node_modules/@deepseek-ai/dsh-client-ui-conversation/README.zh.md +4 -0
  106. package/node_modules/@deepseek-ai/dsh-client-ui-conversation/lib/client.js +119 -55
  107. package/node_modules/@deepseek-ai/dsh-client-ui-conversation/package.json +4 -2
  108. package/node_modules/@deepseek-ai/dsh-client-ui-deliverables/README.i18n.yaml +2 -2
  109. package/node_modules/@deepseek-ai/dsh-client-ui-deliverables/README.md +2 -0
  110. package/node_modules/@deepseek-ai/dsh-client-ui-deliverables/README.zh.md +2 -0
  111. package/node_modules/@deepseek-ai/dsh-client-ui-deliverables/lib/client.js +19 -7
  112. package/node_modules/@deepseek-ai/dsh-client-ui-deliverables/package.json +4 -2
  113. package/node_modules/@deepseek-ai/dsh-client-ui-file-actions/README.i18n.yaml +40 -0
  114. package/node_modules/@deepseek-ai/dsh-client-ui-file-actions/README.md +92 -0
  115. package/node_modules/@deepseek-ai/dsh-client-ui-file-actions/README.zh.md +92 -0
  116. package/node_modules/@deepseek-ai/dsh-client-ui-file-actions/lib/client.js +1875 -0
  117. package/node_modules/@deepseek-ai/dsh-client-ui-file-actions/lib/index.js +6 -0
  118. package/node_modules/@deepseek-ai/dsh-client-ui-file-actions/locale/de.json +5 -0
  119. package/node_modules/@deepseek-ai/dsh-client-ui-file-actions/locale/en.json +5 -0
  120. package/node_modules/@deepseek-ai/dsh-client-ui-file-actions/locale/es.json +5 -0
  121. package/node_modules/@deepseek-ai/dsh-client-ui-file-actions/locale/fr.json +5 -0
  122. package/node_modules/@deepseek-ai/dsh-client-ui-file-actions/locale/ja.json +5 -0
  123. package/node_modules/@deepseek-ai/dsh-client-ui-file-actions/locale/pt.json +5 -0
  124. package/node_modules/@deepseek-ai/dsh-client-ui-file-actions/locale/ru.json +5 -0
  125. package/node_modules/@deepseek-ai/dsh-client-ui-file-actions/locale/zh.json +5 -0
  126. package/node_modules/@deepseek-ai/dsh-client-ui-file-actions/package.json +65 -0
  127. package/node_modules/@deepseek-ai/dsh-client-ui-layout/README.i18n.yaml +6 -6
  128. package/node_modules/@deepseek-ai/dsh-client-ui-layout/README.md +9 -3
  129. package/node_modules/@deepseek-ai/dsh-client-ui-layout/README.zh.md +9 -3
  130. package/node_modules/@deepseek-ai/dsh-client-ui-layout/lib/client.js +91 -26
  131. package/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/README.i18n.yaml +2 -2
  132. package/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/README.md +8 -0
  133. package/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/README.zh.md +8 -0
  134. package/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/lib/client.js +431 -2
  135. package/node_modules/@deepseek-ai/dsh-client-ui-open-in-app/package.json +13 -2
  136. package/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/README.i18n.yaml +8 -8
  137. package/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/README.md +6 -3
  138. package/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/README.zh.md +6 -3
  139. package/node_modules/@deepseek-ai/dsh-client-ui-plugin-manager/lib/client.js +111 -48
  140. package/node_modules/@deepseek-ai/dsh-client-ui-plugin-market/README.i18n.yaml +2 -2
  141. package/node_modules/@deepseek-ai/dsh-client-ui-plugin-market/README.md +1 -1
  142. package/node_modules/@deepseek-ai/dsh-client-ui-plugin-market/README.zh.md +1 -1
  143. package/node_modules/@deepseek-ai/dsh-client-ui-plugin-market/lib/client.js +2 -1
  144. package/node_modules/@deepseek-ai/dsh-client-ui-reference/README.i18n.yaml +2 -2
  145. package/node_modules/@deepseek-ai/dsh-client-ui-reference/README.md +2 -0
  146. package/node_modules/@deepseek-ai/dsh-client-ui-reference/README.zh.md +2 -0
  147. package/node_modules/@deepseek-ai/dsh-client-ui-reference/lib/client.js +28 -5
  148. package/node_modules/@deepseek-ai/dsh-client-ui-reference/package.json +4 -2
  149. package/node_modules/@deepseek-ai/dsh-client-ui-schedule/README.i18n.yaml +19 -19
  150. package/node_modules/@deepseek-ai/dsh-client-ui-schedule/README.md +25 -39
  151. package/node_modules/@deepseek-ai/dsh-client-ui-schedule/README.zh.md +23 -37
  152. package/node_modules/@deepseek-ai/dsh-client-ui-schedule/lib/client.js +10359 -3743
  153. package/node_modules/@deepseek-ai/dsh-client-ui-schedule/package.json +1 -0
  154. package/node_modules/@deepseek-ai/dsh-client-ui-settings-models/README.i18n.yaml +2 -2
  155. package/node_modules/@deepseek-ai/dsh-client-ui-settings-models/README.md +1 -1
  156. package/node_modules/@deepseek-ai/dsh-client-ui-settings-models/README.zh.md +1 -1
  157. package/node_modules/@deepseek-ai/dsh-client-ui-settings-models/lib/client.js +76 -58
  158. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/README.i18n.yaml +6 -6
  159. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/README.md +5 -1
  160. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/README.zh.md +5 -1
  161. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/lib/client.js +46 -18
  162. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/README.i18n.yaml +8 -8
  163. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/README.md +7 -5
  164. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/README.zh.md +7 -5
  165. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/lib/client.js +349 -251
  166. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-documentpreview/package.json +5 -2
  167. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-files/README.i18n.yaml +20 -14
  168. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-files/README.md +44 -11
  169. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-files/README.zh.md +44 -11
  170. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-files/lib/client.js +1571 -472
  171. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-files/package.json +5 -3
  172. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-right/README.i18n.yaml +12 -12
  173. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-right/README.md +15 -7
  174. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-right/README.zh.md +15 -7
  175. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-right/lib/client.js +435 -52
  176. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar-right/package.json +4 -2
  177. package/node_modules/@deepseek-ai/dsh-client-ui-subagent/lib/client.js +8 -0
  178. package/node_modules/@deepseek-ai/dsh-client-ui-theme/README.i18n.yaml +2 -2
  179. package/node_modules/@deepseek-ai/dsh-client-ui-theme/README.md +1 -1
  180. package/node_modules/@deepseek-ai/dsh-client-ui-theme/README.zh.md +1 -1
  181. package/node_modules/@deepseek-ai/dsh-client-ui-theme/lib/client.js +1 -1
  182. package/node_modules/@deepseek-ai/dsh-client-ui-tool/README.i18n.yaml +4 -4
  183. package/node_modules/@deepseek-ai/dsh-client-ui-tool/README.md +5 -1
  184. package/node_modules/@deepseek-ai/dsh-client-ui-tool/README.zh.md +5 -1
  185. package/node_modules/@deepseek-ai/dsh-client-ui-tool/lib/client.js +195 -59
  186. package/node_modules/@deepseek-ai/dsh-client-ui-tool/package.json +5 -2
  187. package/node_modules/@deepseek-ai/dsh-client-ui-trajectory/README.i18n.yaml +4 -4
  188. package/node_modules/@deepseek-ai/dsh-client-ui-trajectory/README.md +6 -2
  189. package/node_modules/@deepseek-ai/dsh-client-ui-trajectory/README.zh.md +6 -2
  190. package/node_modules/@deepseek-ai/dsh-client-ui-trajectory/lib/client.js +127 -27
  191. package/node_modules/@deepseek-ai/dsh-client-ui-workspace/README.i18n.yaml +15 -15
  192. package/node_modules/@deepseek-ai/dsh-client-ui-workspace/README.md +16 -8
  193. package/node_modules/@deepseek-ai/dsh-client-ui-workspace/README.zh.md +17 -8
  194. package/node_modules/@deepseek-ai/dsh-client-ui-workspace/lib/client.js +523 -480
  195. package/node_modules/@deepseek-ai/dsh-client-ui-workspace/package.json +4 -2
  196. package/node_modules/@deepseek-ai/dsh-commands/README.i18n.yaml +4 -4
  197. package/node_modules/@deepseek-ai/dsh-commands/README.md +3 -0
  198. package/node_modules/@deepseek-ai/dsh-commands/README.zh.md +3 -0
  199. package/node_modules/@deepseek-ai/dsh-commands/lib/typert.host.js +1 -1
  200. package/node_modules/@deepseek-ai/dsh-commands/lib/types/builtin.js +39 -0
  201. package/node_modules/@deepseek-ai/dsh-commands/package.json +5 -1
  202. package/node_modules/@deepseek-ai/dsh-compaction-basic/README.i18n.yaml +4 -10
  203. package/node_modules/@deepseek-ai/dsh-compaction-basic/README.md +2 -0
  204. package/node_modules/@deepseek-ai/dsh-compaction-basic/README.zh.md +2 -0
  205. package/node_modules/@deepseek-ai/dsh-cordis-client-runner/lib/client.js +233 -56
  206. package/node_modules/@deepseek-ai/dsh-cordis-host-runner/lib/typert.host.js +2 -2
  207. package/node_modules/@deepseek-ai/dsh-deepseek-llm-api-extensions/README.i18n.yaml +2 -2
  208. package/node_modules/@deepseek-ai/dsh-deepseek-llm-api-extensions/README.md +2 -0
  209. package/node_modules/@deepseek-ai/dsh-deepseek-llm-api-extensions/README.zh.md +2 -0
  210. package/node_modules/@deepseek-ai/dsh-experimental-auto-review/README.i18n.yaml +16 -19
  211. package/node_modules/@deepseek-ai/dsh-experimental-auto-review/README.md +11 -22
  212. package/node_modules/@deepseek-ai/dsh-experimental-auto-review/README.zh.md +11 -22
  213. package/node_modules/@deepseek-ai/dsh-experimental-auto-review/lib/index.js +2 -0
  214. package/node_modules/@deepseek-ai/dsh-experimental-client-ui-cot-translation/lib/client.js +1 -1
  215. package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/README.i18n.yaml +12 -12
  216. package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/README.md +18 -10
  217. package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/README.zh.md +20 -12
  218. package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/lib/client.js +3338 -297
  219. package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/lib/index.js +159 -52
  220. package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/lib/typert.host.js +298 -18
  221. package/node_modules/@deepseek-ai/dsh-experimental-client-ui-forge/lib/typert.remote-client.js +267 -13
  222. package/node_modules/@deepseek-ai/dsh-experimental-forge/README.i18n.yaml +2 -2
  223. package/node_modules/@deepseek-ai/dsh-experimental-forge/README.md +5 -1
  224. package/node_modules/@deepseek-ai/dsh-experimental-forge/README.zh.md +5 -1
  225. package/node_modules/@deepseek-ai/dsh-experimental-forge/lib/index.js +48 -6
  226. package/node_modules/@deepseek-ai/dsh-experimental-forge-github/README.i18n.yaml +8 -8
  227. package/node_modules/@deepseek-ai/dsh-experimental-forge-github/README.md +9 -5
  228. package/node_modules/@deepseek-ai/dsh-experimental-forge-github/README.zh.md +9 -5
  229. package/node_modules/@deepseek-ai/dsh-experimental-forge-github/lib/index.js +301 -31
  230. package/node_modules/@deepseek-ai/dsh-experimental-forge-github/package.json +1 -0
  231. package/node_modules/@deepseek-ai/dsh-experimental-liveshare/lib/client.js +5 -58
  232. package/node_modules/@deepseek-ai/dsh-experimental-liveshare/lib/index.js +5 -2
  233. package/node_modules/@deepseek-ai/dsh-experimental-liveshare/package.json +1 -1
  234. package/node_modules/@deepseek-ai/dsh-experimental-session-inspector/lib/client.js +77 -92
  235. package/node_modules/@deepseek-ai/dsh-experimental-translator/lib/index.js +2 -2
  236. package/node_modules/@deepseek-ai/dsh-experimental-translator/lib/types/deepseek.js +2 -2
  237. package/node_modules/@deepseek-ai/dsh-fs/README.i18n.yaml +12 -12
  238. package/node_modules/@deepseek-ai/dsh-fs/README.md +15 -7
  239. package/node_modules/@deepseek-ai/dsh-fs/README.zh.md +15 -7
  240. package/node_modules/@deepseek-ai/dsh-fs/lib/index.js +21 -2
  241. package/node_modules/@deepseek-ai/dsh-fs/package.json +3 -0
  242. package/node_modules/@deepseek-ai/dsh-fs-local/README.i18n.yaml +4 -4
  243. package/node_modules/@deepseek-ai/dsh-fs-local/README.md +4 -2
  244. package/node_modules/@deepseek-ai/dsh-fs-local/README.zh.md +4 -2
  245. package/node_modules/@deepseek-ai/dsh-fs-local/lib/index.js +156 -30
  246. package/node_modules/@deepseek-ai/dsh-fs-local/package.json +2 -1
  247. package/node_modules/@deepseek-ai/dsh-fs-observation-policy/README.i18n.yaml +6 -6
  248. package/node_modules/@deepseek-ai/dsh-fs-observation-policy/README.md +4 -2
  249. package/node_modules/@deepseek-ai/dsh-fs-observation-policy/README.zh.md +4 -2
  250. package/node_modules/@deepseek-ai/dsh-fs-observation-policy/lib/index.js +12 -4
  251. package/node_modules/@deepseek-ai/dsh-fs-patch/LICENSE +235 -0
  252. package/node_modules/@deepseek-ai/dsh-fs-patch/README.i18n.yaml +40 -0
  253. package/node_modules/@deepseek-ai/dsh-fs-patch/README.md +112 -0
  254. package/node_modules/@deepseek-ai/dsh-fs-patch/README.zh.md +112 -0
  255. package/node_modules/@deepseek-ai/dsh-fs-patch/lib/index.js +275 -0
  256. package/node_modules/@deepseek-ai/dsh-fs-patch/package.json +35 -0
  257. package/node_modules/@deepseek-ai/dsh-fs-sandbox/README.i18n.yaml +6 -6
  258. package/node_modules/@deepseek-ai/dsh-fs-sandbox/README.md +4 -2
  259. package/node_modules/@deepseek-ai/dsh-fs-sandbox/README.zh.md +4 -2
  260. package/node_modules/@deepseek-ai/dsh-fs-sandbox/lib/index.js +24 -1
  261. package/node_modules/@deepseek-ai/dsh-goal/lib/typert.host.js +1 -1
  262. package/node_modules/@deepseek-ai/dsh-hmr/lib/index.js +4 -3
  263. package/node_modules/@deepseek-ai/dsh-llm/README.i18n.yaml +2 -2
  264. package/node_modules/@deepseek-ai/dsh-llm/README.md +2 -0
  265. package/node_modules/@deepseek-ai/dsh-llm/README.zh.md +2 -0
  266. package/node_modules/@deepseek-ai/dsh-llm/lib/typert.host.js +9 -1
  267. package/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/index.js +4 -3
  268. package/node_modules/@deepseek-ai/dsh-llm-pi-ai/README.i18n.yaml +5 -2
  269. package/node_modules/@deepseek-ai/dsh-llm-pi-ai/README.md +7 -0
  270. package/node_modules/@deepseek-ai/dsh-llm-pi-ai/README.zh.md +7 -0
  271. package/node_modules/@deepseek-ai/dsh-llm-pi-ai/lib/index.js +27 -11
  272. package/node_modules/@deepseek-ai/dsh-official-bundles/README.i18n.yaml +2 -2
  273. package/node_modules/@deepseek-ai/dsh-official-bundles/README.md +1 -1
  274. package/node_modules/@deepseek-ai/dsh-official-bundles/README.zh.md +1 -1
  275. package/node_modules/@deepseek-ai/dsh-official-bundles/lib/index.js +86 -52
  276. package/node_modules/@deepseek-ai/dsh-permission-presets/lib/typert.host.js +1 -1
  277. package/node_modules/@deepseek-ai/dsh-plugin-manager/README.i18n.yaml +2 -2
  278. package/node_modules/@deepseek-ai/dsh-plugin-manager/README.md +4 -4
  279. package/node_modules/@deepseek-ai/dsh-plugin-manager/README.zh.md +4 -4
  280. package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/index.js +32 -12
  281. package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/typert.host.js +31 -31
  282. package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/typert.remote-client.js +27 -27
  283. package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/github-connection.js +13 -3
  284. package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/index.js +14 -2
  285. package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/install-spec.js +1 -1
  286. package/node_modules/@deepseek-ai/dsh-plugin-manager/lib/types/operations.js +2 -0
  287. package/node_modules/@deepseek-ai/dsh-plugin-recommendations/lib/typert.host.js +1 -1
  288. package/node_modules/@deepseek-ai/dsh-schedule/README.i18n.yaml +72 -39
  289. package/node_modules/@deepseek-ai/dsh-schedule/README.md +180 -56
  290. package/node_modules/@deepseek-ai/dsh-schedule/README.zh.md +185 -61
  291. package/node_modules/@deepseek-ai/dsh-schedule/lib/index.js +1270 -992
  292. package/node_modules/@deepseek-ai/dsh-schedule/lib/typert.host.js +1842 -274
  293. package/node_modules/@deepseek-ai/dsh-schedule/lib/typert.remote-client.js +1712 -194
  294. package/node_modules/@deepseek-ai/dsh-schedule/lib/types/delivery-history.js +7 -20
  295. package/node_modules/@deepseek-ai/dsh-schedule/lib/types/domain.js +199 -655
  296. package/node_modules/@deepseek-ai/dsh-schedule/lib/types/index.js +452 -204
  297. package/node_modules/@deepseek-ai/dsh-schedule/lib/types/runtime.js +389 -70
  298. package/node_modules/@deepseek-ai/dsh-schedule/lib/types/storage.js +85 -16
  299. package/node_modules/@deepseek-ai/dsh-schedule/lib/types/types.js +1 -1
  300. package/node_modules/@deepseek-ai/dsh-schedule/lib/types/update.js +72 -144
  301. package/node_modules/@deepseek-ai/dsh-schedule/package.json +5 -2
  302. package/node_modules/@deepseek-ai/dsh-sdk-app/README.i18n.yaml +12 -12
  303. package/node_modules/@deepseek-ai/dsh-sdk-app/README.md +7 -4
  304. package/node_modules/@deepseek-ai/dsh-sdk-app/README.zh.md +7 -4
  305. package/node_modules/@deepseek-ai/dsh-sdk-app/cordis.patch.yml +3 -0
  306. package/node_modules/@deepseek-ai/dsh-sdk-jsonrpc-server/README.i18n.yaml +52 -4
  307. package/node_modules/@deepseek-ai/dsh-sdk-jsonrpc-server/README.md +77 -1
  308. package/node_modules/@deepseek-ai/dsh-sdk-jsonrpc-server/README.zh.md +77 -1
  309. package/node_modules/@deepseek-ai/dsh-sdk-jsonrpc-server/lib/index.js +306 -2
  310. package/node_modules/@deepseek-ai/dsh-sdk-jsonrpc-server/package.json +15 -0
  311. package/node_modules/@deepseek-ai/dsh-sdk-protocol/README.i18n.yaml +4 -4
  312. package/node_modules/@deepseek-ai/dsh-sdk-protocol/README.md +10 -2
  313. package/node_modules/@deepseek-ai/dsh-sdk-protocol/README.zh.md +10 -2
  314. package/node_modules/@deepseek-ai/dsh-sdk-protocol/package.json +2 -0
  315. package/node_modules/@deepseek-ai/dsh-session-log-deepseek/README.i18n.yaml +9 -6
  316. package/node_modules/@deepseek-ai/dsh-session-log-deepseek/README.md +20 -1
  317. package/node_modules/@deepseek-ai/dsh-session-log-deepseek/README.zh.md +20 -1
  318. package/node_modules/@deepseek-ai/dsh-session-log-deepseek/lib/index.js +91 -57
  319. package/node_modules/@deepseek-ai/dsh-session-log-deepseek/lib/types/index.js +100 -66
  320. package/node_modules/@deepseek-ai/dsh-session-persistence-jsonl/lib/worker.cjs +947 -917
  321. package/node_modules/@deepseek-ai/dsh-session-reference/lib/typert.host.js +1 -1
  322. package/node_modules/@deepseek-ai/dsh-session-title-llm/README.i18n.yaml +2 -2
  323. package/node_modules/@deepseek-ai/dsh-session-title-llm/README.md +1 -1
  324. package/node_modules/@deepseek-ai/dsh-session-title-llm/README.zh.md +1 -1
  325. package/node_modules/@deepseek-ai/dsh-settings/lib/index.js +2 -2
  326. package/node_modules/@deepseek-ai/dsh-settings/lib/types/index.js +2 -2
  327. package/node_modules/@deepseek-ai/dsh-subagent/lib/typert.host.js +1 -1
  328. package/node_modules/@deepseek-ai/dsh-system-prompt/lib/index.js +2 -0
  329. package/node_modules/@deepseek-ai/dsh-tool-cordis/lib/types/api-catalog.js +260 -92
  330. package/node_modules/@deepseek-ai/dsh-tool-fs/README.i18n.yaml +38 -20
  331. package/node_modules/@deepseek-ai/dsh-tool-fs/README.md +63 -5
  332. package/node_modules/@deepseek-ai/dsh-tool-fs/README.zh.md +63 -5
  333. package/node_modules/@deepseek-ai/dsh-tool-fs/lib/index.js +784 -27
  334. package/node_modules/@deepseek-ai/dsh-tool-fs/package.json +4 -1
  335. package/node_modules/@deepseek-ai/dsh-tool-schedule/README.i18n.yaml +50 -32
  336. package/node_modules/@deepseek-ai/dsh-tool-schedule/README.md +47 -20
  337. package/node_modules/@deepseek-ai/dsh-tool-schedule/README.zh.md +47 -20
  338. package/node_modules/@deepseek-ai/dsh-tool-schedule/lib/index.js +477 -445
  339. package/node_modules/@deepseek-ai/dsh-tool-schedule/package.json +7 -2
  340. package/node_modules/@deepseek-ai/dsh-tui-app/README.i18n.yaml +2 -2
  341. package/node_modules/@deepseek-ai/dsh-tui-app/README.md +1 -1
  342. package/node_modules/@deepseek-ai/dsh-tui-app/README.zh.md +1 -1
  343. package/node_modules/@deepseek-ai/dsh-tui-app/lib/index.js +24 -8
  344. package/node_modules/@deepseek-ai/dsh-user-questions/lib/typert.host.js +1 -1
  345. package/node_modules/@deepseek-ai/dsh-util-time/README.i18n.yaml +10 -10
  346. package/node_modules/@deepseek-ai/dsh-util-time/README.md +11 -7
  347. package/node_modules/@deepseek-ai/dsh-util-time/README.zh.md +11 -7
  348. package/node_modules/@deepseek-ai/dsh-util-time/lib/index.js +1020 -3
  349. package/node_modules/@deepseek-ai/dsh-util-time/package.json +4 -2
  350. package/node_modules/@deepseek-ai/dsh-util-values/README.i18n.yaml +2 -2
  351. package/node_modules/@deepseek-ai/dsh-util-values/README.md +1 -1
  352. package/node_modules/@deepseek-ai/dsh-util-values/README.zh.md +1 -1
  353. package/node_modules/@deepseek-ai/dsh-util-values/lib/index.js +77 -92
  354. package/node_modules/@deepseek-ai/dsh-web-app/cordis.patch.yml +5 -1
  355. package/node_modules/@deepseek-ai/dsh-web-app/package.json +3 -1
  356. package/node_modules/@deepseek-ai/dsh-web-app/presets/cordis.patch.yml +3 -0
  357. package/node_modules/@deepseek-ai/dsh-web-app/presets/ptc.patch.yml +3 -0
  358. package/node_modules/@deepseek-ai/dsh-web-app/presets/standard.patch.yml +3 -0
  359. package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/index-BCbHmUSs.js +197 -0
  360. package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/index-BUDGJY4R.css +1 -0
  361. package/node_modules/@deepseek-ai/dsh-web-frontend/dist/index.html +2 -2
  362. package/node_modules/@deepseek-ai/dsh-workflow-ptc/lib/index.js +1 -1
  363. package/node_modules/@deepseek-ai/dsh-workspace-changes/README.i18n.yaml +4 -4
  364. package/node_modules/@deepseek-ai/dsh-workspace-changes/README.md +3 -1
  365. package/node_modules/@deepseek-ai/dsh-workspace-changes/README.zh.md +4 -2
  366. package/node_modules/@deepseek-ai/dsh-workspace-changes/lib/index.js +5 -0
  367. package/node_modules/@deepseek-ai/dsh-workspace-changes/lib/types/index.js +5 -0
  368. package/node_modules/@deepseek-ai/dsh-workspace-changes/package.json +4 -1
  369. package/node_modules/@opentelemetry/semantic-conventions/dist/experimental_attributes.cjs +16917 -0
  370. package/node_modules/@opentelemetry/semantic-conventions/dist/experimental_attributes.mjs +15193 -0
  371. package/node_modules/@opentelemetry/semantic-conventions/dist/experimental_events.cjs +325 -0
  372. package/node_modules/@opentelemetry/semantic-conventions/dist/experimental_events.mjs +295 -0
  373. package/node_modules/@opentelemetry/semantic-conventions/dist/experimental_metrics.cjs +4642 -0
  374. package/node_modules/@opentelemetry/semantic-conventions/dist/experimental_metrics.mjs +4155 -0
  375. package/node_modules/@opentelemetry/semantic-conventions/dist/index-incubating.cjs +2495 -0
  376. package/node_modules/@opentelemetry/semantic-conventions/dist/index-incubating.mjs +7 -0
  377. package/node_modules/@opentelemetry/semantic-conventions/dist/index.cjs +662 -0
  378. package/node_modules/@opentelemetry/semantic-conventions/dist/index.mjs +6 -0
  379. package/node_modules/@opentelemetry/semantic-conventions/dist/internal/utils.cjs +20 -0
  380. package/node_modules/@opentelemetry/semantic-conventions/dist/internal/utils.mjs +20 -0
  381. package/node_modules/@opentelemetry/semantic-conventions/dist/resource/SemanticResourceAttributes.cjs +1326 -0
  382. package/node_modules/@opentelemetry/semantic-conventions/dist/resource/SemanticResourceAttributes.mjs +1188 -0
  383. package/node_modules/@opentelemetry/semantic-conventions/dist/stable_attributes.cjs +1947 -0
  384. package/node_modules/@opentelemetry/semantic-conventions/dist/stable_attributes.mjs +1756 -0
  385. package/node_modules/@opentelemetry/semantic-conventions/dist/stable_events.cjs +9 -0
  386. package/node_modules/@opentelemetry/semantic-conventions/dist/stable_events.mjs +9 -0
  387. package/node_modules/@opentelemetry/semantic-conventions/dist/stable_metrics.cjs +362 -0
  388. package/node_modules/@opentelemetry/semantic-conventions/dist/stable_metrics.mjs +312 -0
  389. package/node_modules/@opentelemetry/semantic-conventions/dist/trace/SemanticAttributes.cjs +2508 -0
  390. package/node_modules/@opentelemetry/semantic-conventions/dist/trace/SemanticAttributes.mjs +2236 -0
  391. package/node_modules/@opentelemetry/semantic-conventions/package.json +22 -35
  392. package/node_modules/@smithy/core/dist-cjs/index.js +4 -2
  393. package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +32 -16
  394. package/node_modules/@smithy/core/dist-cjs/submodules/client/index.js +26 -13
  395. package/node_modules/@smithy/core/dist-cjs/submodules/config/index.browser.js +8 -4
  396. package/node_modules/@smithy/core/dist-cjs/submodules/config/index.js +16 -8
  397. package/node_modules/@smithy/core/dist-cjs/submodules/config/index.native.js +8 -4
  398. package/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.browser.js +2 -1
  399. package/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.js +10 -5
  400. package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.browser.js +18 -9
  401. package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js +18 -9
  402. package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +42 -24
  403. package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.browser.js +20 -10
  404. package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.js +24 -12
  405. package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.browser.js +13 -4
  406. package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js +7 -1
  407. package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.native.js +13 -4
  408. package/node_modules/@smithy/core/dist-cjs/submodules/transport/index.js +6 -3
  409. package/node_modules/@smithy/core/dist-es/legacy-root-exports/util-identity-and-auth/DefaultIdentityProviderConfig.js +2 -1
  410. package/node_modules/@smithy/core/dist-es/normalizeProvider.js +2 -1
  411. package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v1/CborShapeDeserializer.js +8 -4
  412. package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v1/CborShapeSerializer.js +6 -3
  413. package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v2/CborShapeDeserializer2.js +12 -6
  414. package/node_modules/@smithy/core/dist-es/submodules/cbor/codec-v2/CborShapeSerializer2.js +4 -2
  415. package/node_modules/@smithy/core/dist-es/submodules/cbor/parseCborBody.js +2 -1
  416. package/node_modules/@smithy/core/dist-es/submodules/client/middleware-stack/MiddlewareStack.js +10 -5
  417. package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/create-aggregated-client.js +2 -1
  418. package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/exceptions.js +4 -2
  419. package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/extensions/checksum.js +2 -1
  420. package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/get-value-from-text-node.js +2 -1
  421. package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/object-mapping.js +4 -2
  422. package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/serde-json.js +2 -1
  423. package/node_modules/@smithy/core/dist-es/submodules/config/shared-ini-file-loader/getHomeDir.js +8 -4
  424. package/node_modules/@smithy/core/dist-es/submodules/config/util-config-provider/booleanSelector.js +6 -3
  425. package/node_modules/@smithy/core/dist-es/submodules/config/util-config-provider/numberSelector.js +2 -1
  426. package/node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/adaptors/getEndpointUrlConfig.js +8 -4
  427. package/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/resolveEndpoint.js +2 -1
  428. package/node_modules/@smithy/core/dist-es/submodules/event-streams/EventStreamSerde.js +6 -3
  429. package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/HeaderMarshaller.js +2 -1
  430. package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/Int64.js +2 -1
  431. package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/SmithyMessageDecoderStream.js +2 -1
  432. package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-serde/utils.js +2 -1
  433. package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-serde-universal/getUnmarshalledStream.js +4 -2
  434. package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpBindingProtocol.js +8 -4
  435. package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js +4 -2
  436. package/node_modules/@smithy/core/dist-es/submodules/protocols/RpcProtocol.js +2 -1
  437. package/node_modules/@smithy/core/dist-es/submodules/protocols/json/codec-v1/JsonShapeDeserializer.js +7 -5
  438. package/node_modules/@smithy/core/dist-es/submodules/protocols/json/codec-v1/JsonShapeSerializer.js +7 -5
  439. package/node_modules/@smithy/core/dist-es/submodules/protocols/json/codec-v2/JsonShapeDeserializer2.js +7 -5
  440. package/node_modules/@smithy/core/dist-es/submodules/protocols/json/codec-v2/JsonShapeSerializer2.js +6 -3
  441. package/node_modules/@smithy/core/dist-es/submodules/protocols/protocol-http/extensions/httpExtensionConfiguration.js +3 -0
  442. package/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/configurations.js +4 -2
  443. package/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/parseRetryAfterHeader.js +2 -1
  444. package/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/retry-pre-sra-deprecated/StandardRetryStrategy.js +6 -3
  445. package/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/retryMiddleware.js +6 -3
  446. package/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/util.js +6 -3
  447. package/node_modules/@smithy/core/dist-es/submodules/serde/index.browser.js +1 -0
  448. package/node_modules/@smithy/core/dist-es/submodules/serde/index.js +1 -0
  449. package/node_modules/@smithy/core/dist-es/submodules/serde/index.native.js +1 -0
  450. package/node_modules/@smithy/core/dist-es/submodules/serde/parse-utils.js +2 -1
  451. package/node_modules/@smithy/core/dist-es/submodules/serde/util-body-length/calculateBodyLength.browser.js +6 -3
  452. package/node_modules/@smithy/core/dist-es/submodules/transport/httpResponse.js +2 -1
  453. package/node_modules/@smithy/core/dist-es/submodules/transport/normalizeProvider.js +2 -1
  454. package/node_modules/@smithy/core/dist-es/submodules/transport/toEndpointV1.js +2 -1
  455. package/node_modules/@smithy/core/package.json +1 -1
  456. package/node_modules/@smithy/node-http-handler/dist-cjs/index.js +19 -7
  457. package/node_modules/@smithy/node-http-handler/dist-es/get-transformed-headers.js +2 -1
  458. package/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +11 -6
  459. package/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +6 -0
  460. package/node_modules/@smithy/node-http-handler/package.json +2 -2
  461. package/node_modules/@smithy/signature-v4/dist-cjs/index.js +23 -11
  462. package/node_modules/@smithy/signature-v4/dist-es/HeaderFormatter.js +4 -2
  463. package/node_modules/@smithy/signature-v4/dist-es/SignatureV4Base.js +4 -2
  464. package/node_modules/@smithy/signature-v4/dist-es/getCanonicalHeaders.js +5 -1
  465. package/node_modules/@smithy/signature-v4/dist-es/getCanonicalQuery.js +2 -1
  466. package/node_modules/@smithy/signature-v4/dist-es/getPayloadHash.js +2 -1
  467. package/node_modules/@smithy/signature-v4/dist-es/headerUtil.js +6 -3
  468. package/node_modules/@smithy/signature-v4/dist-es/moveHeadersToQuery.js +2 -1
  469. package/node_modules/@smithy/signature-v4/dist-es/prepareRequest.js +2 -1
  470. package/node_modules/@smithy/signature-v4/package.json +2 -2
  471. package/node_modules/@types/node/README.md +1 -1
  472. package/node_modules/@types/node/package.json +2 -2
  473. package/node_modules/encodeurl/README.md +14 -0
  474. package/node_modules/encodeurl/index.js +5 -10
  475. package/node_modules/encodeurl/package.json +7 -3
  476. package/node_modules/hast-util-to-html/lib/handle/comment.js +6 -1
  477. package/node_modules/hast-util-to-html/lib/handle/doctype.js +1 -1
  478. package/node_modules/hast-util-to-html/lib/handle/element.js +33 -9
  479. package/node_modules/hast-util-to-html/lib/handle/index.js +1 -1
  480. package/node_modules/hast-util-to-html/lib/handle/raw.js +1 -1
  481. package/node_modules/hast-util-to-html/lib/handle/root.js +1 -1
  482. package/node_modules/hast-util-to-html/lib/handle/text.js +1 -1
  483. package/node_modules/hast-util-to-html/lib/index.js +9 -4
  484. package/node_modules/hast-util-to-html/lib/omission/closing.js +7 -5
  485. package/node_modules/hast-util-to-html/lib/omission/omission.js +0 -1
  486. package/node_modules/hast-util-to-html/lib/omission/opening.js +4 -2
  487. package/node_modules/hast-util-to-html/lib/omission/util/siblings.js +3 -0
  488. package/node_modules/hast-util-to-html/package.json +5 -23
  489. package/node_modules/hast-util-to-html/readme.md +3 -2
  490. package/node_modules/jose/dist/webapi/jwks/remote.js +1 -1
  491. package/node_modules/jose/package.json +1 -1
  492. package/node_modules/rrule/LICENCE +65 -0
  493. package/node_modules/rrule/README.md +837 -0
  494. package/node_modules/rrule/dist/es5/rrule.js +3803 -0
  495. package/node_modules/rrule/dist/es5/rrule.min.js +2 -0
  496. package/node_modules/rrule/dist/esm/cache.js +95 -0
  497. package/node_modules/rrule/dist/esm/callbackiterresult.js +24 -0
  498. package/node_modules/rrule/dist/esm/datetime.js +186 -0
  499. package/node_modules/rrule/dist/esm/dateutil.js +161 -0
  500. package/node_modules/rrule/dist/esm/datewithzone.js +36 -0
  501. package/node_modules/rrule/dist/esm/helpers.js +118 -0
  502. package/node_modules/rrule/dist/esm/index.js +22 -0
  503. package/node_modules/rrule/dist/esm/iter/index.js +138 -0
  504. package/node_modules/rrule/dist/esm/iter/poslist.js +42 -0
  505. package/node_modules/rrule/dist/esm/iterinfo/easter.js +21 -0
  506. package/node_modules/rrule/dist/esm/iterinfo/index.js +188 -0
  507. package/node_modules/rrule/dist/esm/iterinfo/monthinfo.js +51 -0
  508. package/node_modules/rrule/dist/esm/iterinfo/yearinfo.js +128 -0
  509. package/node_modules/rrule/dist/esm/iterresult.js +88 -0
  510. package/node_modules/rrule/dist/esm/iterset.js +63 -0
  511. package/node_modules/rrule/dist/esm/masks.js +30 -0
  512. package/node_modules/rrule/dist/esm/nlp/i18n.js +74 -0
  513. package/node_modules/rrule/dist/esm/nlp/index.js +122 -0
  514. package/node_modules/rrule/dist/esm/nlp/parsetext.js +391 -0
  515. package/node_modules/rrule/dist/esm/nlp/totext.js +395 -0
  516. package/node_modules/rrule/dist/esm/optionstostring.js +98 -0
  517. package/node_modules/rrule/dist/esm/parseoptions.js +201 -0
  518. package/node_modules/rrule/dist/esm/parsestring.js +128 -0
  519. package/node_modules/rrule/dist/esm/rrule.js +232 -0
  520. package/node_modules/rrule/dist/esm/rruleset.js +182 -0
  521. package/node_modules/rrule/dist/esm/rrulestr.js +188 -0
  522. package/node_modules/rrule/dist/esm/types.js +14 -0
  523. package/node_modules/rrule/dist/esm/weekday.js +45 -0
  524. package/node_modules/rrule/package.json +79 -0
  525. package/package.json +32 -31
  526. package/node_modules/@deepseek-ai/dsh-computer-use/README.i18n.yaml +0 -37
  527. package/node_modules/@deepseek-ai/dsh-computer-use/README.md +0 -90
  528. package/node_modules/@deepseek-ai/dsh-computer-use/README.zh.md +0 -90
  529. package/node_modules/@deepseek-ai/dsh-computer-use/lib/index.js +0 -35
  530. package/node_modules/@deepseek-ai/dsh-computer-use/lib/types/brand.js +0 -10
  531. package/node_modules/@deepseek-ai/dsh-computer-use/lib/types/index.js +0 -36
  532. package/node_modules/@deepseek-ai/dsh-computer-use/locale/de.json +0 -6
  533. package/node_modules/@deepseek-ai/dsh-computer-use/locale/en.json +0 -6
  534. package/node_modules/@deepseek-ai/dsh-computer-use/locale/es.json +0 -6
  535. package/node_modules/@deepseek-ai/dsh-computer-use/locale/fr.json +0 -6
  536. package/node_modules/@deepseek-ai/dsh-computer-use/locale/ja.json +0 -6
  537. package/node_modules/@deepseek-ai/dsh-computer-use/locale/pt.json +0 -6
  538. package/node_modules/@deepseek-ai/dsh-computer-use/locale/ru.json +0 -6
  539. package/node_modules/@deepseek-ai/dsh-computer-use/locale/zh.json +0 -6
  540. package/node_modules/@deepseek-ai/dsh-computer-use/package.json +0 -44
  541. package/node_modules/@deepseek-ai/dsh-cua/README.i18n.yaml +0 -49
  542. package/node_modules/@deepseek-ai/dsh-cua/README.md +0 -130
  543. package/node_modules/@deepseek-ai/dsh-cua/README.zh.md +0 -130
  544. package/node_modules/@deepseek-ai/dsh-cua/lib/api.js +0 -597
  545. package/node_modules/@deepseek-ai/dsh-cua/lib/bridge.js +0 -611
  546. package/node_modules/@deepseek-ai/dsh-cua/lib/client.js +0 -1758
  547. package/node_modules/@deepseek-ai/dsh-cua/lib/index.js +0 -1916
  548. package/node_modules/@deepseek-ai/dsh-cua/lib/native-client.js +0 -285
  549. package/node_modules/@deepseek-ai/dsh-cua/lib/protocol.js +0 -305
  550. package/node_modules/@deepseek-ai/dsh-cua/lib/remote-types.js +0 -1
  551. package/node_modules/@deepseek-ai/dsh-cua/lib/typert.host.js +0 -416
  552. package/node_modules/@deepseek-ai/dsh-cua/lib/typert.remote-client.js +0 -301
  553. package/node_modules/@deepseek-ai/dsh-cua/locale/de.json +0 -6
  554. package/node_modules/@deepseek-ai/dsh-cua/locale/en.json +0 -6
  555. package/node_modules/@deepseek-ai/dsh-cua/locale/es.json +0 -6
  556. package/node_modules/@deepseek-ai/dsh-cua/locale/fr.json +0 -6
  557. package/node_modules/@deepseek-ai/dsh-cua/locale/ja.json +0 -6
  558. package/node_modules/@deepseek-ai/dsh-cua/locale/pt.json +0 -6
  559. package/node_modules/@deepseek-ai/dsh-cua/locale/ru.json +0 -6
  560. package/node_modules/@deepseek-ai/dsh-cua/locale/zh.json +0 -6
  561. package/node_modules/@deepseek-ai/dsh-cua/package.json +0 -151
  562. package/node_modules/@deepseek-ai/dsh-cua-bundle/README.i18n.yaml +0 -46
  563. package/node_modules/@deepseek-ai/dsh-cua-bundle/README.md +0 -94
  564. package/node_modules/@deepseek-ai/dsh-cua-bundle/README.zh.md +0 -94
  565. package/node_modules/@deepseek-ai/dsh-cua-bundle/cordis.patch.yml +0 -10
  566. package/node_modules/@deepseek-ai/dsh-cua-bundle/docs/DETAIL.md +0 -1
  567. package/node_modules/@deepseek-ai/dsh-cua-bundle/docs/DETAIL.zh.md +0 -1
  568. package/node_modules/@deepseek-ai/dsh-cua-bundle/docs/preview.svg +0 -33
  569. package/node_modules/@deepseek-ai/dsh-cua-bundle/docs/preview.zh.svg +0 -33
  570. package/node_modules/@deepseek-ai/dsh-cua-bundle/icon.svg +0 -35
  571. package/node_modules/@deepseek-ai/dsh-cua-bundle/lib/index.js +0 -1
  572. package/node_modules/@deepseek-ai/dsh-cua-bundle/locale/de.json +0 -7
  573. package/node_modules/@deepseek-ai/dsh-cua-bundle/locale/en.json +0 -7
  574. package/node_modules/@deepseek-ai/dsh-cua-bundle/locale/es.json +0 -7
  575. package/node_modules/@deepseek-ai/dsh-cua-bundle/locale/fr.json +0 -7
  576. package/node_modules/@deepseek-ai/dsh-cua-bundle/locale/ja.json +0 -7
  577. package/node_modules/@deepseek-ai/dsh-cua-bundle/locale/pt.json +0 -7
  578. package/node_modules/@deepseek-ai/dsh-cua-bundle/locale/ru.json +0 -7
  579. package/node_modules/@deepseek-ai/dsh-cua-bundle/locale/zh.json +0 -7
  580. package/node_modules/@deepseek-ai/dsh-cua-bundle/package.json +0 -58
  581. package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/index--TtJvO-i.js +0 -197
  582. package/node_modules/@deepseek-ai/dsh-web-frontend/dist/assets/index-Jtzf36XE.css +0 -1
  583. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_attributes.js +0 -14991
  584. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_events.js +0 -298
  585. package/node_modules/@opentelemetry/semantic-conventions/build/esm/experimental_metrics.js +0 -4060
  586. package/node_modules/@opentelemetry/semantic-conventions/build/esm/index-incubating.js +0 -13
  587. package/node_modules/@opentelemetry/semantic-conventions/build/esm/index.js +0 -16
  588. package/node_modules/@opentelemetry/semantic-conventions/build/esm/internal/utils.js +0 -23
  589. package/node_modules/@opentelemetry/semantic-conventions/build/esm/resource/SemanticResourceAttributes.js +0 -1250
  590. package/node_modules/@opentelemetry/semantic-conventions/build/esm/resource/index.js +0 -10
  591. package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_attributes.js +0 -1733
  592. package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_events.js +0 -12
  593. package/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_metrics.js +0 -315
  594. package/node_modules/@opentelemetry/semantic-conventions/build/esm/trace/SemanticAttributes.js +0 -2360
  595. package/node_modules/@opentelemetry/semantic-conventions/build/esm/trace/index.js +0 -10
  596. package/node_modules/@opentelemetry/semantic-conventions/build/esm/version.js +0 -7
  597. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_attributes.js +0 -14991
  598. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_events.js +0 -298
  599. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/experimental_metrics.js +0 -4060
  600. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/index-incubating.js +0 -13
  601. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/index.js +0 -16
  602. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/internal/utils.js +0 -23
  603. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/resource/SemanticResourceAttributes.js +0 -1250
  604. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/resource/index.js +0 -10
  605. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_attributes.js +0 -1733
  606. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_events.js +0 -12
  607. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/stable_metrics.js +0 -315
  608. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/trace/SemanticAttributes.js +0 -2360
  609. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/trace/index.js +0 -10
  610. package/node_modules/@opentelemetry/semantic-conventions/build/esnext/version.js +0 -7
  611. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_attributes.js +0 -15049
  612. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_events.js +0 -301
  613. package/node_modules/@opentelemetry/semantic-conventions/build/src/experimental_metrics.js +0 -4072
  614. package/node_modules/@opentelemetry/semantic-conventions/build/src/index-incubating.js +0 -29
  615. package/node_modules/@opentelemetry/semantic-conventions/build/src/index.js +0 -32
  616. package/node_modules/@opentelemetry/semantic-conventions/build/src/internal/utils.js +0 -27
  617. package/node_modules/@opentelemetry/semantic-conventions/build/src/resource/SemanticResourceAttributes.js +0 -1255
  618. package/node_modules/@opentelemetry/semantic-conventions/build/src/resource/index.js +0 -26
  619. package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_attributes.js +0 -1759
  620. package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_events.js +0 -15
  621. package/node_modules/@opentelemetry/semantic-conventions/build/src/stable_metrics.js +0 -319
  622. package/node_modules/@opentelemetry/semantic-conventions/build/src/trace/SemanticAttributes.js +0 -2368
  623. package/node_modules/@opentelemetry/semantic-conventions/build/src/trace/index.js +0 -26
  624. package/node_modules/@opentelemetry/semantic-conventions/build/src/version.js +0 -10
  625. /package/node_modules/@smithy/core/dist-es/submodules/{protocols → serde}/writeKey.js +0 -0
@@ -680,110 +680,95 @@ function enumerableStringKeys(value) {
680
680
  function walkJsonValue(value, detach) {
681
681
  const ancestors = /* @__PURE__ */ new Set();
682
682
  let root;
683
- const assign = (destination, item) => {
684
- if (destination === void 0) return;
685
- if (destination.kind === "root") root = item;
686
- else if (destination.kind === "array") destination.target[destination.index] = item;
687
- else Object.defineProperty(destination.target, destination.key, {
683
+ let parent;
684
+ const assign = (item) => {
685
+ if (parent === void 0) {
686
+ if (detach) root = item;
687
+ } else if (parent.kind === "array") {
688
+ if (parent.target !== void 0) parent.target[parent.key] = item;
689
+ } else if (parent.target !== void 0) Object.defineProperty(parent.target, parent.key, {
688
690
  value: item,
689
691
  enumerable: true,
690
692
  configurable: true,
691
693
  writable: true
692
694
  });
693
695
  };
694
- const tasks = [{
695
- kind: "visit",
696
- value,
697
- ...detach ? { destination: { kind: "root" } } : {}
698
- }];
699
- for (let task = tasks.pop(); task !== void 0; task = tasks.pop()) {
700
- if (task.kind === "leave") {
701
- ancestors.delete(task.source);
702
- continue;
703
- }
704
- if (task.kind === "array-item") {
705
- if (!Object.prototype.hasOwnProperty.call(task.source, task.index)) return void 0;
706
- tasks.push({
707
- kind: "visit",
708
- value: task.source[task.index],
709
- ...task.target === void 0 ? {} : { destination: {
696
+ const frames = [];
697
+ let current = value;
698
+ for (;;) {
699
+ if (current === null) assign(null);
700
+ else if (typeof current === "boolean" || typeof current === "string") assign(current);
701
+ else if (typeof current === "number") {
702
+ if (!Number.isFinite(current) || Object.is(current, -0)) return void 0;
703
+ assign(current);
704
+ } else {
705
+ if (typeof current !== "object") return void 0;
706
+ if (ancestors.has(current)) return void 0;
707
+ if (Array.isArray(current)) {
708
+ if (!hasPlainArrayPrototype(current)) return void 0;
709
+ const length = current.length;
710
+ if (Reflect.ownKeys(current).length !== length + 1) return void 0;
711
+ const target = detach ? [] : void 0;
712
+ if (target !== void 0) assign(target);
713
+ let indices;
714
+ if (!Number.isInteger(length)) {
715
+ indices = [];
716
+ for (let index = length - 1; index >= 0; index--) indices.push(index);
717
+ }
718
+ frames.push({
710
719
  kind: "array",
711
- target: task.target,
712
- index: task.index
713
- } }
714
- });
715
- continue;
716
- }
717
- if (task.kind === "object-property") {
718
- tasks.push({
719
- kind: "visit",
720
- value: task.source[task.key],
721
- ...task.target === void 0 ? {} : { destination: {
720
+ source: current,
721
+ length: indices?.length ?? length,
722
+ index: 0,
723
+ key: 0,
724
+ indices,
725
+ target
726
+ });
727
+ } else {
728
+ if (!hasPlainObjectPrototype(current)) return void 0;
729
+ const keys = enumerableStringKeys(current);
730
+ if (keys === void 0) return void 0;
731
+ const target = detach ? {} : void 0;
732
+ if (target !== void 0) assign(target);
733
+ frames.push({
722
734
  kind: "object",
723
- target: task.target,
724
- key: task.key
725
- } }
726
- });
727
- continue;
728
- }
729
- const current = task.value;
730
- if (current === null) {
731
- assign(task.destination, null);
732
- continue;
733
- }
734
- if (typeof current === "boolean" || typeof current === "string") {
735
- assign(task.destination, current);
736
- continue;
737
- }
738
- if (typeof current === "number") {
739
- if (!Number.isFinite(current) || Object.is(current, -0)) return void 0;
740
- assign(task.destination, current);
741
- continue;
742
- }
743
- if (typeof current !== "object") return void 0;
744
- if (ancestors.has(current)) return void 0;
745
- if (Array.isArray(current)) {
746
- if (!hasPlainArrayPrototype(current)) return void 0;
747
- const length = current.length;
748
- if (Reflect.ownKeys(current).length !== length + 1) return void 0;
749
- const target = detach ? [] : void 0;
750
- if (target !== void 0) assign(task.destination, target);
735
+ source: current,
736
+ keys,
737
+ index: 0,
738
+ key: "",
739
+ target
740
+ });
741
+ }
751
742
  ancestors.add(current);
752
- tasks.push({
753
- kind: "leave",
754
- source: current
755
- });
756
- for (let index = length - 1; index >= 0; index--) tasks.push({
757
- kind: "array-item",
758
- source: current,
759
- index,
760
- ...target === void 0 ? {} : { target }
761
- });
762
- continue;
763
743
  }
764
- if (!hasPlainObjectPrototype(current)) return void 0;
765
- const keys = enumerableStringKeys(current);
766
- if (keys === void 0) return void 0;
767
- const target = detach ? {} : void 0;
768
- if (target !== void 0) assign(task.destination, target);
769
- ancestors.add(current);
770
- tasks.push({
771
- kind: "leave",
772
- source: current
773
- });
774
- for (let index = keys.length - 1; index >= 0; index--) {
775
- const key = keys[index];
776
- /* v8 ignore next -- the loop is bounded by the captured key count. */
777
- if (key === void 0) return void 0;
778
- tasks.push({
779
- kind: "object-property",
780
- source: current,
781
- key,
782
- ...target === void 0 ? {} : { target }
783
- });
744
+ for (;;) {
745
+ const frame = frames.at(-1);
746
+ if (frame === void 0) return detach ? root : true;
747
+ const length = frame.kind === "array" ? frame.length : frame.keys.length;
748
+ if (frame.index >= length) {
749
+ ancestors.delete(frame.source);
750
+ frames.pop();
751
+ continue;
752
+ }
753
+ const index = frame.index++;
754
+ parent = frame;
755
+ if (frame.kind === "array") {
756
+ const key = frame.indices === void 0 ? index : frame.indices[frame.indices.length - index - 1];
757
+ /* v8 ignore next -- the loop is bounded by the captured index count. */
758
+ if (key === void 0) return void 0;
759
+ if (!Object.prototype.hasOwnProperty.call(frame.source, key)) return void 0;
760
+ frame.key = key;
761
+ current = frame.source[key];
762
+ } else {
763
+ const key = frame.keys[index];
764
+ /* v8 ignore next -- the loop is bounded by the captured key count. */
765
+ if (key === void 0) return void 0;
766
+ frame.key = key;
767
+ current = frame.source[key];
768
+ }
769
+ break;
784
770
  }
785
771
  }
786
- return detach ? root : true;
787
772
  }
788
773
  /**
789
774
  * Validate and detach lossless JSON in one read per property.
@@ -1275,6 +1260,7 @@ var DisposableList = class {
1275
1260
  /** Shared symbols used to avoid public property-name collisions. */
1276
1261
  const symbols = {
1277
1262
  shadow: Symbol.for("cordis.shadow"),
1263
+ caller: Symbol.for("cordis.caller"),
1278
1264
  receiver: Symbol.for("cordis.receiver"),
1279
1265
  original: Symbol.for("cordis.original"),
1280
1266
  metadata: Symbol.for("cordis.metadata"),
@@ -1349,11 +1335,12 @@ function withProp(target, prop, value) {
1349
1335
  writable: false
1350
1336
  }));
1351
1337
  }
1352
- function createShadow(ctx, target, property, receiver) {
1338
+ function createShadow(useSite, target, property, receiver) {
1353
1339
  if (!property) return receiver;
1354
- const origin = Reflect.getOwnPropertyDescriptor(target, property)?.value;
1355
- if (!origin) return receiver;
1356
- return withProp(receiver, property, ctx.extend({ [symbols.shadow]: origin }));
1340
+ const value = getPropertyDescriptor(target, property)?.value;
1341
+ if (!value) return receiver;
1342
+ const defSite = value[symbols.shadow] ?? value;
1343
+ return withProp(receiver, property, useSite.extend({ [symbols.shadow]: defSite }));
1357
1344
  }
1358
1345
  function createShadowMethod(ctx, value, outer, shadow) {
1359
1346
  return new Proxy(value, { apply: (target, thisArg, args) => {
@@ -1362,37 +1349,40 @@ function createShadowMethod(ctx, value, outer, shadow) {
1362
1349
  } });
1363
1350
  }
1364
1351
  function createTraceable(ctx, value, tracker) {
1365
- if (ctx[symbols.shadow] && !tracker.noShadow) ctx = Object.getPrototypeOf(ctx);
1352
+ const defSite = ctx[symbols.shadow] ?? ctx;
1353
+ const useSite = ctx[symbols.shadow] ? Object.getPrototypeOf(ctx) : ctx;
1366
1354
  const proxy = new Proxy(value, {
1367
1355
  get: (target, prop, receiver) => {
1368
1356
  if (prop === symbols.original) return target;
1369
- if (prop === tracker.property) return ctx;
1357
+ if (prop === symbols.caller) return defSite;
1358
+ if (prop === tracker.property) return useSite;
1370
1359
  if (typeof prop === "symbol") return Reflect.get(target, prop, receiver);
1371
- if (tracker.associate && ctx.reflect.props[`${tracker.associate}.${prop}`]) return Reflect.get(ctx, `${tracker.associate}.${prop}`, withProp(ctx, symbols.receiver, receiver));
1360
+ if (tracker.associate && useSite.reflect.props[`${tracker.associate}.${prop}`]) return Reflect.get(ctx, `${tracker.associate}.${prop}`, withProp(ctx, symbols.receiver, receiver));
1372
1361
  let shadow, innerValue;
1373
1362
  const desc = getPropertyDescriptor(target, prop);
1374
1363
  if (desc && "value" in desc) innerValue = desc.value;
1375
1364
  else {
1376
- shadow = createShadow(ctx, target, tracker.property, receiver);
1365
+ shadow = createShadow(useSite, target, tracker.property, receiver);
1377
1366
  innerValue = Reflect.get(target, prop, shadow);
1378
1367
  }
1379
1368
  const innerTracker = innerValue?.[symbols.tracker];
1380
- if (innerTracker) return createTraceable(ctx, innerValue, innerTracker);
1369
+ if (innerTracker) return createTraceable(useSite, innerValue, innerTracker);
1381
1370
  else if (!tracker.noShadow && typeof innerValue === "function") {
1382
- shadow ??= createShadow(ctx, target, tracker.property, receiver);
1383
- return createShadowMethod(ctx, innerValue, receiver, shadow);
1371
+ shadow ??= createShadow(useSite, target, tracker.property, receiver);
1372
+ return createShadowMethod(useSite, innerValue, receiver, shadow);
1384
1373
  } else return innerValue;
1385
1374
  },
1386
1375
  set: (target, prop, value, receiver) => {
1387
1376
  if (prop === symbols.original) return false;
1377
+ if (prop === symbols.caller) return false;
1388
1378
  if (prop === tracker.property) return false;
1389
1379
  if (typeof prop === "symbol") return Reflect.set(target, prop, value, receiver);
1390
- if (tracker.associate && ctx.reflect.props[`${tracker.associate}.${prop}`]) return Reflect.set(ctx, `${tracker.associate}.${prop}`, value, withProp(ctx, symbols.receiver, receiver));
1391
- const shadow = createShadow(ctx, target, tracker.property, receiver);
1380
+ if (tracker.associate && useSite.reflect.props[`${tracker.associate}.${prop}`]) return Reflect.set(ctx, `${tracker.associate}.${prop}`, value, withProp(ctx, symbols.receiver, receiver));
1381
+ const shadow = createShadow(useSite, target, tracker.property, receiver);
1392
1382
  return Reflect.set(target, prop, value, shadow);
1393
1383
  },
1394
1384
  apply: (target, thisArg, args) => {
1395
- return applyTraceable(proxy, target, thisArg, args);
1385
+ return applyTraceable(tracker.noShadow ? proxy : createShadow(useSite, target, tracker.property, proxy), target, thisArg, args);
1396
1386
  }
1397
1387
  });
1398
1388
  return proxy;
@@ -1404,7 +1394,8 @@ function applyTraceable(proxy, value, thisArg, args) {
1404
1394
  /** Create a callable service object that dispatches through `symbols.invoke`. */
1405
1395
  function createCallable(name, proto, tracker) {
1406
1396
  const self = function(...args) {
1407
- return applyTraceable(createTraceable(self["ctx"], self, tracker), self, this, args);
1397
+ const proxy = createTraceable(self["ctx"], self, tracker);
1398
+ return Reflect.apply(proxy, this, args);
1408
1399
  };
1409
1400
  defineProperty(self, "name", name);
1410
1401
  return Object.setPrototypeOf(self, proto);
@@ -1450,649 +1441,215 @@ function buildOuterStack(offset = 0) {
1450
1441
  return () => outerError.stack.split("\n").slice(3 + offset);
1451
1442
  }
1452
1443
  //#endregion
1453
- //#region ../../../vendor/cordis/src/events.ts
1444
+ //#region ../../../vendor/cordis/src/fiber.ts
1445
+ const kValidationError$1 = Symbol.for("ValidationError");
1446
+ /** Error raised when plugin configuration fails standard-schema validation. */
1447
+ var ValidationError$1 = class extends TypeError {
1448
+ name = "ValidationError";
1449
+ /**
1450
+ * Build the aggregated message from schema issues.
1451
+ *
1452
+ * @param issues — the standard-schema issues, one message line each.
1453
+ */
1454
+ constructor(issues) {
1455
+ super(`invalid config:\n` + issues.map((issue) => {
1456
+ if (issue.path) return ` - ${issue.message} (at ${issue.path.join(".")})`;
1457
+ else return ` - ${issue.message}`;
1458
+ }).join("\n"));
1459
+ }
1460
+ };
1461
+ Object.defineProperty(ValidationError$1.prototype, kValidationError$1, { value: true });
1454
1462
  /**
1455
- * Return whether an event result should stop a bail-style dispatch.
1463
+ * Validate and normalize config for a plugin runtime before it starts.
1456
1464
  *
1457
- * @param value — a listener's return value.
1458
- * @returns `true` unless `value` is `null`, `false`, or `undefined`.
1465
+ * @param runtime — the plugin runtime whose `Config` schema to apply.
1466
+ * @param config — the raw user config.
1467
+ * @returns the validated config, or `config` unchanged if the runtime has no schema.
1468
+ * @throws {ValidationError} when validation reports issues.
1459
1469
  */
1460
- function isBailed(value) {
1461
- return value !== null && value !== false && value !== void 0;
1470
+ function resolveConfig(runtime, config) {
1471
+ if (!runtime.Config) return config;
1472
+ const result = runtime.Config["~standard"].validate(config);
1473
+ if ("then" in result) throw new TypeError("Async config validation is not supported");
1474
+ if (result.issues) throw new ValidationError$1(result.issues);
1475
+ else return result.value;
1476
+ }
1477
+ const effectInertia = /* @__PURE__ */ new WeakMap();
1478
+ function runDisposable(dispose) {
1479
+ const result = dispose();
1480
+ return effectInertia.get(dispose)?.() ?? result;
1481
+ }
1482
+ /** Notify plugin teardown without allowing one observer to break ownership cleanup. */
1483
+ function emitPluginDisposed(context, fiber) {
1484
+ const args = ["internal/plugin", fiber];
1485
+ let callbacks;
1486
+ try {
1487
+ callbacks = context.events.dispatch("emit", args);
1488
+ } catch (error) {
1489
+ context.logger.error(error);
1490
+ return;
1491
+ }
1492
+ for (const callback of callbacks) try {
1493
+ const returned = callback(...args);
1494
+ Promise.resolve(returned).catch((error) => context.logger.error(error));
1495
+ } catch (error) {
1496
+ context.logger.error(error);
1497
+ }
1462
1498
  }
1499
+ /** Framework error with a stable machine-readable code. */
1500
+ var CordisError = class CordisError extends Error {
1501
+ code;
1502
+ /**
1503
+ * @param code — the stable error code; also the default message.
1504
+ * @param message — optional human-readable override.
1505
+ */
1506
+ constructor(code, message) {
1507
+ super(message ?? CordisError.Code[code]);
1508
+ this.code = code;
1509
+ }
1510
+ };
1511
+ (function(_CordisError) {
1512
+ _CordisError.Code = { INACTIVE_EFFECT: "cannot create effect on inactive context" };
1513
+ })(CordisError || (CordisError = {}));
1514
+ const INACTIVE = "__INACTIVE__";
1463
1515
  /**
1464
- * Event bus installed as `ctx.events` and mixed into every context.
1516
+ * Runtime instance of one plugin application.
1465
1517
  *
1466
- * The service supports concurrent, synchronous, serial, bail, and waterfall
1467
- * dispatch and automatically disposes listeners with their owning fiber.
1518
+ * A fiber tracks dependency state, raw and effective config, lifecycle effects, and
1519
+ * cleanup for the plugin context returned by `ctx.plugin()`.
1468
1520
  */
1469
- var EventsService = class {
1521
+ var Fiber = class {
1522
+ parent;
1523
+ inject;
1524
+ runtime;
1525
+ /** Unique id within the registry; 0 for the root fiber, `null` once disposed. */
1526
+ uid;
1527
+ /** The context this fiber's plugin runs in (extends the parent context). */
1470
1528
  ctx;
1471
- _hooks = {};
1472
- constructor(ctx) {
1473
- this.ctx = ctx;
1474
- defineProperty(this, symbols.tracker, {
1475
- property: "ctx",
1476
- noShadow: true
1477
- });
1478
- this.on("internal/listener", function(name, listener, options) {
1479
- if (name === "internal/update" && !options.global) return (this.fiber._hooks["internal/update"] ??= new DisposableList())[options.prepend ? "unshift" : "push"](listener);
1480
- });
1481
- this.on("internal/update", function(config, noSave, next) {
1482
- const cbs = [...this._hooks["internal/update"] || []];
1483
- const _next = () => {
1484
- return (cbs.shift() ?? next).call(this, config, noSave, _next);
1485
- };
1486
- return _next();
1487
- }, {
1488
- global: true,
1489
- prepend: true
1490
- });
1491
- }
1529
+ /** Raw plugin input retained for the next activation. */
1530
+ config;
1531
+ /** Current lifecycle state; transitions emit `internal/status`. */
1532
+ state = 0;
1533
+ /** Dispose this fiber: unload the plugin, then settle once cleanup finished. */
1534
+ dispose;
1535
+ /** Required implementations retained through dependent teardown. */
1536
+ committed;
1537
+ /** Service implementations owned by this fiber, including isolated provisions. */
1538
+ provisions = /* @__PURE__ */ new Set();
1539
+ /** The in-flight load/unload transition, if one is currently running. */
1540
+ inertia;
1541
+ _hooks = Object.create(null);
1542
+ _disposables = new DisposableList();
1543
+ context;
1544
+ _error;
1545
+ _revision = 0;
1546
+ _configRevision = 0;
1547
+ _effectiveConfig;
1548
+ _runner;
1549
+ _store = Object.create(null);
1550
+ _release;
1492
1551
  /**
1493
- * Resolve listeners for one dispatch and apply context filtering.
1552
+ * Create a fiber. Plugin authors normally obtain fibers from `ctx.plugin()`
1553
+ * rather than constructing them directly.
1494
1554
  *
1495
- * @param type — the dispatch mode, reported on `internal/dispatch`.
1496
- * @param args — the raw dispatch arguments; consumed up to the event name.
1497
- * @returns the matching listener callbacks, bound to the dispatch `this`.
1555
+ * @param parent — the context the plugin was loaded from.
1556
+ * @param config — raw config, validated against the runtime's schema.
1557
+ * @param inject — resolved dependency map (service name → intercept config).
1558
+ * @param runtime — the shared plugin runtime, or `null` for the root fiber.
1559
+ * @param getOuterStack — captures the caller stack for effect diagnostics.
1498
1560
  */
1499
- dispatch(type, args) {
1500
- const thisArg = typeof args[0] === "object" || typeof args[0] === "function" ? args.shift() : null;
1501
- const name = args.shift();
1502
- if (!name.startsWith("internal/")) this.emit("internal/dispatch", type, name, args, thisArg);
1503
- const filter = thisArg?.[Context.filter];
1504
- return (this._hooks[name] || []).filter((hook) => hook.global || !filter || filter.call(thisArg, hook.ctx)).map((hook) => hook.callback.bind(thisArg));
1561
+ constructor(parent, config, inject, runtime, getOuterStack) {
1562
+ this.parent = parent;
1563
+ this.inject = inject;
1564
+ this.runtime = runtime;
1565
+ this.config = config;
1566
+ const collect = (dispose) => {
1567
+ this._disposables.push(dispose);
1568
+ };
1569
+ if (runtime) {
1570
+ this.uid = parent.registry.counter;
1571
+ this.ctx = this.context = parent.extend({ fiber: this });
1572
+ const injectEntries = Object.entries(this.inject);
1573
+ if (injectEntries.length) {
1574
+ this.ctx[Context.intercept] = Object.create(parent[Context.intercept]);
1575
+ for (const [name, config] of injectEntries) {
1576
+ if (isNullable(config)) continue;
1577
+ this.ctx[Context.intercept][name] = config;
1578
+ }
1579
+ }
1580
+ this._runner = {
1581
+ epoch: INACTIVE,
1582
+ getOuterStack,
1583
+ execute: function() {
1584
+ const config = this.resolveConfig(this.config);
1585
+ this._effectiveConfig = config;
1586
+ if (isConstructor(runtime.callback)) {
1587
+ const instance = new runtime.callback(this.ctx, config);
1588
+ for (const hook of instance?.[symbols.initHooks] ?? []) hook();
1589
+ return instance?.[symbols.init]?.();
1590
+ } else return runtime.callback(this.ctx, config);
1591
+ },
1592
+ collect
1593
+ };
1594
+ this.dispose = parent.fiber.effect(() => {
1595
+ const remove = runtime.fibers.push(this);
1596
+ return async () => {
1597
+ this.uid = null;
1598
+ emitPluginDisposed(this.context, this);
1599
+ if (this.ctx.registry.has(runtime.callback)) {
1600
+ remove();
1601
+ if (!runtime.fibers.length) this.ctx.registry.delete(runtime.callback);
1602
+ }
1603
+ this._setEpoch(INACTIVE);
1604
+ if (!this.inertia) this._updateState(() => {
1605
+ this.inertia = this._unload();
1606
+ return 5;
1607
+ });
1608
+ while (this.inertia) await this.inertia;
1609
+ };
1610
+ }, "ctx.plugin()");
1611
+ try {
1612
+ this.context.emit("internal/plugin", this);
1613
+ } catch (error) {
1614
+ Promise.resolve(this.dispose()).catch((reason) => this.ctx.logger.error(reason));
1615
+ throw error;
1616
+ }
1617
+ if (this.uid !== null && parent.fiber.state !== 5) {
1618
+ for (const name of Object.keys(this.inject)) this._checkImpl(name);
1619
+ this._refresh();
1620
+ }
1621
+ } else {
1622
+ this.uid = 0;
1623
+ this.ctx = this.context = parent;
1624
+ this.state = 2;
1625
+ this.committed = Object.create(null);
1626
+ this._runner = {
1627
+ epoch: "0",
1628
+ getOuterStack,
1629
+ execute: () => {},
1630
+ collect
1631
+ };
1632
+ this.dispose = () => this.restart();
1633
+ }
1634
+ }
1635
+ /** The plugin's display name, inherited from the nearest named ancestor, else `'root'`. */
1636
+ get name() {
1637
+ let fiber = this;
1638
+ do {
1639
+ if (fiber.runtime?.name) return fiber.runtime.name;
1640
+ fiber = fiber.parent.fiber;
1641
+ } while (fiber !== fiber.parent.fiber);
1642
+ return "root";
1505
1643
  }
1506
1644
  /**
1507
- * Run listeners concurrently and wait for all of them.
1645
+ * Throw if the fiber has already been disposed.
1508
1646
  *
1509
- * @param args — optional `this`, the event name, then listener arguments.
1510
- * @returns a promise resolving once every listener has settled.
1647
+ * @returns nothing when the fiber is still active.
1648
+ * @throws {CordisError} `INACTIVE_EFFECT` when the fiber's uid has been cleared.
1511
1649
  */
1512
- async parallel(...args) {
1513
- const errors = (await Promise.allSettled(this.dispatch("emit", args).map(async (cb) => cb(...args)))).filter((result) => result.status === "rejected");
1514
- if (errors.length) throw new AggregateError(errors.map((error) => error.reason));
1515
- }
1516
- /**
1517
- * Run listeners synchronously without waiting for returned promises.
1518
- *
1519
- * @param args — optional `this`, the event name, then listener arguments.
1520
- */
1521
- emit(...args) {
1522
- this.dispatch("emit", args).map((cb) => cb(...args));
1523
- }
1524
- /**
1525
- * Run listeners in order, awaiting each, until one returns a bail value.
1526
- *
1527
- * @param args — optional `this`, the event name, then listener arguments.
1528
- * @returns the first bail value (see {@link isBailed}), if any.
1529
- */
1530
- async serial(...args) {
1531
- for (const cb of this.dispatch("serial", args)) {
1532
- const result = await cb(...args);
1533
- if (isBailed(result)) return result;
1534
- }
1535
- }
1536
- /**
1537
- * Run listeners synchronously until one returns a bail value.
1538
- *
1539
- * @param args — optional `this`, the event name, then listener arguments.
1540
- * @returns the first bail value (see {@link isBailed}), if any.
1541
- */
1542
- bail(...args) {
1543
- for (const cb of this.dispatch("bail", args)) {
1544
- const result = cb(...args);
1545
- if (isBailed(result)) return result;
1546
- }
1547
- }
1548
- /**
1549
- * Compose listeners around the final `next` callback.
1550
- *
1551
- * The last dispatch argument is treated as the innermost `next`. Listeners
1552
- * run outermost-first; a listener that does not call `next()` vetoes the
1553
- * rest of the chain, including the built-in behavior.
1554
- *
1555
- * @param args — optional `this`, the event name, listener arguments, then `next`.
1556
- * @returns the outermost listener's return value.
1557
- */
1558
- waterfall(...args) {
1559
- const cbs = this.dispatch("waterfall", args);
1560
- const inner = args.pop();
1561
- const next = () => {
1562
- return (cbs.shift() ?? inner)(...args);
1563
- };
1564
- args.push(next);
1565
- return next();
1566
- }
1567
- /**
1568
- * Store a listener record as an effect on the current fiber.
1569
- *
1570
- * @param label — effect label shown in fiber diagnostics.
1571
- * @param hooks — the listener list for one event.
1572
- * @param callback — the listener to store.
1573
- * @param options — placement and filtering options.
1574
- * @returns a disposer that unregisters the listener.
1575
- */
1576
- register(label, hooks, callback, options) {
1577
- const method = options.prepend ? "unshift" : "push";
1578
- return this.ctx.fiber.effect(() => {
1579
- hooks[method]({
1580
- ctx: this.ctx,
1581
- callback,
1582
- ...options
1583
- });
1584
- return () => this.unregister(hooks, callback);
1585
- }, label);
1586
- }
1587
- /**
1588
- * Remove a stored listener record.
1589
- *
1590
- * @param hooks — the listener list for one event.
1591
- * @param callback — the listener to remove.
1592
- * @returns `true` if the listener was found and removed.
1593
- */
1594
- unregister(hooks, callback) {
1595
- const index = hooks.findIndex((hook) => hook.callback === callback);
1596
- if (index >= 0) {
1597
- hooks.splice(index, 1);
1598
- return true;
1599
- }
1600
- }
1601
- /**
1602
- * Register an event listener owned by the current fiber.
1603
- *
1604
- * The listener is removed automatically when the fiber unloads. Throws
1605
- * `CordisError('INACTIVE_EFFECT')` if the fiber is already disposed.
1606
- *
1607
- * @param name — the event name to listen for.
1608
- * @param listener — called with the dispatch arguments.
1609
- * @param options — listener options; a boolean is shorthand for `prepend`.
1610
- * @returns a disposer removing the listener; `true` if it was still registered.
1611
- */
1612
- on(name, listener, options) {
1613
- if (typeof options !== "object") options = { prepend: options };
1614
- this.ctx.fiber.assertActive();
1615
- listener = this.ctx.reflect.bind(listener);
1616
- const result = this.bail(this.ctx, "internal/listener", name, listener, options);
1617
- if (result) return result;
1618
- const hooks = this._hooks[name] ||= [];
1619
- const label = `ctx.on(${typeof name === "string" ? JSON.stringify(name) : name.toString()})`;
1620
- return this.register(label, hooks, listener, options);
1621
- }
1622
- /**
1623
- * Register an event listener that disposes itself after the first call.
1624
- *
1625
- * @param name — the event name to listen for.
1626
- * @param listener — called at most once with the dispatch arguments.
1627
- * @param options — listener options; a boolean is shorthand for `prepend`.
1628
- * @returns a disposer removing the listener; `true` if it was still registered.
1629
- */
1630
- once(name, listener, options) {
1631
- const dispose = this.on(name, function(...args) {
1632
- dispose();
1633
- return listener.apply(this, args);
1634
- }, options);
1635
- return dispose;
1636
- }
1637
- };
1638
- //#endregion
1639
- //#region ../../../vendor/cordis/src/logger.ts
1640
- /** Built-in placeholder formatters used by `Logger.format()`. */
1641
- const defaultFormatters = {
1642
- s: (value) => String(value),
1643
- d: (value) => Math.trunc(Number(value)),
1644
- i: (value) => Math.trunc(Number(value)),
1645
- f: (value) => Number(value),
1646
- o: (value) => JSON.stringify(value),
1647
- O: (value) => JSON.stringify(value),
1648
- c: () => "",
1649
- C: (value, exporter, message) => {
1650
- return Logger.color(exporter, Logger.code(message.name, exporter.colors), value);
1651
- }
1652
- };
1653
- function isAggregateError(error) {
1654
- return error instanceof Error && Array.isArray(error["errors"]);
1655
- }
1656
- /** Logger facade for one named subsystem. */
1657
- var Logger = class {
1658
- service;
1659
- static color(exporter, code, value, decoration = "") {
1660
- if (!exporter.colors) return "" + value;
1661
- return `\u001b[3${code < 8 ? code : "8;5;" + code}${exporter.colors >= 2 ? decoration : ""}m${value}\u001b[0m`;
1662
- }
1663
- static code(name, level) {
1664
- let hash = 0;
1665
- for (let i = 0; i < name.length; i++) {
1666
- hash = (hash << 3) - hash + name.charCodeAt(i) + 13;
1667
- hash |= 0;
1668
- }
1669
- const colors = !level ? [] : level >= 2 ? c256 : c16;
1670
- return colors[Math.abs(hash) % colors.length];
1671
- }
1672
- static format(exporter, message) {
1673
- const args = message.args.slice();
1674
- if (args[0] instanceof Error) {
1675
- args[0] = args[0].stack || args[0].message;
1676
- args.unshift("%s");
1677
- } else if (typeof args[0] !== "string") args.unshift("%o");
1678
- let format = args.shift();
1679
- format = format.replace(/%([a-zA-Z%])/g, (match, char) => {
1680
- if (match === "%%") return "%";
1681
- const formatter = exporter.formatters?.[char] ?? defaultFormatters[char];
1682
- if (typeof formatter === "function") return formatter(args.shift(), exporter, message);
1683
- return match;
1684
- });
1685
- const oFormatter = exporter.formatters?.o ?? defaultFormatters.o;
1686
- for (let arg of args) {
1687
- if (typeof arg === "object" && arg) arg = oFormatter(arg, exporter, message);
1688
- format += " " + arg;
1689
- }
1690
- const { maxLength = 10240 } = exporter;
1691
- return format.split(/\r?\n/g).map((line) => {
1692
- return line.slice(0, maxLength) + (line.length > maxLength ? "..." : "");
1693
- }).join("\n");
1694
- }
1695
- constructor(options, service) {
1696
- this.service = service;
1697
- Object.assign(this, options);
1698
- this.error = this._method("error", 0);
1699
- this.info = this._method("info", 1);
1700
- this.warn = this._method("warn", 2);
1701
- this.debug = this._method("debug", 3);
1702
- }
1703
- _method(type, level) {
1704
- return (...args) => {
1705
- if (args.length === 1 && args[0] instanceof Error) {
1706
- if (args[0].cause) this[type](args[0].cause);
1707
- else if (isAggregateError(args[0])) {
1708
- args[0].errors.forEach((error) => this[type](error));
1709
- return;
1710
- }
1711
- }
1712
- const sn = ++this.service._snMessage;
1713
- const ts = Date.now();
1714
- for (const exporter of this.service.exporters.values()) {
1715
- if ((exporter.levels?.[this.name] ?? exporter.levels?.default ?? this.level ?? 1) < level) continue;
1716
- const message = {
1717
- sn,
1718
- ts,
1719
- type,
1720
- level,
1721
- name: this.name,
1722
- ...this.meta,
1723
- args
1724
- };
1725
- exporter.export(message);
1726
- }
1727
- };
1728
- }
1729
- };
1730
- /** ANSI 16-color palette indexes used for logger name coloring. */
1731
- const c16 = [
1732
- 6,
1733
- 2,
1734
- 3,
1735
- 4,
1736
- 5,
1737
- 1
1738
- ];
1739
- /** ANSI 256-color palette indexes used for logger name coloring. */
1740
- const c256 = [
1741
- 20,
1742
- 21,
1743
- 26,
1744
- 27,
1745
- 32,
1746
- 33,
1747
- 38,
1748
- 39,
1749
- 40,
1750
- 41,
1751
- 42,
1752
- 43,
1753
- 44,
1754
- 45,
1755
- 56,
1756
- 57,
1757
- 62,
1758
- 63,
1759
- 68,
1760
- 69,
1761
- 74,
1762
- 75,
1763
- 76,
1764
- 77,
1765
- 78,
1766
- 79,
1767
- 80,
1768
- 81,
1769
- 92,
1770
- 93,
1771
- 98,
1772
- 99,
1773
- 112,
1774
- 113,
1775
- 129,
1776
- 134,
1777
- 135,
1778
- 148,
1779
- 149,
1780
- 160,
1781
- 161,
1782
- 162,
1783
- 163,
1784
- 164,
1785
- 165,
1786
- 166,
1787
- 167,
1788
- 168,
1789
- 169,
1790
- 170,
1791
- 171,
1792
- 172,
1793
- 173,
1794
- 178,
1795
- 179,
1796
- 184,
1797
- 185,
1798
- 196,
1799
- 197,
1800
- 198,
1801
- 199,
1802
- 200,
1803
- 201,
1804
- 202,
1805
- 203,
1806
- 204,
1807
- 205,
1808
- 206,
1809
- 207,
1810
- 208,
1811
- 209,
1812
- 214,
1813
- 215,
1814
- 220,
1815
- 221
1816
- ];
1817
- /**
1818
- * Built-in logging service.
1819
- *
1820
- * Call `ctx.logger()` to create a named logger, or call `ctx.logger.info()`
1821
- * directly to log with the current fiber-derived name.
1822
- */
1823
- var LoggerService = class LoggerService {
1824
- bufferSize = 1e3;
1825
- buffer = [];
1826
- ctx;
1827
- _snMessage = 0;
1828
- _snExporter = 0;
1829
- exporters = /* @__PURE__ */ new Map();
1830
- constructor(ctx) {
1831
- const tracker = {
1832
- property: "ctx",
1833
- noShadow: true
1834
- };
1835
- const self = createCallable("logger", joinPrototype(Object.getPrototypeOf(this), Function.prototype), tracker);
1836
- Object.assign(self, this);
1837
- self.ctx = ctx;
1838
- defineProperty(self, symbols.tracker, tracker);
1839
- self.exporter({
1840
- colors: 3,
1841
- export: (message) => {
1842
- self.buffer.push(message);
1843
- if (self.buffer.length > self.bufferSize) self.buffer = self.buffer.slice(-self.bufferSize);
1844
- }
1845
- });
1846
- return self;
1847
- }
1848
- /**
1849
- * Register an exporter and dispose it with the current fiber.
1850
- *
1851
- * @param exporter — the sink that receives structured log messages.
1852
- * @returns a disposer that removes the exporter.
1853
- */
1854
- exporter(exporter) {
1855
- return this.ctx.effect(() => {
1856
- const id = ++this._snExporter;
1857
- this.exporters.set(id, exporter);
1858
- return () => this.exporters.delete(id);
1859
- }, "ctx.logger.exporter()");
1860
- }
1861
- _resolveConfig() {
1862
- let intercept = this.ctx[symbols.intercept];
1863
- const configs = [];
1864
- while ("logger" in intercept) {
1865
- if (Object.hasOwn(intercept, "logger")) configs.unshift(intercept["logger"]);
1866
- intercept = Object.getPrototypeOf(intercept);
1867
- }
1868
- return Object.assign({}, ...configs);
1869
- }
1870
- [symbols.invoke](name) {
1871
- const config = this._resolveConfig();
1872
- const fiber = (this.ctx[symbols.shadow] ?? this.ctx).fiber;
1873
- name ??= config.name;
1874
- name ??= hyphenate(fiber.name);
1875
- return new Logger({
1876
- name,
1877
- level: config.level,
1878
- meta: { fiber: new WeakRef(fiber) }
1879
- }, this);
1880
- }
1881
- static {
1882
- for (const type of [
1883
- "error",
1884
- "info",
1885
- "warn",
1886
- "debug"
1887
- ]) LoggerService.prototype[type] = function(...args) {
1888
- return this()[type](...args);
1889
- };
1890
- }
1891
- };
1892
- //#endregion
1893
- //#region ../../../vendor/cordis/src/fiber.ts
1894
- const kValidationError$1 = Symbol.for("ValidationError");
1895
- /** Error raised when plugin configuration fails standard-schema validation. */
1896
- var ValidationError$1 = class extends TypeError {
1897
- name = "ValidationError";
1898
- /**
1899
- * Build the aggregated message from schema issues.
1900
- *
1901
- * @param issues — the standard-schema issues, one message line each.
1902
- */
1903
- constructor(issues) {
1904
- super(`invalid config:\n` + issues.map((issue) => {
1905
- if (issue.path) return ` - ${issue.message} (at ${issue.path.join(".")})`;
1906
- else return ` - ${issue.message}`;
1907
- }).join("\n"));
1908
- }
1909
- };
1910
- Object.defineProperty(ValidationError$1.prototype, kValidationError$1, { value: true });
1911
- /**
1912
- * Validate and normalize config for a plugin runtime before it starts.
1913
- *
1914
- * @param runtime — the plugin runtime whose `Config` schema to apply.
1915
- * @param config — the raw user config.
1916
- * @returns the validated config, or `config` unchanged if the runtime has no schema.
1917
- * @throws {ValidationError} when validation reports issues.
1918
- */
1919
- function resolveConfig(runtime, config) {
1920
- if (!runtime.Config) return config;
1921
- const result = runtime.Config["~standard"].validate(config);
1922
- if ("then" in result) throw new TypeError("Async config validation is not supported");
1923
- if (result.issues) throw new ValidationError$1(result.issues);
1924
- else return result.value;
1925
- }
1926
- const effectInertia = /* @__PURE__ */ new WeakMap();
1927
- function runDisposable(dispose) {
1928
- const result = dispose();
1929
- return effectInertia.get(dispose)?.() ?? result;
1930
- }
1931
- /** Notify plugin teardown without allowing one observer to break ownership cleanup. */
1932
- function emitPluginDisposed(context, fiber) {
1933
- const args = ["internal/plugin", fiber];
1934
- let callbacks;
1935
- try {
1936
- callbacks = context.events.dispatch("emit", args);
1937
- } catch (error) {
1938
- context.logger.error(error);
1939
- return;
1940
- }
1941
- for (const callback of callbacks) try {
1942
- const returned = callback(...args);
1943
- Promise.resolve(returned).catch((error) => context.logger.error(error));
1944
- } catch (error) {
1945
- context.logger.error(error);
1946
- }
1947
- }
1948
- /** Framework error with a stable machine-readable code. */
1949
- var CordisError = class CordisError extends Error {
1950
- code;
1951
- /**
1952
- * @param code — the stable error code; also the default message.
1953
- * @param message — optional human-readable override.
1954
- */
1955
- constructor(code, message) {
1956
- super(message ?? CordisError.Code[code]);
1957
- this.code = code;
1958
- }
1959
- };
1960
- (function(_CordisError) {
1961
- _CordisError.Code = { INACTIVE_EFFECT: "cannot create effect on inactive context" };
1962
- })(CordisError || (CordisError = {}));
1963
- const INACTIVE = "__INACTIVE__";
1964
- /**
1965
- * Runtime instance of one plugin application.
1966
- *
1967
- * A fiber tracks dependency state, validated config, lifecycle effects, and
1968
- * cleanup for the plugin context returned by `ctx.plugin()`.
1969
- */
1970
- var Fiber = class {
1971
- parent;
1972
- inject;
1973
- runtime;
1974
- /** Unique id within the registry; 0 for the root fiber, `null` once disposed. */
1975
- uid;
1976
- /** The context this fiber's plugin runs in (extends the parent context). */
1977
- ctx;
1978
- /** The validated plugin config (updated by `update()`); read through {@link effectiveConfig}. */
1979
- config;
1980
- /** The raw plugin config, re-resolved before activation; use {@link rawConfig} to read or retain it. */
1981
- _config;
1982
- /** Current lifecycle state; transitions emit `internal/status`. */
1983
- state = 0;
1984
- /** Dispose this fiber: unload the plugin, then settle once cleanup finished. */
1985
- dispose;
1986
- /** Snapshot of required service implementations while loaded; `undefined` otherwise. */
1987
- store;
1988
- /** The in-flight load/unload transition, if one is currently running. */
1989
- inertia;
1990
- _hooks = Object.create(null);
1991
- _disposables = new DisposableList();
1992
- context;
1993
- _error;
1994
- _runner;
1995
- _store = Object.create(null);
1996
- /**
1997
- * Create a fiber. Plugin authors normally obtain fibers from `ctx.plugin()`
1998
- * rather than constructing them directly.
1999
- *
2000
- * @param parent — the context the plugin was loaded from.
2001
- * @param config — raw config, validated against the runtime's schema.
2002
- * @param inject — resolved dependency map (service name → intercept config).
2003
- * @param runtime — the shared plugin runtime, or `null` for the root fiber.
2004
- * @param getOuterStack — captures the caller stack for effect diagnostics.
2005
- */
2006
- constructor(parent, config, inject, runtime, getOuterStack) {
2007
- this.parent = parent;
2008
- this.inject = inject;
2009
- this.runtime = runtime;
2010
- this._config = config;
2011
- const collect = (dispose) => {
2012
- this._disposables.push(dispose);
2013
- };
2014
- if (runtime) {
2015
- this.uid = parent.registry.counter;
2016
- this.ctx = this.context = parent.extend({ fiber: this });
2017
- const injectEntries = Object.entries(this.inject);
2018
- if (injectEntries.length) {
2019
- this.ctx[Context.intercept] = Object.create(parent[Context.intercept]);
2020
- for (const [name, config] of injectEntries) {
2021
- if (isNullable(config)) continue;
2022
- this.ctx[Context.intercept][name] = config;
2023
- }
2024
- }
2025
- this._runner = {
2026
- epoch: INACTIVE,
2027
- getOuterStack,
2028
- execute: function() {
2029
- if (isConstructor(runtime.callback)) {
2030
- const instance = new runtime.callback(this.ctx, this.config);
2031
- for (const hook of instance?.[symbols.initHooks] ?? []) hook();
2032
- return instance?.[symbols.init]?.();
2033
- } else return runtime.callback(this.ctx, this.config);
2034
- },
2035
- collect
2036
- };
2037
- this.dispose = parent.fiber.effect(() => {
2038
- const remove = runtime.fibers.push(this);
2039
- return async () => {
2040
- this.uid = null;
2041
- emitPluginDisposed(this.context, this);
2042
- if (this.ctx.registry.has(runtime.callback)) {
2043
- remove();
2044
- if (!runtime.fibers.length) this.ctx.registry.delete(runtime.callback);
2045
- }
2046
- this._setEpoch(INACTIVE);
2047
- if (!this.inertia) this._updateState(() => {
2048
- this.inertia = this._unload();
2049
- return 5;
2050
- });
2051
- while (this.inertia) await this.inertia;
2052
- };
2053
- }, "ctx.plugin()");
2054
- try {
2055
- this.context.emit("internal/plugin", this);
2056
- } catch (error) {
2057
- Promise.resolve(this.dispose()).catch((reason) => this.ctx.logger.error(reason));
2058
- throw error;
2059
- }
2060
- if (this.uid !== null && parent.fiber.state !== 5) {
2061
- for (const name of Object.keys(this.inject)) this._checkImpl(name);
2062
- this._refresh();
2063
- }
2064
- } else {
2065
- this.uid = 0;
2066
- this.ctx = this.context = parent;
2067
- this.state = 2;
2068
- this.store = Object.create(null);
2069
- this._runner = {
2070
- epoch: "",
2071
- getOuterStack,
2072
- execute: () => {},
2073
- collect
2074
- };
2075
- this.dispose = () => this.restart();
2076
- }
2077
- }
2078
- /** The plugin's display name, inherited from the nearest named ancestor, else `'root'`. */
2079
- get name() {
2080
- let fiber = this;
2081
- do {
2082
- if (fiber.runtime?.name) return fiber.runtime.name;
2083
- fiber = fiber.parent.fiber;
2084
- } while (fiber !== fiber.parent.fiber);
2085
- return "root";
2086
- }
2087
- /**
2088
- * Throw if the fiber has already been disposed.
2089
- *
2090
- * @returns nothing when the fiber is still active.
2091
- * @throws {CordisError} `INACTIVE_EFFECT` when the fiber's uid has been cleared.
2092
- */
2093
- assertActive() {
2094
- if (this.uid !== null) return;
2095
- throw new CordisError("INACTIVE_EFFECT");
1650
+ assertActive() {
1651
+ if (this.uid !== null) return;
1652
+ throw new CordisError("INACTIVE_EFFECT");
2096
1653
  }
2097
1654
  _execute(runner) {
2098
1655
  const oldEpoch = runner.epoch;
@@ -2234,199 +1791,667 @@ var Fiber = class {
2234
1791
  runner.epoch = false;
2235
1792
  return finalizeDisposal(dispose);
2236
1793
  };
2237
- wrapper.then = async (onFulfilled, onRejected) => {
2238
- return Promise.resolve(task).then(() => disposeAsync).then(onFulfilled, onRejected);
1794
+ wrapper.then = async (onFulfilled, onRejected) => {
1795
+ return Promise.resolve(task).then(() => disposeAsync).then(onFulfilled, onRejected);
1796
+ };
1797
+ return wrapper;
1798
+ }
1799
+ /**
1800
+ * Return metadata for currently registered effects.
1801
+ *
1802
+ * @returns one {@link EffectMeta} tree per labeled live effect.
1803
+ */
1804
+ getEffects() {
1805
+ return [...this._disposables].map((dispose) => dispose[symbols.effect]).filter(Boolean);
1806
+ }
1807
+ _getState() {
1808
+ if (this.uid === null) return 4;
1809
+ if (this._error) return 3;
1810
+ if (this._runner.epoch !== INACTIVE) return 2;
1811
+ return 0;
1812
+ }
1813
+ _updateState(callback) {
1814
+ const oldState = this.state;
1815
+ this.state = callback() ?? this._getState();
1816
+ if (oldState === this.state) return;
1817
+ this.context.emit("internal/status", this, oldState);
1818
+ if (oldState !== 2 && this.state !== 2) return;
1819
+ for (const key of Reflect.ownKeys(this.ctx.reflect.store)) {
1820
+ const impl = this.ctx.reflect.store[key];
1821
+ if (impl.ctx.fiber !== this) continue;
1822
+ this.ctx.isolate(impl.name, impl.isolate).reflect.notify([impl.name]);
1823
+ }
1824
+ }
1825
+ _checkImpl(name) {
1826
+ const impl = this.ctx.reflect._getImpl(name, true);
1827
+ if (!impl) return delete this._store[name];
1828
+ try {
1829
+ if (impl.check && !impl.check.call(getTraceable(this.ctx, impl.value))) return delete this._store[name];
1830
+ } catch (error) {
1831
+ impl.ctx.logger.error(error);
1832
+ return delete this._store[name];
1833
+ }
1834
+ this._store[name] = impl;
1835
+ }
1836
+ _refresh() {
1837
+ let epoch = `${this._revision}`;
1838
+ for (const name of Object.keys(this.inject)) {
1839
+ const impl = this._store[name];
1840
+ if (!impl) {
1841
+ epoch = INACTIVE;
1842
+ break;
1843
+ }
1844
+ epoch += ":" + impl.uid;
1845
+ }
1846
+ this._setEpoch(epoch);
1847
+ }
1848
+ _setEpoch(epoch) {
1849
+ const oldEpoch = this._runner.epoch;
1850
+ if (epoch === oldEpoch) return;
1851
+ if (this._error) return;
1852
+ this._runner.epoch = epoch;
1853
+ if (this.inertia) return;
1854
+ this._updateState(() => {
1855
+ if (epoch !== INACTIVE && oldEpoch === INACTIVE) {
1856
+ this.inertia = this._reload();
1857
+ return 1;
1858
+ } else {
1859
+ this.inertia = this._unload();
1860
+ return 5;
1861
+ }
1862
+ });
1863
+ }
1864
+ /** Raw input retained for the next activation, without evaluating expressions or validating it. */
1865
+ get rawConfig() {
1866
+ return this.ctx.fiber.config;
1867
+ }
1868
+ /** Retain raw input without changing the running config or triggering an update. */
1869
+ set rawConfig(config) {
1870
+ this.ctx.fiber.config = config;
1871
+ this.ctx.fiber._configRevision++;
1872
+ }
1873
+ /**
1874
+ * The object passed to plugin activation or the latest successful update that retained the instance.
1875
+ * Candidate resolution does not publish it; volatile updates retain its references.
1876
+ * Undefined before activation and readable after unload; callers requiring a live instance check `state`.
1877
+ */
1878
+ get effectiveConfig() {
1879
+ return this.ctx.fiber._effectiveConfig;
1880
+ }
1881
+ /**
1882
+ * Evaluate and validate a candidate using this fiber's `internal/config` hooks and runtime schema.
1883
+ * Does not publish the result, replace raw input, or commit running volatile references.
1884
+ * Required injections must be available when a hook uses them.
1885
+ * @param config Raw candidate input.
1886
+ * @returns The candidate's resolved config, retaining the schema's result identity.
1887
+ * @throws {ValidationError} when the runtime schema rejects the candidate; hook errors propagate.
1888
+ */
1889
+ resolveConfig(config) {
1890
+ const fiber = this.ctx.fiber;
1891
+ return fiber.context.waterfall("internal/config", fiber, () => config);
1892
+ }
1893
+ async _reload() {
1894
+ this.committed = { ...this._store };
1895
+ for (const impl of Object.values(this.committed)) {
1896
+ if (impl.ctx.fiber === this) continue;
1897
+ impl.dependents.add(this);
1898
+ }
1899
+ const oldEpoch = this._runner.epoch;
1900
+ try {
1901
+ await Promise.resolve();
1902
+ if (this._runner.epoch === oldEpoch) await this._execute(this._runner);
1903
+ } catch (reason) {
1904
+ this.ctx.logger.error(reason);
1905
+ if (this._runner.epoch === oldEpoch) {
1906
+ this._error = reason;
1907
+ this._runner.epoch = INACTIVE;
1908
+ }
1909
+ }
1910
+ this._updateState(() => {
1911
+ if (this._runner.epoch === oldEpoch) this.inertia = void 0;
1912
+ else {
1913
+ this.inertia = this._unload();
1914
+ return 5;
1915
+ }
1916
+ });
1917
+ }
1918
+ async _unload() {
1919
+ while ([...this.provisions].some((impl) => impl.dependents.size)) await new Promise((resolve) => this._release = resolve);
1920
+ this._release = void 0;
1921
+ await Promise.all(this._disposables.clear().map(async (dispose) => {
1922
+ try {
1923
+ await composeError(async (info) => {
1924
+ await Promise.resolve();
1925
+ info.error = /* @__PURE__ */ new Error();
1926
+ await runDisposable(dispose);
1927
+ }, this._runner.getOuterStack);
1928
+ } catch (reason) {
1929
+ this.ctx.logger.error(reason);
1930
+ }
1931
+ }));
1932
+ for (const impl of Object.values(this.committed ?? {})) {
1933
+ if (!impl.dependents.delete(this) || impl.dependents.size) continue;
1934
+ impl.release?.();
1935
+ impl.ctx.fiber._release?.();
1936
+ }
1937
+ this.committed = void 0;
1938
+ this._updateState(() => {
1939
+ if (this._runner.epoch === INACTIVE) this.inertia = void 0;
1940
+ else {
1941
+ this.inertia = this._reload();
1942
+ return 1;
1943
+ }
1944
+ });
1945
+ }
1946
+ /**
1947
+ * Wait for current lifecycle work and rethrow startup errors.
1948
+ *
1949
+ * @returns this fiber, once it has settled into a stable state.
1950
+ * @throws the config-validation or plugin-startup error, if any.
1951
+ */
1952
+ async await() {
1953
+ while (this.inertia) await this.inertia;
1954
+ if (this._error) throw this._error;
1955
+ return this;
1956
+ }
1957
+ /**
1958
+ * Dispose and immediately reload this plugin with its current config.
1959
+ *
1960
+ * @returns a promise resolving once the reload settled.
1961
+ * @throws {CordisError} `INACTIVE_EFFECT` when the fiber is already disposed.
1962
+ */
1963
+ async restart() {
1964
+ const fiber = this.ctx.fiber;
1965
+ fiber.assertActive();
1966
+ fiber._revision++;
1967
+ fiber._refresh();
1968
+ await fiber.await();
1969
+ }
1970
+ /**
1971
+ * Resolve a candidate, retain its raw config and apply it through the update waterfall.
1972
+ * @param config Raw config; pending fibers defer resolution until activation.
1973
+ * @param noSave Suppress the persistence notification when true.
1974
+ * @returns The awaited update/restart result, or undefined when a synchronous listener handles it.
1975
+ * @throws {ValidationError} when an active fiber's candidate is invalid.
1976
+ */
1977
+ update(config, noSave = false) {
1978
+ const fiber = this.ctx.fiber;
1979
+ fiber.assertActive();
1980
+ const loaded = fiber._runner.epoch !== INACTIVE;
1981
+ const resolved = loaded ? fiber.resolveConfig(config) : void 0;
1982
+ if (!noSave) fiber.context.emit("internal/commit", fiber, config);
1983
+ fiber.config = config;
1984
+ fiber._error = void 0;
1985
+ const configRevision = ++fiber._configRevision;
1986
+ const epoch = fiber._runner.epoch;
1987
+ const committed = fiber.committed;
1988
+ let restarted = false;
1989
+ const restart = () => {
1990
+ restarted = true;
1991
+ return fiber.restart();
1992
+ };
1993
+ const publish = () => {
1994
+ if (!restarted && fiber.uid !== null && fiber._configRevision === configRevision && fiber._runner.epoch === epoch && fiber.committed === committed) fiber._effectiveConfig = resolved;
2239
1995
  };
2240
- return wrapper;
1996
+ const result = loaded ? fiber.context.waterfall(fiber, "internal/update", resolved, restart) : restart();
1997
+ if (result === void 0) {
1998
+ publish();
1999
+ return;
2000
+ }
2001
+ const task = Promise.resolve(result).then(publish);
2002
+ task.catch(() => {});
2003
+ return task;
2004
+ }
2005
+ };
2006
+ //#endregion
2007
+ //#region ../../../vendor/cordis/src/events.ts
2008
+ /**
2009
+ * Return whether an event result should stop a bail-style dispatch.
2010
+ *
2011
+ * @param value — a listener's return value.
2012
+ * @returns `true` unless `value` is `null`, `false`, or `undefined`.
2013
+ */
2014
+ function isBailed(value) {
2015
+ return value !== null && value !== false && value !== void 0;
2016
+ }
2017
+ /**
2018
+ * Event bus installed as `ctx.events` and mixed into every context.
2019
+ *
2020
+ * The service supports concurrent, synchronous, serial, bail, and waterfall
2021
+ * dispatch and automatically disposes listeners with their owning fiber.
2022
+ */
2023
+ var EventsService = class {
2024
+ ctx;
2025
+ _hooks = Object.create(null);
2026
+ constructor(ctx) {
2027
+ this.ctx = ctx;
2028
+ defineProperty(this, symbols.tracker, {
2029
+ property: "ctx",
2030
+ noShadow: true
2031
+ });
2032
+ this.on("internal/listener", function(name, listener, options) {
2033
+ if (name === "internal/update" && !options.global) {
2034
+ const hooks = this.fiber._hooks["internal/update"] ??= new DisposableList();
2035
+ const method = options.prepend ? "unshift" : "push";
2036
+ return this.fiber.effect(() => hooks[method](listener), "ctx.on(\"internal/update\")");
2037
+ }
2038
+ });
2039
+ this.on("internal/update", function(config, next) {
2040
+ const cbs = [...this._hooks["internal/update"] || []];
2041
+ const _next = () => {
2042
+ return (cbs.shift() ?? next).call(this, config, _next);
2043
+ };
2044
+ return _next();
2045
+ }, {
2046
+ global: true,
2047
+ prepend: true
2048
+ });
2049
+ this.on("internal/config", (fiber, next) => {
2050
+ const config = next();
2051
+ return fiber.runtime ? resolveConfig(fiber.runtime, config) : config;
2052
+ });
2053
+ }
2054
+ _resolve(type, args) {
2055
+ const thisArg = typeof args[0] === "object" || typeof args[0] === "function" ? args.shift() : null;
2056
+ const name = args.shift();
2057
+ if ((typeof name !== "string" || !name.startsWith("internal/")) && this._hooks["internal/dispatch"]?.length) this.emit("internal/dispatch", type, name, args, thisArg);
2058
+ const filter = thisArg?.[Context.filter];
2059
+ return [thisArg, (this._hooks[name] || []).filter((hook) => hook.global || !filter || filter.call(thisArg, hook.ctx)).map((hook) => hook.callback)];
2241
2060
  }
2242
2061
  /**
2243
- * Return metadata for currently registered effects.
2062
+ * Resolve bound callbacks using the event's context filter.
2063
+ * @param type Dispatch mode reported to observers.
2064
+ * @param args Dispatch arguments, consumed through the event name.
2065
+ * @returns Matching callbacks bound to the dispatch receiver.
2066
+ * DSH retains callback enumeration for per-listener error containment.
2067
+ */
2068
+ dispatch(type, args) {
2069
+ const [thisArg, callbacks] = this._resolve(type, args);
2070
+ return callbacks.map((callback) => callback.bind(thisArg));
2071
+ }
2072
+ /**
2073
+ * Run listeners concurrently and wait for all of them.
2244
2074
  *
2245
- * @returns one {@link EffectMeta} tree per labeled live effect.
2075
+ * @param args — optional `this`, the event name, then listener arguments.
2076
+ * @returns a promise resolving once every listener has settled.
2246
2077
  */
2247
- getEffects() {
2248
- return [...this._disposables].map((dispose) => dispose[symbols.effect]).filter(Boolean);
2078
+ async parallel(...args) {
2079
+ const [thisArg, callbacks] = this._resolve("parallel", args);
2080
+ const errors = (await Promise.allSettled(callbacks.map(async (callback) => Reflect.apply(callback, thisArg, args)))).filter((result) => result.status === "rejected");
2081
+ if (errors.length) throw new AggregateError(errors.map((error) => error.reason));
2249
2082
  }
2250
- _getState() {
2251
- if (this.uid === null) return 4;
2252
- if (this._error) return 3;
2253
- if (this._runner.epoch !== INACTIVE) return 2;
2254
- return 0;
2083
+ /**
2084
+ * Run listeners synchronously without waiting for returned promises.
2085
+ *
2086
+ * @param args — optional `this`, the event name, then listener arguments.
2087
+ */
2088
+ emit(...args) {
2089
+ const [thisArg, callbacks] = this._resolve("emit", args);
2090
+ for (const callback of callbacks) Reflect.apply(callback, thisArg, args);
2255
2091
  }
2256
- _updateState(callback) {
2257
- const oldState = this.state;
2258
- this.state = callback() ?? this._getState();
2259
- if (oldState === this.state) return;
2260
- this.context.emit("internal/status", this, oldState);
2261
- if (oldState !== 2 && this.state !== 2) return;
2262
- for (const key of Reflect.ownKeys(this.ctx.reflect.store)) {
2263
- const impl = this.ctx.reflect.store[key];
2264
- if (impl.fiber !== this) continue;
2265
- this.ctx.reflect.notify([impl.name]);
2092
+ /**
2093
+ * Run listeners in order, awaiting each, until one returns a bail value.
2094
+ *
2095
+ * @param args — optional `this`, the event name, then listener arguments.
2096
+ * @returns the first bail value (see {@link isBailed}), if any.
2097
+ */
2098
+ async serial(...args) {
2099
+ const [thisArg, callbacks] = this._resolve("serial", args);
2100
+ for (const callback of callbacks) {
2101
+ const result = await Reflect.apply(callback, thisArg, args);
2102
+ if (isBailed(result)) return result;
2266
2103
  }
2267
2104
  }
2268
- _checkImpl(name) {
2269
- const impl = this.ctx.reflect._getImpl(name, true);
2270
- if (!impl) return delete this._store[name];
2271
- try {
2272
- if (impl.check && !impl.check.call(getTraceable(this.ctx, impl.value))) return delete this._store[name];
2273
- } catch (error) {
2274
- impl.fiber.ctx.logger.error(error);
2275
- return delete this._store[name];
2105
+ /**
2106
+ * Run listeners synchronously until one returns a bail value.
2107
+ *
2108
+ * @param args — optional `this`, the event name, then listener arguments.
2109
+ * @returns the first bail value (see {@link isBailed}), if any.
2110
+ */
2111
+ bail(...args) {
2112
+ const [thisArg, callbacks] = this._resolve("bail", args);
2113
+ for (const callback of callbacks) {
2114
+ const result = Reflect.apply(callback, thisArg, args);
2115
+ if (isBailed(result)) return result;
2276
2116
  }
2277
- this._store[name] = impl;
2278
2117
  }
2279
- _refresh() {
2280
- let epoch = false;
2281
- epoch = "";
2282
- for (const name of Object.keys(this.inject)) {
2283
- const impl = this._store[name];
2284
- if (!impl) {
2285
- epoch = INACTIVE;
2286
- break;
2287
- }
2288
- epoch += ":" + impl.fiber.uid;
2289
- }
2290
- this._setEpoch(epoch);
2118
+ /**
2119
+ * Compose listeners around the final `next` callback.
2120
+ *
2121
+ * The last dispatch argument is treated as the innermost `next`. Listeners
2122
+ * run outermost-first; a listener that does not call `next()` vetoes the
2123
+ * rest of the chain, including the built-in behavior.
2124
+ *
2125
+ * @param args — optional `this`, the event name, listener arguments, then `next`.
2126
+ * @returns the outermost listener's return value.
2127
+ */
2128
+ waterfall(...args) {
2129
+ const [thisArg, callbacks] = this._resolve("waterfall", args);
2130
+ const inner = args.pop();
2131
+ const dispatch = () => {
2132
+ const callback = callbacks.shift();
2133
+ if (!callback) return inner();
2134
+ let called = false;
2135
+ const next = () => {
2136
+ if (called) throw new Error("next() called multiple times");
2137
+ called = true;
2138
+ return dispatch();
2139
+ };
2140
+ return Reflect.apply(callback, thisArg, [...args, next]);
2141
+ };
2142
+ return dispatch();
2291
2143
  }
2292
- _setEpoch(epoch) {
2293
- const oldEpoch = this._runner.epoch;
2294
- if (epoch === oldEpoch) return;
2295
- this._runner.epoch = epoch;
2296
- if (this.inertia) return;
2297
- this._updateState(() => {
2298
- if (epoch !== INACTIVE && oldEpoch === INACTIVE) {
2299
- this.inertia = this._reload();
2300
- return 1;
2301
- } else {
2302
- this.inertia = this._unload();
2303
- return 5;
2304
- }
2305
- });
2144
+ register(label, name, callback, options) {
2145
+ const method = options.prepend ? "unshift" : "push";
2146
+ return this.ctx.fiber.effect(() => {
2147
+ (this._hooks[name] ??= [])[method]({
2148
+ ctx: this.ctx,
2149
+ callback,
2150
+ ...options
2151
+ });
2152
+ return () => this.unregister(name, callback);
2153
+ }, label);
2306
2154
  }
2307
- /** Raw input retained for the next activation, without evaluating expressions or validating it. */
2308
- get rawConfig() {
2309
- return this.ctx.fiber._config;
2155
+ unregister(name, callback) {
2156
+ const hooks = this._hooks[name];
2157
+ if (!hooks) return;
2158
+ const index = hooks.findIndex((hook) => hook.callback === callback);
2159
+ if (index >= 0) {
2160
+ hooks.splice(index, 1);
2161
+ if (!hooks.length) delete this._hooks[name];
2162
+ return true;
2163
+ }
2310
2164
  }
2311
- /** Retain raw input without changing the running config or triggering an update. */
2312
- set rawConfig(config) {
2313
- this.ctx.fiber._config = config;
2165
+ /**
2166
+ * Register an event listener owned by the current fiber.
2167
+ *
2168
+ * The listener is removed automatically when the fiber unloads. Throws
2169
+ * `CordisError('INACTIVE_EFFECT')` if the fiber is already disposed.
2170
+ *
2171
+ * @param name — the event name to listen for.
2172
+ * @param listener — called with the dispatch arguments.
2173
+ * @param options — listener options; a boolean is shorthand for `prepend`.
2174
+ * @returns a disposer removing the listener; `true` if it was still registered.
2175
+ */
2176
+ on(name, listener, options) {
2177
+ if (typeof options !== "object") options = { prepend: options };
2178
+ this.ctx.fiber.assertActive();
2179
+ listener = this.ctx.reflect.bind(listener);
2180
+ const result = this.bail(this.ctx, "internal/listener", name, listener, options);
2181
+ if (result) return result;
2182
+ const label = `ctx.on(${typeof name === "string" ? JSON.stringify(name) : name.toString()})`;
2183
+ return this.register(label, name, listener, options);
2314
2184
  }
2315
2185
  /**
2316
- * The config object published by the existing activation/update lifecycle, without cloning or re-parsing.
2317
- * It is undefined before the first resolution and remains readable after unload; callers requiring a live instance check `state`.
2186
+ * Register an event listener that disposes itself after the first call.
2187
+ *
2188
+ * @param name — the event name to listen for.
2189
+ * @param listener — called at most once with the dispatch arguments.
2190
+ * @param options — listener options; a boolean is shorthand for `prepend`.
2191
+ * @returns a disposer removing the listener; `true` if it was still registered.
2318
2192
  */
2319
- get effectiveConfig() {
2320
- return this.ctx.fiber.config;
2193
+ once(name, listener, options) {
2194
+ const dispose = this.on(name, function(...args) {
2195
+ dispose();
2196
+ return listener.apply(this, args);
2197
+ }, options);
2198
+ return dispose;
2199
+ }
2200
+ };
2201
+ //#endregion
2202
+ //#region ../../../vendor/cordis/src/logger.ts
2203
+ /** Built-in placeholder formatters used by `Logger.format()`. */
2204
+ const defaultFormatters = {
2205
+ s: (value) => String(value),
2206
+ d: (value) => Math.trunc(Number(value)),
2207
+ i: (value) => Math.trunc(Number(value)),
2208
+ f: (value) => Number(value),
2209
+ o: (value) => JSON.stringify(value),
2210
+ O: (value) => JSON.stringify(value),
2211
+ c: () => "",
2212
+ C: (value, exporter, message) => {
2213
+ return Logger.color(exporter, Logger.code(message.name, exporter.colors), value);
2214
+ }
2215
+ };
2216
+ function isAggregateError(error) {
2217
+ return error instanceof Error && Array.isArray(error["errors"]);
2218
+ }
2219
+ /** Logger facade for one named subsystem. */
2220
+ var Logger = class {
2221
+ service;
2222
+ static color(exporter, code, value, decoration = "") {
2223
+ if (!exporter.colors) return "" + value;
2224
+ return `\u001b[3${code < 8 ? code : "8;5;" + code}${exporter.colors >= 2 ? decoration : ""}m${value}\u001b[0m`;
2225
+ }
2226
+ static code(name, level) {
2227
+ let hash = 0;
2228
+ for (let i = 0; i < name.length; i++) {
2229
+ hash = (hash << 3) - hash + name.charCodeAt(i) + 13;
2230
+ hash |= 0;
2231
+ }
2232
+ const colors = !level ? [] : level >= 2 ? c256 : c16;
2233
+ return colors[Math.abs(hash) % colors.length];
2234
+ }
2235
+ static format(exporter, message) {
2236
+ const args = message.args.slice();
2237
+ if (args[0] instanceof Error) {
2238
+ args[0] = args[0].stack || args[0].message;
2239
+ args.unshift("%s");
2240
+ } else if (typeof args[0] !== "string") args.unshift("%o");
2241
+ let format = args.shift();
2242
+ format = format.replace(/%([a-zA-Z%])/g, (match, char) => {
2243
+ if (match === "%%") return "%";
2244
+ const formatter = exporter.formatters?.[char] ?? defaultFormatters[char];
2245
+ if (typeof formatter === "function") return formatter(args.shift(), exporter, message);
2246
+ return match;
2247
+ });
2248
+ const oFormatter = exporter.formatters?.o ?? defaultFormatters.o;
2249
+ for (let arg of args) {
2250
+ if (typeof arg === "object" && arg) arg = oFormatter(arg, exporter, message);
2251
+ format += " " + arg;
2252
+ }
2253
+ const { maxLength = 10240 } = exporter;
2254
+ return format.split(/\r?\n/g).map((line) => {
2255
+ return line.slice(0, maxLength) + (line.length > maxLength ? "..." : "");
2256
+ }).join("\n");
2321
2257
  }
2322
- /**
2323
- * Evaluate and validate a candidate using this fiber's `internal/config` hooks and runtime schema.
2324
- * Does not publish the result, replace raw input, or commit running volatile references.
2325
- * Required injections must be available when a hook uses them.
2326
- * @param config Raw candidate input.
2327
- * @returns The candidate's resolved config, retaining the schema's result identity.
2328
- * @throws {ValidationError} when the runtime schema rejects the candidate; hook errors propagate.
2329
- */
2330
- resolveConfig(config) {
2331
- const fiber = this.ctx.fiber;
2332
- config = fiber.context.waterfall(fiber, "internal/config", config, () => config);
2333
- return fiber.runtime ? resolveConfig(fiber.runtime, config) : config;
2258
+ constructor(options, service) {
2259
+ this.service = service;
2260
+ Object.assign(this, options);
2261
+ this.error = this._method("error", 0);
2262
+ this.info = this._method("info", 2);
2263
+ this.warn = this._method("warn", 1);
2264
+ this.debug = this._method("debug", 3);
2334
2265
  }
2335
- async _reload() {
2336
- this.store = { ...this._store };
2337
- const oldEpoch = this._runner.epoch;
2338
- try {
2339
- await Promise.resolve();
2340
- if (this._runner.epoch === oldEpoch) {
2341
- this.config = this.resolveConfig(this._config);
2342
- await this._execute(this._runner);
2343
- this._error = void 0;
2266
+ _method(type, level) {
2267
+ return (...args) => {
2268
+ if (args.length === 1 && args[0] instanceof Error) {
2269
+ if (args[0].cause) this[type](args[0].cause);
2270
+ else if (isAggregateError(args[0])) {
2271
+ args[0].errors.forEach((error) => this[type](error));
2272
+ return;
2273
+ }
2344
2274
  }
2345
- } catch (reason) {
2346
- this.ctx.logger.error(reason);
2347
- this._error = reason;
2348
- this._runner.epoch = INACTIVE;
2349
- }
2350
- this._updateState(() => {
2351
- if (this._runner.epoch === oldEpoch) this.inertia = void 0;
2352
- else {
2353
- this.inertia = this._unload();
2354
- return 5;
2275
+ const sn = ++this.service._snMessage;
2276
+ const ts = Date.now();
2277
+ for (const exporter of this.service.exporters.values()) {
2278
+ if ((exporter.levels?.[this.name] ?? exporter.levels?.default ?? this.level ?? 2) < level) continue;
2279
+ const message = {
2280
+ sn,
2281
+ ts,
2282
+ type,
2283
+ level,
2284
+ name: this.name,
2285
+ ...this.meta,
2286
+ args
2287
+ };
2288
+ exporter.export(message);
2355
2289
  }
2356
- });
2290
+ };
2357
2291
  }
2358
- async _unload() {
2359
- await Promise.all(this._disposables.clear().map(async (dispose) => {
2360
- try {
2361
- await composeError(async (info) => {
2362
- await Promise.resolve();
2363
- info.error = /* @__PURE__ */ new Error();
2364
- await runDisposable(dispose);
2365
- }, this._runner.getOuterStack);
2366
- } catch (reason) {
2367
- this.ctx.logger.error(reason);
2368
- }
2369
- }));
2370
- this.store = void 0;
2371
- this._updateState(() => {
2372
- if (this._runner.epoch === INACTIVE) this.inertia = void 0;
2373
- else {
2374
- this.inertia = this._reload();
2375
- return 1;
2292
+ };
2293
+ /** ANSI 16-color palette indexes used for logger name coloring. */
2294
+ const c16 = [
2295
+ 6,
2296
+ 2,
2297
+ 3,
2298
+ 4,
2299
+ 5,
2300
+ 1
2301
+ ];
2302
+ /** ANSI 256-color palette indexes used for logger name coloring. */
2303
+ const c256 = [
2304
+ 20,
2305
+ 21,
2306
+ 26,
2307
+ 27,
2308
+ 32,
2309
+ 33,
2310
+ 38,
2311
+ 39,
2312
+ 40,
2313
+ 41,
2314
+ 42,
2315
+ 43,
2316
+ 44,
2317
+ 45,
2318
+ 56,
2319
+ 57,
2320
+ 62,
2321
+ 63,
2322
+ 68,
2323
+ 69,
2324
+ 74,
2325
+ 75,
2326
+ 76,
2327
+ 77,
2328
+ 78,
2329
+ 79,
2330
+ 80,
2331
+ 81,
2332
+ 92,
2333
+ 93,
2334
+ 98,
2335
+ 99,
2336
+ 112,
2337
+ 113,
2338
+ 129,
2339
+ 134,
2340
+ 135,
2341
+ 148,
2342
+ 149,
2343
+ 160,
2344
+ 161,
2345
+ 162,
2346
+ 163,
2347
+ 164,
2348
+ 165,
2349
+ 166,
2350
+ 167,
2351
+ 168,
2352
+ 169,
2353
+ 170,
2354
+ 171,
2355
+ 172,
2356
+ 173,
2357
+ 178,
2358
+ 179,
2359
+ 184,
2360
+ 185,
2361
+ 196,
2362
+ 197,
2363
+ 198,
2364
+ 199,
2365
+ 200,
2366
+ 201,
2367
+ 202,
2368
+ 203,
2369
+ 204,
2370
+ 205,
2371
+ 206,
2372
+ 207,
2373
+ 208,
2374
+ 209,
2375
+ 214,
2376
+ 215,
2377
+ 220,
2378
+ 221
2379
+ ];
2380
+ /**
2381
+ * Built-in logging service.
2382
+ *
2383
+ * Call `ctx.logger()` to create a named logger, or call `ctx.logger.info()`
2384
+ * directly to log with the current fiber-derived name.
2385
+ */
2386
+ var LoggerService = class LoggerService {
2387
+ bufferSize = 1e3;
2388
+ buffer = [];
2389
+ ctx;
2390
+ _snMessage = 0;
2391
+ _snExporter = 0;
2392
+ exporters = /* @__PURE__ */ new Map();
2393
+ constructor(ctx) {
2394
+ const tracker = {
2395
+ property: "ctx",
2396
+ noShadow: true
2397
+ };
2398
+ const self = createCallable("logger", joinPrototype(Object.getPrototypeOf(this), Function.prototype), tracker);
2399
+ Object.assign(self, this);
2400
+ self.ctx = ctx;
2401
+ defineProperty(self, symbols.tracker, tracker);
2402
+ self.exporter({
2403
+ colors: 3,
2404
+ export: (message) => {
2405
+ self.buffer.push(message);
2406
+ const overflow = self.buffer.length - self.bufferSize;
2407
+ if (overflow === 1) self.buffer.shift();
2408
+ else if (overflow > 1) self.buffer.splice(0, overflow);
2376
2409
  }
2377
2410
  });
2411
+ return self;
2378
2412
  }
2379
2413
  /**
2380
- * Wait for current lifecycle work and rethrow startup errors.
2381
- *
2382
- * @returns this fiber, once it has settled into a stable state.
2383
- * @throws the config-validation or plugin-startup error, if any.
2384
- */
2385
- async await() {
2386
- while (this.inertia) await this.inertia;
2387
- if (this._error) throw this._error;
2388
- return this;
2389
- }
2390
- /**
2391
- * Dispose and immediately reload this plugin with its current config.
2414
+ * Register an exporter and dispose it with the current fiber.
2392
2415
  *
2393
- * @returns a promise resolving once the reload settled.
2394
- * @throws {CordisError} `INACTIVE_EFFECT` when the fiber is already disposed.
2416
+ * @param exporter — the sink that receives structured log messages.
2417
+ * @returns a disposer that removes the exporter.
2395
2418
  */
2396
- async restart() {
2397
- const fiber = this.ctx.fiber;
2398
- fiber.assertActive();
2399
- fiber._setEpoch(INACTIVE);
2400
- fiber._refresh();
2401
- await fiber.await();
2419
+ exporter(exporter) {
2420
+ return this.ctx.effect(() => {
2421
+ const id = ++this._snExporter;
2422
+ this.exporters.set(id, exporter);
2423
+ return () => this.exporters.delete(id);
2424
+ }, "ctx.logger.exporter()");
2402
2425
  }
2403
- /**
2404
- * Validate and apply new config, then restart the plugin.
2405
- *
2406
- * Runs the `internal/update` waterfall first, so update hooks (and HMR)
2407
- * can veto or replace the restart.
2408
- *
2409
- * @param config — the new raw config; validated before anything restarts.
2410
- * @param noSave — hint for persistence hooks not to write the change back.
2411
- * @returns nothing; the restart runs behind the `internal/update` waterfall.
2412
- * @throws {ValidationError} when the new config fails validation.
2413
- */
2414
- update(config, noSave = false) {
2415
- const fiber = this.ctx.fiber;
2416
- fiber.assertActive();
2417
- fiber._config = config;
2418
- if (fiber.state !== 2) {
2419
- fiber._error = void 0;
2420
- fiber._setEpoch(INACTIVE);
2421
- fiber._refresh();
2422
- return;
2426
+ _resolveConfig() {
2427
+ let intercept = this.ctx[symbols.intercept];
2428
+ const configs = [];
2429
+ while ("logger" in intercept) {
2430
+ if (Object.hasOwn(intercept, "logger")) configs.unshift(intercept["logger"]);
2431
+ intercept = Object.getPrototypeOf(intercept);
2423
2432
  }
2424
- config = fiber.resolveConfig(config);
2425
- fiber.context.waterfall(fiber, "internal/update", config, noSave, () => {
2426
- fiber.config = config;
2427
- fiber._error = void 0;
2428
- return fiber.restart();
2429
- });
2433
+ return Object.assign({}, ...configs);
2434
+ }
2435
+ [symbols.invoke](name) {
2436
+ const config = this._resolveConfig();
2437
+ const fiber = (this[symbols.caller] ?? this.ctx).fiber;
2438
+ name ??= config.name;
2439
+ name ??= hyphenate(fiber.name);
2440
+ return new Logger({
2441
+ name,
2442
+ level: config.level,
2443
+ meta: { fiber: new WeakRef(fiber) }
2444
+ }, this);
2445
+ }
2446
+ static {
2447
+ for (const type of [
2448
+ "error",
2449
+ "info",
2450
+ "warn",
2451
+ "debug"
2452
+ ]) LoggerService.prototype[type] = function(...args) {
2453
+ return this()[type](...args);
2454
+ };
2430
2455
  }
2431
2456
  };
2432
2457
  //#endregion
@@ -2458,12 +2483,14 @@ var ReflectService = class {
2458
2483
  try {
2459
2484
  const def = target.reflect.props[prop];
2460
2485
  if (def?.type === "accessor") return def.get.call(ctx, ctx[symbols.receiver], error);
2461
- if (!ctx.fiber.runtime) return ctx.reflect.get(prop, false);
2486
+ const defSite = ctx[symbols.shadow] ?? ctx;
2487
+ if (!defSite.fiber.runtime) return ctx.reflect.get(prop, false);
2462
2488
  return ctx.events.waterfall("internal/get", ctx, prop, error, () => {
2463
- const key = target[symbols.isolate][prop];
2464
- let fiber = (ctx[symbols.shadow] ?? ctx).fiber;
2489
+ const key = defSite[symbols.isolate][prop];
2490
+ let fiber = defSite.fiber;
2465
2491
  while (true) {
2466
- const impl = fiber.store?.[prop];
2492
+ let impl = fiber.committed?.[prop];
2493
+ for (const provision of fiber.provisions) if (provision.name === prop && provision.ctx[symbols.isolate][prop] === key) impl = provision;
2467
2494
  if (impl) return getTraceable(ctx, impl.value);
2468
2495
  if (prop in fiber.inject) {
2469
2496
  error.message = `cannot get required service "${prop}" in inactive context`;
@@ -2508,6 +2535,7 @@ var ReflectService = class {
2508
2535
  store = Object.create(null);
2509
2536
  /** Declared context properties (services and accessors), by name. */
2510
2537
  props = Object.create(null);
2538
+ _implCounter = 0;
2511
2539
  constructor(ctx) {
2512
2540
  this.ctx = ctx;
2513
2541
  defineProperty(this, symbols.tracker, {
@@ -2548,7 +2576,7 @@ var ReflectService = class {
2548
2576
  const key = this.ctx[symbols.isolate][name];
2549
2577
  const impl = key && this.store[key];
2550
2578
  if (!impl) return;
2551
- if (strict && impl.fiber.state !== 2) return;
2579
+ if (strict && impl.ctx.fiber.state !== 2) return;
2552
2580
  return impl;
2553
2581
  }
2554
2582
  /**
@@ -2564,7 +2592,7 @@ var ReflectService = class {
2564
2592
  const key = this.ctx[symbols.isolate][name];
2565
2593
  const impl = this.store[key];
2566
2594
  if (!impl) throw new Error(`cannot set property "${name}" without provide`);
2567
- if (impl.fiber !== this.ctx.fiber) throw new Error(`cannot set property "${name}" in multiple fibers`);
2595
+ if (impl.ctx.fiber !== this.ctx.fiber) throw new Error(`cannot set property "${name}" in multiple fibers`);
2568
2596
  impl.value = value;
2569
2597
  return true;
2570
2598
  }
@@ -2586,20 +2614,27 @@ var ReflectService = class {
2586
2614
  this.ctx.root[symbols.isolate][name] ??= Symbol(name);
2587
2615
  const key = this.ctx[symbols.isolate][name];
2588
2616
  const impl = {
2617
+ uid: ++this._implCounter,
2589
2618
  name,
2590
2619
  value,
2591
- fiber: this.ctx.fiber,
2592
- check
2620
+ ctx: this.ctx,
2621
+ check,
2622
+ isolate: key,
2623
+ dependents: /* @__PURE__ */ new Set()
2593
2624
  };
2594
- if (this.store[key]) throw new Error(`service "${name}" has been registered at <${this.store[key].fiber.name}>`);
2625
+ if (this.store[key]) throw new Error(`service "${name}" has been registered at <${this.store[key].ctx.fiber.name}>`);
2595
2626
  this.store[key] = impl;
2596
- this.ctx.fiber.store[name] = impl;
2627
+ this.ctx.fiber.provisions.add(impl);
2597
2628
  if (this.ctx.fiber.state === 2) this.notify([name]);
2598
2629
  return async () => {
2599
- delete this.store[key];
2600
- const fibers = this.notify([name]);
2601
- await Promise.allSettled(fibers.map((fiber) => fiber.await()));
2602
- delete this.ctx.fiber.store[name];
2630
+ if (this.store[impl.isolate] === impl) delete this.store[impl.isolate];
2631
+ this.ctx.isolate(name, impl.isolate).reflect.notify([name]);
2632
+ await new Promise((resolve) => {
2633
+ impl.release = resolve;
2634
+ if (!impl.dependents.size) resolve();
2635
+ });
2636
+ impl.release = void 0;
2637
+ this.ctx.fiber.provisions.delete(impl);
2603
2638
  };
2604
2639
  }, `ctx.provide(${JSON.stringify(name)})`);
2605
2640
  }
@@ -2608,10 +2643,8 @@ var ReflectService = class {
2608
2643
  *
2609
2644
  * @param names — the service names that changed.
2610
2645
  * @param filter — restricts notification to matching isolation scopes.
2611
- * @returns the fibers whose dependency state was refreshed.
2612
2646
  */
2613
2647
  notify(names, filter = (ctx, name) => ctx[symbols.isolate][name] === this.ctx[symbols.isolate][name]) {
2614
- const fibers = [];
2615
2648
  for (const runtime of this.ctx.registry.values()) for (const fiber of runtime.fibers) {
2616
2649
  let hasUpdate = false;
2617
2650
  for (const name of names) {
@@ -2622,14 +2655,12 @@ var ReflectService = class {
2622
2655
  }
2623
2656
  if (!hasUpdate) continue;
2624
2657
  fiber._refresh();
2625
- fibers.push(fiber);
2626
2658
  }
2627
2659
  for (const name of names) {
2628
2660
  const self = Object.create(this.ctx);
2629
2661
  self[symbols.filter] = (target) => filter(target, name);
2630
2662
  this.ctx.events.emit(self, "internal/service", name, this._getImpl(name, false)?.value);
2631
2663
  }
2632
- return fibers;
2633
2664
  }
2634
2665
  /**
2635
2666
  * Define a computed context property backed by get/set hooks.
@@ -7681,7 +7712,6 @@ function fourDigitYearEpoch(value) {
7681
7712
  epoch
7682
7713
  });
7683
7714
  }
7684
- Number.MAX_SAFE_INTEGER;
7685
7715
  //#endregion
7686
7716
  //#region ../session-format-v0-to-v1/src/validation-helpers.ts
7687
7717
  /**