@askdkc/dsh-cli 0.11.7 → 0.12.0

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 (838) hide show
  1. package/LICENSE +1 -0
  2. package/README.md +47 -283
  3. package/cordis.patch.yml +1 -0
  4. package/cordis.yml +1 -0
  5. package/lib/types/adapter/channel/ui-policy.d.ts +1 -1
  6. package/lib/types/adapter/channel/ui-policy.d.ts.map +1 -1
  7. package/lib/types/adapter/channel/ui-policy.js +1 -0
  8. package/lib/types/adapter/ports/channel-ui.d.ts +2 -0
  9. package/lib/types/adapter/ports/channel-ui.d.ts.map +1 -1
  10. package/lib/types/components/LogoV2.d.ts +2 -1
  11. package/lib/types/components/LogoV2.d.ts.map +1 -1
  12. package/lib/types/components/LogoV2.js +9 -15
  13. package/lib/types/components/ModelPicker.d.ts +9 -11
  14. package/lib/types/components/ModelPicker.d.ts.map +1 -1
  15. package/lib/types/components/ModelPicker.js +6 -9
  16. package/lib/types/components/Spinner/SpinnerAnimationRow.d.ts +6 -1
  17. package/lib/types/components/Spinner/SpinnerAnimationRow.d.ts.map +1 -1
  18. package/lib/types/components/Spinner/SpinnerAnimationRow.js +8 -9
  19. package/lib/types/components/WorkingSpinner.d.ts +3 -1
  20. package/lib/types/components/WorkingSpinner.d.ts.map +1 -1
  21. package/lib/types/components/WorkingSpinner.js +9 -4
  22. package/lib/types/components/bigfont.d.ts +2 -0
  23. package/lib/types/components/bigfont.d.ts.map +1 -1
  24. package/lib/types/components/bigfont.js +5 -1
  25. package/lib/types/components/splashLayout.d.ts +12 -0
  26. package/lib/types/components/splashLayout.d.ts.map +1 -0
  27. package/lib/types/components/splashLayout.js +18 -0
  28. package/lib/types/dsh-adapter/activity-store.d.ts +1 -1
  29. package/lib/types/dsh-adapter/activity-store.d.ts.map +1 -1
  30. package/lib/types/dsh-adapter/channel/projection.d.ts +1 -1
  31. package/lib/types/dsh-adapter/channel/projection.d.ts.map +1 -1
  32. package/lib/types/dsh-adapter/channel/projection.js +4 -0
  33. package/lib/types/dsh-adapter/channel/session-reset.d.ts +1 -1
  34. package/lib/types/dsh-adapter/channel/session-reset.d.ts.map +1 -1
  35. package/lib/types/dsh-adapter/channel/session-reset.js +2 -0
  36. package/lib/types/dsh-adapter/channel/state.d.ts +1 -1
  37. package/lib/types/dsh-adapter/channel/state.d.ts.map +1 -1
  38. package/lib/types/dsh-adapter/channel/state.js +2 -1
  39. package/lib/types/i18n.d.ts +32 -2
  40. package/lib/types/i18n.d.ts.map +1 -1
  41. package/lib/types/i18n.js +19 -1
  42. package/lib/types/modelGroups.d.ts +3 -1
  43. package/lib/types/modelGroups.d.ts.map +1 -1
  44. package/lib/types/modelGroups.js +4 -0
  45. package/lib/types/screens/Chat.d.ts.map +1 -1
  46. package/lib/types/screens/Chat.js +37 -37
  47. package/node_modules/@askdkc/dsh-auth/LICENSE +1 -0
  48. package/node_modules/@askdkc/dsh-auth/README.ja.md +17 -12
  49. package/node_modules/@askdkc/dsh-auth/README.md +18 -13
  50. package/node_modules/@askdkc/dsh-auth/package.json +7 -2
  51. package/node_modules/dsh-working-activity/LICENSE +28 -0
  52. package/node_modules/dsh-working-activity/README.md +16 -0
  53. package/node_modules/dsh-working-activity/cordis.patch.yml +19 -0
  54. package/node_modules/dsh-working-activity/lib/client.js +169 -0
  55. package/node_modules/dsh-working-activity/lib/client.js.map +1 -0
  56. package/node_modules/dsh-working-activity/lib/types/activity-event.d.ts +147 -0
  57. package/node_modules/dsh-working-activity/lib/types/activity-event.js +18 -0
  58. package/node_modules/dsh-working-activity/lib/types/client/WorkingLine.d.ts +8 -0
  59. package/node_modules/dsh-working-activity/lib/types/client/WorkingLine.d.ts.map +1 -0
  60. package/node_modules/dsh-working-activity/lib/types/client/WorkingLine.js +57 -0
  61. package/node_modules/dsh-working-activity/lib/types/client/activity.d.ts +37 -0
  62. package/node_modules/dsh-working-activity/lib/types/client/activity.d.ts.map +1 -0
  63. package/node_modules/dsh-working-activity/lib/types/client/activity.js +26 -0
  64. package/node_modules/dsh-working-activity/lib/types/client/elapsed.d.ts +41 -0
  65. package/node_modules/dsh-working-activity/lib/types/client/elapsed.d.ts.map +1 -0
  66. package/node_modules/dsh-working-activity/lib/types/client/elapsed.js +78 -0
  67. package/node_modules/dsh-working-activity/lib/types/client/index.d.ts +26 -0
  68. package/node_modules/dsh-working-activity/lib/types/client/index.d.ts.map +1 -0
  69. package/node_modules/dsh-working-activity/lib/types/client/index.js +19 -0
  70. package/node_modules/dsh-working-activity/lib/types/compat/assistant-stream.d.ts +59 -0
  71. package/node_modules/dsh-working-activity/lib/types/compat/assistant-stream.js +189 -0
  72. package/node_modules/dsh-working-activity/lib/types/compat/session-events.d.ts +38 -0
  73. package/node_modules/dsh-working-activity/lib/types/compat/session-events.js +193 -0
  74. package/node_modules/dsh-working-activity/lib/types/compat/tool-result.d.ts +72 -0
  75. package/node_modules/dsh-working-activity/lib/types/compat/tool-result.js +136 -0
  76. package/node_modules/dsh-working-activity/lib/types/config.d.ts +74 -0
  77. package/node_modules/dsh-working-activity/lib/types/config.js +142 -0
  78. package/node_modules/dsh-working-activity/lib/types/events.d.ts +41 -0
  79. package/node_modules/dsh-working-activity/lib/types/events.js +9 -0
  80. package/node_modules/dsh-working-activity/lib/types/frames.d.ts +36 -0
  81. package/node_modules/dsh-working-activity/lib/types/frames.js +126 -0
  82. package/node_modules/dsh-working-activity/lib/types/index.d.ts +71 -0
  83. package/node_modules/dsh-working-activity/lib/types/index.js +350 -0
  84. package/node_modules/dsh-working-activity/lib/types/invariant.d.ts +15 -0
  85. package/node_modules/dsh-working-activity/lib/types/invariant.js +72 -0
  86. package/node_modules/dsh-working-activity/lib/types/japanese.d.ts +28 -0
  87. package/node_modules/dsh-working-activity/lib/types/japanese.js +47 -0
  88. package/node_modules/dsh-working-activity/lib/types/lang.d.ts +140 -0
  89. package/node_modules/dsh-working-activity/lib/types/lang.js +209 -0
  90. package/node_modules/dsh-working-activity/lib/types/phrases.d.ts +246 -0
  91. package/node_modules/dsh-working-activity/lib/types/phrases.js +611 -0
  92. package/node_modules/dsh-working-activity/lib/types/projection.d.ts +168 -0
  93. package/node_modules/dsh-working-activity/lib/types/projection.js +162 -0
  94. package/node_modules/dsh-working-activity/lib/types/registration.d.ts +6 -0
  95. package/node_modules/dsh-working-activity/lib/types/registration.js +94 -0
  96. package/node_modules/dsh-working-activity/lib/types/status.d.ts +400 -0
  97. package/node_modules/dsh-working-activity/lib/types/status.js +1306 -0
  98. package/node_modules/dsh-working-activity/package.json +108 -0
  99. package/node_modules/dsh-working-activity/src/activity-event.ts +106 -0
  100. package/node_modules/dsh-working-activity/src/client/WorkingLine.module.css +74 -0
  101. package/node_modules/dsh-working-activity/src/client/WorkingLine.tsx +94 -0
  102. package/node_modules/dsh-working-activity/src/client/activity.ts +43 -0
  103. package/node_modules/dsh-working-activity/src/client/css-modules.d.ts +6 -0
  104. package/node_modules/dsh-working-activity/src/client/elapsed.ts +88 -0
  105. package/node_modules/dsh-working-activity/src/client/index.ts +45 -0
  106. package/node_modules/dsh-working-activity/src/compat/assistant-stream.ts +209 -0
  107. package/node_modules/dsh-working-activity/src/compat/session-events.ts +201 -0
  108. package/node_modules/dsh-working-activity/src/compat/tool-result.ts +132 -0
  109. package/node_modules/dsh-working-activity/src/config.ts +176 -0
  110. package/node_modules/dsh-working-activity/src/events.ts +45 -0
  111. package/node_modules/dsh-working-activity/src/frames.ts +138 -0
  112. package/node_modules/dsh-working-activity/src/index.ts +467 -0
  113. package/node_modules/dsh-working-activity/src/invariant.ts +98 -0
  114. package/node_modules/dsh-working-activity/src/japanese.ts +47 -0
  115. package/node_modules/dsh-working-activity/src/lang.ts +221 -0
  116. package/node_modules/dsh-working-activity/src/phrases.ts +715 -0
  117. package/node_modules/dsh-working-activity/src/projection.ts +259 -0
  118. package/node_modules/dsh-working-activity/src/registration.ts +99 -0
  119. package/node_modules/dsh-working-activity/src/status.ts +1474 -0
  120. package/package.json +13 -9
  121. package/vendor/dsh-working-activity/node_modules/zod/LICENSE +21 -0
  122. package/vendor/dsh-working-activity/node_modules/zod/README.md +191 -0
  123. package/vendor/dsh-working-activity/node_modules/zod/index.cjs +33 -0
  124. package/vendor/dsh-working-activity/node_modules/zod/index.d.cts +4 -0
  125. package/vendor/dsh-working-activity/node_modules/zod/index.d.ts +4 -0
  126. package/vendor/dsh-working-activity/node_modules/zod/index.js +4 -0
  127. package/vendor/dsh-working-activity/node_modules/zod/locales/index.cjs +17 -0
  128. package/vendor/dsh-working-activity/node_modules/zod/locales/index.d.cts +1 -0
  129. package/vendor/dsh-working-activity/node_modules/zod/locales/index.d.ts +1 -0
  130. package/vendor/dsh-working-activity/node_modules/zod/locales/index.js +1 -0
  131. package/vendor/dsh-working-activity/node_modules/zod/locales/package.json +7 -0
  132. package/vendor/dsh-working-activity/node_modules/zod/mini/index.cjs +32 -0
  133. package/vendor/dsh-working-activity/node_modules/zod/mini/index.d.cts +3 -0
  134. package/vendor/dsh-working-activity/node_modules/zod/mini/index.d.ts +3 -0
  135. package/vendor/dsh-working-activity/node_modules/zod/mini/index.js +3 -0
  136. package/vendor/dsh-working-activity/node_modules/zod/mini/package.json +7 -0
  137. package/vendor/dsh-working-activity/node_modules/zod/package.json +135 -0
  138. package/vendor/dsh-working-activity/node_modules/zod/src/index.ts +4 -0
  139. package/vendor/dsh-working-activity/node_modules/zod/src/locales/index.ts +1 -0
  140. package/vendor/dsh-working-activity/node_modules/zod/src/mini/index.ts +3 -0
  141. package/vendor/dsh-working-activity/node_modules/zod/src/v3/ZodError.ts +330 -0
  142. package/vendor/dsh-working-activity/node_modules/zod/src/v3/benchmarks/datetime.ts +58 -0
  143. package/vendor/dsh-working-activity/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +80 -0
  144. package/vendor/dsh-working-activity/node_modules/zod/src/v3/benchmarks/index.ts +59 -0
  145. package/vendor/dsh-working-activity/node_modules/zod/src/v3/benchmarks/ipv4.ts +57 -0
  146. package/vendor/dsh-working-activity/node_modules/zod/src/v3/benchmarks/object.ts +69 -0
  147. package/vendor/dsh-working-activity/node_modules/zod/src/v3/benchmarks/primitives.ts +162 -0
  148. package/vendor/dsh-working-activity/node_modules/zod/src/v3/benchmarks/realworld.ts +63 -0
  149. package/vendor/dsh-working-activity/node_modules/zod/src/v3/benchmarks/string.ts +55 -0
  150. package/vendor/dsh-working-activity/node_modules/zod/src/v3/benchmarks/union.ts +80 -0
  151. package/vendor/dsh-working-activity/node_modules/zod/src/v3/errors.ts +13 -0
  152. package/vendor/dsh-working-activity/node_modules/zod/src/v3/external.ts +6 -0
  153. package/vendor/dsh-working-activity/node_modules/zod/src/v3/helpers/enumUtil.ts +17 -0
  154. package/vendor/dsh-working-activity/node_modules/zod/src/v3/helpers/errorUtil.ts +8 -0
  155. package/vendor/dsh-working-activity/node_modules/zod/src/v3/helpers/parseUtil.ts +176 -0
  156. package/vendor/dsh-working-activity/node_modules/zod/src/v3/helpers/partialUtil.ts +34 -0
  157. package/vendor/dsh-working-activity/node_modules/zod/src/v3/helpers/typeAliases.ts +2 -0
  158. package/vendor/dsh-working-activity/node_modules/zod/src/v3/helpers/util.ts +224 -0
  159. package/vendor/dsh-working-activity/node_modules/zod/src/v3/index.ts +4 -0
  160. package/vendor/dsh-working-activity/node_modules/zod/src/v3/locales/en.ts +124 -0
  161. package/vendor/dsh-working-activity/node_modules/zod/src/v3/standard-schema.ts +113 -0
  162. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/Mocker.ts +54 -0
  163. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/all-errors.test.ts +157 -0
  164. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/anyunknown.test.ts +28 -0
  165. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/array.test.ts +71 -0
  166. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/async-parsing.test.ts +388 -0
  167. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/async-refinements.test.ts +46 -0
  168. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/base.test.ts +29 -0
  169. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/bigint.test.ts +55 -0
  170. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/branded.test.ts +53 -0
  171. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/catch.test.ts +220 -0
  172. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/coerce.test.ts +133 -0
  173. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/complex.test.ts +70 -0
  174. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/custom.test.ts +31 -0
  175. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/date.test.ts +32 -0
  176. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/deepmasking.test.ts +186 -0
  177. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/default.test.ts +112 -0
  178. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/description.test.ts +33 -0
  179. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +315 -0
  180. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/enum.test.ts +80 -0
  181. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/error.test.ts +551 -0
  182. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/firstparty.test.ts +87 -0
  183. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +21 -0
  184. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/function.test.ts +261 -0
  185. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/generics.test.ts +48 -0
  186. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/instanceof.test.ts +37 -0
  187. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/intersection.test.ts +110 -0
  188. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/language-server.source.ts +76 -0
  189. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/language-server.test.ts +207 -0
  190. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/literal.test.ts +36 -0
  191. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/map.test.ts +110 -0
  192. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/masking.test.ts +4 -0
  193. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/mocker.test.ts +19 -0
  194. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/nan.test.ts +24 -0
  195. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/nativeEnum.test.ts +87 -0
  196. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/nullable.test.ts +42 -0
  197. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/number.test.ts +176 -0
  198. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/object-augmentation.test.ts +29 -0
  199. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +29 -0
  200. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/object.test.ts +434 -0
  201. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/optional.test.ts +42 -0
  202. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/parseUtil.test.ts +23 -0
  203. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/parser.test.ts +41 -0
  204. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/partials.test.ts +243 -0
  205. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/pickomit.test.ts +111 -0
  206. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/pipeline.test.ts +29 -0
  207. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/preprocess.test.ts +186 -0
  208. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/primitive.test.ts +440 -0
  209. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/promise.test.ts +90 -0
  210. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/readonly.test.ts +194 -0
  211. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/record.test.ts +171 -0
  212. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/recursive.test.ts +197 -0
  213. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/refine.test.ts +313 -0
  214. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/safeparse.test.ts +27 -0
  215. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/set.test.ts +142 -0
  216. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/standard-schema.test.ts +83 -0
  217. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/string.test.ts +916 -0
  218. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/transformer.test.ts +233 -0
  219. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/tuple.test.ts +90 -0
  220. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/unions.test.ts +57 -0
  221. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/validations.test.ts +133 -0
  222. package/vendor/dsh-working-activity/node_modules/zod/src/v3/tests/void.test.ts +15 -0
  223. package/vendor/dsh-working-activity/node_modules/zod/src/v3/types.ts +5138 -0
  224. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/checks.ts +32 -0
  225. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/coerce.ts +27 -0
  226. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/compat.ts +70 -0
  227. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/errors.ts +82 -0
  228. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/external.ts +52 -0
  229. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/from-json-schema.ts +659 -0
  230. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/index.ts +5 -0
  231. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/iso.ts +90 -0
  232. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/parse.ts +82 -0
  233. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/schemas.ts +2672 -0
  234. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +26 -0
  235. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/apply.test.ts +59 -0
  236. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/array.test.ts +264 -0
  237. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/assignability.test.ts +216 -0
  238. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +381 -0
  239. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +68 -0
  240. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/base.test.ts +7 -0
  241. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/bigint.test.ts +54 -0
  242. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/brand.test.ts +106 -0
  243. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/catch.test.ts +326 -0
  244. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +20 -0
  245. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +573 -0
  246. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/codec.test.ts +703 -0
  247. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/coerce.test.ts +160 -0
  248. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/continuability.test.ts +374 -0
  249. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/custom.test.ts +40 -0
  250. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/date.test.ts +62 -0
  251. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/datetime.test.ts +302 -0
  252. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/default.test.ts +409 -0
  253. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/describe-meta-checks.test.ts +27 -0
  254. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/description.test.ts +32 -0
  255. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +197 -0
  256. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +694 -0
  257. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/enum.test.ts +285 -0
  258. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +807 -0
  259. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/error.test.ts +711 -0
  260. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/file.test.ts +96 -0
  261. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +179 -0
  262. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/fix-json-issue.test.ts +26 -0
  263. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +895 -0
  264. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/function.test.ts +360 -0
  265. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/generics.test.ts +72 -0
  266. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/global-config.test.ts +39 -0
  267. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/hash.test.ts +68 -0
  268. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/index.test.ts +939 -0
  269. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +60 -0
  270. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/intersection.test.ts +198 -0
  271. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +46 -0
  272. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/json.test.ts +109 -0
  273. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/lazy.test.ts +227 -0
  274. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/literal.test.ts +117 -0
  275. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/locales_ka.test.ts +29 -0
  276. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/locales_ro.test.ts +24 -0
  277. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/map.test.ts +330 -0
  278. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/nan.test.ts +21 -0
  279. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +168 -0
  280. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +101 -0
  281. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/nullable.test.ts +22 -0
  282. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/number.test.ts +325 -0
  283. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/object.test.ts +717 -0
  284. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/optional.test.ts +333 -0
  285. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/partial.test.ts +450 -0
  286. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +211 -0
  287. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/pipe.test.ts +101 -0
  288. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/prefault.test.ts +74 -0
  289. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +26 -0
  290. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +351 -0
  291. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/primitive.test.ts +175 -0
  292. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/promise.test.ts +81 -0
  293. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +23 -0
  294. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/readonly.test.ts +252 -0
  295. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/record.test.ts +717 -0
  296. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +631 -0
  297. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/refine.test.ts +633 -0
  298. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/registries.test.ts +243 -0
  299. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/set.test.ts +181 -0
  300. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +134 -0
  301. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +125 -0
  302. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/string.test.ts +1224 -0
  303. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +106 -0
  304. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +771 -0
  305. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/to-json-schema-methods.test.ts +438 -0
  306. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +3125 -0
  307. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/transform.test.ts +378 -0
  308. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/tuple.test.ts +496 -0
  309. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/union.test.ts +273 -0
  310. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/url.test.ts +13 -0
  311. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/validations.test.ts +283 -0
  312. package/vendor/dsh-working-activity/node_modules/zod/src/v4/classic/tests/void.test.ts +12 -0
  313. package/vendor/dsh-working-activity/node_modules/zod/src/v4/core/api.ts +1823 -0
  314. package/vendor/dsh-working-activity/node_modules/zod/src/v4/core/checks.ts +1293 -0
  315. package/vendor/dsh-working-activity/node_modules/zod/src/v4/core/config.ts +15 -0
  316. package/vendor/dsh-working-activity/node_modules/zod/src/v4/core/core.ts +153 -0
  317. package/vendor/dsh-working-activity/node_modules/zod/src/v4/core/doc.ts +44 -0
  318. package/vendor/dsh-working-activity/node_modules/zod/src/v4/core/errors.ts +455 -0
  319. package/vendor/dsh-working-activity/node_modules/zod/src/v4/core/index.ts +16 -0
  320. package/vendor/dsh-working-activity/node_modules/zod/src/v4/core/json-schema-generator.ts +126 -0
  321. package/vendor/dsh-working-activity/node_modules/zod/src/v4/core/json-schema-processors.ts +666 -0
  322. package/vendor/dsh-working-activity/node_modules/zod/src/v4/core/json-schema.ts +147 -0
  323. package/vendor/dsh-working-activity/node_modules/zod/src/v4/core/parse.ts +195 -0
  324. package/vendor/dsh-working-activity/node_modules/zod/src/v4/core/regexes.ts +190 -0
  325. package/vendor/dsh-working-activity/node_modules/zod/src/v4/core/registries.ts +105 -0
  326. package/vendor/dsh-working-activity/node_modules/zod/src/v4/core/schemas.ts +4730 -0
  327. package/vendor/dsh-working-activity/node_modules/zod/src/v4/core/standard-schema.ts +159 -0
  328. package/vendor/dsh-working-activity/node_modules/zod/src/v4/core/tests/extend.test.ts +59 -0
  329. package/vendor/dsh-working-activity/node_modules/zod/src/v4/core/tests/index.test.ts +46 -0
  330. package/vendor/dsh-working-activity/node_modules/zod/src/v4/core/tests/locales/be.test.ts +124 -0
  331. package/vendor/dsh-working-activity/node_modules/zod/src/v4/core/tests/locales/el.test.ts +215 -0
  332. package/vendor/dsh-working-activity/node_modules/zod/src/v4/core/tests/locales/en.test.ts +22 -0
  333. package/vendor/dsh-working-activity/node_modules/zod/src/v4/core/tests/locales/es.test.ts +181 -0
  334. package/vendor/dsh-working-activity/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +72 -0
  335. package/vendor/dsh-working-activity/node_modules/zod/src/v4/core/tests/locales/he.test.ts +379 -0
  336. package/vendor/dsh-working-activity/node_modules/zod/src/v4/core/tests/locales/hr.test.ts +163 -0
  337. package/vendor/dsh-working-activity/node_modules/zod/src/v4/core/tests/locales/nl.test.ts +46 -0
  338. package/vendor/dsh-working-activity/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +128 -0
  339. package/vendor/dsh-working-activity/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +69 -0
  340. package/vendor/dsh-working-activity/node_modules/zod/src/v4/core/tests/locales/uz.test.ts +105 -0
  341. package/vendor/dsh-working-activity/node_modules/zod/src/v4/core/tests/record-constructor.test.ts +125 -0
  342. package/vendor/dsh-working-activity/node_modules/zod/src/v4/core/tests/recursive-tuples.test.ts +45 -0
  343. package/vendor/dsh-working-activity/node_modules/zod/src/v4/core/to-json-schema.ts +622 -0
  344. package/vendor/dsh-working-activity/node_modules/zod/src/v4/core/util.ts +983 -0
  345. package/vendor/dsh-working-activity/node_modules/zod/src/v4/core/versions.ts +5 -0
  346. package/vendor/dsh-working-activity/node_modules/zod/src/v4/core/zsf.ts +323 -0
  347. package/vendor/dsh-working-activity/node_modules/zod/src/v4/index.ts +4 -0
  348. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/ar.ts +115 -0
  349. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/az.ts +111 -0
  350. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/be.ts +176 -0
  351. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/bg.ts +128 -0
  352. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/ca.ts +116 -0
  353. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/cs.ts +118 -0
  354. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/da.ts +123 -0
  355. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/de.ts +116 -0
  356. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/el.ts +121 -0
  357. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/en.ts +123 -0
  358. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/eo.ts +118 -0
  359. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/es.ts +141 -0
  360. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/fa.ts +126 -0
  361. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/fi.ts +121 -0
  362. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/fr-CA.ts +116 -0
  363. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/fr.ts +132 -0
  364. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/he.ts +246 -0
  365. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/hr.ts +131 -0
  366. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/hu.ts +117 -0
  367. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/hy.ts +164 -0
  368. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/id.ts +115 -0
  369. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/index.ts +52 -0
  370. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/is.ts +119 -0
  371. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/it.ts +116 -0
  372. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/ja.ts +114 -0
  373. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/ka.ts +123 -0
  374. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/kh.ts +7 -0
  375. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/km.ts +119 -0
  376. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/ko.ts +121 -0
  377. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/lt.ts +239 -0
  378. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/mk.ts +118 -0
  379. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/ms.ts +115 -0
  380. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/nl.ts +121 -0
  381. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/no.ts +116 -0
  382. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/ota.ts +117 -0
  383. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/pl.ts +118 -0
  384. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/ps.ts +126 -0
  385. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/pt.ts +116 -0
  386. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/ro.ts +129 -0
  387. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/ru.ts +176 -0
  388. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/sl.ts +118 -0
  389. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/sv.ts +119 -0
  390. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/ta.ts +118 -0
  391. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/th.ts +119 -0
  392. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/tr.ts +111 -0
  393. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/ua.ts +7 -0
  394. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/uk.ts +117 -0
  395. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/ur.ts +119 -0
  396. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/uz.ts +117 -0
  397. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/vi.ts +117 -0
  398. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/yo.ts +124 -0
  399. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/zh-CN.ts +116 -0
  400. package/vendor/dsh-working-activity/node_modules/zod/src/v4/locales/zh-TW.ts +115 -0
  401. package/vendor/dsh-working-activity/node_modules/zod/src/v4/mini/checks.ts +32 -0
  402. package/vendor/dsh-working-activity/node_modules/zod/src/v4/mini/coerce.ts +27 -0
  403. package/vendor/dsh-working-activity/node_modules/zod/src/v4/mini/external.ts +41 -0
  404. package/vendor/dsh-working-activity/node_modules/zod/src/v4/mini/index.ts +3 -0
  405. package/vendor/dsh-working-activity/node_modules/zod/src/v4/mini/iso.ts +66 -0
  406. package/vendor/dsh-working-activity/node_modules/zod/src/v4/mini/parse.ts +14 -0
  407. package/vendor/dsh-working-activity/node_modules/zod/src/v4/mini/schemas.ts +1947 -0
  408. package/vendor/dsh-working-activity/node_modules/zod/src/v4/mini/tests/apply.test.ts +24 -0
  409. package/vendor/dsh-working-activity/node_modules/zod/src/v4/mini/tests/assignability.test.ts +129 -0
  410. package/vendor/dsh-working-activity/node_modules/zod/src/v4/mini/tests/brand.test.ts +94 -0
  411. package/vendor/dsh-working-activity/node_modules/zod/src/v4/mini/tests/checks.test.ts +144 -0
  412. package/vendor/dsh-working-activity/node_modules/zod/src/v4/mini/tests/codec.test.ts +548 -0
  413. package/vendor/dsh-working-activity/node_modules/zod/src/v4/mini/tests/computed.test.ts +36 -0
  414. package/vendor/dsh-working-activity/node_modules/zod/src/v4/mini/tests/error.test.ts +22 -0
  415. package/vendor/dsh-working-activity/node_modules/zod/src/v4/mini/tests/functions.test.ts +5 -0
  416. package/vendor/dsh-working-activity/node_modules/zod/src/v4/mini/tests/index.test.ts +993 -0
  417. package/vendor/dsh-working-activity/node_modules/zod/src/v4/mini/tests/number.test.ts +95 -0
  418. package/vendor/dsh-working-activity/node_modules/zod/src/v4/mini/tests/object.test.ts +227 -0
  419. package/vendor/dsh-working-activity/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +43 -0
  420. package/vendor/dsh-working-activity/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +325 -0
  421. package/vendor/dsh-working-activity/node_modules/zod/src/v4/mini/tests/standard-schema.test.ts +50 -0
  422. package/vendor/dsh-working-activity/node_modules/zod/src/v4/mini/tests/string.test.ts +352 -0
  423. package/vendor/dsh-working-activity/node_modules/zod/src/v4-mini/index.ts +3 -0
  424. package/vendor/dsh-working-activity/node_modules/zod/v3/ZodError.cjs +138 -0
  425. package/vendor/dsh-working-activity/node_modules/zod/v3/ZodError.d.cts +164 -0
  426. package/vendor/dsh-working-activity/node_modules/zod/v3/ZodError.d.ts +164 -0
  427. package/vendor/dsh-working-activity/node_modules/zod/v3/ZodError.js +133 -0
  428. package/vendor/dsh-working-activity/node_modules/zod/v3/errors.cjs +17 -0
  429. package/vendor/dsh-working-activity/node_modules/zod/v3/errors.d.cts +5 -0
  430. package/vendor/dsh-working-activity/node_modules/zod/v3/errors.d.ts +5 -0
  431. package/vendor/dsh-working-activity/node_modules/zod/v3/errors.js +9 -0
  432. package/vendor/dsh-working-activity/node_modules/zod/v3/external.cjs +22 -0
  433. package/vendor/dsh-working-activity/node_modules/zod/v3/external.d.cts +6 -0
  434. package/vendor/dsh-working-activity/node_modules/zod/v3/external.d.ts +6 -0
  435. package/vendor/dsh-working-activity/node_modules/zod/v3/external.js +6 -0
  436. package/vendor/dsh-working-activity/node_modules/zod/v3/helpers/enumUtil.cjs +2 -0
  437. package/vendor/dsh-working-activity/node_modules/zod/v3/helpers/enumUtil.d.cts +8 -0
  438. package/vendor/dsh-working-activity/node_modules/zod/v3/helpers/enumUtil.d.ts +8 -0
  439. package/vendor/dsh-working-activity/node_modules/zod/v3/helpers/enumUtil.js +1 -0
  440. package/vendor/dsh-working-activity/node_modules/zod/v3/helpers/errorUtil.cjs +9 -0
  441. package/vendor/dsh-working-activity/node_modules/zod/v3/helpers/errorUtil.d.cts +9 -0
  442. package/vendor/dsh-working-activity/node_modules/zod/v3/helpers/errorUtil.d.ts +9 -0
  443. package/vendor/dsh-working-activity/node_modules/zod/v3/helpers/errorUtil.js +6 -0
  444. package/vendor/dsh-working-activity/node_modules/zod/v3/helpers/parseUtil.cjs +124 -0
  445. package/vendor/dsh-working-activity/node_modules/zod/v3/helpers/parseUtil.d.cts +78 -0
  446. package/vendor/dsh-working-activity/node_modules/zod/v3/helpers/parseUtil.d.ts +78 -0
  447. package/vendor/dsh-working-activity/node_modules/zod/v3/helpers/parseUtil.js +109 -0
  448. package/vendor/dsh-working-activity/node_modules/zod/v3/helpers/partialUtil.cjs +2 -0
  449. package/vendor/dsh-working-activity/node_modules/zod/v3/helpers/partialUtil.d.cts +8 -0
  450. package/vendor/dsh-working-activity/node_modules/zod/v3/helpers/partialUtil.d.ts +8 -0
  451. package/vendor/dsh-working-activity/node_modules/zod/v3/helpers/partialUtil.js +1 -0
  452. package/vendor/dsh-working-activity/node_modules/zod/v3/helpers/typeAliases.cjs +2 -0
  453. package/vendor/dsh-working-activity/node_modules/zod/v3/helpers/typeAliases.d.cts +2 -0
  454. package/vendor/dsh-working-activity/node_modules/zod/v3/helpers/typeAliases.d.ts +2 -0
  455. package/vendor/dsh-working-activity/node_modules/zod/v3/helpers/typeAliases.js +1 -0
  456. package/vendor/dsh-working-activity/node_modules/zod/v3/helpers/util.cjs +137 -0
  457. package/vendor/dsh-working-activity/node_modules/zod/v3/helpers/util.d.cts +85 -0
  458. package/vendor/dsh-working-activity/node_modules/zod/v3/helpers/util.d.ts +85 -0
  459. package/vendor/dsh-working-activity/node_modules/zod/v3/helpers/util.js +133 -0
  460. package/vendor/dsh-working-activity/node_modules/zod/v3/index.cjs +33 -0
  461. package/vendor/dsh-working-activity/node_modules/zod/v3/index.d.cts +4 -0
  462. package/vendor/dsh-working-activity/node_modules/zod/v3/index.d.ts +4 -0
  463. package/vendor/dsh-working-activity/node_modules/zod/v3/index.js +4 -0
  464. package/vendor/dsh-working-activity/node_modules/zod/v3/locales/en.cjs +112 -0
  465. package/vendor/dsh-working-activity/node_modules/zod/v3/locales/en.d.cts +3 -0
  466. package/vendor/dsh-working-activity/node_modules/zod/v3/locales/en.d.ts +3 -0
  467. package/vendor/dsh-working-activity/node_modules/zod/v3/locales/en.js +109 -0
  468. package/vendor/dsh-working-activity/node_modules/zod/v3/package.json +7 -0
  469. package/vendor/dsh-working-activity/node_modules/zod/v3/standard-schema.cjs +2 -0
  470. package/vendor/dsh-working-activity/node_modules/zod/v3/standard-schema.d.cts +102 -0
  471. package/vendor/dsh-working-activity/node_modules/zod/v3/standard-schema.d.ts +102 -0
  472. package/vendor/dsh-working-activity/node_modules/zod/v3/standard-schema.js +1 -0
  473. package/vendor/dsh-working-activity/node_modules/zod/v3/types.cjs +3777 -0
  474. package/vendor/dsh-working-activity/node_modules/zod/v3/types.d.cts +1034 -0
  475. package/vendor/dsh-working-activity/node_modules/zod/v3/types.d.ts +1034 -0
  476. package/vendor/dsh-working-activity/node_modules/zod/v3/types.js +3695 -0
  477. package/vendor/dsh-working-activity/node_modules/zod/v4/classic/checks.cjs +33 -0
  478. package/vendor/dsh-working-activity/node_modules/zod/v4/classic/checks.d.cts +1 -0
  479. package/vendor/dsh-working-activity/node_modules/zod/v4/classic/checks.d.ts +1 -0
  480. package/vendor/dsh-working-activity/node_modules/zod/v4/classic/checks.js +1 -0
  481. package/vendor/dsh-working-activity/node_modules/zod/v4/classic/coerce.cjs +47 -0
  482. package/vendor/dsh-working-activity/node_modules/zod/v4/classic/coerce.d.cts +17 -0
  483. package/vendor/dsh-working-activity/node_modules/zod/v4/classic/coerce.d.ts +17 -0
  484. package/vendor/dsh-working-activity/node_modules/zod/v4/classic/coerce.js +17 -0
  485. package/vendor/dsh-working-activity/node_modules/zod/v4/classic/compat.cjs +61 -0
  486. package/vendor/dsh-working-activity/node_modules/zod/v4/classic/compat.d.cts +50 -0
  487. package/vendor/dsh-working-activity/node_modules/zod/v4/classic/compat.d.ts +50 -0
  488. package/vendor/dsh-working-activity/node_modules/zod/v4/classic/compat.js +31 -0
  489. package/vendor/dsh-working-activity/node_modules/zod/v4/classic/errors.cjs +74 -0
  490. package/vendor/dsh-working-activity/node_modules/zod/v4/classic/errors.d.cts +30 -0
  491. package/vendor/dsh-working-activity/node_modules/zod/v4/classic/errors.d.ts +30 -0
  492. package/vendor/dsh-working-activity/node_modules/zod/v4/classic/errors.js +48 -0
  493. package/vendor/dsh-working-activity/node_modules/zod/v4/classic/external.cjs +73 -0
  494. package/vendor/dsh-working-activity/node_modules/zod/v4/classic/external.d.cts +16 -0
  495. package/vendor/dsh-working-activity/node_modules/zod/v4/classic/external.d.ts +16 -0
  496. package/vendor/dsh-working-activity/node_modules/zod/v4/classic/external.js +20 -0
  497. package/vendor/dsh-working-activity/node_modules/zod/v4/classic/from-json-schema.cjs +625 -0
  498. package/vendor/dsh-working-activity/node_modules/zod/v4/classic/from-json-schema.d.cts +12 -0
  499. package/vendor/dsh-working-activity/node_modules/zod/v4/classic/from-json-schema.d.ts +12 -0
  500. package/vendor/dsh-working-activity/node_modules/zod/v4/classic/from-json-schema.js +599 -0
  501. package/vendor/dsh-working-activity/node_modules/zod/v4/classic/index.cjs +33 -0
  502. package/vendor/dsh-working-activity/node_modules/zod/v4/classic/index.d.cts +4 -0
  503. package/vendor/dsh-working-activity/node_modules/zod/v4/classic/index.d.ts +4 -0
  504. package/vendor/dsh-working-activity/node_modules/zod/v4/classic/index.js +4 -0
  505. package/vendor/dsh-working-activity/node_modules/zod/v4/classic/iso.cjs +60 -0
  506. package/vendor/dsh-working-activity/node_modules/zod/v4/classic/iso.d.cts +22 -0
  507. package/vendor/dsh-working-activity/node_modules/zod/v4/classic/iso.d.ts +22 -0
  508. package/vendor/dsh-working-activity/node_modules/zod/v4/classic/iso.js +30 -0
  509. package/vendor/dsh-working-activity/node_modules/zod/v4/classic/package.json +7 -0
  510. package/vendor/dsh-working-activity/node_modules/zod/v4/classic/parse.cjs +41 -0
  511. package/vendor/dsh-working-activity/node_modules/zod/v4/classic/parse.d.cts +31 -0
  512. package/vendor/dsh-working-activity/node_modules/zod/v4/classic/parse.d.ts +31 -0
  513. package/vendor/dsh-working-activity/node_modules/zod/v4/classic/parse.js +15 -0
  514. package/vendor/dsh-working-activity/node_modules/zod/v4/classic/schemas.cjs +1511 -0
  515. package/vendor/dsh-working-activity/node_modules/zod/v4/classic/schemas.d.cts +767 -0
  516. package/vendor/dsh-working-activity/node_modules/zod/v4/classic/schemas.d.ts +767 -0
  517. package/vendor/dsh-working-activity/node_modules/zod/v4/classic/schemas.js +1395 -0
  518. package/vendor/dsh-working-activity/node_modules/zod/v4/core/api.cjs +1227 -0
  519. package/vendor/dsh-working-activity/node_modules/zod/v4/core/api.d.cts +325 -0
  520. package/vendor/dsh-working-activity/node_modules/zod/v4/core/api.d.ts +325 -0
  521. package/vendor/dsh-working-activity/node_modules/zod/v4/core/api.js +1087 -0
  522. package/vendor/dsh-working-activity/node_modules/zod/v4/core/checks.cjs +601 -0
  523. package/vendor/dsh-working-activity/node_modules/zod/v4/core/checks.d.cts +278 -0
  524. package/vendor/dsh-working-activity/node_modules/zod/v4/core/checks.d.ts +278 -0
  525. package/vendor/dsh-working-activity/node_modules/zod/v4/core/checks.js +575 -0
  526. package/vendor/dsh-working-activity/node_modules/zod/v4/core/core.cjs +85 -0
  527. package/vendor/dsh-working-activity/node_modules/zod/v4/core/core.d.cts +70 -0
  528. package/vendor/dsh-working-activity/node_modules/zod/v4/core/core.d.ts +70 -0
  529. package/vendor/dsh-working-activity/node_modules/zod/v4/core/core.js +78 -0
  530. package/vendor/dsh-working-activity/node_modules/zod/v4/core/doc.cjs +39 -0
  531. package/vendor/dsh-working-activity/node_modules/zod/v4/core/doc.d.cts +14 -0
  532. package/vendor/dsh-working-activity/node_modules/zod/v4/core/doc.d.ts +14 -0
  533. package/vendor/dsh-working-activity/node_modules/zod/v4/core/doc.js +35 -0
  534. package/vendor/dsh-working-activity/node_modules/zod/v4/core/errors.cjs +216 -0
  535. package/vendor/dsh-working-activity/node_modules/zod/v4/core/errors.d.cts +221 -0
  536. package/vendor/dsh-working-activity/node_modules/zod/v4/core/errors.d.ts +221 -0
  537. package/vendor/dsh-working-activity/node_modules/zod/v4/core/errors.js +185 -0
  538. package/vendor/dsh-working-activity/node_modules/zod/v4/core/index.cjs +47 -0
  539. package/vendor/dsh-working-activity/node_modules/zod/v4/core/index.d.cts +16 -0
  540. package/vendor/dsh-working-activity/node_modules/zod/v4/core/index.d.ts +16 -0
  541. package/vendor/dsh-working-activity/node_modules/zod/v4/core/index.js +16 -0
  542. package/vendor/dsh-working-activity/node_modules/zod/v4/core/json-schema-generator.cjs +99 -0
  543. package/vendor/dsh-working-activity/node_modules/zod/v4/core/json-schema-generator.d.cts +65 -0
  544. package/vendor/dsh-working-activity/node_modules/zod/v4/core/json-schema-generator.d.ts +65 -0
  545. package/vendor/dsh-working-activity/node_modules/zod/v4/core/json-schema-generator.js +95 -0
  546. package/vendor/dsh-working-activity/node_modules/zod/v4/core/json-schema-processors.cjs +644 -0
  547. package/vendor/dsh-working-activity/node_modules/zod/v4/core/json-schema-processors.d.cts +49 -0
  548. package/vendor/dsh-working-activity/node_modules/zod/v4/core/json-schema-processors.d.ts +49 -0
  549. package/vendor/dsh-working-activity/node_modules/zod/v4/core/json-schema-processors.js +601 -0
  550. package/vendor/dsh-working-activity/node_modules/zod/v4/core/json-schema.cjs +2 -0
  551. package/vendor/dsh-working-activity/node_modules/zod/v4/core/json-schema.d.cts +88 -0
  552. package/vendor/dsh-working-activity/node_modules/zod/v4/core/json-schema.d.ts +88 -0
  553. package/vendor/dsh-working-activity/node_modules/zod/v4/core/json-schema.js +1 -0
  554. package/vendor/dsh-working-activity/node_modules/zod/v4/core/package.json +7 -0
  555. package/vendor/dsh-working-activity/node_modules/zod/v4/core/parse.cjs +131 -0
  556. package/vendor/dsh-working-activity/node_modules/zod/v4/core/parse.d.cts +49 -0
  557. package/vendor/dsh-working-activity/node_modules/zod/v4/core/parse.d.ts +49 -0
  558. package/vendor/dsh-working-activity/node_modules/zod/v4/core/parse.js +93 -0
  559. package/vendor/dsh-working-activity/node_modules/zod/v4/core/regexes.cjs +172 -0
  560. package/vendor/dsh-working-activity/node_modules/zod/v4/core/regexes.d.cts +85 -0
  561. package/vendor/dsh-working-activity/node_modules/zod/v4/core/regexes.d.ts +85 -0
  562. package/vendor/dsh-working-activity/node_modules/zod/v4/core/regexes.js +139 -0
  563. package/vendor/dsh-working-activity/node_modules/zod/v4/core/registries.cjs +56 -0
  564. package/vendor/dsh-working-activity/node_modules/zod/v4/core/registries.d.cts +35 -0
  565. package/vendor/dsh-working-activity/node_modules/zod/v4/core/registries.d.ts +35 -0
  566. package/vendor/dsh-working-activity/node_modules/zod/v4/core/registries.js +51 -0
  567. package/vendor/dsh-working-activity/node_modules/zod/v4/core/schemas.cjs +2270 -0
  568. package/vendor/dsh-working-activity/node_modules/zod/v4/core/schemas.d.cts +1184 -0
  569. package/vendor/dsh-working-activity/node_modules/zod/v4/core/schemas.d.ts +1184 -0
  570. package/vendor/dsh-working-activity/node_modules/zod/v4/core/schemas.js +2239 -0
  571. package/vendor/dsh-working-activity/node_modules/zod/v4/core/standard-schema.cjs +2 -0
  572. package/vendor/dsh-working-activity/node_modules/zod/v4/core/standard-schema.d.cts +126 -0
  573. package/vendor/dsh-working-activity/node_modules/zod/v4/core/standard-schema.d.ts +126 -0
  574. package/vendor/dsh-working-activity/node_modules/zod/v4/core/standard-schema.js +1 -0
  575. package/vendor/dsh-working-activity/node_modules/zod/v4/core/to-json-schema.cjs +457 -0
  576. package/vendor/dsh-working-activity/node_modules/zod/v4/core/to-json-schema.d.cts +114 -0
  577. package/vendor/dsh-working-activity/node_modules/zod/v4/core/to-json-schema.d.ts +114 -0
  578. package/vendor/dsh-working-activity/node_modules/zod/v4/core/to-json-schema.js +448 -0
  579. package/vendor/dsh-working-activity/node_modules/zod/v4/core/util.cjs +734 -0
  580. package/vendor/dsh-working-activity/node_modules/zod/v4/core/util.d.cts +200 -0
  581. package/vendor/dsh-working-activity/node_modules/zod/v4/core/util.d.ts +200 -0
  582. package/vendor/dsh-working-activity/node_modules/zod/v4/core/util.js +674 -0
  583. package/vendor/dsh-working-activity/node_modules/zod/v4/core/versions.cjs +8 -0
  584. package/vendor/dsh-working-activity/node_modules/zod/v4/core/versions.d.cts +5 -0
  585. package/vendor/dsh-working-activity/node_modules/zod/v4/core/versions.d.ts +5 -0
  586. package/vendor/dsh-working-activity/node_modules/zod/v4/core/versions.js +5 -0
  587. package/vendor/dsh-working-activity/node_modules/zod/v4/index.cjs +22 -0
  588. package/vendor/dsh-working-activity/node_modules/zod/v4/index.d.cts +3 -0
  589. package/vendor/dsh-working-activity/node_modules/zod/v4/index.d.ts +3 -0
  590. package/vendor/dsh-working-activity/node_modules/zod/v4/index.js +3 -0
  591. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/ar.cjs +133 -0
  592. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/ar.d.cts +5 -0
  593. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/ar.d.ts +4 -0
  594. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/ar.js +106 -0
  595. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/az.cjs +132 -0
  596. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/az.d.cts +5 -0
  597. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/az.d.ts +4 -0
  598. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/az.js +105 -0
  599. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/be.cjs +183 -0
  600. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/be.d.cts +5 -0
  601. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/be.d.ts +4 -0
  602. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/be.js +156 -0
  603. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/bg.cjs +147 -0
  604. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/bg.d.cts +5 -0
  605. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/bg.d.ts +4 -0
  606. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/bg.js +120 -0
  607. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/ca.cjs +134 -0
  608. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/ca.d.cts +5 -0
  609. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/ca.d.ts +4 -0
  610. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/ca.js +107 -0
  611. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/cs.cjs +138 -0
  612. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/cs.d.cts +5 -0
  613. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/cs.d.ts +4 -0
  614. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/cs.js +111 -0
  615. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/da.cjs +142 -0
  616. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/da.d.cts +5 -0
  617. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/da.d.ts +4 -0
  618. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/da.js +115 -0
  619. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/de.cjs +135 -0
  620. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/de.d.cts +5 -0
  621. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/de.d.ts +4 -0
  622. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/de.js +108 -0
  623. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/el.cjs +136 -0
  624. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/el.d.cts +5 -0
  625. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/el.d.ts +4 -0
  626. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/el.js +109 -0
  627. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/en.cjs +140 -0
  628. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/en.d.cts +5 -0
  629. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/en.d.ts +4 -0
  630. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/en.js +113 -0
  631. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/eo.cjs +136 -0
  632. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/eo.d.cts +5 -0
  633. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/eo.d.ts +4 -0
  634. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/eo.js +109 -0
  635. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/es.cjs +159 -0
  636. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/es.d.cts +5 -0
  637. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/es.d.ts +4 -0
  638. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/es.js +132 -0
  639. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/fa.cjs +141 -0
  640. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/fa.d.cts +5 -0
  641. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/fa.d.ts +4 -0
  642. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/fa.js +114 -0
  643. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/fi.cjs +139 -0
  644. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/fi.d.cts +5 -0
  645. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/fi.d.ts +4 -0
  646. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/fi.js +112 -0
  647. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/fr-CA.cjs +134 -0
  648. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/fr-CA.d.cts +5 -0
  649. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/fr-CA.d.ts +4 -0
  650. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/fr-CA.js +107 -0
  651. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/fr.cjs +152 -0
  652. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/fr.d.cts +5 -0
  653. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/fr.d.ts +4 -0
  654. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/fr.js +125 -0
  655. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/he.cjs +241 -0
  656. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/he.d.cts +5 -0
  657. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/he.d.ts +4 -0
  658. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/he.js +214 -0
  659. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/hr.cjs +149 -0
  660. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/hr.d.cts +5 -0
  661. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/hr.d.ts +4 -0
  662. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/hr.js +122 -0
  663. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/hu.cjs +135 -0
  664. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/hu.d.cts +5 -0
  665. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/hu.d.ts +4 -0
  666. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/hu.js +108 -0
  667. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/hy.cjs +174 -0
  668. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/hy.d.cts +5 -0
  669. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/hy.d.ts +4 -0
  670. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/hy.js +147 -0
  671. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/id.cjs +133 -0
  672. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/id.d.cts +5 -0
  673. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/id.d.ts +4 -0
  674. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/id.js +106 -0
  675. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/index.cjs +111 -0
  676. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/index.d.cts +52 -0
  677. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/index.d.ts +52 -0
  678. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/index.js +52 -0
  679. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/is.cjs +136 -0
  680. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/is.d.cts +5 -0
  681. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/is.d.ts +4 -0
  682. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/is.js +109 -0
  683. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/it.cjs +135 -0
  684. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/it.d.cts +5 -0
  685. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/it.d.ts +4 -0
  686. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/it.js +108 -0
  687. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/ja.cjs +134 -0
  688. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/ja.d.cts +5 -0
  689. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/ja.d.ts +4 -0
  690. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/ja.js +107 -0
  691. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/ka.cjs +139 -0
  692. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/ka.d.cts +5 -0
  693. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/ka.d.ts +4 -0
  694. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/ka.js +112 -0
  695. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/kh.cjs +12 -0
  696. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/kh.d.cts +5 -0
  697. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/kh.d.ts +5 -0
  698. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/kh.js +5 -0
  699. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/km.cjs +137 -0
  700. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/km.d.cts +5 -0
  701. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/km.d.ts +4 -0
  702. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/km.js +110 -0
  703. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/ko.cjs +138 -0
  704. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/ko.d.cts +5 -0
  705. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/ko.d.ts +4 -0
  706. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/ko.js +111 -0
  707. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/lt.cjs +230 -0
  708. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/lt.d.cts +5 -0
  709. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/lt.d.ts +4 -0
  710. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/lt.js +203 -0
  711. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/mk.cjs +136 -0
  712. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/mk.d.cts +5 -0
  713. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/mk.d.ts +4 -0
  714. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/mk.js +109 -0
  715. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/ms.cjs +134 -0
  716. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/ms.d.cts +5 -0
  717. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/ms.d.ts +4 -0
  718. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/ms.js +107 -0
  719. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/nl.cjs +137 -0
  720. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/nl.d.cts +5 -0
  721. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/nl.d.ts +4 -0
  722. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/nl.js +110 -0
  723. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/no.cjs +135 -0
  724. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/no.d.cts +5 -0
  725. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/no.d.ts +4 -0
  726. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/no.js +108 -0
  727. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/ota.cjs +136 -0
  728. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/ota.d.cts +5 -0
  729. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/ota.d.ts +4 -0
  730. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/ota.js +109 -0
  731. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/package.json +7 -0
  732. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/pl.cjs +136 -0
  733. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/pl.d.cts +5 -0
  734. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/pl.d.ts +4 -0
  735. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/pl.js +109 -0
  736. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/ps.cjs +141 -0
  737. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/ps.d.cts +5 -0
  738. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/ps.d.ts +4 -0
  739. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/ps.js +114 -0
  740. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/pt.cjs +135 -0
  741. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/pt.d.cts +5 -0
  742. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/pt.d.ts +4 -0
  743. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/pt.js +108 -0
  744. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/ro.cjs +146 -0
  745. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/ro.d.cts +5 -0
  746. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/ro.d.ts +4 -0
  747. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/ro.js +119 -0
  748. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/ru.cjs +183 -0
  749. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/ru.d.cts +5 -0
  750. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/ru.d.ts +4 -0
  751. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/ru.js +156 -0
  752. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/sl.cjs +136 -0
  753. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/sl.d.cts +5 -0
  754. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/sl.d.ts +4 -0
  755. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/sl.js +109 -0
  756. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/sv.cjs +137 -0
  757. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/sv.d.cts +5 -0
  758. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/sv.d.ts +4 -0
  759. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/sv.js +110 -0
  760. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/ta.cjs +137 -0
  761. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/ta.d.cts +5 -0
  762. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/ta.d.ts +4 -0
  763. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/ta.js +110 -0
  764. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/th.cjs +137 -0
  765. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/th.d.cts +5 -0
  766. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/th.d.ts +4 -0
  767. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/th.js +110 -0
  768. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/tr.cjs +132 -0
  769. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/tr.d.cts +5 -0
  770. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/tr.d.ts +4 -0
  771. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/tr.js +105 -0
  772. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/ua.cjs +12 -0
  773. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/ua.d.cts +5 -0
  774. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/ua.d.ts +5 -0
  775. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/ua.js +5 -0
  776. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/uk.cjs +135 -0
  777. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/uk.d.cts +5 -0
  778. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/uk.d.ts +4 -0
  779. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/uk.js +108 -0
  780. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/ur.cjs +137 -0
  781. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/ur.d.cts +5 -0
  782. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/ur.d.ts +4 -0
  783. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/ur.js +110 -0
  784. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/uz.cjs +137 -0
  785. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/uz.d.cts +5 -0
  786. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/uz.d.ts +4 -0
  787. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/uz.js +110 -0
  788. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/vi.cjs +135 -0
  789. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/vi.d.cts +5 -0
  790. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/vi.d.ts +4 -0
  791. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/vi.js +108 -0
  792. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/yo.cjs +134 -0
  793. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/yo.d.cts +5 -0
  794. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/yo.d.ts +4 -0
  795. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/yo.js +107 -0
  796. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/zh-CN.cjs +136 -0
  797. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/zh-CN.d.cts +5 -0
  798. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/zh-CN.d.ts +4 -0
  799. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/zh-CN.js +109 -0
  800. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/zh-TW.cjs +134 -0
  801. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/zh-TW.d.cts +5 -0
  802. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/zh-TW.d.ts +4 -0
  803. package/vendor/dsh-working-activity/node_modules/zod/v4/locales/zh-TW.js +107 -0
  804. package/vendor/dsh-working-activity/node_modules/zod/v4/mini/checks.cjs +34 -0
  805. package/vendor/dsh-working-activity/node_modules/zod/v4/mini/checks.d.cts +1 -0
  806. package/vendor/dsh-working-activity/node_modules/zod/v4/mini/checks.d.ts +1 -0
  807. package/vendor/dsh-working-activity/node_modules/zod/v4/mini/checks.js +1 -0
  808. package/vendor/dsh-working-activity/node_modules/zod/v4/mini/coerce.cjs +52 -0
  809. package/vendor/dsh-working-activity/node_modules/zod/v4/mini/coerce.d.cts +7 -0
  810. package/vendor/dsh-working-activity/node_modules/zod/v4/mini/coerce.d.ts +7 -0
  811. package/vendor/dsh-working-activity/node_modules/zod/v4/mini/coerce.js +22 -0
  812. package/vendor/dsh-working-activity/node_modules/zod/v4/mini/external.cjs +63 -0
  813. package/vendor/dsh-working-activity/node_modules/zod/v4/mini/external.d.cts +13 -0
  814. package/vendor/dsh-working-activity/node_modules/zod/v4/mini/external.d.ts +13 -0
  815. package/vendor/dsh-working-activity/node_modules/zod/v4/mini/external.js +14 -0
  816. package/vendor/dsh-working-activity/node_modules/zod/v4/mini/index.cjs +32 -0
  817. package/vendor/dsh-working-activity/node_modules/zod/v4/mini/index.d.cts +3 -0
  818. package/vendor/dsh-working-activity/node_modules/zod/v4/mini/index.d.ts +3 -0
  819. package/vendor/dsh-working-activity/node_modules/zod/v4/mini/index.js +3 -0
  820. package/vendor/dsh-working-activity/node_modules/zod/v4/mini/iso.cjs +64 -0
  821. package/vendor/dsh-working-activity/node_modules/zod/v4/mini/iso.d.cts +22 -0
  822. package/vendor/dsh-working-activity/node_modules/zod/v4/mini/iso.d.ts +22 -0
  823. package/vendor/dsh-working-activity/node_modules/zod/v4/mini/iso.js +34 -0
  824. package/vendor/dsh-working-activity/node_modules/zod/v4/mini/package.json +7 -0
  825. package/vendor/dsh-working-activity/node_modules/zod/v4/mini/parse.cjs +16 -0
  826. package/vendor/dsh-working-activity/node_modules/zod/v4/mini/parse.d.cts +1 -0
  827. package/vendor/dsh-working-activity/node_modules/zod/v4/mini/parse.d.ts +1 -0
  828. package/vendor/dsh-working-activity/node_modules/zod/v4/mini/parse.js +1 -0
  829. package/vendor/dsh-working-activity/node_modules/zod/v4/mini/schemas.cjs +1083 -0
  830. package/vendor/dsh-working-activity/node_modules/zod/v4/mini/schemas.d.cts +445 -0
  831. package/vendor/dsh-working-activity/node_modules/zod/v4/mini/schemas.d.ts +445 -0
  832. package/vendor/dsh-working-activity/node_modules/zod/v4/mini/schemas.js +961 -0
  833. package/vendor/dsh-working-activity/node_modules/zod/v4/package.json +7 -0
  834. package/vendor/dsh-working-activity/node_modules/zod/v4-mini/index.cjs +32 -0
  835. package/vendor/dsh-working-activity/node_modules/zod/v4-mini/index.d.cts +3 -0
  836. package/vendor/dsh-working-activity/node_modules/zod/v4-mini/index.d.ts +3 -0
  837. package/vendor/dsh-working-activity/node_modules/zod/v4-mini/index.js +3 -0
  838. package/vendor/dsh-working-activity/node_modules/zod/v4-mini/package.json +7 -0
@@ -0,0 +1,1306 @@
1
+ /**
2
+ * Pure activity state machine for the working-activity status line. Consumes
3
+ * session events (turn/step/tool/stream) plus agent running/idle transitions
4
+ * and renders a human-readable status line at any wall-clock instant. No I/O,
5
+ * no timers, no cordis — deterministic given the event stream and a clock.
6
+ * @module @deepseek-ai/dsh-working-activity/status
7
+ */
8
+ import { actionFor, compactPhrase, continuePhrase, donePhrase, failPhrase, fmtDuration, holidayPhrase, isGitTool, isNight, isWeekend, mixSlot, modelQuip, overflowPhrase, rarePhrase, RARE_CHANCE, thinkingPhrase, toolOpeningPhrase, weekendPhrase, waitingPhrase, waitingReasonPhrase, } from './phrases.js';
9
+ import { feedSessionEvent } from './compat/session-events.js';
10
+ import { detectInputLanguage, isLang, langNow, t, terminalProgressLang, withProgressLang } from './lang.js';
11
+ /**
12
+ * Compatibility handle for {@link ActivityTracker.snapshot} output.
13
+ *
14
+ * The snapshot shape is private to this module; this number is the only part a
15
+ * consumer may rely on. Bump it whenever the emitted shape changes, so a
16
+ * persisted projection checkpoint from an older build is discarded (the host
17
+ * refolds the log) instead of being misread as the new shape.
18
+ */
19
+ export const TRACKER_SNAPSHOT_VERSION = 6;
20
+ /** Format one tool into its display fragment (`跑个命令 npm test`). */
21
+ function toolFragment(tool) {
22
+ return tool.detail.length === 0 ? tool.action : `${tool.action} ${tool.detail}`;
23
+ }
24
+ /** The phase vocabulary, for snapshot shape validation (see {@link ActivityTracker.restore}). */
25
+ const PHASES = ['idle', 'waiting', 'thinking', 'tool', 'done'];
26
+ /** Whether `value` is one of {@link PHASES}. */
27
+ function isPhase(value) {
28
+ return PHASES.includes(value);
29
+ }
30
+ /**
31
+ * Duration label for a settled tool: sub-second tools read in milliseconds.
32
+ *
33
+ * The shared `fmtDuration` is second-granular, which renders the measured
34
+ * median tool (87 ms) as a meaningless `0s` — the settled line exists to make
35
+ * that work visible, so it has to say how long it took.
36
+ * @param ms - Tool duration in milliseconds.
37
+ */
38
+ function durationLabel(ms) {
39
+ // Floor, not round: 999.6 ms is "999ms", not a "1000ms" that never happened.
40
+ return ms < 1000 ? `${Math.max(0, Math.floor(ms))}ms` : fmtDuration(ms);
41
+ }
42
+ /** Simple non-ANSI string shortener by grapheme count. */
43
+ function shorten(value, limit) {
44
+ const graphemes = Array.from(value);
45
+ if (graphemes.length <= limit)
46
+ return value;
47
+ return `${graphemes.slice(0, Math.max(0, limit - 1)).join('')}…`;
48
+ }
49
+ /**
50
+ * Flatten model-written text for the single-line render path.
51
+ *
52
+ * The line is composed from text the model wrote (its `⏵` narration, the path
53
+ * or command inside a tool call), and it is displayed by a terminal and by the
54
+ * Web UI. So this is where that text stops being able to do anything but be
55
+ * read: complete ANSI/OSC sequences go first (stripping only their control
56
+ * bytes would leave `[31m` residue behind), every remaining C0/C1 control char
57
+ * becomes a space — a `\n` inside a multi-line shell command would otherwise
58
+ * split the status line in two — and whitespace collapses, because a render
59
+ * path is one line by definition.
60
+ * @param value - Raw model-written fragment.
61
+ * @returns the fragment, safe and single-line.
62
+ */
63
+ function sanitizeFragment(value) {
64
+ return value
65
+ .replace(/\u001B\][^\u0007]*(?:\u0007|\u001B\\)/gu, '')
66
+ .replace(/\u001B\[[0-?]*[ -/]*[@-~]/gu, '')
67
+ // eslint-disable-next-line no-control-regex -- deliberate: model text is untrusted render input
68
+ .replace(/[\u0000-\u001f\u007f-\u009f]/g, ' ')
69
+ .replace(/\s+/g, ' ')
70
+ .trim();
71
+ }
72
+ /**
73
+ * Extract a displayable detail fragment from a tool call's parsed arguments.
74
+ * @param toolName - Registry tool name.
75
+ * @param args - Parsed tool arguments (lossless JSON by registry contract).
76
+ */
77
+ export function detailFor(toolName, args, limit) {
78
+ if (args === undefined)
79
+ return '';
80
+ const pickString = (...keys) => {
81
+ for (const key of keys) {
82
+ const value = args[key];
83
+ if (typeof value === 'string' && value.trim().length > 0)
84
+ return sanitizeFragment(value);
85
+ }
86
+ return '';
87
+ };
88
+ const normalized = toolName.toLowerCase();
89
+ if (normalized === 'mcp' || normalized.startsWith('mcp__') || normalized.includes('__')) {
90
+ const action = pickString('action', 'tool', 'server', 'connect', 'describe');
91
+ return shorten(action, limit);
92
+ }
93
+ const path = pickString('path', 'file', 'file_path', 'filepath', 'target');
94
+ if (path.length > 0)
95
+ return shorten(path, limit);
96
+ const command = pickString('command', 'cmd', 'cmdline');
97
+ if (command.length > 0)
98
+ return shorten(command, limit);
99
+ const pattern = pickString('pattern', 'query', 'search');
100
+ if (pattern.length > 0)
101
+ return shorten(pattern, limit);
102
+ const url = pickString('url');
103
+ if (url.length > 0)
104
+ return shorten(url, limit);
105
+ if (/^(?:subagent|agent|task)$/i.test(toolName)) {
106
+ const description = pickString('description');
107
+ if (description.length > 0)
108
+ return shorten(description, limit);
109
+ const prompt = pickString('prompt');
110
+ if (prompt.length > 0)
111
+ return shorten(prompt, limit);
112
+ }
113
+ const named = pickString('name', 'server', 'tool', 'id', 'goal');
114
+ if (named.length > 0)
115
+ return shorten(named, limit);
116
+ return '';
117
+ }
118
+ /**
119
+ * Track one agent's activity from its durable session events. Events from
120
+ * other sessions are ignored (the owning plugin feeds only the agent it
121
+ * displays). The tracker is deliberately single-agent: multi-session UIs
122
+ * instantiate one tracker per agent.
123
+ */
124
+ export class ActivityTracker {
125
+ config;
126
+ now;
127
+ customActions;
128
+ progressLang = terminalProgressLang();
129
+ phase = 'idle';
130
+ phaseStartedAt = 0;
131
+ turnStartedAt = 0;
132
+ thinkingStartedAt = 0;
133
+ thinkingMs = 0;
134
+ toolMs = 0;
135
+ toolCount = 0;
136
+ /** When the turn's first tool started; 0 until it does (see {@link toolOpening}). */
137
+ firstToolStartedAt = 0;
138
+ activeTools = new Map();
139
+ doneQueue = [];
140
+ thinkingPhases = 0;
141
+ waitingFirstToken = false;
142
+ /** Latest `⏵` self-narration line extracted from the stream, or null. */
143
+ narratedText = null;
144
+ /** Wall-clock time of the most recent stream delta (narration freshness). */
145
+ lastChunkAt = 0;
146
+ /** Rolling window of VISIBLE text deltas, for `⏵` extraction (see onEvent). */
147
+ recentStream = '';
148
+ /** Total tokens reported across the turn's assistant messages. */
149
+ turnTokens = 0;
150
+ /** Completion prefix drawn ONCE at turn end so the done line stays stable. */
151
+ donePrefix = t('done-prefix');
152
+ /** One-off copy pinned by an external event (interrupt / model switch /
153
+ * compaction / work reminder), shown until it expires. */
154
+ pendingPhrase = null;
155
+ pendingUntil = 0;
156
+ /** Git branch of the session cwd (fed by the host, best-effort). */
157
+ gitBranch;
158
+ /** Last model route announced, so a repeated selection stays quiet. */
159
+ model;
160
+ /** Consecutive fast tool streak (combo). */
161
+ streak = 0;
162
+ lastToolEndAt = 0;
163
+ maxStreak = 0;
164
+ /** Subagent (agent/task) calls in the current turn. */
165
+ subagentCount = 0;
166
+ /**
167
+ * Why the turn is stalled, when it is (retry / approval / compaction).
168
+ *
169
+ * A stall is state, not decoration: "waiting on the model" and "the model is
170
+ * waiting on YOU" need different copy, so it outranks the phrase pools and
171
+ * survives `phrases: false`.
172
+ */
173
+ waitingReason;
174
+ /** When the current stall began (seeds its copy; 0 with no stall). */
175
+ waitingReasonAt = 0;
176
+ /** Streaming token estimate for the tps prefix. */
177
+ tokBuf = 0;
178
+ tokWindowStart = 0;
179
+ /**
180
+ * @param config - Behavioral knobs.
181
+ * @param now - Wall-clock supplier (injectable for tests).
182
+ * @param customActions - Exact-name custom action pools for {@link actionFor}.
183
+ */
184
+ constructor(config, now = Date.now, customActions) {
185
+ this.config = config;
186
+ this.now = now;
187
+ this.customActions = customActions;
188
+ }
189
+ /** The locale used by this session's line. Existing modes still follow /lang. */
190
+ language() {
191
+ return this.config.inputLanguage ? this.progressLang : (this.config.language?.() ?? langNow());
192
+ }
193
+ /** Agent transitioned to running/idle. */
194
+ onAgentStatus(status) {
195
+ if (status === 'idle') {
196
+ // The turn end already moved us to the done phase; idle only clears the
197
+ // lingering done card after its display window.
198
+ if (this.phase !== 'done')
199
+ this.phase = 'idle';
200
+ return;
201
+ }
202
+ if (this.phase === 'idle') {
203
+ this.phase = 'waiting';
204
+ this.phaseStartedAt = this.now();
205
+ this.waitingFirstToken = true;
206
+ }
207
+ }
208
+ /** The user interrupted the running turn: show a comeback quip next. */
209
+ onInterrupted() {
210
+ if (!this.config.phrases)
211
+ return;
212
+ if ((this.config.features ?? {}).continuePhrases === false)
213
+ return;
214
+ this.pendingPhrase = continuePhrase();
215
+ this.pendingUntil = this.now() + PENDING_MS;
216
+ }
217
+ /**
218
+ * The model was switched: quip for the new model id.
219
+ *
220
+ * Repeats are ignored. A `model/selection` event is logged whenever the host
221
+ * validates a selection — including a re-selection of the current model and
222
+ * every replay of the log — and re-announcing the same model would replace
223
+ * whatever the line is saying with a stale quip.
224
+ */
225
+ onModelSwitch(modelId) {
226
+ if (modelId === this.model)
227
+ return;
228
+ this.model = modelId;
229
+ if (!this.config.phrases)
230
+ return;
231
+ if ((this.config.features ?? {}).modelQuips === false)
232
+ return;
233
+ const quip = modelQuip(modelId);
234
+ if (quip !== null) {
235
+ this.pendingPhrase = quip;
236
+ this.pendingUntil = this.now() + PENDING_MS;
237
+ }
238
+ }
239
+ /** A context compaction finished (or overflowed): quip about it. */
240
+ onCompact(kind) {
241
+ // The compaction stall (if any) is over either way.
242
+ if (this.waitingReason === 'compaction')
243
+ this.clearWaitingReason();
244
+ if (!this.config.phrases)
245
+ return;
246
+ this.pendingPhrase = kind === 'overflow' ? overflowPhrase() : compactPhrase();
247
+ this.pendingUntil = this.now() + PENDING_MS;
248
+ }
249
+ /** Feed the session cwd's git branch (best-effort, host-resolved). */
250
+ onGitBranch(branch) {
251
+ this.gitBranch = branch;
252
+ }
253
+ /**
254
+ * Consume one normalized activity event. This is the state machine's only
255
+ * input: host payload shapes are normalized in `src/compat/*` first, so a
256
+ * host-line drift never reaches this switch.
257
+ */
258
+ onEvent(event) {
259
+ if (event.kind === 'user-prompt') {
260
+ if (this.config.inputLanguage) {
261
+ const next = detectInputLanguage(event.text);
262
+ if (next !== undefined && next !== this.progressLang) {
263
+ this.progressLang = next;
264
+ withProgressLang(next, () => {
265
+ for (const tool of this.activeTools.values()) {
266
+ tool.action = this.config.phrases ? actionFor(tool.name, this.customActions) : tool.name;
267
+ }
268
+ for (const tool of this.doneQueue) {
269
+ tool.action = this.config.phrases ? actionFor(tool.name, this.customActions) : tool.name;
270
+ }
271
+ this.donePrefix = t('done-prefix');
272
+ });
273
+ this.pendingPhrase = null;
274
+ }
275
+ }
276
+ return;
277
+ }
278
+ withProgressLang(this.language(), () => this.applyEvent(event));
279
+ }
280
+ applyEvent(event) {
281
+ switch (event.kind) {
282
+ case 'turn-start': {
283
+ const at = event.at;
284
+ this.turnStartedAt = at;
285
+ this.thinkingStartedAt = at;
286
+ this.thinkingMs = 0;
287
+ this.toolMs = 0;
288
+ this.toolCount = 0;
289
+ this.turnTokens = 0;
290
+ this.activeTools.clear();
291
+ this.doneQueue = [];
292
+ this.waitingFirstToken = true;
293
+ this.narratedText = null;
294
+ this.lastChunkAt = 0;
295
+ this.recentStream = '';
296
+ // Eggs are once-per-turn and derived from the turn's seed, so a fresh
297
+ // turn only needs its phase counter cleared.
298
+ this.thinkingPhases = 0;
299
+ this.firstToolStartedAt = 0;
300
+ // Per-turn stats reset; the pending quip (interrupt/model/compact)
301
+ // survives across the turn boundary so it shows on the next think.
302
+ this.streak = 0;
303
+ this.maxStreak = 0;
304
+ this.subagentCount = 0;
305
+ this.clearWaitingReason();
306
+ this.tokBuf = 0;
307
+ this.tokWindowStart = at;
308
+ this.setPhase('waiting', at);
309
+ return;
310
+ }
311
+ case 'step-start':
312
+ // No phase change of its own: a step without streamed output stays
313
+ // waiting until its first delta promotes it.
314
+ return;
315
+ case 'stream-start':
316
+ // A new attempt must not inherit the previous attempt's provisional
317
+ // text: the narration buffer and the token estimate are attempt-scoped.
318
+ // The phase is untouched — the first delta promotes waiting → thinking.
319
+ this.recentStream = '';
320
+ this.narratedText = null;
321
+ this.tokBuf = 0;
322
+ this.lastChunkAt = 0;
323
+ return;
324
+ case 'stream-delta': {
325
+ const at = event.at;
326
+ this.lastChunkAt = at;
327
+ // Output is flowing again — whatever stalled the turn is over.
328
+ this.clearWaitingReason();
329
+ if (this.waitingFirstToken) {
330
+ this.waitingFirstToken = false;
331
+ // A delta that arrives while a tool runs must not steal the phase:
332
+ // models may stream text after a tool call inside the same attempt,
333
+ // and the tool is what the user is actually waiting on. The tool
334
+ // result hands the phase back to thinking on its own.
335
+ if (this.activeTools.size === 0) {
336
+ this.setPhase('thinking', at);
337
+ this.thinkingStartedAt = at;
338
+ }
339
+ }
340
+ // Streaming token estimate for the tps prefix (pi parity).
341
+ this.tokBuf += estimateTokens(event.text);
342
+ // Only VISIBLE output narrates. The injected contract asks for the `⏵`
343
+ // line at the beginning of the *response body*, and the durable path
344
+ // (`assistant-settled`) already reads text blocks only — folding
345
+ // reasoning deltas in here made the line quote the model's private
346
+ // thinking back at the user. Reported live: the status line showed a
347
+ // half sentence from reasoning, because thinking about this very
348
+ // format means writing `⏵` about it.
349
+ if (event.stream !== 'text')
350
+ return;
351
+ this.recentStream = (this.recentStream + event.text).slice(-STREAM_BUFFER_CHARS);
352
+ const narration = extractNarration(this.recentStream);
353
+ if (narration !== null)
354
+ this.narratedText = narration;
355
+ return;
356
+ }
357
+ case 'stream-reset': {
358
+ // An abandoned attempt (or a partial settlement) must not leave its
359
+ // provisional narration or token estimate behind for the next attempt.
360
+ this.recentStream = '';
361
+ this.narratedText = null;
362
+ this.tokBuf = 0;
363
+ this.lastChunkAt = 0;
364
+ this.waitingFirstToken = true;
365
+ if (this.activeTools.size === 0)
366
+ this.setPhase('waiting', event.at);
367
+ return;
368
+ }
369
+ case 'assistant-settled': {
370
+ const usage = event.usage;
371
+ if (usage !== undefined) {
372
+ this.turnTokens += usage.inputTokens + usage.outputTokens
373
+ + (usage.cacheReadTokens ?? 0) + (usage.cacheWriteTokens ?? 0);
374
+ }
375
+ // The settled text is where a projection (or a replayed log) recovers
376
+ // the narration: frames are live-only, this event is durable.
377
+ if (event.text !== undefined) {
378
+ const narration = extractNarration(event.text);
379
+ if (narration !== null) {
380
+ this.narratedText = narration;
381
+ this.lastChunkAt = event.at;
382
+ }
383
+ }
384
+ return;
385
+ }
386
+ case 'tool-start': {
387
+ const at = event.at;
388
+ if (this.phase === 'thinking' || this.phase === 'waiting') {
389
+ this.thinkingMs += at - this.thinkingStartedAt;
390
+ }
391
+ // The turn's first tool is where "thinking" turns into "doing": its
392
+ // opening line is derived from this instant (see toolOpening).
393
+ if (this.firstToolStartedAt === 0)
394
+ this.firstToolStartedAt = at;
395
+ // Combo streak: consecutive tools within COMBO_GAP_MS count up.
396
+ this.streak = (this.lastToolEndAt > 0 && at - this.lastToolEndAt <= COMBO_GAP_MS)
397
+ ? this.streak + 1
398
+ : 1;
399
+ if (this.streak > this.maxStreak)
400
+ this.maxStreak = this.streak;
401
+ if (/^(?:subagent|agent|task)$/i.test(event.name))
402
+ this.subagentCount += 1;
403
+ const parsed = parseArguments(event.arguments);
404
+ const action = this.config.phrases ? actionFor(event.name, this.customActions) : event.name;
405
+ const detail = detailFor(event.name, parsed, this.config.detailLimit);
406
+ const active = {
407
+ callId: event.callId,
408
+ name: event.name,
409
+ action,
410
+ detail,
411
+ isGit: isGitTool(event.name, parsed),
412
+ startedAt: at,
413
+ failed: false,
414
+ };
415
+ this.activeTools.set(event.callId, active);
416
+ this.setPhase('tool', at);
417
+ return;
418
+ }
419
+ case 'tool-end': {
420
+ const at = event.at;
421
+ const callId = event.callId;
422
+ const active = this.activeTools.get(callId);
423
+ if (active === undefined)
424
+ return;
425
+ active.failed = event.failed;
426
+ active.endedAt = at;
427
+ this.toolMs += at - active.startedAt;
428
+ this.toolCount += 1;
429
+ this.lastToolEndAt = at;
430
+ this.doneQueue.push({
431
+ name: active.name,
432
+ action: active.action,
433
+ detail: active.detail,
434
+ failed: active.failed,
435
+ endedAt: at,
436
+ // Kept so the settled line can show how long it took: on real
437
+ // sessions the median tool is 87 ms, so the duration is most of what
438
+ // there is to read.
439
+ durationMs: Math.max(0, at - active.startedAt),
440
+ });
441
+ if (this.doneQueue.length > DONE_QUEUE_MAX)
442
+ this.doneQueue.shift();
443
+ this.activeTools.delete(callId);
444
+ // An approval-parked tool resolved the moment it settled.
445
+ if (this.waitingReason === 'approval')
446
+ this.clearWaitingReason();
447
+ if (this.activeTools.size === 0) {
448
+ // Back to thinking (or a trailing done card if the turn just closed).
449
+ this.setPhase('thinking', at);
450
+ this.thinkingStartedAt = at;
451
+ }
452
+ return;
453
+ }
454
+ case 'turn-end': {
455
+ const at = event.at;
456
+ if (this.activeTools.size > 0) {
457
+ // Tools still running at turn end: count their elapsed time as tool time.
458
+ for (const tool of this.activeTools.values()) {
459
+ this.toolMs += Math.max(0, at - tool.startedAt);
460
+ }
461
+ this.activeTools.clear();
462
+ }
463
+ else if (this.phase === 'thinking' || this.phase === 'waiting') {
464
+ this.thinkingMs += Math.max(0, at - this.thinkingStartedAt);
465
+ }
466
+ // Draw the completion prefix ONCE so repeated renders of the done line
467
+ // stay stable (a fresh random per render would make it flicker). The
468
+ // pools are language-aware, so the line matches the language the turn
469
+ // ended in.
470
+ const lastTool = this.doneQueue.at(-1);
471
+ if (this.config.phrases) {
472
+ this.donePrefix = lastTool?.failed
473
+ ? ((this.config.features ?? {}).failPhrases !== false ? failPhrase() : t('done-prefix'))
474
+ : donePhrase();
475
+ }
476
+ else {
477
+ this.donePrefix = t('done-prefix');
478
+ }
479
+ if (event.interrupted === true)
480
+ this.onInterrupted();
481
+ this.clearWaitingReason();
482
+ this.setPhase('done', at);
483
+ return;
484
+ }
485
+ case 'route-change':
486
+ this.onModelSwitch(event.model);
487
+ return;
488
+ case 'compaction':
489
+ this.onCompact(event.overflow === true ? 'overflow' : 'done');
490
+ return;
491
+ case 'waiting-reason':
492
+ this.waitingReason = event.reason;
493
+ this.waitingReasonAt = event.at;
494
+ return;
495
+ case 'waiting-cleared':
496
+ this.clearWaitingReason();
497
+ return;
498
+ case 'agent-status':
499
+ this.onAgentStatus(event.status);
500
+ return;
501
+ default:
502
+ return;
503
+ }
504
+ }
505
+ /**
506
+ * Feed one raw durable session event.
507
+ * @deprecated Host-shape input kept for one release so an already-published
508
+ * consumer that drives this tracker itself (dsh-TUI ≤ 0.11.x calls this
509
+ * method) keeps working across the upgrade. New code normalizes through
510
+ * `src/compat/*` and calls {@link onEvent}. The parameter type is inferred
511
+ * from the compat function on purpose — this module must not import a DSH
512
+ * type.
513
+ * @param event - Raw durable session event.
514
+ */
515
+ onSessionEvent(event) {
516
+ feedSessionEvent(this, event);
517
+ }
518
+ /** Render the current status snapshot at a wall-clock instant. */
519
+ render(nowMs = this.now()) {
520
+ return withProgressLang(this.language(), () => this.renderCurrent(nowMs));
521
+ }
522
+ renderCurrent(nowMs) {
523
+ switch (this.phase) {
524
+ case 'idle':
525
+ return {
526
+ phase: 'idle',
527
+ line: '',
528
+ toolCount: 0,
529
+ turnElapsedMs: 0,
530
+ phaseStartedAt: this.phaseStartedAt,
531
+ };
532
+ case 'done': {
533
+ const summary = this.doneSummary(nowMs);
534
+ return {
535
+ phase: 'done',
536
+ line: summary.line,
537
+ toolCount: this.toolCount,
538
+ turnElapsedMs: this.turnElapsedMs(nowMs),
539
+ phaseStartedAt: this.phaseStartedAt,
540
+ ...(summary.phrase === undefined ? {} : { phrase: summary.phrase }),
541
+ };
542
+ }
543
+ case 'tool': {
544
+ const tool = this.primaryTool();
545
+ if (tool === undefined) {
546
+ return this.renderThinking(nowMs);
547
+ }
548
+ const fragment = toolFragment(tool);
549
+ // Same granularity as the settled line: a fast tool's counter would
550
+ // otherwise sit at `0s` for its whole (measured 87 ms median) life.
551
+ const elapsed = durationLabel(Math.max(0, nowMs - tool.startedAt));
552
+ const git = tool.isGit
553
+ ? (this.gitBranch !== undefined ? ` · git ${this.gitBranch}` : ' · git')
554
+ : '';
555
+ const combo = (this.config.features ?? {}).combo !== false && this.streak >= COMBO_SHOW_AT
556
+ ? ` · ${t('tool-streak', { count: this.streak })}`
557
+ : '';
558
+ // An approval-parked tool says so even in minimal mode: this is the one
559
+ // state where the user, not the model, is the one being waited on.
560
+ const approval = this.waitingReason === 'approval' ? ` · ${t('tool-waiting-approval')}` : '';
561
+ const narration = this.freshNarration(nowMs);
562
+ // The turn's first tool opens with a short "thought it through, getting
563
+ // to work" line, prepended so the tool's own copy stays readable.
564
+ const opening = this.toolOpening(nowMs);
565
+ const prefix = opening === '' ? '' : `${opening} · `;
566
+ const line = narration === null
567
+ ? `${prefix}${fragment} · ${elapsed}${git}${combo}${approval}`
568
+ : `⏵ ${narration} · ${prefix}${fragment} · ${elapsed}${git}${combo}${approval}`;
569
+ return {
570
+ phase: 'tool',
571
+ line,
572
+ label: tool.action,
573
+ detail: tool.detail,
574
+ ...(narration === null ? (opening === '' ? {} : { phrase: opening }) : { phrase: narration }),
575
+ toolCount: this.toolCount,
576
+ turnElapsedMs: this.turnElapsedMs(nowMs),
577
+ phaseStartedAt: this.phaseStartedAt,
578
+ };
579
+ }
580
+ case 'waiting':
581
+ case 'thinking': {
582
+ const rendered = this.renderThinking(nowMs);
583
+ if (this.phase === 'waiting') {
584
+ return { ...rendered, phase: 'waiting' };
585
+ }
586
+ return rendered;
587
+ }
588
+ }
589
+ }
590
+ /** Per-turn thinking/tooling split for stats consumers. */
591
+ stats() {
592
+ return {
593
+ thinkingMs: this.thinkingMs,
594
+ toolMs: this.toolMs,
595
+ toolCount: this.toolCount,
596
+ };
597
+ }
598
+ /**
599
+ * Opaque, JSON-safe snapshot of this tracker's complete state.
600
+ *
601
+ * A persisted projection checkpoint has to resume folding **without**
602
+ * replaying a session's whole log, so the state machine must be able to hand
603
+ * its state out and take it back. The shape is not public API: pass the value
604
+ * straight back to {@link ActivityTracker.restore}. {@link TRACKER_SNAPSHOT_VERSION}
605
+ * is the compatibility handle between the two.
606
+ * @returns every field the fold depends on, as JSON-safe values.
607
+ */
608
+ snapshot() {
609
+ const data = {
610
+ version: TRACKER_SNAPSHOT_VERSION,
611
+ progressLang: this.progressLang,
612
+ phase: this.phase,
613
+ phaseStartedAt: this.phaseStartedAt,
614
+ turnStartedAt: this.turnStartedAt,
615
+ thinkingStartedAt: this.thinkingStartedAt,
616
+ thinkingMs: this.thinkingMs,
617
+ toolMs: this.toolMs,
618
+ toolCount: this.toolCount,
619
+ activeTools: [...this.activeTools.values()],
620
+ doneQueue: this.doneQueue,
621
+ thinkingPhases: this.thinkingPhases,
622
+ firstToolStartedAt: this.firstToolStartedAt,
623
+ waitingFirstToken: this.waitingFirstToken,
624
+ narratedText: this.narratedText,
625
+ lastChunkAt: this.lastChunkAt,
626
+ recentStream: this.recentStream,
627
+ turnTokens: this.turnTokens,
628
+ donePrefix: this.donePrefix,
629
+ pendingPhrase: this.pendingPhrase,
630
+ pendingUntil: this.pendingUntil,
631
+ gitBranch: this.gitBranch ?? null,
632
+ model: this.model ?? null,
633
+ streak: this.streak,
634
+ lastToolEndAt: this.lastToolEndAt,
635
+ maxStreak: this.maxStreak,
636
+ subagentCount: this.subagentCount,
637
+ waitingReason: this.waitingReason ?? null,
638
+ waitingReasonAt: this.waitingReasonAt,
639
+ tokBuf: this.tokBuf,
640
+ tokWindowStart: this.tokWindowStart,
641
+ };
642
+ return data;
643
+ }
644
+ /**
645
+ * Rebuild a tracker from {@link snapshot} output.
646
+ *
647
+ * The behavioral knobs are not part of the snapshot, so they are passed in
648
+ * again; everything the fold accumulates is restored. Mutable entries are
649
+ * cloned, so the restored tracker can never write back into the value the
650
+ * caller still holds as a checkpoint.
651
+ * @param config - Behavioral knobs.
652
+ * @param now - Wall-clock supplier.
653
+ * @param customActions - Custom action pools.
654
+ * @param payload - A value previously returned by `snapshot()`.
655
+ * @returns an equivalent tracker that can keep folding.
656
+ * @throws when the payload is not a snapshot of {@link TRACKER_SNAPSHOT_VERSION}
657
+ * — a caller holding a stale checkpoint must refold the log rather than render
658
+ * a state it cannot interpret.
659
+ */
660
+ static restore(config, now = Date.now, customActions, payload) {
661
+ const data = payload;
662
+ // The shape guards are deliberately cheap (phase + the two anchor clocks):
663
+ // they catch the torn-write / hand-edited cache cases a version number
664
+ // alone cannot, so a corrupt-but-current-version checkpoint fails HERE —
665
+ // where the projection can catch it and refold — instead of mid-render.
666
+ if (data === undefined || data === null || typeof data !== 'object'
667
+ || data.version !== TRACKER_SNAPSHOT_VERSION
668
+ || !isLang(data.progressLang)
669
+ || !isPhase(data.phase)
670
+ || typeof data.phaseStartedAt !== 'number'
671
+ || typeof data.turnStartedAt !== 'number') {
672
+ throw new Error(`working-activity: unsupported tracker snapshot (expected version ${TRACKER_SNAPSHOT_VERSION})`);
673
+ }
674
+ const tracker = new ActivityTracker(config, now, customActions);
675
+ tracker.progressLang = data.progressLang;
676
+ tracker.phase = data.phase;
677
+ tracker.phaseStartedAt = data.phaseStartedAt;
678
+ tracker.turnStartedAt = data.turnStartedAt;
679
+ tracker.thinkingStartedAt = data.thinkingStartedAt;
680
+ tracker.thinkingMs = data.thinkingMs;
681
+ tracker.toolMs = data.toolMs;
682
+ tracker.toolCount = data.toolCount;
683
+ tracker.activeTools = new Map(data.activeTools.map(tool => [tool.callId, { ...tool }]));
684
+ tracker.doneQueue = data.doneQueue.map(tool => ({ ...tool }));
685
+ tracker.thinkingPhases = data.thinkingPhases;
686
+ tracker.firstToolStartedAt = data.firstToolStartedAt;
687
+ tracker.waitingFirstToken = data.waitingFirstToken;
688
+ tracker.narratedText = data.narratedText;
689
+ tracker.lastChunkAt = data.lastChunkAt;
690
+ tracker.recentStream = data.recentStream;
691
+ tracker.turnTokens = data.turnTokens;
692
+ tracker.donePrefix = data.donePrefix;
693
+ tracker.pendingPhrase = data.pendingPhrase;
694
+ tracker.pendingUntil = data.pendingUntil;
695
+ tracker.gitBranch = data.gitBranch ?? undefined;
696
+ tracker.model = data.model ?? undefined;
697
+ tracker.streak = data.streak;
698
+ tracker.lastToolEndAt = data.lastToolEndAt;
699
+ tracker.maxStreak = data.maxStreak;
700
+ tracker.subagentCount = data.subagentCount;
701
+ tracker.waitingReason = data.waitingReason ?? undefined;
702
+ tracker.waitingReasonAt = data.waitingReasonAt;
703
+ tracker.tokBuf = data.tokBuf;
704
+ tracker.tokWindowStart = data.tokWindowStart;
705
+ return tracker;
706
+ }
707
+ /**
708
+ * The next instant at which {@link render} can produce a different line, or
709
+ * `undefined` when the line stays exactly as it is until another event
710
+ * arrives.
711
+ *
712
+ * A status line does not need a heartbeat: it needs to be redrawn when
713
+ * something it displays moves. Those movements are all known here — the
714
+ * elapsed second, the phrase rotation, a narration or tok/s window closing,
715
+ * and the done card swapping its tool fragment for the summary — so a caller
716
+ * can sleep exactly that long instead of polling. Idle and settled lines
717
+ * return `undefined`: nothing about them changes on its own, so they need no
718
+ * timer at all. Transitions on a longer horizon than the displayed second
719
+ * (the work reminder, for one) need no candidate of their own: the elapsed
720
+ * counter redraws long before them.
721
+ *
722
+ * The value is a lower bound on the next visible change, so waking at it can
723
+ * only be early, never late.
724
+ * @param nowMs - Wall-clock instant to measure from.
725
+ * @returns the next wake instant in epoch milliseconds, or `undefined`.
726
+ */
727
+ nextWakeAt(nowMs = this.now()) {
728
+ switch (this.phase) {
729
+ case 'idle':
730
+ return undefined;
731
+ case 'done': {
732
+ // The done line shows the last tool's fragment for a short window and
733
+ // then the summary; after that it is static until the next turn.
734
+ const last = this.doneQueue.at(-1);
735
+ if (last === undefined)
736
+ return undefined;
737
+ const swapAt = last.endedAt + DONE_FRAGMENT_MS;
738
+ return nowMs < swapAt ? swapAt : undefined;
739
+ }
740
+ case 'tool': {
741
+ const tool = this.primaryTool();
742
+ // `render` falls back to the thinking line when no tool is tracked.
743
+ if (tool === undefined)
744
+ return this.liveWakeAt(nowMs, this.thinkingStartedAt);
745
+ return minWake(secondBoundary(tool.startedAt, nowMs), this.narrationWakeAt(nowMs), this.tpsWakeAt(nowMs));
746
+ }
747
+ case 'waiting':
748
+ case 'thinking':
749
+ return this.liveWakeAt(nowMs, this.turnStartedAt);
750
+ }
751
+ }
752
+ /**
753
+ * Wake instant for a live phase that displays the turn's elapsed second: the
754
+ * next whole second, whichever of the other displayed windows closes first,
755
+ * and the phrase rotation — or the expiry of a one-off quip, which the render
756
+ * after it replaces.
757
+ * @param nowMs - Wall-clock instant to measure from.
758
+ * @param elapsedFrom - Instant the displayed second counter counts from.
759
+ */
760
+ liveWakeAt(nowMs, elapsedFrom) {
761
+ return minWake(secondBoundary(elapsedFrom, nowMs), this.rotationWakeAt(nowMs), this.narrationWakeAt(nowMs), this.tpsWakeAt(nowMs));
762
+ }
763
+ /** When the displayed phrase is replaced: a rotation, or a quip expiring. */
764
+ rotationWakeAt(nowMs) {
765
+ if (!this.config.phrases)
766
+ return undefined;
767
+ // An expired quip is no longer displayed (see pendingPhraseAt), so the
768
+ // wake falls through to the pool rotation — returning its past expiry
769
+ // would arm a zero-delay timer that re-arms forever.
770
+ if (this.pendingPhrase !== null && nowMs < this.pendingUntil)
771
+ return this.pendingUntil;
772
+ // The next window boundary of the phase's own pool. Derived rather than
773
+ // remembered: a read must never be what advances the copy (see phraseForSlot).
774
+ const rotateMs = this.rarePool() ? RARE_ROTATE_MS : PHRASE_ROTATE_MS;
775
+ return this.phraseAnchorAt() + (this.phraseSlot(nowMs, rotateMs) + 1) * rotateMs;
776
+ }
777
+ /** When the currently displayed narration expires, if one is displayed. */
778
+ narrationWakeAt(nowMs) {
779
+ if (this.freshNarration(nowMs) === null)
780
+ return undefined;
781
+ return this.lastChunkAt + NARRATE_GRACE_MS;
782
+ }
783
+ /** When the displayed tok/s estimate ages out, if one is displayed. */
784
+ tpsWakeAt(nowMs) {
785
+ if (this.config.showTokPerSec !== true || this.tokBuf <= 0)
786
+ return undefined;
787
+ if (this.tpsPrefix(nowMs) === '')
788
+ return undefined;
789
+ return this.lastChunkAt + TPS_WINDOW_MS;
790
+ }
791
+ renderThinking(nowMs) {
792
+ const thinkingMs = this.phase === 'waiting'
793
+ ? 0
794
+ : this.thinkingMs + Math.max(0, nowMs - this.thinkingStartedAt);
795
+ const elapsed = fmtDuration(this.turnElapsedMs(nowMs));
796
+ const elapsedLine = t('line-elapsed', { elapsed });
797
+ // A tool that just settled keeps its own copy on screen for a beat. Measured
798
+ // on real sessions: the median tool lasts 87 ms and 73% last under 500 ms, so
799
+ // without this the tool line is a single frame nobody can read. It outranks
800
+ // the narration for its window — the narration is usually the same `⏵` line
801
+ // from before the tool, while this one is the news.
802
+ const settled = this.settledToolLine(nowMs);
803
+ if (settled !== null)
804
+ return settled;
805
+ const narration = this.freshNarration(nowMs);
806
+ if (narration !== null) {
807
+ return {
808
+ phase: this.phase,
809
+ line: `⏵ ${narration} · ${elapsedLine}`,
810
+ phrase: narration,
811
+ toolCount: this.toolCount,
812
+ turnElapsedMs: this.turnElapsedMs(nowMs),
813
+ phaseStartedAt: this.phaseStartedAt,
814
+ };
815
+ }
816
+ // A stall outranks the copy pools (and survives minimal mode): the pool
817
+ // says "still queuing", which reads as model latency — a retry or a parked
818
+ // approval is a different fact the user cannot act on unless it is said.
819
+ const stall = this.stallPhrase();
820
+ if (stall !== null) {
821
+ return {
822
+ phase: this.phase,
823
+ line: `${stall} · ${elapsedLine}`,
824
+ phrase: stall,
825
+ toolCount: this.toolCount,
826
+ turnElapsedMs: this.turnElapsedMs(nowMs),
827
+ phaseStartedAt: this.phaseStartedAt,
828
+ };
829
+ }
830
+ if (this.config.phrases) {
831
+ const pending = this.pendingPhraseAt(nowMs);
832
+ // Waiting (pre-first-token) draws from the waiting pool; thinking draws
833
+ // the egg-aware lively pool (holiday / rare / weekend / night). The pool
834
+ // follows the CURRENT phase and the window follows the phase's own start,
835
+ // so neither the copy nor the cadence depends on how often this is read.
836
+ const rotateMs = this.rarePool() ? RARE_ROTATE_MS : PHRASE_ROTATE_MS;
837
+ const phrase = pending ?? this.phraseForSlot(this.phraseSlot(nowMs, rotateMs), rotateMs, nowMs);
838
+ // The indicator animation (whale etc.) already signals activity, so the
839
+ // pi DOT_FRAMES ellipsis breathing is dropped for the DSH line.
840
+ const tps = this.tpsPrefix(nowMs);
841
+ return {
842
+ phase: this.phase,
843
+ line: `${tps}${phrase} · ${elapsedLine}`,
844
+ phrase,
845
+ toolCount: this.toolCount,
846
+ turnElapsedMs: this.turnElapsedMs(nowMs),
847
+ phaseStartedAt: this.phaseStartedAt,
848
+ };
849
+ }
850
+ const label = this.phase === 'waiting' ? t('waiting-label') : t('thinking-label');
851
+ return {
852
+ phase: this.phase,
853
+ line: `${label} · ${elapsedLine}`,
854
+ label,
855
+ toolCount: this.toolCount,
856
+ turnElapsedMs: this.turnElapsedMs(nowMs),
857
+ phaseStartedAt: this.phaseStartedAt,
858
+ };
859
+ }
860
+ /**
861
+ * The live narration this tracker is currently showing, if any.
862
+ *
863
+ * A projection folds DURABLE events only, so a live host that also sees
864
+ * stream frames has to hand the frame-derived narration to the projected
865
+ * value separately (see `ActivityProjectionOptions.live`); this is that
866
+ * payload, and `undefined` means "nothing live to overlay".
867
+ */
868
+ liveNarration() {
869
+ if (this.narratedText === null)
870
+ return undefined;
871
+ return { narration: this.narratedText, lastChunkAt: this.lastChunkAt };
872
+ }
873
+ /**
874
+ * Show `narration` as if it had just streamed in.
875
+ *
876
+ * Used by the live overlay: the projected state carries no frames, so the
877
+ * host paints the freshest narration it has over the folded value.
878
+ */
879
+ applyLiveNarration(narration, at) {
880
+ this.narratedText = narration;
881
+ this.lastChunkAt = at;
882
+ }
883
+ /**
884
+ * The "thought it through, getting to work" line for the turn's first tool.
885
+ *
886
+ * Shown as a prefix for a short window after that tool starts, then gone: it
887
+ * marks the thinking→doing boundary once per turn, and being derived (like
888
+ * every other phrase) it neither rotates nor repeats within the window.
889
+ * @param nowMs - Wall-clock instant to test.
890
+ * @returns the opening copy, or '' when the window is closed.
891
+ */
892
+ toolOpening(nowMs) {
893
+ if (!this.config.phrases)
894
+ return '';
895
+ if (this.firstToolStartedAt === 0)
896
+ return '';
897
+ if (nowMs - this.firstToolStartedAt >= TOOL_OPENING_MS)
898
+ return '';
899
+ return toolOpeningPhrase({ seed: this.turnStartedAt, slot: 0 });
900
+ }
901
+ /**
902
+ * The just-finished tool, while its copy is still worth reading.
903
+ *
904
+ * Derived from the last settled tool's end time, so it neither lingers past
905
+ * its window nor depends on how often the line is read. `✓` marks it as
906
+ * settled, so it cannot be mistaken for the running-tool line.
907
+ * @param nowMs - Wall-clock instant to test.
908
+ * @returns the settled-tool state, or null when the window is closed.
909
+ */
910
+ settledToolLine(nowMs) {
911
+ if (!this.config.phrases)
912
+ return null;
913
+ const last = this.doneQueue.at(-1);
914
+ if (last === undefined)
915
+ return null;
916
+ const age = nowMs - last.endedAt;
917
+ if (age < 0 || age >= TOOL_LINGER_MS)
918
+ return null;
919
+ const fragment = toolFragment(last);
920
+ return {
921
+ phase: this.phase === 'waiting' ? 'thinking' : this.phase,
922
+ line: `✓ ${fragment} · ${durationLabel(last.durationMs)}`,
923
+ label: last.action,
924
+ detail: last.detail,
925
+ phrase: last.action,
926
+ toolCount: this.toolCount,
927
+ turnElapsedMs: this.turnElapsedMs(nowMs),
928
+ phaseStartedAt: this.phaseStartedAt,
929
+ };
930
+ }
931
+ /**
932
+ * The pending one-off quip (interrupt / model / compact), while fresh.
933
+ *
934
+ * A pure read: an expired quip is simply not returned (the field is
935
+ * overwritten by the next one), and the work reminder has its own derived
936
+ * window — the old version wrote here (`pendingPhrase = null`,
937
+ * `reminded = true`), which a projection's throwaway restore discarded, so
938
+ * the reminder re-fired on EVERY read and pinned the line for the rest of
939
+ * the turn.
940
+ */
941
+ pendingPhraseAt(nowMs) {
942
+ if (this.pendingPhrase !== null && nowMs < this.pendingUntil)
943
+ return this.pendingPhrase;
944
+ return this.workReminderAt(nowMs);
945
+ }
946
+ /**
947
+ * The work reminder, purely derived from elapsed time.
948
+ *
949
+ * Shown for {@link PENDING_MS} of wall time each time another `workRemindAt`
950
+ * hours of continuous work accumulate (`hours % workRemindAt` is the distance
951
+ * into the current bucket). No state: repeated reads agree, a resumed
952
+ * checkpoint renders the same answer, and the reminder returns every bucket
953
+ * instead of once per process.
954
+ */
955
+ workReminderAt(nowMs) {
956
+ const remindAt = this.config.workRemindAt ?? 0;
957
+ if (remindAt <= 0)
958
+ return null;
959
+ const hours = this.turnElapsedMs(nowMs) / 3_600_000;
960
+ if (hours < remindAt)
961
+ return null;
962
+ const intoBucketMs = (hours % remindAt) * 3_600_000;
963
+ if (intoBucketMs >= PENDING_MS)
964
+ return null;
965
+ return t('work-remind', { hours: Math.floor(hours) });
966
+ }
967
+ /** Estimated tokens/s while the stream is fresh (pi parity, opt-in). */
968
+ tpsPrefix(nowMs) {
969
+ if (!this.config.showTokPerSec || this.tokBuf <= 0)
970
+ return '';
971
+ if (nowMs - this.lastChunkAt > TPS_WINDOW_MS)
972
+ return '';
973
+ const windowSec = Math.max(1, (nowMs - this.tokWindowStart) / 1000);
974
+ const tps = Math.round(this.tokBuf / windowSec);
975
+ return tps > 0 ? `~${tps} tok/s · ` : '';
976
+ }
977
+ doneSummary(nowMs) {
978
+ const { thinkingMs, toolMs, toolCount } = this.stats();
979
+ const tokens = this.turnTokens > 0 ? ` · 🔥 ${fmtTokens(this.turnTokens)}` : '';
980
+ const sub = this.subagentCount > 0 ? ` · ${t('subagent-count', { count: this.subagentCount })}` : '';
981
+ const combo = (this.config.features ?? {}).combo !== false && this.maxStreak >= COMBO_SHOW_AT
982
+ ? ` · ${t('tool-streak', { count: this.maxStreak })}`
983
+ : '';
984
+ const tools = t(toolCount === 1 ? 'tool-count-one' : 'tool-count-many', { count: toolCount });
985
+ // Sub-second splits read in milliseconds for the same reason a settled
986
+ // tool does: a quick turn would otherwise summarize as 想0s 干0s.
987
+ const summary = t('done-summary', {
988
+ tools,
989
+ thinking: durationLabel(thinkingMs),
990
+ tooling: durationLabel(toolMs),
991
+ });
992
+ if (!this.config.phrases) {
993
+ return { line: `${t('done-prefix')} · ${summary}${sub}${combo}${tokens}` };
994
+ }
995
+ const last = this.doneQueue.at(-1);
996
+ if (last !== undefined && nowMs - last.endedAt < DONE_FRAGMENT_MS) {
997
+ const fragment = toolFragment(last);
998
+ return { line: `${this.donePrefix} · ${fragment} · ${tools}${sub}${combo}${tokens}`, phrase: this.donePrefix };
999
+ }
1000
+ return { line: `${this.donePrefix} · ${summary}${sub}${combo}${tokens}`, phrase: this.donePrefix };
1001
+ }
1002
+ /** The fresh self-narration line, or null once the stream has been quiet. */
1003
+ freshNarration(nowMs) {
1004
+ if (this.narratedText === null)
1005
+ return null;
1006
+ if (nowMs - this.lastChunkAt > NARRATE_GRACE_MS)
1007
+ return null;
1008
+ return this.narratedText;
1009
+ }
1010
+ primaryTool() {
1011
+ let primary;
1012
+ for (const tool of this.activeTools.values()) {
1013
+ if (primary === undefined || tool.startedAt < primary.startedAt)
1014
+ primary = tool;
1015
+ }
1016
+ return primary;
1017
+ }
1018
+ turnElapsedMs(nowMs) {
1019
+ return this.turnStartedAt === 0 ? 0 : Math.max(0, nowMs - this.turnStartedAt);
1020
+ }
1021
+ /** Drop the current stall, whatever it was. */
1022
+ clearWaitingReason() {
1023
+ this.waitingReason = undefined;
1024
+ this.waitingReasonAt = 0;
1025
+ }
1026
+ /**
1027
+ * Copy for the current stall, or null when the turn is not stalled.
1028
+ *
1029
+ * Deterministic per stall — seeded by the turn and the stall's start, so
1030
+ * every read of one stall shows the same line (a per-read re-roll is the
1031
+ * flicker bug the slot scheme exists to prevent).
1032
+ */
1033
+ stallPhrase() {
1034
+ if (this.waitingReason === undefined)
1035
+ return null;
1036
+ return waitingReasonPhrase(this.waitingReason, {
1037
+ seed: this.turnStartedAt + this.waitingReasonAt,
1038
+ slot: 0,
1039
+ });
1040
+ }
1041
+ /**
1042
+ * How the current line is derived — the debug trace behind the optional
1043
+ * `debugLog`, so "why did it say THAT" is answerable from a file instead of
1044
+ * from memory.
1045
+ * @param nowMs - Wall-clock instant to describe.
1046
+ * @returns the derivation inputs of the current render.
1047
+ */
1048
+ describe(nowMs = this.now()) {
1049
+ const rotateMs = this.rarePool() ? RARE_ROTATE_MS : PHRASE_ROTATE_MS;
1050
+ return {
1051
+ phase: this.phase,
1052
+ phraseSlot: this.phraseSlot(nowMs, rotateMs),
1053
+ rotateMs,
1054
+ rarePool: this.rarePool(),
1055
+ thinkingPhases: this.thinkingPhases,
1056
+ waitingReason: this.waitingReason ?? null,
1057
+ pendingPhrase: this.pendingPhrase ?? null,
1058
+ narration: this.narratedText ?? null,
1059
+ toolCount: this.toolCount,
1060
+ turnElapsedMs: this.turnElapsedMs(nowMs),
1061
+ };
1062
+ }
1063
+ setPhase(phase, atMs) {
1064
+ // A phase change switches copy pools at once — the phrase is derived from
1065
+ // the CURRENT phase, so nothing from the previous phase can linger.
1066
+ if (phase === 'thinking' && this.phase !== 'thinking')
1067
+ this.thinkingPhases += 1;
1068
+ this.phase = phase;
1069
+ this.phaseStartedAt = atMs;
1070
+ }
1071
+ /**
1072
+ * The instant the current phrase's rotation window starts from.
1073
+ *
1074
+ * The phase's own start, so entering a phase immediately shows that phase's
1075
+ * copy; a phase still needs a turn to belong to, hence the fallback.
1076
+ */
1077
+ phraseAnchorAt() {
1078
+ return this.phaseStartedAt > 0 ? this.phaseStartedAt : this.turnStartedAt;
1079
+ }
1080
+ /** The rotation window index of the current phase at `nowMs`. */
1081
+ phraseSlot(nowMs, rotateMs) {
1082
+ return Math.max(0, Math.floor((nowMs - this.phraseAnchorAt()) / rotateMs));
1083
+ }
1084
+ /**
1085
+ * Whether this phase draws from the rare pool.
1086
+ *
1087
+ * Once per turn, in the turn's FIRST thinking phase, decided by the seed — a
1088
+ * per-read dice roll would pop an egg in and out of the line (the egg's own
1089
+ * display window then lasts for the whole phase).
1090
+ */
1091
+ rarePool() {
1092
+ const features = this.config.features ?? {};
1093
+ if (features.rareEggs === false)
1094
+ return false;
1095
+ if (this.phase !== 'thinking' || this.thinkingPhases !== 1)
1096
+ return false;
1097
+ return mixSlot(this.turnStartedAt, 0x5EED) % Math.round(1 / RARE_CHANCE) === 0;
1098
+ }
1099
+ /**
1100
+ * The phrase for one rotation window — a PURE function of the state and `nowMs`.
1101
+ *
1102
+ * This used to be stateful (`previousPhrase` + `phraseChangedAt` mutated on
1103
+ * render). That works for a long-lived in-process tracker, but a projected
1104
+ * value is read far more often than it is written: the read renders a
1105
+ * throwaway copy, so every read rolled a new phrase (measured: three different
1106
+ * phrases in three consecutive 500 ms reads) and a phase change could carry the
1107
+ * previous phase's pool in. Deriving from (phase, phase start, seed, slot)
1108
+ * makes a read idempotent and keeps the pools apart by construction.
1109
+ */
1110
+ phraseForSlot(slot, rotateMs, nowMs) {
1111
+ const at = { seed: this.turnStartedAt, slot };
1112
+ const features = this.config.features ?? {};
1113
+ // The RENDER instant, not the tracker's clock supplier: one render, one
1114
+ // time source. Night/holiday copy used to read `this.now()` while the
1115
+ // elapsed read `nowMs`, so rendering "as of" another instant (a test, a
1116
+ // historical value) picked copy from a different moment than it displayed.
1117
+ const now = new Date(nowMs);
1118
+ if (this.phase === 'waiting')
1119
+ return waitingPhrase(undefined, at);
1120
+ // Eggs belong to the turn's first thinking window — the waiting phase is
1121
+ // usually over before a window elapses, so a greeting shown there would
1122
+ // flash by. Order matches the pi extension: holiday → rare → weekend, and
1123
+ // "first thinking phase, first window" is what makes them once per turn.
1124
+ if (this.thinkingPhases === 1 && slot === 0) {
1125
+ if (features.holidays !== false) {
1126
+ const holiday = holidayPhrase(now, at);
1127
+ if (holiday !== null)
1128
+ return holiday;
1129
+ }
1130
+ if (this.rarePool())
1131
+ return rarePhrase(undefined, at);
1132
+ if (features.weekend !== false && isWeekend(now))
1133
+ return weekendPhrase(undefined, at);
1134
+ }
1135
+ if (this.rarePool())
1136
+ return rarePhrase(undefined, at);
1137
+ // The long-thinking tiers are chosen at the WINDOW's start, not at the
1138
+ // instant of the read: a tier boundary crossed mid-window would otherwise
1139
+ // swap the copy seconds into a window the reader is still on.
1140
+ const windowStart = this.phraseAnchorAt() + slot * rotateMs;
1141
+ const thinkingAtWindowStart = Math.max(0, windowStart - this.thinkingStartedAt);
1142
+ return thinkingPhrase(this.thinkingStartedAt === 0 ? this.thinkingMs : thinkingAtWindowStart, undefined, features.nightPhrases !== false && isNight(now.getHours()), this.config.customPhrases, at);
1143
+ }
1144
+ }
1145
+ /** Earliest of the candidate wake instants, ignoring the absent ones. */
1146
+ function minWake(...candidates) {
1147
+ let earliest;
1148
+ for (const candidate of candidates) {
1149
+ if (candidate === undefined)
1150
+ continue;
1151
+ if (earliest === undefined || candidate < earliest)
1152
+ earliest = candidate;
1153
+ }
1154
+ return earliest;
1155
+ }
1156
+ /**
1157
+ * The next whole second after `nowMs`, counted from `from`. The line renders
1158
+ * elapsed time with second resolution, so this is the finest cadence a live
1159
+ * phase can actually show.
1160
+ * @param from - Instant the displayed counter counts from.
1161
+ * @param nowMs - Current instant.
1162
+ */
1163
+ function secondBoundary(from, nowMs) {
1164
+ const elapsed = Math.max(0, nowMs - from);
1165
+ return from + (Math.floor(elapsed / 1000) + 1) * 1000;
1166
+ }
1167
+ /**
1168
+ * How long one phrase stays on screen.
1169
+ *
1170
+ * This is the pi extension's cadence, unchanged: the copy was never rotating
1171
+ * too fast — it was being re-rolled on every read (see phraseForSlot), which is
1172
+ * what read as flicker. With the read made pure, one phrase per window is
1173
+ * exactly what a reader sees, and 4 s is the pace that felt right.
1174
+ */
1175
+ const PHRASE_ROTATE_MS = 4000;
1176
+ /** Rare easter-egg phrases linger longer, since they are a one-off per turn. */
1177
+ const RARE_ROTATE_MS = 7500;
1178
+ /** One-off quips (interrupt / model / compact) display window. */
1179
+ const PENDING_MS = 6000;
1180
+ /** How long the thinking→doing opening line rides the turn's first tool. */
1181
+ const TOOL_OPENING_MS = 2500;
1182
+ /**
1183
+ * How long a settled tool keeps its own line before the copy returns to phrases.
1184
+ *
1185
+ * Real-session measurement: median tool 87 ms, 73% under 500 ms — shorter than a
1186
+ * single client re-read, so without a linger the tool line is unreadable.
1187
+ */
1188
+ const TOOL_LINGER_MS = 2500;
1189
+ /** Tools closer than this count as one combo streak. */
1190
+ const COMBO_GAP_MS = 10_000;
1191
+ /** Streak at which the combo badge shows. */
1192
+ const COMBO_SHOW_AT = 2;
1193
+ /** The tps estimate stays fresh this long after the last chunk. */
1194
+ const TPS_WINDOW_MS = 3500;
1195
+ /** Cap on replayed done cards; older entries drop. */
1196
+ const DONE_QUEUE_MAX = 6;
1197
+ /** Show the last tool's fragment in the done line for this long after it ends. */
1198
+ const DONE_FRAGMENT_MS = 3000;
1199
+ /** Rolling stream buffer size for `⏵` narration extraction. */
1200
+ const STREAM_BUFFER_CHARS = 300;
1201
+ /** A narration stays visible this long after the stream went quiet. */
1202
+ const NARRATE_GRACE_MS = 5000;
1203
+ /** Narration budget in display columns: 40 CJK chars ≈ 12 English words. */
1204
+ const NARRATION_MAX_COLUMNS = 80;
1205
+ /** A CJK/full-width code point renders 2 terminal columns; the rest render 1. */
1206
+ function isWide(cp) {
1207
+ return ((cp >= 0x1100 && cp <= 0x115f) || // Hangul Jamo
1208
+ (cp >= 0x2e80 && cp <= 0xa4cf) || // CJK radicals, kana, Yi
1209
+ (cp >= 0xac00 && cp <= 0xd7a3) || // Hangul syllables
1210
+ (cp >= 0xf900 && cp <= 0xfaff) || // CJK compatibility ideographs
1211
+ (cp >= 0xfe30 && cp <= 0xfe4f) || // CJK compatibility forms
1212
+ (cp >= 0xff00 && cp <= 0xff60) || // full-width forms
1213
+ (cp >= 0xffe0 && cp <= 0xffe6) || // full-width signs
1214
+ (cp >= 0x20000 && cp <= 0x3fffd) // CJK extensions
1215
+ // Emoji occupy two columns in every mainstream terminal; counting them as
1216
+ // one let an "80-column" narration run ~40 columns over budget (the pools
1217
+ // carry 🧧 🐳 🎃).
1218
+ || (cp >= 0x1f000 && cp <= 0x1faff) // cards, emoji, symbols, pictographs
1219
+ );
1220
+ }
1221
+ /** Cut before `max` columns, backing off to the last word or clause boundary. */
1222
+ function cutToWidth(text, max) {
1223
+ let width = 0;
1224
+ let cut = text.length;
1225
+ const chars = [...text];
1226
+ for (let i = 0; i < chars.length; i++) {
1227
+ const w = isWide(chars[i].codePointAt(0)) ? 2 : 1;
1228
+ if (width + w > max) {
1229
+ cut = chars.slice(0, i).join('').length;
1230
+ break;
1231
+ }
1232
+ width += w;
1233
+ }
1234
+ if (cut === text.length)
1235
+ return text;
1236
+ // Back off to a soft boundary so English words survive intact; dense CJK has
1237
+ // none and hard-cuts at the budget like the original fixed 40-char capture.
1238
+ const head = text.slice(0, cut);
1239
+ const soft = Math.max(head.lastIndexOf(' '), head.lastIndexOf('\t'), head.lastIndexOf(','), head.lastIndexOf('、'), head.lastIndexOf(';'), head.lastIndexOf(';'), head.lastIndexOf(','));
1240
+ return soft > 0 ? head.slice(0, soft) : head;
1241
+ }
1242
+ /**
1243
+ * Extract the latest `⏵` self-narration line from a stream buffer.
1244
+ *
1245
+ * The marker has to START a line. The injected contract asks for one standalone
1246
+ * line, so a `⏵` inside a sentence is the model *mentioning* the format rather
1247
+ * than narrating with it — measured on a live session, where the line quoted a
1248
+ * fragment out of the middle of the model's own prose.
1249
+ *
1250
+ * The text is model output destined for a terminal, so it is flattened here:
1251
+ * an ESC or a newline carried by a delta must not reach the screen (see
1252
+ * {@link sanitizeFragment}).
1253
+ * @param buffer - Rolling window of the visible streamed text.
1254
+ * @returns the narration, or null when the buffer carries none.
1255
+ */
1256
+ export function extractNarration(buffer) {
1257
+ const matches = [...buffer.matchAll(/(?:^|\n)⏵[ \t]*([^\n⏵]*)/g)];
1258
+ const matched = matches[matches.length - 1]?.[1];
1259
+ if (matched === undefined)
1260
+ return null;
1261
+ const latest = sanitizeFragment(matched);
1262
+ if (!latest)
1263
+ return null;
1264
+ // A missing newline must not turn the rest of the response into status text.
1265
+ // Stop at sentence ends and clause delimiters, while leaving dotted
1266
+ // identifiers such as `ink.tsx`, `agent.ctx` and `README.MD` intact. A dot
1267
+ // ends a sentence only before whitespace, the end, or a Title-case word
1268
+ // (`safely.The`); dot-uppercase-uppercase stays an extension (`.MD`).
1269
+ const boundary = latest.search(/[。.!?!?;;]|\.(?=\s|$|[A-Z][a-z])/);
1270
+ const sentence = boundary < 0 ? latest : latest.slice(0, boundary + 1);
1271
+ // The budget is display width, so English and Chinese render equally long:
1272
+ // 40 CJK characters and ~12 English words share the same line budget.
1273
+ const text = cutToWidth(sentence, NARRATION_MAX_COLUMNS).replace(/[。..!!,,、;;]+$/, '').trim();
1274
+ return text.length === 0 ? null : text;
1275
+ }
1276
+ /** Format a token count compactly (`12.3k`, `1.2M`). */
1277
+ function fmtTokens(tokens) {
1278
+ if (tokens >= 1_000_000)
1279
+ return `${(tokens / 1_000_000).toFixed(1)}M`;
1280
+ if (tokens >= 1000)
1281
+ return `${(tokens / 1000).toFixed(1)}k`;
1282
+ return String(tokens);
1283
+ }
1284
+ /** Coarse streaming token estimate (pi parity: CJK ×1.5, others ÷4). */
1285
+ function estimateTokens(text) {
1286
+ const compact = text.replace(/\s/g, '');
1287
+ if (compact.length === 0)
1288
+ return 0;
1289
+ const cjkCount = (compact.match(/[\u3400-\u9fff]/g) ?? []).length;
1290
+ return Math.max(1, Math.ceil(cjkCount * 1.5 + (compact.length - cjkCount) / 4));
1291
+ }
1292
+ /** Parse a tool call's raw arguments JSON defensively. */
1293
+ function parseArguments(raw) {
1294
+ if (raw.trim().length === 0)
1295
+ return undefined;
1296
+ try {
1297
+ const parsed = JSON.parse(raw);
1298
+ if (parsed !== null && typeof parsed === 'object' && !Array.isArray(parsed)) {
1299
+ return parsed;
1300
+ }
1301
+ return undefined;
1302
+ }
1303
+ catch {
1304
+ return undefined;
1305
+ }
1306
+ }