@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
@@ -1,26 +1,13 @@
1
1
  /**
2
- * Strict Schedule decoding, replay, time validation, and framing.
2
+ * Host task decoding, timing validation, occurrence selection, and reminder framing.
3
3
  * @module @deepseek-ai/dsh-schedule
4
4
  */
5
5
  import { Temporal } from '@js-temporal/polyfill';
6
- import { MAX_FOUR_DIGIT_YEAR_MS, MIN_FOUR_DIGIT_YEAR_MS, canonicalizeTimeZone as canonicalizeSharedTimeZone, formatFourDigitYearInstant, fourDigitYearEpoch, isFourDigitYearInstant, parseLocalCalendar, parseOffsetInstant, resolveLocalInstant, } from '@deepseek-ai/dsh-util-time';
7
- import { SessionLogOffset } from '@deepseek-ai/dsh-session';
8
- /** Durable Schedule protocol version implemented by this package. */
9
- export const SCHEDULE_CHANGE_VERSION = 1;
10
- /** Fixed v1 lower bound for a fixed-rate reminder. */
6
+ import { Cron, RRule, MAX_FOUR_DIGIT_YEAR_MS, MIN_FOUR_DIGIT_YEAR_MS, canonicalizeTimeZone as canonicalizeSharedTimeZone, formatFourDigitYearInstant, fourDigitYearEpoch, isFourDigitYearInstant, parseLocalCalendar, parseOffsetInstant, resolveLocalInstant, } from '@deepseek-ai/dsh-util-time';
7
+ /** Minimum supported fixed-rate interval. */
11
8
  export const MIN_EVERY_INTERVAL_SECONDS = 60;
12
- /** Fixed v1 upper bound for a stored task title. */
9
+ /** Maximum stored task title length. */
13
10
  export const MAX_TITLE_LENGTH = 120;
14
- /**
15
- * Longest forward or backward walk of the cron date search, in years.
16
- *
17
- * The proleptic Gregorian leap-year and weekday alignment repeats every 400
18
- * years, so a rule that matches any local date has a match within this window;
19
- * walking further can only reach a rule that never matches. Bounding the walk
20
- * keeps a valid but unsatisfiable rule's creation and decision cost fixed
21
- * instead of enumerating candidate dates toward the four-digit-year ceiling.
22
- */
23
- export const CRON_SEARCH_HORIZON_YEARS = 400;
24
11
  const LOCAL_CLOCK_TIME = /^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d{1,3})?$/;
25
12
  /** Error from malformed or transition-invalid durable Schedule data. */
26
13
  export class ScheduleLogError extends Error {
@@ -52,27 +39,31 @@ export class ScheduleInputError extends Error {
52
39
  }
53
40
  }
54
41
  /**
55
- * Brand a raw session-local id without changing its runtime value.
56
- * @param value - Raw session-local id.
42
+ * Brand a raw task id without changing its runtime value.
43
+ * @param value - Raw task id.
57
44
  * @returns The same string with the Schedule brand.
58
45
  */
59
46
  export function ScheduleId(value) {
60
47
  return value;
61
48
  }
62
- /** Whether an unknown value is a non-array object. */
63
- function isRecord(value) {
49
+ /**
50
+ * Narrow an unknown value to a non-array object.
51
+ * @param value - Value to inspect.
52
+ * @returns Whether the value is a non-null, non-array object.
53
+ */
54
+ export function isRecord(value) {
64
55
  return typeof value === 'object' && value !== null && !Array.isArray(value);
65
56
  }
66
- /** Require exactly the named durable object keys. */
67
- function hasExactKeys(value, expected) {
57
+ /**
58
+ * Require exactly the named durable object keys.
59
+ * @param value - Object to inspect.
60
+ * @param expected - Complete allowed key set.
61
+ * @returns Whether every expected key is present and no other key is present.
62
+ */
63
+ export function hasExactKeys(value, expected) {
68
64
  const allowed = new Set(expected);
69
65
  return expected.every(key => key in value) && Object.keys(value).every(key => allowed.has(key));
70
66
  }
71
- /** Require the named durable keys while admitting further optional members. */
72
- function hasExactKeysWithOptional(value, required, optional) {
73
- const allowed = new Set([...required, ...optional]);
74
- return required.every(key => key in value) && Object.keys(value).every(key => allowed.has(key));
75
- }
76
67
  /** Stable diagnostic for a title that is missing or empty after trimming. */
77
68
  export const REQUIRED_TITLE_MESSAGE = 'title is required and must be non-empty after trimming.';
78
69
  /**
@@ -131,24 +122,11 @@ function decodeRecordTitle(value, expected, message) {
131
122
  return title;
132
123
  }
133
124
  /**
134
- * Decode the stored title of one historical `schedule/change` create record.
135
- *
136
- * A version-1 event written before names existed has no `title` member, so the
137
- * key set is required without it and the absent member decodes as undefined. A
138
- * present title stays subject to the canonical stored form.
139
- * @param value - Untrusted durable record already known to be an object.
140
- * @param expected - Exact keys the record may carry; `title` is optional within them.
141
- * @param message - Diagnostic naming the record's keys.
142
- * @returns The stored title, or undefined when the historical record predates it.
125
+ * Validate one stable task id at the durable boundary.
126
+ * @param value - Untrusted durable id field.
127
+ * @returns The branded id; an invalid id throws ScheduleLogError.
143
128
  */
144
- function decodeHistoricalRecordTitle(value, expected, message) {
145
- const keys = expected.filter(key => key !== 'title');
146
- if (!hasExactKeysWithOptional(value, keys, ['title']))
147
- throw new ScheduleLogError(message);
148
- return value['title'] === undefined ? undefined : decodeStoredTitle(value['title']);
149
- }
150
- /** Validate one stable session-local id at the durable boundary. */
151
- function decodeId(value) {
129
+ export function decodeId(value) {
152
130
  if (typeof value !== 'string' || value.length === 0 || value.trim() !== value) {
153
131
  throw new ScheduleLogError('schedule id must be a non-empty string without surrounding whitespace');
154
132
  }
@@ -156,8 +134,12 @@ function decodeId(value) {
156
134
  }
157
135
  /** Stable Schedule diagnostic for a `scheduledAt` outside the canonical profile. */
158
136
  const NON_CANONICAL_INSTANT_MESSAGE = 'scheduledAt must be a canonical four-digit-year RFC 3339 UTC instant';
159
- /** Validate one canonical four-digit-year UTC instant. */
160
- function decodeInstant(value) {
137
+ /**
138
+ * Validate one canonical four-digit-year UTC instant at the durable boundary.
139
+ * @param value - Untrusted durable instant field.
140
+ * @returns The canonical instant; an invalid instant throws ScheduleLogError.
141
+ */
142
+ export function decodeInstant(value) {
161
143
  if (typeof value !== 'string') {
162
144
  throw new ScheduleLogError(NON_CANONICAL_INSTANT_MESSAGE);
163
145
  }
@@ -253,8 +235,13 @@ function resolveLocalAt(parts, timeZone) {
253
235
  }
254
236
  return target;
255
237
  }
256
- /** Require a safe, representable, strictly future UTC target. */
257
- function futureInstant(epoch, now) {
238
+ /**
239
+ * Require a safe, representable, strictly future UTC target.
240
+ * @param epoch - Candidate target in epoch milliseconds.
241
+ * @param now - Exclusive lower bound in epoch milliseconds.
242
+ * @returns The canonical UTC instant; an out-of-range or past target throws ScheduleInputError.
243
+ */
244
+ export function futureInstant(epoch, now) {
258
245
  const instant = formatFourDigitYearInstant(epoch);
259
246
  if (!Number.isSafeInteger(now) || instant === undefined) {
260
247
  throw new ScheduleInputError('time_out_of_range', 'The scheduled time must be representable as a four-digit-year RFC 3339 UTC instant.');
@@ -284,12 +271,9 @@ function parseAtOffsetInstant(value) {
284
271
  }
285
272
  }
286
273
  }
287
- /** Decode the exact v1 after record shape. */
274
+ /** Decode a delayed one-shot Host record. */
288
275
  function decodeAfterRecord(value) {
289
- /* v8 ignore next -- decodeLegacyScheduleRecord rejects a non-object before it dispatches here. */
290
- if (!isRecord(value))
291
- throw new ScheduleLogError('after schedule must be an object');
292
- const title = decodeHistoricalRecordTitle(value, ['id', 'kind', 'title', 'prompt', 'afterSeconds', 'scheduledAt'], 'after schedule must contain exactly id, kind, title, prompt, afterSeconds, and scheduledAt');
276
+ const title = decodeRecordTitle(value, ['id', 'kind', 'title', 'prompt', 'afterSeconds', 'scheduledAt'], 'after schedule must contain exactly id, kind, title, prompt, afterSeconds, and scheduledAt');
293
277
  const prompt = value['prompt'];
294
278
  if (typeof prompt !== 'string' || prompt.length === 0 || prompt.trim() !== prompt) {
295
279
  throw new ScheduleLogError('after prompt must be non-empty and already trimmed');
@@ -301,18 +285,15 @@ function decodeAfterRecord(value) {
301
285
  return Object.freeze({
302
286
  id: decodeId(value['id']),
303
287
  kind: 'after',
304
- ...(title === undefined ? {} : { title }),
288
+ title,
305
289
  prompt,
306
290
  afterSeconds: afterSeconds,
307
291
  scheduledAt: decodeInstant(value['scheduledAt']),
308
292
  });
309
293
  }
310
- /** Decode the exact v1 absolute one-shot record shape. */
294
+ /** Decode an absolute one-shot Host record. */
311
295
  function decodeAtRecord(value) {
312
- /* v8 ignore next -- decodeLegacyScheduleRecord rejects a non-object before it dispatches here. */
313
- if (!isRecord(value))
314
- throw new ScheduleLogError('at schedule must be an object');
315
- const title = decodeHistoricalRecordTitle(value, ['id', 'kind', 'title', 'prompt', 'scheduledAt'], 'at schedule must contain exactly id, kind, title, prompt, and scheduledAt');
296
+ const title = decodeRecordTitle(value, ['id', 'kind', 'title', 'prompt', 'scheduledAt'], 'at schedule must contain exactly id, kind, title, prompt, and scheduledAt');
316
297
  const prompt = value['prompt'];
317
298
  if (typeof prompt !== 'string' || prompt.length === 0 || prompt.trim() !== prompt) {
318
299
  throw new ScheduleLogError('at prompt must be non-empty and already trimmed');
@@ -320,17 +301,14 @@ function decodeAtRecord(value) {
320
301
  return Object.freeze({
321
302
  id: decodeId(value['id']),
322
303
  kind: 'at',
323
- ...(title === undefined ? {} : { title }),
304
+ title,
324
305
  prompt,
325
306
  scheduledAt: decodeInstant(value['scheduledAt']),
326
307
  });
327
308
  }
328
- /** Decode the exact v1 fixed-rate record shape. */
309
+ /** Decode a fixed-rate Host record. */
329
310
  function decodeEveryRecord(value) {
330
- /* v8 ignore next -- decodeLegacyScheduleRecord rejects a non-object before it dispatches here. */
331
- if (!isRecord(value))
332
- throw new ScheduleLogError('every schedule must be an object');
333
- const title = decodeHistoricalRecordTitle(value, ['id', 'kind', 'title', 'prompt', 'everySeconds', 'scheduledAt'], 'every schedule must contain exactly id, kind, title, prompt, everySeconds, and scheduledAt');
311
+ const title = decodeRecordTitle(value, ['id', 'kind', 'title', 'prompt', 'everySeconds', 'scheduledAt'], 'every schedule must contain exactly id, kind, title, prompt, everySeconds, and scheduledAt');
334
312
  const prompt = value['prompt'];
335
313
  if (typeof prompt !== 'string' || prompt.length === 0 || prompt.trim() !== prompt) {
336
314
  throw new ScheduleLogError('every prompt must be non-empty and already trimmed');
@@ -345,7 +323,7 @@ function decodeEveryRecord(value) {
345
323
  return Object.freeze({
346
324
  id: decodeId(value['id']),
347
325
  kind: 'every',
348
- ...(title === undefined ? {} : { title }),
326
+ title,
349
327
  prompt,
350
328
  everySeconds: everySeconds,
351
329
  scheduledAt: decodeInstant(value['scheduledAt']),
@@ -377,9 +355,6 @@ export function weeklyTime(value) {
377
355
  }
378
356
  /** Fail already-typed durable values without wrapping the stored-data diagnostic. */
379
357
  function rethrowLogError(error) {
380
- /* v8 ignore next -- every wrapped call raises ScheduleInputError, so this pass-through never fires. */
381
- if (error instanceof ScheduleLogError)
382
- throw error;
383
358
  throw new ScheduleLogError(String(error));
384
359
  }
385
360
  /** Decode a Host daily rule without re-resolving its committed UTC target. */
@@ -504,7 +479,7 @@ function decodeCronRecord(value) {
504
479
  }
505
480
  let canonical;
506
481
  try {
507
- canonical = parseCronExpression(expression).expression;
482
+ canonical = canonicalizeCronExpression(expression);
508
483
  }
509
484
  catch (error) {
510
485
  rethrowLogError(error);
@@ -517,94 +492,22 @@ function decodeCronRecord(value) {
517
492
  });
518
493
  }
519
494
  /**
520
- * Decode a current Host task record, preserving its committed target and stored zone spelling.
521
- *
522
- * Every variant of a stored Host task carries its title, so the historical
523
- * one-shot variants are re-checked for that member after their shape decodes.
495
+ * Decode one of the seven current Host timing records without recomputing its committed occurrence.
524
496
  * @param value - Untrusted durable JSON record.
525
- * @returns Detached frozen record; malformed fields throw ScheduleLogError.
497
+ * @returns Detached frozen record with its required title and authoritative timing fields.
526
498
  */
527
499
  export function decodeScheduleRecord(value) {
528
- if (isRecord(value) && value['kind'] === 'daily')
529
- return decodeDailyRecord(value);
530
- if (isRecord(value) && value['kind'] === 'weekly')
531
- return decodeWeeklyRecord(value);
532
- if (isRecord(value) && value['kind'] === 'cron')
533
- return decodeCronRecord(value);
534
- const record = decodeLegacyScheduleRecord(value);
535
- if (record.title === undefined)
536
- throw new ScheduleLogError(REQUIRED_TITLE_MESSAGE);
537
- return record;
538
- }
539
- /**
540
- * Decode only the variants admitted by historical version-1 Session events.
541
- *
542
- * A record written before titles existed decodes without that member, so the
543
- * fold keeps reading a log that the current creation path could not write.
544
- * @param value - Untrusted durable JSON record from a Session event.
545
- * @returns Detached frozen record, without a title when the event omitted it.
546
- */
547
- function decodeLegacyScheduleRecord(value) {
548
500
  if (!isRecord(value))
549
501
  throw new ScheduleLogError('schedule record must be an object');
550
502
  switch (value['kind']) {
551
503
  case 'after': return decodeAfterRecord(value);
552
504
  case 'at': return decodeAtRecord(value);
553
505
  case 'every': return decodeEveryRecord(value);
554
- default: throw new ScheduleLogError('v1 schedule kind must be "after", "at", or "every"');
555
- }
556
- }
557
- /**
558
- * Decode one strict version-1 `schedule/change` payload.
559
- * @param value - Untrusted durable JSON value.
560
- * @returns Detached, frozen Schedule change.
561
- */
562
- export function decodeScheduleChange(value) {
563
- if (!isRecord(value))
564
- throw new ScheduleLogError('schedule/change payload must be an object');
565
- if (value['version'] !== SCHEDULE_CHANGE_VERSION) {
566
- throw new ScheduleLogError('schedule/change version must be 1');
567
- }
568
- switch (value['operation']) {
569
- case 'create':
570
- if (!hasExactKeys(value, ['version', 'operation', 'schedule'])) {
571
- throw new ScheduleLogError('schedule create must contain exactly version, operation, and schedule');
572
- }
573
- return Object.freeze({
574
- version: SCHEDULE_CHANGE_VERSION,
575
- operation: 'create',
576
- schedule: decodeLegacyScheduleRecord(value['schedule']),
577
- });
578
- case 'delete': {
579
- if (!hasExactKeys(value, ['version', 'operation', 'id'])) {
580
- throw new ScheduleLogError('schedule delete must contain exactly version, operation, and id');
581
- }
582
- return Object.freeze({
583
- version: SCHEDULE_CHANGE_VERSION,
584
- operation: 'delete',
585
- id: decodeId(value['id']),
586
- });
587
- }
588
- case 'dispatch': {
589
- if (hasExactKeys(value, ['version', 'operation', 'id'])) {
590
- return Object.freeze({
591
- version: SCHEDULE_CHANGE_VERSION,
592
- operation: 'dispatch',
593
- id: decodeId(value['id']),
594
- });
595
- }
596
- if (hasExactKeys(value, ['version', 'operation', 'id', 'acceptedAt'])) {
597
- return Object.freeze({
598
- version: SCHEDULE_CHANGE_VERSION,
599
- operation: 'dispatch',
600
- id: decodeId(value['id']),
601
- acceptedAt: decodeInstant(value['acceptedAt']),
602
- });
603
- }
604
- throw new ScheduleLogError('schedule dispatch must contain id and optional acceptedAt only');
605
- }
606
- default:
607
- throw new ScheduleLogError('schedule/change operation must be create, delete, or dispatch');
506
+ case 'daily': return decodeDailyRecord(value);
507
+ case 'weekly': return decodeWeeklyRecord(value);
508
+ case 'cron': return decodeCronRecord(value);
509
+ case 'rrule': return decodeRRuleScheduleRecord(value);
510
+ default: throw new ScheduleLogError('schedule kind must be "after", "at", "every", "daily", "weekly", "cron", or "rrule"');
608
511
  }
609
512
  }
610
513
  /**
@@ -686,8 +589,13 @@ function latestDueOccurrence(timeZone, matches, time, acceptedAt, savedTarget) {
686
589
  return Math.max(candidate, savedTarget);
687
590
  }
688
591
  }
689
- /** Resolve a wall-clock rule only when its decision is at a representable four-digit-year instant. */
690
- function acceptedDecision(selector, acceptedAt) {
592
+ /**
593
+ * Resolve a wall-clock rule only when its decision is at a representable four-digit-year instant.
594
+ * @param selector - Rule kind named in the failure message.
595
+ * @param acceptedAt - Explicit wall-clock decision time in epoch milliseconds.
596
+ * @returns The validated decision time.
597
+ */
598
+ export function acceptedDecision(selector, acceptedAt) {
691
599
  if (!isFourDigitYearInstant(acceptedAt)) {
692
600
  throw new ScheduleLogError(`${selector} acceptedAt must be a representable four-digit-year instant`);
693
601
  }
@@ -745,158 +653,16 @@ export function resolveWeeklyOccurrence(record, acceptedAt) {
745
653
  return Object.freeze(nextScheduledAt === undefined ? { occurrenceAt } : { occurrenceAt, nextScheduledAt });
746
654
  }
747
655
  /**
748
- * Build the local-date predicate of one parsed cron rule under Vixie day-of-month/day-of-week semantics.
749
- *
750
- * The star flag selects the branch only; it never excuses a field's matched values.
751
- * When either field text starts with `*`, a local date must satisfy BOTH fields, so a
752
- * stepped star such as `*` followed by `/2` still restricts the dates it matches. A bare
753
- * `*` matches every value, which makes that field's match always true and degrades the
754
- * AND to the other field, exactly like Vixie's `DOM_STAR`/`DOW_STAR` test. Only when
755
- * neither field text starts with `*` does either field matching suffice.
756
- * @param parsed - Parsed cron rule with canonical field text and matched values.
757
- * @returns Whether one local date matches the rule.
758
- */
759
- function cronDateMatch(parsed) {
760
- const months = new Set(parsed.months);
761
- const daysOfMonth = new Set(parsed.daysOfMonth);
762
- const daysOfWeek = new Set(parsed.daysOfWeek);
763
- const dayOfMonthRestricted = !parsed.dayOfMonthStar;
764
- const dayOfWeekRestricted = !parsed.dayOfWeekStar;
765
- return (date) => {
766
- /* v8 ignore next -- both callers pre-filter by month before matching a date. */
767
- if (!months.has(date.month))
768
- return false;
769
- const dayOfMonth = daysOfMonth.has(date.day);
770
- const dayOfWeek = daysOfWeek.has(date.dayOfWeek % 7);
771
- if (dayOfMonthRestricted && dayOfWeekRestricted)
772
- return dayOfMonth || dayOfWeek;
773
- return dayOfMonth && dayOfWeek;
774
- };
775
- }
776
- /** Enumerate one parsed cron rule's local times of day in ascending wall-clock order. */
777
- function cronTimes(parsed) {
778
- const times = [];
779
- for (const hour of parsed.hours) {
780
- for (const minute of parsed.minutes)
781
- times.push(Temporal.PlainTime.from({ hour, minute }));
782
- }
783
- return times;
784
- }
785
- /**
786
- * Find the first strictly future cron occurrence without leaving the four-digit UTC year range.
787
- *
788
- * The walk stops at {@link CRON_SEARCH_HORIZON_YEARS} past the floor date when that
789
- * horizon precedes the four-digit ceiling: a rule with no match inside the horizon
790
- * never matches, so its search resolves to exhaustion instead of scanning to the ceiling.
791
- * @param parsed - Parsed cron rule.
792
- * @param timeZone - Explicit zone interpreting its local date and time.
793
- * @param floor - Instant every returned target must exceed.
794
- * @returns The first matching target, or exhaustion as undefined.
795
- */
796
- function nextCronTarget(parsed, timeZone, floor) {
797
- const times = cronTimes(parsed);
798
- const matches = cronDateMatch(parsed);
799
- const months = new Set(parsed.months);
800
- const firstDate = localDate(floor, timeZone);
801
- let date = firstDate;
802
- // The floor's own local wall clock, so the first date converts only candidates
803
- // that can exceed it instead of its whole day of times.
804
- const floorTime = Temporal.Instant.fromEpochMilliseconds(floor).toZonedDateTimeISO(timeZone).toPlainTime();
805
- const ceiling = localDate(MAX_FOUR_DIGIT_YEAR_MS, 'UTC').add({ days: 1 });
806
- const horizon = date.add({ years: CRON_SEARCH_HORIZON_YEARS });
807
- const lastDate = Temporal.PlainDate.compare(horizon, ceiling) < 0 ? horizon : ceiling;
808
- while (Temporal.PlainDate.compare(date, lastDate) <= 0) {
809
- if (!months.has(date.month)) {
810
- date = date.add({ months: 1 }).with({ day: 1 });
811
- continue;
812
- }
813
- if (matches(date)) {
814
- for (const time of times) {
815
- if (date.equals(firstDate) && Temporal.PlainTime.compare(time, floorTime) < 0)
816
- continue;
817
- const target = resolveLocalInstant(date.toPlainDateTime(time), timeZone);
818
- if (target === undefined)
819
- continue;
820
- if (target > MAX_FOUR_DIGIT_YEAR_MS)
821
- return undefined;
822
- if (target >= MIN_FOUR_DIGIT_YEAR_MS && target > floor)
823
- return new Date(target).toISOString();
824
- }
825
- }
826
- date = date.add({ days: 1 });
827
- }
828
- return undefined;
829
- }
830
- /**
831
- * Find the latest matching cron occurrence at or before a decision without leaving the committed floor.
832
- *
833
- * The walk stops at {@link CRON_SEARCH_HORIZON_YEARS} before the decision date when that
834
- * horizon follows the four-digit floor, which is the local date holding that floor instant
835
- * in the rule's own zone: a rule with no match inside the horizon keeps the committed target
836
- * instead of scanning back to the floor, and a candidate before the floor instant is skipped.
837
- * @param parsed - Parsed cron rule.
838
- * @param timeZone - Explicit zone interpreting its local date and time.
839
- * @param decision - Wall-clock decision time in epoch milliseconds.
840
- * @param savedTarget - Committed target that stays due even when current zone data resolves past it.
841
- * @returns The latest due occurrence, or the committed target when no local occurrence is representable.
842
- */
843
- function latestCronOccurrence(parsed, timeZone, decision, savedTarget) {
844
- const times = cronTimes(parsed);
845
- const matches = cronDateMatch(parsed);
846
- const months = new Set(parsed.months);
847
- // Offsets are less than 24 hours; a date-line rollback can make a due local date
848
- // later than the UTC decision date, which is why the walk starts one day after it.
849
- let date = localDate(decision, 'UTC').add({ days: 1 });
850
- // The floor is an instant: the earliest local date the walk may reach is the one
851
- // holding it in the rule's own zone, and candidates below it are skipped, so a
852
- // negative offset can still resolve a due local minute dated before the UTC floor.
853
- const floorDate = localDate(MIN_FOUR_DIGIT_YEAR_MS, timeZone);
854
- const horizon = date.subtract({ years: CRON_SEARCH_HORIZON_YEARS });
855
- const firstDate = Temporal.PlainDate.compare(horizon, floorDate) > 0 ? horizon : floorDate;
856
- while (Temporal.PlainDate.compare(date, firstDate) >= 0) {
857
- if (!months.has(date.month)) {
858
- date = date.with({ day: 1 }).subtract({ days: 1 });
859
- continue;
860
- }
861
- if (matches(date)) {
862
- // One conversion of the date's earliest wall clock decides whether the whole
863
- // date lies beyond the decision: every later time on it is later too, so the
864
- // walk steps back instead of converting the rest of a day that cannot match.
865
- // An earliest time that a DST gap removes leaves the bound to the first time
866
- // that does exist, and a date with no existing time keeps the full walk.
867
- const earliest = times.reduce((found, time) => found ?? resolveLocalInstant(date.toPlainDateTime(time), timeZone), undefined);
868
- if (earliest !== undefined && earliest > decision) {
869
- date = date.subtract({ days: 1 });
870
- continue;
871
- }
872
- for (const time of [...times].reverse()) {
873
- const candidate = resolveLocalInstant(date.toPlainDateTime(time), timeZone);
874
- if (candidate === undefined || candidate > decision || candidate < MIN_FOUR_DIGIT_YEAR_MS)
875
- continue;
876
- // A committed target remains due even if current tzdata places the rule before it.
877
- return Math.max(candidate, savedTarget);
878
- }
879
- }
880
- date = date.subtract({ days: 1 });
881
- }
882
- return savedTarget;
883
- }
884
- /**
885
- * Resolve a cron decision near the decision's local date, not across its missed history.
886
- * @param record - Cron rule with a committed earliest unaccepted UTC target.
887
- * @param acceptedAt - Explicit wall-clock decision time, at or after the committed target.
888
- * @returns Latest actual due occurrence and the first future occurrence.
656
+ * Resolve a Cron rule through the shared bounded recurrence engine.
657
+ * @param record - Authoritative Cron expression, zone, and committed occurrence.
658
+ * @param acceptedAt - Decision time at or after the committed occurrence.
659
+ * @returns The latest due occurrence and optional future successor.
889
660
  */
890
661
  export function resolveCronOccurrence(record, acceptedAt) {
891
- const decision = acceptedDecision('cron', acceptedAt);
892
- const savedTarget = Date.parse(record.scheduledAt);
893
- if (decision < savedTarget)
662
+ acceptedDecision('cron', acceptedAt);
663
+ if (acceptedAt < Date.parse(record.scheduledAt))
894
664
  throw new ScheduleLogError('cron dispatch cannot precede the active scheduledAt');
895
- const parsed = parseCronExpression(record.expression);
896
- const occurrence = latestCronOccurrence(parsed, record.timeZone, decision, savedTarget);
897
- const occurrenceAt = new Date(occurrence).toISOString();
898
- const nextScheduledAt = nextCronTarget(parsed, record.timeZone, decision);
899
- return Object.freeze(nextScheduledAt === undefined ? { occurrenceAt } : { occurrenceAt, nextScheduledAt });
665
+ return readRecurrence(Cron.parse(record.expression, record.timeZone)).resolve(record.scheduledAt, acceptedAt);
900
666
  }
901
667
  /**
902
668
  * Identify recurring Host records explicitly, excluding both one-shot variants.
@@ -904,7 +670,7 @@ export function resolveCronOccurrence(record, acceptedAt) {
904
670
  * @returns Whether the record uses a recurring rule.
905
671
  */
906
672
  export function isRecurringScheduleRecord(record) {
907
- return record.kind === 'every' || record.kind === 'daily' || record.kind === 'weekly' || record.kind === 'cron';
673
+ return record.kind === 'every' || record.kind === 'daily' || record.kind === 'weekly' || record.kind === 'cron' || record.kind === 'rrule';
908
674
  }
909
675
  /**
910
676
  * Resolve one due recurring Host record with its rule-specific calendar or interval arithmetic.
@@ -918,112 +684,9 @@ export function resolveRecurringOccurrence(record, acceptedAt) {
918
684
  case 'daily': return resolveDailyOccurrence(record, acceptedAt);
919
685
  case 'weekly': return resolveWeeklyOccurrence(record, acceptedAt);
920
686
  case 'cron': return resolveCronOccurrence(record, acceptedAt);
687
+ case 'rrule': return resolveRRuleOccurrence(record, acceptedAt);
921
688
  }
922
689
  }
923
- /** Apply one decoded dispatch to its exact active record. */
924
- function dispatchedRecord(record, change) {
925
- const hasAcceptedAt = 'acceptedAt' in change;
926
- if (record.kind !== 'every') {
927
- if (hasAcceptedAt)
928
- throw new ScheduleLogError('one-shot dispatch must not contain acceptedAt');
929
- return undefined;
930
- }
931
- if (!hasAcceptedAt)
932
- throw new ScheduleLogError('every dispatch must contain acceptedAt');
933
- const occurrence = resolveEveryOccurrence(record, Date.parse(change.acceptedAt));
934
- return occurrence.nextScheduledAt === undefined
935
- ? undefined
936
- : Object.freeze({ ...record, scheduledAt: occurrence.nextScheduledAt });
937
- }
938
- /**
939
- * Apply already-decoded Schedule changes to one complete fold value.
940
- *
941
- * The transition authority for full-log replay. One mutable Map/Set pair spans
942
- * the whole batch; the returned arrays are materialized and frozen once.
943
- * @param folded - complete active records and used-id history before the changes.
944
- * @param changes - strictly decoded durable mutations in log order.
945
- * @returns the complete fold value after every mutation.
946
- */
947
- export function applyScheduleChanges(folded, changes) {
948
- const active = new Map(folded.active.map(record => [record.id, record]));
949
- const seen = new Set(folded.seenIds);
950
- for (const change of changes) {
951
- switch (change.operation) {
952
- case 'create':
953
- if (seen.has(change.schedule.id)) {
954
- throw new ScheduleLogError(`schedule id ${JSON.stringify(change.schedule.id)} was reused`);
955
- }
956
- seen.add(change.schedule.id);
957
- active.set(change.schedule.id, change.schedule);
958
- break;
959
- case 'delete':
960
- if (!active.delete(change.id)) {
961
- throw new ScheduleLogError(`schedule delete targets inactive id ${JSON.stringify(change.id)}`);
962
- }
963
- break;
964
- case 'dispatch': {
965
- const record = active.get(change.id);
966
- if (record === undefined) {
967
- throw new ScheduleLogError(`schedule dispatch targets inactive id ${JSON.stringify(change.id)}`);
968
- }
969
- const next = dispatchedRecord(record, change);
970
- if (next === undefined)
971
- active.delete(change.id);
972
- else
973
- active.set(change.id, next);
974
- break;
975
- }
976
- /* v8 ignore next 3 -- decodeScheduleChange returns a closed operation union. */
977
- default: {
978
- const unreachable = change;
979
- throw new ScheduleLogError(`unknown decoded schedule change ${String(unreachable)}`);
980
- }
981
- }
982
- }
983
- return Object.freeze({
984
- active: Object.freeze([...active.values()]),
985
- seenIds: Object.freeze([...seen]),
986
- });
987
- }
988
- /**
989
- * Fold the package-owned stream after the durable fork seed boundary.
990
- * @param events - Complete ordered session log or candidate-extended log.
991
- * @param inheritedEventCount - Inherited prefix length excluded from child ownership.
992
- * @returns Active records and all previously used ids.
993
- */
994
- export function foldScheduleEvents(events, inheritedEventCount = SessionLogOffset(0)) {
995
- if (!Number.isSafeInteger(inheritedEventCount)
996
- || inheritedEventCount < 0
997
- || inheritedEventCount > events.length) {
998
- throw new ScheduleLogError('schedule inheritedEventCount must be within the supplied event log');
999
- }
1000
- const initial = Object.freeze({
1001
- active: Object.freeze([]),
1002
- seenIds: Object.freeze([]),
1003
- });
1004
- const changes = function* () {
1005
- for (const event of events.slice(inheritedEventCount)) {
1006
- if (event.type === 'schedule/change')
1007
- yield decodeScheduleChange(event.data);
1008
- }
1009
- };
1010
- return applyScheduleChanges(initial, changes());
1011
- }
1012
- /**
1013
- * Allocate the next readable id without reusing any prior session-local id.
1014
- * @param folded - Fold containing every previously created id.
1015
- * @returns A fresh `schedule-N` identity.
1016
- */
1017
- export function allocateScheduleId(folded) {
1018
- const seen = new Set(folded.seenIds);
1019
- let sequence = seen.size + 1;
1020
- let candidate = ScheduleId(`schedule-${sequence}`);
1021
- while (seen.has(candidate)) {
1022
- sequence += 1;
1023
- candidate = ScheduleId(`schedule-${sequence}`);
1024
- }
1025
- return candidate;
1026
- }
1027
690
  /**
1028
691
  * Validate a model after rule and compute its durable target.
1029
692
  * @param id - Already allocated task id.
@@ -1226,7 +889,7 @@ export function createCronScheduleRecord(id, prompt, cron, now, title) {
1226
889
  if (!isFourDigitYearInstant(now)) {
1227
890
  throw new ScheduleInputError('time_out_of_range', 'Cron creation time must be a representable four-digit-year UTC instant.');
1228
891
  }
1229
- const scheduledAt = nextCronTarget(parseCronExpression(expression), timeZone, now);
892
+ const scheduledAt = readRecurrence(Cron.parse(expression, timeZone)).next(now);
1230
893
  if (scheduledAt === undefined) {
1231
894
  throw new ScheduleInputError('time_out_of_range', 'No future cron occurrence is representable as a four-digit-year UTC instant.');
1232
895
  }
@@ -1254,242 +917,20 @@ export function parseWeeklyInput(weekly) {
1254
917
  weekdays: normalizeWeekdays(weekly['weekdays']),
1255
918
  };
1256
919
  }
1257
- const CRON_FIELDS = [
1258
- { name: 'minute', min: 0, max: 59, canonicalMax: 59 },
1259
- { name: 'hour', min: 0, max: 23, canonicalMax: 23 },
1260
- { name: 'day-of-month', min: 1, max: 31, canonicalMax: 31 },
1261
- { name: 'month', min: 1, max: 12, canonicalMax: 12 },
1262
- { name: 'day-of-week', min: 0, max: 7, canonicalMax: 6 },
1263
- ];
1264
- /** Build the stable diagnostic for one malformed cron field element. */
1265
- function invalidCronField(spec, element) {
1266
- return new ScheduleInputError('invalid_rule', `cron.expression ${spec.name} field element ${JSON.stringify(element)} must be *, a value, a-b, */n, a-b/n, `
1267
- + 'or a comma-separated list of those.');
1268
- }
1269
- /** Read one in-range cron field value. */
1270
- function cronFieldValue(text, spec) {
1271
- const value = Number(text);
1272
- if (!Number.isSafeInteger(value) || value < spec.min || value > spec.max) {
1273
- throw new ScheduleInputError('invalid_rule', `cron.expression ${spec.name} field value ${text} is outside ${spec.min}-${spec.max}.`);
1274
- }
1275
- return value;
1276
- }
1277
- /** Read one positive cron field step. */
1278
- function cronFieldStep(text, spec) {
1279
- const step = Number(text);
1280
- if (!Number.isSafeInteger(step) || step < 1) {
1281
- throw new ScheduleInputError('invalid_rule', `cron.expression ${spec.name} field step must be a positive integer.`);
1282
- }
1283
- return step;
1284
- }
1285
- /** Expand one comma-separated cron field into its matched value set. */
1286
- function cronFieldValues(raw, spec) {
1287
- const matched = new Set();
1288
- for (const element of raw.split(',')) {
1289
- if (element.length === 0) {
1290
- throw new ScheduleInputError('invalid_rule', `cron.expression ${spec.name} field must not contain an empty list element.`);
1291
- }
1292
- if (element === '*') {
1293
- for (let value = spec.min; value <= spec.max; value += 1)
1294
- matched.add(value);
1295
- continue;
1296
- }
1297
- if (element.startsWith('*')) {
1298
- const stepped = /^\*\/(?<step>\d+)$/.exec(element);
1299
- const groups = stepped?.groups;
1300
- if (groups === undefined)
1301
- throw invalidCronField(spec, element);
1302
- const stepText = groups['step'];
1303
- /* v8 ignore next -- a successful fixed regex always provides the step group. */
1304
- if (stepText === undefined)
1305
- throw invalidCronField(spec, element);
1306
- const step = cronFieldStep(stepText, spec);
1307
- for (let value = spec.min; value <= spec.max; value += step)
1308
- matched.add(value);
1309
- continue;
1310
- }
1311
- const parsed = /^(?<start>\d+)(?:-(?<end>\d+))?(?:\/(?<step>\d+))?$/.exec(element);
1312
- const groups = parsed?.groups;
1313
- if (groups === undefined)
1314
- throw invalidCronField(spec, element);
1315
- const startText = groups['start'];
1316
- /* v8 ignore next -- a successful fixed regex always provides the start group. */
1317
- if (startText === undefined)
1318
- throw invalidCronField(spec, element);
1319
- const start = cronFieldValue(startText, spec);
1320
- const end = groups['end'];
1321
- const stepText = groups['step'];
1322
- if (end === undefined) {
1323
- if (stepText !== undefined)
1324
- throw invalidCronField(spec, element);
1325
- matched.add(start);
1326
- continue;
1327
- }
1328
- const last = cronFieldValue(end, spec);
1329
- if (start > last) {
1330
- throw new ScheduleInputError('invalid_rule', `cron.expression ${spec.name} field range ${start}-${last} is inverted.`);
1331
- }
1332
- const step = stepText === undefined ? 1 : cronFieldStep(stepText, spec);
1333
- for (let value = start; value <= last; value += step)
1334
- matched.add(value);
1335
- }
1336
- const values = new Set();
1337
- for (const value of matched) {
1338
- values.add(spec.canonicalMax !== spec.max && value === spec.max ? spec.min : value);
1339
- }
1340
- return [...values].sort((left, right) => left - right);
920
+ /** Map a shared time-parser reason into Schedule's public error vocabulary. */
921
+ function readRecurrence(result) {
922
+ if (result.kind === 'accepted')
923
+ return result.rule;
924
+ const codes = { syntax: 'invalid_rule', time_zone: 'invalid_time_zone', density: 'frequency_too_high' };
925
+ throw new ScheduleInputError(codes[result.reason], result.detail, { cause: result.cause });
1341
926
  }
1342
927
  /**
1343
- * Read one value the encoder already proved present.
1344
- * @param values - matched value set the parser always fills.
1345
- * @param index - index the caller derived from that set.
1346
- * @returns the value at that index.
1347
- */
1348
- function cronFieldValueAt(values, index) {
1349
- const value = values[index];
1350
- /* v8 ignore next -- a parsed cron field always matches at least one value. */
1351
- if (value === undefined)
1352
- throw new ScheduleLogError('cron field encoding requires a non-empty value set');
1353
- return value;
1354
- }
1355
- /** Encode one matched value set as the shortest equivalent comma-separated cron field.
1356
- * @param values - Matched values in ascending order.
1357
- * @returns Field text that re-parses to exactly `values`, never spelled with a leading `*`.
1358
- */
1359
- function encodeCronField(values) {
1360
- const first = cronFieldValueAt(values, 0);
1361
- if (values.length === 1)
1362
- return String(first);
1363
- const last = cronFieldValueAt(values, values.length - 1);
1364
- const step = cronFieldValueAt(values, 1) - first;
1365
- let uniform = true;
1366
- for (let index = 2; index < values.length; index += 1) {
1367
- if (cronFieldValueAt(values, index) - cronFieldValueAt(values, index - 1) !== step) {
1368
- uniform = false;
1369
- break;
1370
- }
1371
- }
1372
- if (uniform) {
1373
- if (step === 1)
1374
- return `${first}-${last}`;
1375
- return `${first}-${last}/${step}`;
1376
- }
1377
- const parts = [];
1378
- let runStart = first;
1379
- for (let index = 1; index < values.length; index += 1) {
1380
- const current = cronFieldValueAt(values, index);
1381
- const previous = cronFieldValueAt(values, index - 1);
1382
- if (current === previous + 1)
1383
- continue;
1384
- parts.push(runStart === previous ? String(runStart) : `${runStart}-${previous}`);
1385
- runStart = current;
1386
- }
1387
- const final = cronFieldValueAt(values, values.length - 1);
1388
- parts.push(runStart === final ? String(runStart) : `${runStart}-${final}`);
1389
- return parts.join(',');
1390
- }
1391
- /**
1392
- * One uniform walk from a field's minimum, folded exactly as a parsed field folds.
1393
- * @param spec - Field range and canonical maximum.
1394
- * @param step - Positive step of the walk.
1395
- * @returns Ascending values `step` produces from the minimum.
1396
- */
1397
- function starWalk(spec, step) {
1398
- const walked = new Set();
1399
- for (let value = spec.min; value <= spec.max; value += step) {
1400
- walked.add(spec.canonicalMax !== spec.max && value === spec.max ? spec.min : value);
1401
- }
1402
- return [...walked].sort((left, right) => left - right);
1403
- }
1404
- /**
1405
- * Canonical spelling of a field whose text started with `*`.
1406
- *
1407
- * Only a `*`-prefixed spelling keeps the star flag, and only the bare star or a star-step
1408
- * (a `*` followed by `/n`) admits a leading `*`, so the encoding is the bare star for every
1409
- * value, otherwise the widest star-step walk plus any remaining values as a list.
1410
- * Re-parsing therefore reproduces both the star flag and the matched set, which is what
1411
- * keeps day-of-month/day-of-week AND/OR selection stable across a stored canonical
1412
- * expression.
1413
- * @param values - Matched values in ascending order.
1414
- * @param spec - Field range and canonical maximum.
1415
- * @returns Canonical field text that starts with `*`.
1416
- */
1417
- function encodeStarCronField(values, spec) {
1418
- if (values.length === spec.canonicalMax - spec.min + 1)
1419
- return '*';
1420
- const present = new Set(values);
1421
- let bestStep;
1422
- let bestWalk = [];
1423
- for (let step = 1; step <= spec.max - spec.min + 1; step += 1) {
1424
- const walk = starWalk(spec, step);
1425
- if (walk.length > bestWalk.length && walk.every(value => present.has(value))) {
1426
- bestStep = step;
1427
- bestWalk = walk;
1428
- }
1429
- }
1430
- /* v8 ignore next -- the widest step yields the single minimum, which every `*`-led field matches. */
1431
- if (bestStep === undefined)
1432
- throw new ScheduleInputError('invalid_rule', `${spec.name} cannot keep a leading \`*\`.`);
1433
- const walked = new Set(bestWalk);
1434
- const remaining = values.filter(value => !walked.has(value));
1435
- const walkText = `*/${bestStep}`;
1436
- return remaining.length === 0
1437
- ? walkText
1438
- : `${walkText},${encodeCronField(remaining)}`;
1439
- }
1440
- /**
1441
- * Parse one cron field into its matched values, canonical spelling, and star flag.
1442
- *
1443
- * The star flag tests the field text's first character, which is how Vixie sets
1444
- * `DOM_STAR`/`DOW_STAR`: a stepped star (`*` followed by `/2`) is a star although
1445
- * it matches half the range, while an explicit full range such as `1-31` is
1446
- * restricted. Canonicalization preserves the flag: a `*`-led field keeps a `*`-led
1447
- * spelling, and a field that did not start with `*` is never spelled as a star-step.
1448
- */
1449
- function parseCronField(raw, spec) {
1450
- const values = cronFieldValues(raw, spec);
1451
- const star = raw.startsWith('*');
1452
- return Object.freeze({
1453
- values: Object.freeze(values),
1454
- canonical: star ? encodeStarCronField(values, spec) : encodeCronField(values),
1455
- star,
1456
- });
1457
- }
1458
- /** Parse and canonicalize one strict five-field cron expression. */
1459
- function parseCronExpression(expression) {
1460
- if (typeof expression !== 'string' || expression.length === 0 || expression.trim() !== expression) {
1461
- throw new ScheduleInputError('invalid_rule', 'cron.expression must be a non-empty trimmed string.');
1462
- }
1463
- const fields = expression.split(/\s+/);
1464
- if (fields.length !== 5) {
1465
- throw new ScheduleInputError('invalid_rule', 'cron.expression must contain exactly five whitespace-separated fields: '
1466
- + 'minute hour day-of-month month day-of-week.');
1467
- }
1468
- const [minute, hour, dayOfMonth, month, dayOfWeek] = fields.map((field, index) => {
1469
- const fieldSpec = CRON_FIELDS[index];
1470
- /* v8 ignore next -- the five-field split bounds this index. */
1471
- if (fieldSpec === undefined)
1472
- throw new ScheduleLogError('cron field specification is missing');
1473
- return parseCronField(field, fieldSpec);
1474
- });
1475
- return Object.freeze({
1476
- expression: [minute, hour, dayOfMonth, month, dayOfWeek].map(field => field.canonical).join(' '),
1477
- minutes: minute.values,
1478
- hours: hour.values,
1479
- daysOfMonth: dayOfMonth.values,
1480
- months: month.values,
1481
- daysOfWeek: dayOfWeek.values,
1482
- dayOfMonthStar: dayOfMonth.star,
1483
- dayOfWeekStar: dayOfWeek.star,
1484
- });
1485
- }
1486
- /**
1487
- * Canonicalize one strict five-field cron expression.
1488
- * @param expression - Candidate `minute hour day-of-month month day-of-week` expression.
1489
- * @returns The canonical expression; malformed or unsupported input throws ScheduleInputError.
928
+ * Canonicalize one supported five-field Cron expression.
929
+ * @param expression - Strict five-field input text.
930
+ * @returns Canonical text preserving the Vixie day-matching semantics.
1490
931
  */
1491
932
  export function canonicalizeCronExpression(expression) {
1492
- return parseCronExpression(expression).expression;
933
+ return readRecurrence(Cron.parse(expression, 'UTC')).expression;
1493
934
  }
1494
935
  /**
1495
936
  * Normalize a cron selector without calculating a new committed target.
@@ -1504,28 +945,15 @@ export function parseCronInput(cron) {
1504
945
  throw new ScheduleInputError('invalid_time_zone', 'time_zone must be a string.');
1505
946
  }
1506
947
  return {
1507
- expression: parseCronExpression(cron['expression']).expression,
948
+ expression: canonicalizeCronExpression(cron['expression']),
1508
949
  timeZone: canonicalizeTimeZone(cron['time_zone']),
1509
950
  };
1510
951
  }
1511
- /**
1512
- * Derive one execution-local management view.
1513
- * @param record - Active durable record.
1514
- * @param now - Wall-clock sample used for its timing state.
1515
- * @returns Complete Host delivery view.
1516
- */
1517
- export function scheduleView(record, now) {
1518
- return Object.freeze({
1519
- ...record,
1520
- state: now >= Date.parse(record.scheduledAt) ? 'overdue' : 'scheduled',
1521
- deliveryMode: 'host',
1522
- });
1523
- }
1524
952
  /** Fixed model-facing origin line shared by one-shot and recurring reminder delivery. */
1525
953
  const SCHEDULED_MESSAGE_FRAMING = 'This is a scheduled message from the user';
1526
954
  /**
1527
- * Render the fixed model framing for a due reminder.
1528
- * @param record - Due active record.
955
+ * Render the fixed model framing for one due reminder.
956
+ * @param record - Due task identity, instruction, and delivered occurrence.
1529
957
  * @returns Stable model-visible text with JSON-escaped dynamic fields.
1530
958
  */
1531
959
  export function renderReminderFraming(record) {
@@ -1554,4 +982,120 @@ export function renderRecurringReminderBatchFraming(reminders) {
1554
982
  `reminders_json: ${JSON.stringify(payload)}`,
1555
983
  ].join('\n');
1556
984
  }
985
+ /** Freeze a record whose scheduledAt is the first occurrence of a prepared rule strictly after a time. */
986
+ function firstRecord(id, title, prompt, prepared, now) {
987
+ if (!isFourDigitYearInstant(now))
988
+ throw new ScheduleInputError('time_out_of_range', 'The recurrence reference time is outside the supported range.');
989
+ const scheduledAt = prepared.next(now);
990
+ if (scheduledAt === undefined) {
991
+ throw new ScheduleInputError('not_future', 'rrule must contain an occurrence strictly in the future.');
992
+ }
993
+ return Object.freeze({ id, kind: 'rrule', title, prompt, rrule: prepared.expression, scheduledAt });
994
+ }
995
+ /**
996
+ * Validate and normalize the supported RFC 5545 recurrence content.
997
+ * @param value - Two-line DTSTART and RRULE input.
998
+ * @returns The trimmed newline-separated recurrence; an unsupported rule throws ScheduleInputError.
999
+ */
1000
+ export function normalizeRRule(value) {
1001
+ return readRecurrence(RRule.parse(value)).expression;
1002
+ }
1003
+ /**
1004
+ * Create one Host task record with its first committed occurrence.
1005
+ * @param id - Host-allocated canonical schedule id.
1006
+ * @param title - User-facing schedule title.
1007
+ * @param prompt - Instruction delivered when the schedule fires.
1008
+ * @param rrule - DTSTART and RRULE content.
1009
+ * @param now - Exclusive creation-time lower bound in epoch milliseconds.
1010
+ * @returns Frozen schedule record.
1011
+ */
1012
+ export function createRRuleScheduleRecord(id, title, prompt, rrule, now) {
1013
+ const normalizedTitle = scheduleTitle(title);
1014
+ const normalizedPrompt = prompt.trim();
1015
+ if (normalizedPrompt.length === 0) {
1016
+ throw new ScheduleInputError('invalid_prompt', 'prompt must be non-empty after trimming.');
1017
+ }
1018
+ const prepared = readRecurrence(RRule.parse(rrule, { rejectIneffectiveSetPositions: true }));
1019
+ return firstRecord(id, normalizedTitle, normalizedPrompt, prepared, now);
1020
+ }
1021
+ /**
1022
+ * Update descriptive fields and optionally recompute the next occurrence.
1023
+ * @param current - Existing schedule record.
1024
+ * @param change - Supplied editable record fields.
1025
+ * @param now - Exclusive edit-time lower bound in epoch milliseconds.
1026
+ * @param recompute - Whether to derive a fresh next occurrence.
1027
+ * @returns Frozen updated schedule record.
1028
+ */
1029
+ export function updateRRuleScheduleRecord(current, change, now, recompute) {
1030
+ const title = scheduleTitle(change.title ?? current.title);
1031
+ const prompt = (change.prompt ?? current.prompt).trim();
1032
+ if (prompt.length === 0)
1033
+ throw new ScheduleInputError('invalid_prompt', 'prompt must be non-empty after trimming.');
1034
+ const prepared = change.rrule === undefined
1035
+ ? readRecurrence(RRule.parse(current.rrule))
1036
+ : readRecurrence(RRule.parse(change.rrule, { rejectIneffectiveSetPositions: true }));
1037
+ if (recompute)
1038
+ return firstRecord(current.id, title, prompt, prepared, now);
1039
+ return Object.freeze({ ...current, title, prompt, rrule: prepared.expression });
1040
+ }
1041
+ /**
1042
+ * Resolve the latest due occurrence and the first later occurrence without replaying a backlog.
1043
+ * @param record - Due schedule record.
1044
+ * @param acceptedAt - Dispatch admission time in epoch milliseconds.
1045
+ * @returns Latest due occurrence and optional next occurrence.
1046
+ */
1047
+ export function resolveRRuleOccurrence(record, acceptedAt) {
1048
+ const decision = acceptedDecision('rrule', acceptedAt);
1049
+ const savedTarget = Date.parse(record.scheduledAt);
1050
+ if (decision < savedTarget)
1051
+ throw new ScheduleLogError('rrule dispatch cannot precede the active scheduledAt');
1052
+ return readRecurrence(RRule.parse(record.rrule)).resolve(record.scheduledAt, decision);
1053
+ }
1054
+ /**
1055
+ * Decode a current Host task record.
1056
+ * @param value - Untrusted durable JSON record.
1057
+ * @returns Detached frozen record; malformed fields throw ScheduleLogError.
1058
+ */
1059
+ export function decodeRRuleScheduleRecord(value) {
1060
+ if (!isRecord(value) || value['kind'] !== 'rrule' || !hasExactKeys(value, ['id', 'kind', 'title', 'prompt', 'rrule', 'scheduledAt'])) {
1061
+ throw new ScheduleLogError('rrule schedule must contain exactly id, kind, title, prompt, rrule, and scheduledAt');
1062
+ }
1063
+ const title = decodeStoredTitle(value['title']);
1064
+ const prompt = value['prompt'];
1065
+ const rrule = value['rrule'];
1066
+ if (typeof prompt !== 'string' || prompt.length === 0 || prompt.trim() !== prompt) {
1067
+ throw new ScheduleLogError('schedule prompt must be non-empty and already trimmed');
1068
+ }
1069
+ if (typeof rrule !== 'string')
1070
+ throw new ScheduleLogError('schedule rrule must be a string');
1071
+ let normalized;
1072
+ try {
1073
+ normalized = normalizeRRule(rrule);
1074
+ }
1075
+ catch (error) {
1076
+ throw new ScheduleLogError(`invalid schedule rrule: ${String(error)}`);
1077
+ }
1078
+ if (normalized !== rrule)
1079
+ throw new ScheduleLogError('schedule rrule must be normalized');
1080
+ return Object.freeze({
1081
+ id: decodeId(value['id']),
1082
+ kind: 'rrule',
1083
+ title,
1084
+ prompt,
1085
+ rrule,
1086
+ scheduledAt: decodeInstant(value['scheduledAt']),
1087
+ });
1088
+ }
1089
+ /**
1090
+ * Render an instant in the authoritative zone of any timing kind; elapsed and absolute rules use UTC.
1091
+ * @param record - Timing record that owns the display zone.
1092
+ * @param instant - UTC instant to render with second precision.
1093
+ * @returns Local ISO date-time with its numeric offset.
1094
+ */
1095
+ export function formatScheduleLocalTime(record, instant) {
1096
+ const timeZone = record.kind === 'rrule' ? readRecurrence(RRule.parse(record.rrule)).timeZone
1097
+ : 'timeZone' in record ? record.timeZone : 'UTC';
1098
+ return Temporal.Instant.from(instant).toZonedDateTimeISO(timeZone)
1099
+ .toString({ timeZoneName: 'never', smallestUnit: 'second' });
1100
+ }
1557
1101
  //# sourceMappingURL=domain.js.map