@openclaw/line 2026.9.4 → 2026.9.6

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 (698) hide show
  1. package/assets/activity.svg +40 -0
  2. package/assets/icon.png +0 -0
  3. package/dist/.setup/api-D_06cuHl.mjs +11 -0
  4. package/dist/.setup/api-RdEuQgW-.mjs +3 -0
  5. package/dist/{card-command-pwvE48Wb.js → .setup/card-command-710u8FBH.mjs} +2 -2
  6. package/dist/{channel-C2D8vUmv.js → .setup/channel-kc3VRglA.mjs} +286 -91
  7. package/dist/.setup/channel.runtime-BtkeDELb.mjs +4 -0
  8. package/dist/{markdown-to-line-DR3sFH6H.js → .setup/markdown-to-line-CRfEHFs0.mjs} +58 -25
  9. package/dist/{monitor-2lOtBpg-.js → .setup/monitor-morJPcPd.mjs} +398 -141
  10. package/dist/.setup/monitor.runtime-BGhxYDKG.mjs +2 -0
  11. package/dist/{outbound.runtime-Cpp7NAmT.js → .setup/outbound.runtime-QGvZy8Em.mjs} +2 -2
  12. package/dist/.setup/probe.runtime-CMf8b-jB.mjs +2 -0
  13. package/dist/{rich-messages-HS8pNeOa.js → .setup/rich-messages-d8CmBVJj.mjs} +158 -18
  14. package/dist/{send-CQQxpxPp.js → .setup/send-BmsHY4WC.mjs} +27 -10
  15. package/dist/{send-retry-ChpfJ-LM.js → .setup/send-retry-DbfiHBPd.mjs} +105 -4
  16. package/dist/{setup-surface-DiXO4x5f.js → .setup/setup-surface-CcfKJKtr.mjs} +2 -2
  17. package/dist/api.js +2 -10
  18. package/dist/channel-plugin-api.js +1 -1
  19. package/dist/contract-api.js +1 -1
  20. package/dist/doctor-contract-api.js +1 -1
  21. package/dist/index.js +1 -1
  22. package/dist/runtime-api.js +9 -9
  23. package/dist/setup-api.js +1 -1
  24. package/dist/setup-entry.js +2 -1
  25. package/node_modules/@line/bot-sdk/node_modules/@types/node/README.md +1 -1
  26. package/node_modules/@line/bot-sdk/node_modules/@types/node/package.json +2 -2
  27. package/node_modules/@line/bot-sdk/node_modules/@types/node/stream/web.d.ts +4 -0
  28. package/node_modules/typebox/build/compile/validator.d.mts +1 -1
  29. package/node_modules/typebox/build/compile/validator.mjs +1 -1
  30. package/node_modules/typebox/build/format/idna/idn-hostname.mjs +7 -5
  31. package/node_modules/typebox/build/format/iri.mjs +5 -1
  32. package/node_modules/typebox/build/guard/emit.mjs +2 -4
  33. package/node_modules/typebox/build/guard/guard.mjs +6 -18
  34. package/node_modules/typebox/build/guard/string.mjs +16 -24
  35. package/node_modules/typebox/build/schema/build.mjs +2 -2
  36. package/node_modules/typebox/build/schema/check.mjs +1 -1
  37. package/node_modules/typebox/build/schema/compile.d.mts +3 -2
  38. package/node_modules/typebox/build/schema/compile.mjs +8 -8
  39. package/node_modules/typebox/build/schema/engine/_context.d.mts +6 -7
  40. package/node_modules/typebox/build/schema/engine/_context.mjs +23 -15
  41. package/node_modules/typebox/build/schema/engine/_functions.d.mts +2 -2
  42. package/node_modules/typebox/build/schema/engine/_functions.mjs +1 -1
  43. package/node_modules/typebox/build/schema/engine/_reducer.d.mts +3 -3
  44. package/node_modules/typebox/build/schema/engine/_refine.d.mts +5 -5
  45. package/node_modules/typebox/build/schema/engine/_refine.mjs +4 -7
  46. package/node_modules/typebox/build/schema/engine/_stack.d.mts +34 -16
  47. package/node_modules/typebox/build/schema/engine/_stack.mjs +148 -104
  48. package/node_modules/typebox/build/schema/engine/additionalItems.d.mts +4 -4
  49. package/node_modules/typebox/build/schema/engine/additionalProperties.d.mts +8 -8
  50. package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +26 -18
  51. package/node_modules/typebox/build/schema/engine/allOf.d.mts +4 -4
  52. package/node_modules/typebox/build/schema/engine/allOf.mjs +3 -3
  53. package/node_modules/typebox/build/schema/engine/anyOf.d.mts +4 -4
  54. package/node_modules/typebox/build/schema/engine/anyOf.mjs +5 -10
  55. package/node_modules/typebox/build/schema/engine/boolean.d.mts +4 -4
  56. package/node_modules/typebox/build/schema/engine/boolean.mjs +2 -6
  57. package/node_modules/typebox/build/schema/engine/const.d.mts +4 -4
  58. package/node_modules/typebox/build/schema/engine/const.mjs +2 -6
  59. package/node_modules/typebox/build/schema/engine/contains.d.mts +4 -4
  60. package/node_modules/typebox/build/schema/engine/contains.mjs +2 -6
  61. package/node_modules/typebox/build/schema/engine/dependencies.d.mts +4 -4
  62. package/node_modules/typebox/build/schema/engine/dependencies.mjs +3 -6
  63. package/node_modules/typebox/build/schema/engine/dependentRequired.d.mts +4 -4
  64. package/node_modules/typebox/build/schema/engine/dependentRequired.mjs +2 -6
  65. package/node_modules/typebox/build/schema/engine/dependentSchemas.d.mts +4 -4
  66. package/node_modules/typebox/build/schema/engine/dynamicRef.d.mts +4 -4
  67. package/node_modules/typebox/build/schema/engine/dynamicRef.mjs +11 -7
  68. package/node_modules/typebox/build/schema/engine/enum.d.mts +4 -4
  69. package/node_modules/typebox/build/schema/engine/enum.mjs +2 -6
  70. package/node_modules/typebox/build/schema/engine/exclusiveMaximum.d.mts +4 -4
  71. package/node_modules/typebox/build/schema/engine/exclusiveMaximum.mjs +2 -6
  72. package/node_modules/typebox/build/schema/engine/exclusiveMinimum.d.mts +4 -4
  73. package/node_modules/typebox/build/schema/engine/exclusiveMinimum.mjs +2 -6
  74. package/node_modules/typebox/build/schema/engine/format.d.mts +4 -4
  75. package/node_modules/typebox/build/schema/engine/format.mjs +2 -6
  76. package/node_modules/typebox/build/schema/engine/if.d.mts +4 -4
  77. package/node_modules/typebox/build/schema/engine/if.mjs +7 -15
  78. package/node_modules/typebox/build/schema/engine/items.d.mts +4 -4
  79. package/node_modules/typebox/build/schema/engine/items.mjs +1 -1
  80. package/node_modules/typebox/build/schema/engine/maxContains.d.mts +4 -4
  81. package/node_modules/typebox/build/schema/engine/maxContains.mjs +2 -6
  82. package/node_modules/typebox/build/schema/engine/maxItems.d.mts +4 -4
  83. package/node_modules/typebox/build/schema/engine/maxItems.mjs +2 -6
  84. package/node_modules/typebox/build/schema/engine/maxLength.d.mts +4 -4
  85. package/node_modules/typebox/build/schema/engine/maxLength.mjs +2 -6
  86. package/node_modules/typebox/build/schema/engine/maxProperties.d.mts +4 -4
  87. package/node_modules/typebox/build/schema/engine/maxProperties.mjs +2 -6
  88. package/node_modules/typebox/build/schema/engine/maximum.d.mts +4 -4
  89. package/node_modules/typebox/build/schema/engine/maximum.mjs +2 -6
  90. package/node_modules/typebox/build/schema/engine/minContains.d.mts +4 -4
  91. package/node_modules/typebox/build/schema/engine/minContains.mjs +2 -6
  92. package/node_modules/typebox/build/schema/engine/minItems.d.mts +5 -5
  93. package/node_modules/typebox/build/schema/engine/minItems.mjs +2 -6
  94. package/node_modules/typebox/build/schema/engine/minLength.d.mts +4 -4
  95. package/node_modules/typebox/build/schema/engine/minLength.mjs +2 -6
  96. package/node_modules/typebox/build/schema/engine/minProperties.d.mts +4 -4
  97. package/node_modules/typebox/build/schema/engine/minProperties.mjs +2 -6
  98. package/node_modules/typebox/build/schema/engine/minimum.d.mts +4 -4
  99. package/node_modules/typebox/build/schema/engine/minimum.mjs +2 -6
  100. package/node_modules/typebox/build/schema/engine/multipleOf.d.mts +4 -4
  101. package/node_modules/typebox/build/schema/engine/multipleOf.mjs +2 -6
  102. package/node_modules/typebox/build/schema/engine/not.d.mts +4 -4
  103. package/node_modules/typebox/build/schema/engine/not.mjs +4 -8
  104. package/node_modules/typebox/build/schema/engine/oneOf.d.mts +4 -4
  105. package/node_modules/typebox/build/schema/engine/oneOf.mjs +6 -11
  106. package/node_modules/typebox/build/schema/engine/pattern.d.mts +4 -4
  107. package/node_modules/typebox/build/schema/engine/pattern.mjs +3 -7
  108. package/node_modules/typebox/build/schema/engine/patternProperties.d.mts +4 -4
  109. package/node_modules/typebox/build/schema/engine/patternProperties.mjs +1 -1
  110. package/node_modules/typebox/build/schema/engine/prefixItems.d.mts +4 -4
  111. package/node_modules/typebox/build/schema/engine/prefixItems.mjs +1 -1
  112. package/node_modules/typebox/build/schema/engine/properties.d.mts +4 -4
  113. package/node_modules/typebox/build/schema/engine/properties.mjs +1 -1
  114. package/node_modules/typebox/build/schema/engine/propertyNames.d.mts +4 -4
  115. package/node_modules/typebox/build/schema/engine/propertyNames.mjs +4 -10
  116. package/node_modules/typebox/build/schema/engine/recursiveRef.d.mts +4 -4
  117. package/node_modules/typebox/build/schema/engine/recursiveRef.mjs +11 -7
  118. package/node_modules/typebox/build/schema/engine/ref.d.mts +4 -4
  119. package/node_modules/typebox/build/schema/engine/ref.mjs +19 -15
  120. package/node_modules/typebox/build/schema/engine/required.d.mts +4 -4
  121. package/node_modules/typebox/build/schema/engine/required.mjs +2 -6
  122. package/node_modules/typebox/build/schema/engine/schema.d.mts +7 -7
  123. package/node_modules/typebox/build/schema/engine/schema.mjs +137 -133
  124. package/node_modules/typebox/build/schema/engine/type.d.mts +4 -4
  125. package/node_modules/typebox/build/schema/engine/type.mjs +2 -6
  126. package/node_modules/typebox/build/schema/engine/unevaluatedItems.d.mts +4 -4
  127. package/node_modules/typebox/build/schema/engine/unevaluatedItems.mjs +5 -9
  128. package/node_modules/typebox/build/schema/engine/unevaluatedProperties.d.mts +4 -4
  129. package/node_modules/typebox/build/schema/engine/unevaluatedProperties.mjs +5 -9
  130. package/node_modules/typebox/build/schema/engine/uniqueItems.d.mts +4 -4
  131. package/node_modules/typebox/build/schema/engine/uniqueItems.mjs +2 -6
  132. package/node_modules/typebox/build/schema/errors.d.mts +2 -2
  133. package/node_modules/typebox/build/schema/errors.mjs +8 -14
  134. package/node_modules/typebox/build/schema/intern/index.d.mts +1 -0
  135. package/node_modules/typebox/build/schema/intern/index.mjs +1 -0
  136. package/node_modules/typebox/build/schema/intern/intern.d.mts +11 -0
  137. package/node_modules/typebox/build/schema/intern/intern.mjs +293 -0
  138. package/node_modules/typebox/build/schema/meta/draft_2019_09.d.mts +2 -0
  139. package/node_modules/typebox/build/schema/meta/draft_2019_09.mjs +288 -0
  140. package/node_modules/typebox/build/schema/meta/draft_2020_12.d.mts +2 -0
  141. package/node_modules/typebox/build/schema/meta/draft_2020_12.mjs +300 -0
  142. package/node_modules/typebox/build/schema/meta/draft_3.d.mts +2 -0
  143. package/node_modules/typebox/build/schema/meta/draft_3.mjs +143 -0
  144. package/node_modules/typebox/build/schema/meta/draft_4.d.mts +2 -0
  145. package/node_modules/typebox/build/schema/meta/draft_4.mjs +149 -0
  146. package/node_modules/typebox/build/schema/meta/draft_6.d.mts +2 -0
  147. package/node_modules/typebox/build/schema/meta/draft_6.mjs +155 -0
  148. package/node_modules/typebox/build/schema/meta/draft_7.d.mts +2 -0
  149. package/node_modules/typebox/build/schema/meta/draft_7.mjs +172 -0
  150. package/node_modules/typebox/build/schema/meta/index.d.mts +2 -0
  151. package/node_modules/typebox/build/schema/meta/index.mjs +2 -0
  152. package/node_modules/typebox/build/schema/meta/meta.d.mts +9 -0
  153. package/node_modules/typebox/build/schema/meta/meta.mjs +15 -0
  154. package/node_modules/typebox/build/schema/meta/schema.d.mts +6 -0
  155. package/node_modules/typebox/build/schema/meta/schema.mjs +1 -0
  156. package/node_modules/typebox/build/schema/parse.d.mts +1 -0
  157. package/node_modules/typebox/build/schema/parse.mjs +10 -5
  158. package/node_modules/typebox/build/schema/resolve/resolve.d.mts +8 -3
  159. package/node_modules/typebox/build/schema/resolve/resolve.mjs +268 -139
  160. package/node_modules/typebox/build/schema/schema.d.mts +2 -0
  161. package/node_modules/typebox/build/schema/schema.mjs +2 -0
  162. package/node_modules/typebox/build/value/errors/errors.d.mts +2 -12
  163. package/node_modules/typebox/build/value/errors/errors.mjs +2 -7
  164. package/node_modules/typebox/package.json +1 -1
  165. package/node_modules/typebox/readme.md +59 -89
  166. package/node_modules/zod/README.md +29 -2
  167. package/node_modules/zod/compile.cjs +96 -0
  168. package/node_modules/zod/compile.d.cts +1 -0
  169. package/node_modules/zod/compile.d.ts +1 -0
  170. package/node_modules/zod/compile.js +52 -0
  171. package/node_modules/zod/index.cjs +21 -2
  172. package/node_modules/zod/index.d.cts +1 -2
  173. package/node_modules/zod/index.d.ts +1 -2
  174. package/node_modules/zod/index.js +5 -2
  175. package/node_modules/zod/locales/index.cjs +19 -0
  176. package/node_modules/zod/mini/index.cjs +19 -0
  177. package/node_modules/zod/package.json +20 -8
  178. package/node_modules/zod/src/compile.ts +56 -0
  179. package/node_modules/zod/src/index.ts +5 -2
  180. package/node_modules/zod/src/v3/ZodError.ts +22 -12
  181. package/node_modules/zod/src/v3/helpers/errorUtil.ts +1 -1
  182. package/node_modules/zod/src/v3/tests/error.test.ts +35 -0
  183. package/node_modules/zod/src/v3/tests/intersection.test.ts +18 -0
  184. package/node_modules/zod/src/v3/tests/language-server.test.ts +1 -2
  185. package/node_modules/zod/src/v3/tests/object.test.ts +3 -6
  186. package/node_modules/zod/src/v3/tests/readonly.test.ts +0 -80
  187. package/node_modules/zod/src/v3/tests/string.test.ts +6 -0
  188. package/node_modules/zod/src/v3/types.ts +5 -5
  189. package/node_modules/zod/src/v4/classic/checks.ts +1 -0
  190. package/node_modules/zod/src/v4/classic/compat.ts +26 -18
  191. package/node_modules/zod/src/v4/classic/deep-partial.ts +76 -0
  192. package/node_modules/zod/src/v4/classic/errors.ts +59 -44
  193. package/node_modules/zod/src/v4/classic/external.ts +14 -9
  194. package/node_modules/zod/src/v4/classic/from-json-schema.ts +363 -78
  195. package/node_modules/zod/src/v4/classic/in-out.ts +45 -0
  196. package/node_modules/zod/src/v4/classic/index.ts +2 -2
  197. package/node_modules/zod/src/v4/classic/iso.ts +2 -72
  198. package/node_modules/zod/src/v4/classic/parse.ts +10 -4
  199. package/node_modules/zod/src/v4/classic/schemas.ts +640 -375
  200. package/node_modules/zod/src/v4/classic/tests/apply.test.ts +27 -0
  201. package/node_modules/zod/src/v4/classic/tests/array.test.ts +2 -2
  202. package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +186 -0
  203. package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +36 -1
  204. package/node_modules/zod/src/v4/classic/tests/catch.test.ts +278 -0
  205. package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +1 -2
  206. package/node_modules/zod/src/v4/classic/tests/codec.test.ts +2 -1
  207. package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +3 -3
  208. package/node_modules/zod/src/v4/classic/tests/credit-card.test.ts +76 -0
  209. package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +985 -0
  210. package/node_modules/zod/src/v4/classic/tests/date.test.ts +30 -0
  211. package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +32 -18
  212. package/node_modules/zod/src/v4/classic/tests/deep-partial.test.ts +380 -0
  213. package/node_modules/zod/src/v4/classic/tests/default-locale.test.ts +32 -0
  214. package/node_modules/zod/src/v4/classic/tests/default.test.ts +46 -0
  215. package/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +31 -7
  216. package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +261 -13
  217. package/node_modules/zod/src/v4/classic/tests/enum.test.ts +20 -0
  218. package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +112 -2
  219. package/node_modules/zod/src/v4/classic/tests/error.test.ts +403 -6
  220. package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +582 -10
  221. package/node_modules/zod/src/v4/classic/tests/function.test.ts +31 -0
  222. package/node_modules/zod/src/v4/classic/tests/global-config.test.ts +2 -9
  223. package/node_modules/zod/src/v4/classic/tests/hash.test.ts +1 -2
  224. package/node_modules/zod/src/v4/classic/tests/iban.test.ts +81 -0
  225. package/node_modules/zod/src/v4/classic/tests/in-out.test.ts +159 -0
  226. package/node_modules/zod/src/v4/classic/tests/index.test.ts +21 -2
  227. package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +319 -0
  228. package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +67 -0
  229. package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +136 -0
  230. package/node_modules/zod/src/v4/classic/tests/issue-schema.test.ts +215 -0
  231. package/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +3 -10
  232. package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +36 -1
  233. package/node_modules/zod/src/v4/classic/tests/literal.test.ts +12 -1
  234. package/node_modules/zod/src/v4/classic/tests/map.test.ts +12 -0
  235. package/node_modules/zod/src/v4/classic/tests/number.test.ts +85 -9
  236. package/node_modules/zod/src/v4/classic/tests/object.test.ts +301 -12
  237. package/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +235 -0
  238. package/node_modules/zod/src/v4/classic/tests/optional.test.ts +49 -16
  239. package/node_modules/zod/src/v4/classic/tests/partial.test.ts +51 -4
  240. package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +70 -0
  241. package/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +20 -2
  242. package/node_modules/zod/src/v4/classic/tests/properties.test.ts +141 -0
  243. package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +0 -68
  244. package/node_modules/zod/src/v4/classic/tests/record.test.ts +186 -18
  245. package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +79 -3
  246. package/node_modules/zod/src/v4/classic/tests/redos.test.ts +68 -0
  247. package/node_modules/zod/src/v4/classic/tests/refine.test.ts +60 -0
  248. package/node_modules/zod/src/v4/classic/tests/set.test.ts +9 -0
  249. package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +19 -0
  250. package/node_modules/zod/src/v4/classic/tests/string.test.ts +222 -6
  251. package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +18 -0
  252. package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +44 -3
  253. package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +1812 -204
  254. package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +45 -30
  255. package/node_modules/zod/src/v4/classic/tests/union.test.ts +39 -2
  256. package/node_modules/zod/src/v4/classic/tests/validate.test.ts +645 -0
  257. package/node_modules/zod/src/v4/classic/tests/validations.test.ts +2 -2
  258. package/node_modules/zod/src/v4/core/api.ts +87 -35
  259. package/node_modules/zod/src/v4/core/checks.ts +119 -146
  260. package/node_modules/zod/src/v4/core/compile.ts +2313 -0
  261. package/node_modules/zod/src/v4/core/core.ts +99 -22
  262. package/node_modules/zod/src/v4/core/doc.ts +17 -9
  263. package/node_modules/zod/src/v4/core/errors.ts +113 -25
  264. package/node_modules/zod/src/v4/core/index.ts +3 -0
  265. package/node_modules/zod/src/v4/core/json-schema-generator.ts +8 -3
  266. package/node_modules/zod/src/v4/core/json-schema-processors.ts +424 -156
  267. package/node_modules/zod/src/v4/core/json-schema.ts +2 -1
  268. package/node_modules/zod/src/v4/core/memoizer.ts +331 -0
  269. package/node_modules/zod/src/v4/core/parse.ts +164 -50
  270. package/node_modules/zod/src/v4/core/regexes.ts +42 -15
  271. package/node_modules/zod/src/v4/core/registries.ts +2 -2
  272. package/node_modules/zod/src/v4/core/schemas.ts +1000 -538
  273. package/node_modules/zod/src/v4/core/tests/cached.test.ts +54 -0
  274. package/node_modules/zod/src/v4/core/tests/compile-differential.test.ts +1004 -0
  275. package/node_modules/zod/src/v4/core/tests/compile-generative.test.ts +445 -0
  276. package/node_modules/zod/src/v4/core/tests/compile-global.test.ts +89 -0
  277. package/node_modules/zod/src/v4/core/tests/compile-off-by-default.test.ts +26 -0
  278. package/node_modules/zod/src/v4/core/tests/compile-stats.test.ts +34 -0
  279. package/node_modules/zod/src/v4/core/tests/compile.test.ts +2036 -0
  280. package/node_modules/zod/src/v4/core/tests/email-regex.test.ts +140 -0
  281. package/node_modules/zod/src/v4/core/tests/locales/el.test.ts +1 -2
  282. package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +1 -2
  283. package/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +3 -3
  284. package/node_modules/zod/src/v4/core/tests/locales/parity.test.ts +42 -0
  285. package/node_modules/zod/src/v4/core/tests/locales/tg.test.ts +85 -0
  286. package/node_modules/zod/src/v4/core/tests/locales/tk.test.ts +69 -0
  287. package/node_modules/zod/src/v4/core/tests/polyfill-collision.test.ts +46 -0
  288. package/node_modules/zod/src/v4/core/tests/treeshake.test.ts +51 -0
  289. package/node_modules/zod/src/v4/core/tests/url-no-canparse.test.ts +133 -0
  290. package/node_modules/zod/src/v4/core/to-json-schema.ts +283 -48
  291. package/node_modules/zod/src/v4/core/util.ts +454 -157
  292. package/node_modules/zod/src/v4/core/versions.ts +2 -2
  293. package/node_modules/zod/src/v4/core/visit.ts +193 -0
  294. package/node_modules/zod/src/v4/index.ts +3 -3
  295. package/node_modules/zod/src/v4/locales/ar.ts +5 -0
  296. package/node_modules/zod/src/v4/locales/az.ts +5 -0
  297. package/node_modules/zod/src/v4/locales/be.ts +12 -0
  298. package/node_modules/zod/src/v4/locales/bg.ts +5 -0
  299. package/node_modules/zod/src/v4/locales/bn.ts +123 -0
  300. package/node_modules/zod/src/v4/locales/ca.ts +5 -0
  301. package/node_modules/zod/src/v4/locales/ckb.ts +140 -0
  302. package/node_modules/zod/src/v4/locales/cs.ts +5 -0
  303. package/node_modules/zod/src/v4/locales/da.ts +7 -2
  304. package/node_modules/zod/src/v4/locales/de.ts +5 -0
  305. package/node_modules/zod/src/v4/locales/el.ts +3 -0
  306. package/node_modules/zod/src/v4/locales/en.ts +17 -4
  307. package/node_modules/zod/src/v4/locales/eo.ts +5 -0
  308. package/node_modules/zod/src/v4/locales/es.ts +4 -0
  309. package/node_modules/zod/src/v4/locales/fa.ts +5 -0
  310. package/node_modules/zod/src/v4/locales/fi.ts +5 -0
  311. package/node_modules/zod/src/v4/locales/fr-CA.ts +5 -0
  312. package/node_modules/zod/src/v4/locales/fr.ts +21 -14
  313. package/node_modules/zod/src/v4/locales/gu.ts +123 -0
  314. package/node_modules/zod/src/v4/locales/he.ts +8 -1
  315. package/node_modules/zod/src/v4/locales/hi.ts +126 -0
  316. package/node_modules/zod/src/v4/locales/hr.ts +4 -0
  317. package/node_modules/zod/src/v4/locales/hu.ts +5 -0
  318. package/node_modules/zod/src/v4/locales/hy.ts +11 -0
  319. package/node_modules/zod/src/v4/locales/id.ts +5 -0
  320. package/node_modules/zod/src/v4/locales/index.ts +11 -0
  321. package/node_modules/zod/src/v4/locales/is.ts +5 -0
  322. package/node_modules/zod/src/v4/locales/it.ts +5 -0
  323. package/node_modules/zod/src/v4/locales/ja.ts +5 -0
  324. package/node_modules/zod/src/v4/locales/ka.ts +5 -0
  325. package/node_modules/zod/src/v4/locales/km.ts +5 -0
  326. package/node_modules/zod/src/v4/locales/kn.ts +126 -0
  327. package/node_modules/zod/src/v4/locales/ko.ts +5 -0
  328. package/node_modules/zod/src/v4/locales/lt.ts +4 -0
  329. package/node_modules/zod/src/v4/locales/mk.ts +5 -0
  330. package/node_modules/zod/src/v4/locales/ms.ts +5 -0
  331. package/node_modules/zod/src/v4/locales/ne.ts +128 -0
  332. package/node_modules/zod/src/v4/locales/nl.ts +5 -0
  333. package/node_modules/zod/src/v4/locales/nn.ts +121 -0
  334. package/node_modules/zod/src/v4/locales/no.ts +7 -2
  335. package/node_modules/zod/src/v4/locales/ota.ts +5 -0
  336. package/node_modules/zod/src/v4/locales/pl.ts +5 -0
  337. package/node_modules/zod/src/v4/locales/ps.ts +5 -0
  338. package/node_modules/zod/src/v4/locales/pt-BR.ts +161 -0
  339. package/node_modules/zod/src/v4/locales/pt.ts +101 -58
  340. package/node_modules/zod/src/v4/locales/ro.ts +3 -0
  341. package/node_modules/zod/src/v4/locales/ru.ts +12 -0
  342. package/node_modules/zod/src/v4/locales/sk.ts +123 -0
  343. package/node_modules/zod/src/v4/locales/sl.ts +5 -0
  344. package/node_modules/zod/src/v4/locales/sv.ts +7 -2
  345. package/node_modules/zod/src/v4/locales/ta.ts +5 -0
  346. package/node_modules/zod/src/v4/locales/tg.ts +135 -0
  347. package/node_modules/zod/src/v4/locales/th.ts +5 -0
  348. package/node_modules/zod/src/v4/locales/tk.ts +113 -0
  349. package/node_modules/zod/src/v4/locales/tr.ts +5 -0
  350. package/node_modules/zod/src/v4/locales/uk.ts +5 -0
  351. package/node_modules/zod/src/v4/locales/ur.ts +5 -0
  352. package/node_modules/zod/src/v4/locales/uz.ts +3 -0
  353. package/node_modules/zod/src/v4/locales/vi.ts +5 -0
  354. package/node_modules/zod/src/v4/locales/yo.ts +5 -0
  355. package/node_modules/zod/src/v4/locales/zh-CN.ts +5 -0
  356. package/node_modules/zod/src/v4/locales/zh-TW.ts +5 -0
  357. package/node_modules/zod/src/v4/mini/checks.ts +1 -0
  358. package/node_modules/zod/src/v4/mini/deep-partial.ts +73 -0
  359. package/node_modules/zod/src/v4/mini/external.ts +12 -1
  360. package/node_modules/zod/src/v4/mini/in-out.ts +45 -0
  361. package/node_modules/zod/src/v4/mini/parse.ts +2 -0
  362. package/node_modules/zod/src/v4/mini/schemas.ts +167 -63
  363. package/node_modules/zod/src/v4/mini/tests/apply.test.ts +33 -0
  364. package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +62 -1
  365. package/node_modules/zod/src/v4/mini/tests/checks.test.ts +14 -0
  366. package/node_modules/zod/src/v4/mini/tests/codec.test.ts +35 -1
  367. package/node_modules/zod/src/v4/mini/tests/computed.test.ts +11 -17
  368. package/node_modules/zod/src/v4/mini/tests/cyclic-data.test.ts +84 -0
  369. package/node_modules/zod/src/v4/mini/tests/deep-partial.test.ts +54 -0
  370. package/node_modules/zod/src/v4/mini/tests/error.test.ts +23 -4
  371. package/node_modules/zod/src/v4/mini/tests/functions.test.ts +9 -0
  372. package/node_modules/zod/src/v4/mini/tests/index.test.ts +158 -5
  373. package/node_modules/zod/src/v4/mini/tests/number.test.ts +14 -0
  374. package/node_modules/zod/src/v4/mini/tests/object.test.ts +65 -0
  375. package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +16 -0
  376. package/node_modules/zod/src/v4/mini/tests/string.test.ts +44 -0
  377. package/node_modules/zod/v3/ZodError.cjs +41 -12
  378. package/node_modules/zod/v3/ZodError.d.cts +1 -1
  379. package/node_modules/zod/v3/ZodError.d.ts +1 -1
  380. package/node_modules/zod/v3/ZodError.js +22 -12
  381. package/node_modules/zod/v3/errors.cjs +19 -0
  382. package/node_modules/zod/v3/external.cjs +19 -0
  383. package/node_modules/zod/v3/helpers/enumUtil.cjs +19 -0
  384. package/node_modules/zod/v3/helpers/errorUtil.cjs +20 -1
  385. package/node_modules/zod/v3/helpers/errorUtil.js +1 -1
  386. package/node_modules/zod/v3/helpers/parseUtil.cjs +19 -0
  387. package/node_modules/zod/v3/helpers/partialUtil.cjs +19 -0
  388. package/node_modules/zod/v3/helpers/typeAliases.cjs +19 -0
  389. package/node_modules/zod/v3/helpers/util.cjs +19 -0
  390. package/node_modules/zod/v3/index.cjs +19 -0
  391. package/node_modules/zod/v3/standard-schema.cjs +19 -0
  392. package/node_modules/zod/v3/types.cjs +26 -5
  393. package/node_modules/zod/v3/types.js +7 -5
  394. package/node_modules/zod/v4/classic/checks.cjs +21 -1
  395. package/node_modules/zod/v4/classic/checks.d.cts +1 -1
  396. package/node_modules/zod/v4/classic/checks.d.ts +1 -1
  397. package/node_modules/zod/v4/classic/checks.js +1 -1
  398. package/node_modules/zod/v4/classic/coerce.cjs +19 -0
  399. package/node_modules/zod/v4/classic/compat.cjs +19 -0
  400. package/node_modules/zod/v4/classic/compat.d.cts +9 -11
  401. package/node_modules/zod/v4/classic/compat.d.ts +9 -11
  402. package/node_modules/zod/v4/classic/deep-partial.cjs +58 -0
  403. package/node_modules/zod/v4/classic/deep-partial.d.cts +14 -0
  404. package/node_modules/zod/v4/classic/deep-partial.d.ts +14 -0
  405. package/node_modules/zod/v4/classic/deep-partial.js +13 -0
  406. package/node_modules/zod/v4/classic/errors.cjs +62 -34
  407. package/node_modules/zod/v4/classic/errors.d.cts +3 -4
  408. package/node_modules/zod/v4/classic/errors.d.ts +3 -4
  409. package/node_modules/zod/v4/classic/errors.js +43 -34
  410. package/node_modules/zod/v4/classic/external.cjs +51 -27
  411. package/node_modules/zod/v4/classic/external.d.cts +5 -2
  412. package/node_modules/zod/v4/classic/external.d.ts +5 -2
  413. package/node_modules/zod/v4/classic/external.js +5 -8
  414. package/node_modules/zod/v4/classic/from-json-schema.cjs +376 -75
  415. package/node_modules/zod/v4/classic/from-json-schema.js +357 -75
  416. package/node_modules/zod/v4/classic/in-out.cjs +82 -0
  417. package/node_modules/zod/v4/classic/in-out.d.cts +8 -0
  418. package/node_modules/zod/v4/classic/in-out.d.ts +8 -0
  419. package/node_modules/zod/v4/classic/in-out.js +36 -0
  420. package/node_modules/zod/v4/classic/index.cjs +21 -2
  421. package/node_modules/zod/v4/classic/index.d.cts +1 -2
  422. package/node_modules/zod/v4/classic/index.d.ts +1 -2
  423. package/node_modules/zod/v4/classic/index.js +2 -2
  424. package/node_modules/zod/v4/classic/iso.cjs +30 -22
  425. package/node_modules/zod/v4/classic/iso.d.cts +2 -17
  426. package/node_modules/zod/v4/classic/iso.d.ts +2 -17
  427. package/node_modules/zod/v4/classic/iso.js +2 -17
  428. package/node_modules/zod/v4/classic/parse.cjs +23 -1
  429. package/node_modules/zod/v4/classic/parse.d.cts +17 -4
  430. package/node_modules/zod/v4/classic/parse.d.ts +17 -4
  431. package/node_modules/zod/v4/classic/parse.js +1 -0
  432. package/node_modules/zod/v4/classic/schemas.cjs +591 -426
  433. package/node_modules/zod/v4/classic/schemas.d.cts +68 -19
  434. package/node_modules/zod/v4/classic/schemas.d.ts +68 -19
  435. package/node_modules/zod/v4/classic/schemas.js +564 -424
  436. package/node_modules/zod/v4/core/api.cjs +66 -24
  437. package/node_modules/zod/v4/core/api.d.cts +22 -12
  438. package/node_modules/zod/v4/core/api.d.ts +22 -12
  439. package/node_modules/zod/v4/core/api.js +44 -24
  440. package/node_modules/zod/v4/core/checks.cjs +88 -128
  441. package/node_modules/zod/v4/core/checks.d.cts +29 -13
  442. package/node_modules/zod/v4/core/checks.d.ts +29 -13
  443. package/node_modules/zod/v4/core/checks.js +68 -127
  444. package/node_modules/zod/v4/core/compile.cjs +1908 -0
  445. package/node_modules/zod/v4/core/compile.d.cts +65 -0
  446. package/node_modules/zod/v4/core/compile.d.ts +65 -0
  447. package/node_modules/zod/v4/core/compile.js +1858 -0
  448. package/node_modules/zod/v4/core/core.cjs +101 -19
  449. package/node_modules/zod/v4/core/core.d.cts +16 -4
  450. package/node_modules/zod/v4/core/core.d.ts +16 -4
  451. package/node_modules/zod/v4/core/core.js +83 -20
  452. package/node_modules/zod/v4/core/doc.cjs +31 -9
  453. package/node_modules/zod/v4/core/doc.d.cts +3 -1
  454. package/node_modules/zod/v4/core/doc.d.ts +3 -1
  455. package/node_modules/zod/v4/core/doc.js +12 -9
  456. package/node_modules/zod/v4/core/errors.cjs +126 -25
  457. package/node_modules/zod/v4/core/errors.d.cts +4 -0
  458. package/node_modules/zod/v4/core/errors.d.ts +4 -0
  459. package/node_modules/zod/v4/core/errors.js +107 -25
  460. package/node_modules/zod/v4/core/index.cjs +24 -1
  461. package/node_modules/zod/v4/core/index.d.cts +3 -0
  462. package/node_modules/zod/v4/core/index.d.ts +3 -0
  463. package/node_modules/zod/v4/core/index.js +3 -0
  464. package/node_modules/zod/v4/core/json-schema-generator.cjs +24 -1
  465. package/node_modules/zod/v4/core/json-schema-generator.d.cts +2 -2
  466. package/node_modules/zod/v4/core/json-schema-generator.d.ts +2 -2
  467. package/node_modules/zod/v4/core/json-schema-generator.js +6 -2
  468. package/node_modules/zod/v4/core/json-schema-processors.cjs +441 -156
  469. package/node_modules/zod/v4/core/json-schema-processors.d.cts +16 -0
  470. package/node_modules/zod/v4/core/json-schema-processors.d.ts +16 -0
  471. package/node_modules/zod/v4/core/json-schema-processors.js +400 -158
  472. package/node_modules/zod/v4/core/json-schema.cjs +19 -0
  473. package/node_modules/zod/v4/core/json-schema.d.cts +2 -1
  474. package/node_modules/zod/v4/core/json-schema.d.ts +2 -1
  475. package/node_modules/zod/v4/core/memoizer.cjs +360 -0
  476. package/node_modules/zod/v4/core/memoizer.d.cts +15 -0
  477. package/node_modules/zod/v4/core/memoizer.d.ts +15 -0
  478. package/node_modules/zod/v4/core/memoizer.js +311 -0
  479. package/node_modules/zod/v4/core/parse.cjs +148 -46
  480. package/node_modules/zod/v4/core/parse.d.cts +14 -11
  481. package/node_modules/zod/v4/core/parse.d.ts +14 -11
  482. package/node_modules/zod/v4/core/parse.js +127 -45
  483. package/node_modules/zod/v4/core/regexes.cjs +54 -17
  484. package/node_modules/zod/v4/core/regexes.d.cts +5 -0
  485. package/node_modules/zod/v4/core/regexes.d.ts +5 -0
  486. package/node_modules/zod/v4/core/regexes.js +32 -15
  487. package/node_modules/zod/v4/core/registries.cjs +19 -0
  488. package/node_modules/zod/v4/core/registries.js +2 -2
  489. package/node_modules/zod/v4/core/schemas.cjs +785 -386
  490. package/node_modules/zod/v4/core/schemas.d.cts +123 -34
  491. package/node_modules/zod/v4/core/schemas.d.ts +123 -34
  492. package/node_modules/zod/v4/core/schemas.js +753 -386
  493. package/node_modules/zod/v4/core/standard-schema.cjs +19 -0
  494. package/node_modules/zod/v4/core/to-json-schema.cjs +269 -45
  495. package/node_modules/zod/v4/core/to-json-schema.d.cts +45 -5
  496. package/node_modules/zod/v4/core/to-json-schema.d.ts +45 -5
  497. package/node_modules/zod/v4/core/to-json-schema.js +247 -44
  498. package/node_modules/zod/v4/core/util.cjs +372 -157
  499. package/node_modules/zod/v4/core/util.d.cts +79 -1
  500. package/node_modules/zod/v4/core/util.d.ts +79 -1
  501. package/node_modules/zod/v4/core/util.js +341 -156
  502. package/node_modules/zod/v4/core/versions.cjs +21 -2
  503. package/node_modules/zod/v4/core/versions.d.cts +1 -1
  504. package/node_modules/zod/v4/core/versions.d.ts +1 -1
  505. package/node_modules/zod/v4/core/versions.js +2 -2
  506. package/node_modules/zod/v4/core/visit.cjs +214 -0
  507. package/node_modules/zod/v4/core/visit.d.cts +30 -0
  508. package/node_modules/zod/v4/core/visit.d.ts +30 -0
  509. package/node_modules/zod/v4/core/visit.js +169 -0
  510. package/node_modules/zod/v4/index.cjs +34 -5
  511. package/node_modules/zod/v4/index.d.cts +2 -2
  512. package/node_modules/zod/v4/index.d.ts +2 -2
  513. package/node_modules/zod/v4/index.js +3 -2
  514. package/node_modules/zod/v4/locales/ar.cjs +5 -0
  515. package/node_modules/zod/v4/locales/ar.js +5 -0
  516. package/node_modules/zod/v4/locales/az.cjs +5 -0
  517. package/node_modules/zod/v4/locales/az.js +5 -0
  518. package/node_modules/zod/v4/locales/be.cjs +12 -0
  519. package/node_modules/zod/v4/locales/be.js +12 -0
  520. package/node_modules/zod/v4/locales/bg.cjs +5 -0
  521. package/node_modules/zod/v4/locales/bg.js +5 -0
  522. package/node_modules/zod/v4/locales/bn.cjs +140 -0
  523. package/node_modules/zod/v4/locales/bn.d.cts +5 -0
  524. package/node_modules/zod/v4/locales/bn.d.ts +4 -0
  525. package/node_modules/zod/v4/locales/bn.js +113 -0
  526. package/node_modules/zod/v4/locales/ca.cjs +5 -0
  527. package/node_modules/zod/v4/locales/ca.js +5 -0
  528. package/node_modules/zod/v4/locales/ckb.cjs +160 -0
  529. package/node_modules/zod/v4/locales/ckb.d.cts +5 -0
  530. package/node_modules/zod/v4/locales/ckb.d.ts +4 -0
  531. package/node_modules/zod/v4/locales/ckb.js +133 -0
  532. package/node_modules/zod/v4/locales/cs.cjs +5 -0
  533. package/node_modules/zod/v4/locales/cs.js +5 -0
  534. package/node_modules/zod/v4/locales/da.cjs +7 -2
  535. package/node_modules/zod/v4/locales/da.js +7 -2
  536. package/node_modules/zod/v4/locales/de.cjs +5 -0
  537. package/node_modules/zod/v4/locales/de.js +5 -0
  538. package/node_modules/zod/v4/locales/el.cjs +3 -0
  539. package/node_modules/zod/v4/locales/el.js +3 -0
  540. package/node_modules/zod/v4/locales/en.cjs +16 -4
  541. package/node_modules/zod/v4/locales/en.js +16 -4
  542. package/node_modules/zod/v4/locales/eo.cjs +5 -0
  543. package/node_modules/zod/v4/locales/eo.js +5 -0
  544. package/node_modules/zod/v4/locales/es.cjs +4 -0
  545. package/node_modules/zod/v4/locales/es.js +4 -0
  546. package/node_modules/zod/v4/locales/fa.cjs +5 -0
  547. package/node_modules/zod/v4/locales/fa.js +5 -0
  548. package/node_modules/zod/v4/locales/fi.cjs +5 -0
  549. package/node_modules/zod/v4/locales/fi.js +5 -0
  550. package/node_modules/zod/v4/locales/fr-CA.cjs +5 -0
  551. package/node_modules/zod/v4/locales/fr-CA.js +5 -0
  552. package/node_modules/zod/v4/locales/fr.cjs +18 -14
  553. package/node_modules/zod/v4/locales/fr.js +18 -14
  554. package/node_modules/zod/v4/locales/gu.cjs +140 -0
  555. package/node_modules/zod/v4/locales/gu.d.cts +5 -0
  556. package/node_modules/zod/v4/locales/gu.d.ts +4 -0
  557. package/node_modules/zod/v4/locales/gu.js +113 -0
  558. package/node_modules/zod/v4/locales/he.cjs +7 -0
  559. package/node_modules/zod/v4/locales/he.js +7 -0
  560. package/node_modules/zod/v4/locales/hi.cjs +138 -0
  561. package/node_modules/zod/v4/locales/hi.d.cts +5 -0
  562. package/node_modules/zod/v4/locales/hi.d.ts +4 -0
  563. package/node_modules/zod/v4/locales/hi.js +111 -0
  564. package/node_modules/zod/v4/locales/hr.cjs +4 -0
  565. package/node_modules/zod/v4/locales/hr.js +4 -0
  566. package/node_modules/zod/v4/locales/hu.cjs +5 -0
  567. package/node_modules/zod/v4/locales/hu.js +5 -0
  568. package/node_modules/zod/v4/locales/hy.cjs +11 -0
  569. package/node_modules/zod/v4/locales/hy.js +11 -0
  570. package/node_modules/zod/v4/locales/id.cjs +5 -0
  571. package/node_modules/zod/v4/locales/id.js +5 -0
  572. package/node_modules/zod/v4/locales/index.cjs +43 -2
  573. package/node_modules/zod/v4/locales/index.d.cts +11 -0
  574. package/node_modules/zod/v4/locales/index.d.ts +11 -0
  575. package/node_modules/zod/v4/locales/index.js +11 -0
  576. package/node_modules/zod/v4/locales/is.cjs +5 -0
  577. package/node_modules/zod/v4/locales/is.js +5 -0
  578. package/node_modules/zod/v4/locales/it.cjs +5 -0
  579. package/node_modules/zod/v4/locales/it.js +5 -0
  580. package/node_modules/zod/v4/locales/ja.cjs +5 -0
  581. package/node_modules/zod/v4/locales/ja.js +5 -0
  582. package/node_modules/zod/v4/locales/ka.cjs +5 -0
  583. package/node_modules/zod/v4/locales/ka.js +5 -0
  584. package/node_modules/zod/v4/locales/km.cjs +5 -0
  585. package/node_modules/zod/v4/locales/km.js +5 -0
  586. package/node_modules/zod/v4/locales/kn.cjs +143 -0
  587. package/node_modules/zod/v4/locales/kn.d.cts +5 -0
  588. package/node_modules/zod/v4/locales/kn.d.ts +4 -0
  589. package/node_modules/zod/v4/locales/kn.js +116 -0
  590. package/node_modules/zod/v4/locales/ko.cjs +5 -0
  591. package/node_modules/zod/v4/locales/ko.js +5 -0
  592. package/node_modules/zod/v4/locales/lt.cjs +4 -0
  593. package/node_modules/zod/v4/locales/lt.js +4 -0
  594. package/node_modules/zod/v4/locales/mk.cjs +5 -0
  595. package/node_modules/zod/v4/locales/mk.js +5 -0
  596. package/node_modules/zod/v4/locales/ms.cjs +5 -0
  597. package/node_modules/zod/v4/locales/ms.js +5 -0
  598. package/node_modules/zod/v4/locales/ne.cjs +138 -0
  599. package/node_modules/zod/v4/locales/ne.d.cts +5 -0
  600. package/node_modules/zod/v4/locales/ne.d.ts +4 -0
  601. package/node_modules/zod/v4/locales/ne.js +111 -0
  602. package/node_modules/zod/v4/locales/nl.cjs +5 -0
  603. package/node_modules/zod/v4/locales/nl.js +5 -0
  604. package/node_modules/zod/v4/locales/nn.cjs +140 -0
  605. package/node_modules/zod/v4/locales/nn.d.cts +5 -0
  606. package/node_modules/zod/v4/locales/nn.d.ts +4 -0
  607. package/node_modules/zod/v4/locales/nn.js +113 -0
  608. package/node_modules/zod/v4/locales/no.cjs +7 -2
  609. package/node_modules/zod/v4/locales/no.js +7 -2
  610. package/node_modules/zod/v4/locales/ota.cjs +5 -0
  611. package/node_modules/zod/v4/locales/ota.js +5 -0
  612. package/node_modules/zod/v4/locales/pl.cjs +5 -0
  613. package/node_modules/zod/v4/locales/pl.js +5 -0
  614. package/node_modules/zod/v4/locales/ps.cjs +5 -0
  615. package/node_modules/zod/v4/locales/ps.js +5 -0
  616. package/node_modules/zod/v4/locales/pt-BR.cjs +170 -0
  617. package/node_modules/zod/v4/locales/pt-BR.d.cts +5 -0
  618. package/node_modules/zod/v4/locales/pt-BR.d.ts +4 -0
  619. package/node_modules/zod/v4/locales/pt-BR.js +143 -0
  620. package/node_modules/zod/v4/locales/pt.cjs +89 -55
  621. package/node_modules/zod/v4/locales/pt.js +89 -55
  622. package/node_modules/zod/v4/locales/ro.cjs +3 -0
  623. package/node_modules/zod/v4/locales/ro.js +3 -0
  624. package/node_modules/zod/v4/locales/ru.cjs +12 -0
  625. package/node_modules/zod/v4/locales/ru.js +12 -0
  626. package/node_modules/zod/v4/locales/sk.cjs +143 -0
  627. package/node_modules/zod/v4/locales/sk.d.cts +5 -0
  628. package/node_modules/zod/v4/locales/sk.d.ts +4 -0
  629. package/node_modules/zod/v4/locales/sk.js +116 -0
  630. package/node_modules/zod/v4/locales/sl.cjs +5 -0
  631. package/node_modules/zod/v4/locales/sl.js +5 -0
  632. package/node_modules/zod/v4/locales/sv.cjs +7 -2
  633. package/node_modules/zod/v4/locales/sv.js +7 -2
  634. package/node_modules/zod/v4/locales/ta.cjs +5 -0
  635. package/node_modules/zod/v4/locales/ta.js +5 -0
  636. package/node_modules/zod/v4/locales/tg.cjs +144 -0
  637. package/node_modules/zod/v4/locales/tg.d.cts +5 -0
  638. package/node_modules/zod/v4/locales/tg.d.ts +4 -0
  639. package/node_modules/zod/v4/locales/tg.js +117 -0
  640. package/node_modules/zod/v4/locales/th.cjs +5 -0
  641. package/node_modules/zod/v4/locales/th.js +5 -0
  642. package/node_modules/zod/v4/locales/tk.cjs +134 -0
  643. package/node_modules/zod/v4/locales/tk.d.cts +5 -0
  644. package/node_modules/zod/v4/locales/tk.d.ts +4 -0
  645. package/node_modules/zod/v4/locales/tk.js +107 -0
  646. package/node_modules/zod/v4/locales/tr.cjs +5 -0
  647. package/node_modules/zod/v4/locales/tr.js +5 -0
  648. package/node_modules/zod/v4/locales/uk.cjs +5 -0
  649. package/node_modules/zod/v4/locales/uk.js +5 -0
  650. package/node_modules/zod/v4/locales/ur.cjs +5 -0
  651. package/node_modules/zod/v4/locales/ur.js +5 -0
  652. package/node_modules/zod/v4/locales/uz.cjs +3 -0
  653. package/node_modules/zod/v4/locales/uz.js +3 -0
  654. package/node_modules/zod/v4/locales/vi.cjs +5 -0
  655. package/node_modules/zod/v4/locales/vi.js +5 -0
  656. package/node_modules/zod/v4/locales/yo.cjs +5 -0
  657. package/node_modules/zod/v4/locales/yo.js +5 -0
  658. package/node_modules/zod/v4/locales/zh-CN.cjs +5 -0
  659. package/node_modules/zod/v4/locales/zh-CN.js +5 -0
  660. package/node_modules/zod/v4/locales/zh-TW.cjs +5 -0
  661. package/node_modules/zod/v4/locales/zh-TW.js +5 -0
  662. package/node_modules/zod/v4/mini/checks.cjs +21 -1
  663. package/node_modules/zod/v4/mini/checks.d.cts +1 -1
  664. package/node_modules/zod/v4/mini/checks.d.ts +1 -1
  665. package/node_modules/zod/v4/mini/checks.js +1 -1
  666. package/node_modules/zod/v4/mini/coerce.cjs +19 -0
  667. package/node_modules/zod/v4/mini/deep-partial.cjs +58 -0
  668. package/node_modules/zod/v4/mini/deep-partial.d.cts +14 -0
  669. package/node_modules/zod/v4/mini/deep-partial.d.ts +14 -0
  670. package/node_modules/zod/v4/mini/deep-partial.js +13 -0
  671. package/node_modules/zod/v4/mini/external.cjs +33 -1
  672. package/node_modules/zod/v4/mini/external.d.cts +5 -2
  673. package/node_modules/zod/v4/mini/external.d.ts +5 -2
  674. package/node_modules/zod/v4/mini/external.js +3 -1
  675. package/node_modules/zod/v4/mini/in-out.cjs +82 -0
  676. package/node_modules/zod/v4/mini/in-out.d.cts +8 -0
  677. package/node_modules/zod/v4/mini/in-out.d.ts +8 -0
  678. package/node_modules/zod/v4/mini/in-out.js +36 -0
  679. package/node_modules/zod/v4/mini/index.cjs +19 -0
  680. package/node_modules/zod/v4/mini/iso.cjs +19 -0
  681. package/node_modules/zod/v4/mini/parse.cjs +22 -1
  682. package/node_modules/zod/v4/mini/parse.d.cts +1 -1
  683. package/node_modules/zod/v4/mini/parse.d.ts +1 -1
  684. package/node_modules/zod/v4/mini/parse.js +1 -1
  685. package/node_modules/zod/v4/mini/schemas.cjs +117 -53
  686. package/node_modules/zod/v4/mini/schemas.d.cts +49 -14
  687. package/node_modules/zod/v4/mini/schemas.d.ts +49 -14
  688. package/node_modules/zod/v4/mini/schemas.js +92 -51
  689. package/node_modules/zod/v4-mini/index.cjs +19 -0
  690. package/openclaw.plugin.json +120 -42
  691. package/package.json +16 -7
  692. package/dist/channel.runtime-CYHw3gcp.js +0 -4
  693. package/dist/monitor.runtime-BJ0XI3qK.js +0 -2
  694. package/dist/probe.runtime-CbtMgU4s.js +0 -2
  695. package/node_modules/zod/src/v4/core/config.ts +0 -15
  696. /package/dist/{account-helpers-BSUyZwLm.js → .setup/account-helpers-BSUyZwLm.mjs} +0 -0
  697. /package/dist/{accounts-BBEFMYbY.js → .setup/accounts-BBEFMYbY.mjs} +0 -0
  698. /package/dist/{webhook-spool-contract-1rY8OJw8.js → .setup/webhook-spool-contract-1rY8OJw8.mjs} +0 -0
@@ -1,58 +1,43 @@
1
- import { i as resolveLineAccount, r as resolveDefaultLineAccountId } from "./accounts-BBEFMYbY.js";
2
- import { f as resolveLineGroupConfigEntry, h as getLineRuntime, i as prepareLineReplyPayload, n as createLineQuickReply, u as buildLineQuickReplyFallbackText } from "./rich-messages-HS8pNeOa.js";
3
- import { n as findLineHttpError, r as resolveLineNonDispatchRetryable, t as explainLineRefusal, w as buildLineMediaMessage } from "./send-retry-ChpfJ-LM.js";
4
- import { a as eventIdFor, n as LINE_WEBHOOK_SPOOL_INVALID_PAYLOAD_MESSAGE, o as laneKeyFor, r as LineWebhookPayloadError, t as LINE_WEBHOOK_SPOOL_INVALID_EVENT_REASON } from "./webhook-spool-contract-1rY8OJw8.js";
5
- import { a as buildTemplateMessageFromPayload, r as processLineMessage } from "./markdown-to-line-DR3sFH6H.js";
6
- import { _ as showLoadingAnimation, a as getLineGroupName, d as pushMessageLine, f as pushMessagesLine, h as replyMessageLine, n as createLocationMessage, o as getUserDisplayName, s as getUserProfile, t as createFlexMessage, v as quotesLineBotMessage } from "./send-CQQxpxPp.js";
1
+ import { i as resolveLineAccount, r as resolveDefaultLineAccountId } from "./accounts-BBEFMYbY.mjs";
2
+ import { b as normalizeAllowFrom, c as resolveLineQuestionPostback, f as buildLineQuickReplyFallbackText, g as resolveLineGroupConfigEntry, i as prepareLineReplyPayload, n as createLineQuickReply, p as getLineRuntime, s as parseLineQuestionPostbackData, x as normalizeLineAllowEntry, y as firstDefined } from "./rich-messages-d8CmBVJj.mjs";
3
+ import { D as recordLineQuoteToken, E as readLineQuoteToken, O as reportLineQuoteCarrierMissing, T as canCarryLineQuoteToken, j as buildLineMediaMessage, k as resolveLineQuoteToken, n as findLineHttpError, r as resolveLineNonDispatchRetryable, t as explainLineRefusal, w as applyLineQuoteToken } from "./send-retry-DbfiHBPd.mjs";
4
+ import { a as eventIdFor, n as LINE_WEBHOOK_SPOOL_INVALID_PAYLOAD_MESSAGE, o as laneKeyFor, r as LineWebhookPayloadError, t as LINE_WEBHOOK_SPOOL_INVALID_EVENT_REASON } from "./webhook-spool-contract-1rY8OJw8.mjs";
5
+ import { a as buildTemplateMessageFromPayload, r as processLineMessage } from "./markdown-to-line-CRfEHFs0.mjs";
6
+ import { _ as showLoadingAnimation, a as getLineGroupName, d as pushMessageLine, f as pushMessagesLine, h as replyMessageLine, n as createLocationMessage, o as getUserDisplayName, s as getUserProfile, t as createFlexMessage, v as quotesLineBotMessage } from "./send-BmsHY4WC.mjs";
7
7
  import { createChannelPairingChallengeIssuer } from "openclaw/plugin-sdk/channel-pairing";
8
8
  import { resolveChannelGroupsConfigPath } from "openclaw/plugin-sdk/channel-policy";
9
9
  import { normalizeOptionalString, normalizeStringEntries, readNonEmptyStringPreservingWhitespace } from "openclaw/plugin-sdk/string-coerce-runtime";
10
- import { DEFAULT_INGRESS_ADOPTION_STALL_MS, DEFAULT_INGRESS_RETRY_MAX_ATTEMPTS, bindIngressLifecycleToReplyOptions, createChannelIngressMonitor } from "openclaw/plugin-sdk/channel-outbound";
10
+ import { DEFAULT_INGRESS_ADOPTION_STALL_MS, DEFAULT_INGRESS_RETRY_MAX_ATTEMPTS, bindIngressLifecycleToReplyOptions, createChannelIngressMonitor, resolveChannelStreamingBlockEnabled } from "openclaw/plugin-sdk/channel-outbound";
11
11
  import { buildChannelInboundEventContext, buildMentionRegexes, formatInboundEnvelope, formatInboundMediaUnavailableText, formatLocationText, hasFinalInboundReplyDispatch, implicitMentionKindWhen, isChannelPartialDeliveryError, logInboundDrop, matchesMentionPatterns, resolveInboundSessionEnvelopeContext, toInboundMediaFactsWithMetadata, toLocationContext } from "openclaw/plugin-sdk/channel-inbound";
12
12
  import { collectErrorGraphCandidates, extractErrorCode, formatErrorMessage, readErrorName, toErrorObject } from "openclaw/plugin-sdk/error-runtime";
13
13
  import { resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload";
14
14
  import { sanitizeAssistantVisibleText } from "openclaw/plugin-sdk/text-chunking";
15
+ import { createNonExitingRuntime, danger, logVerbose, shouldLogVerbose, waitForAbortSignal, warn } from "openclaw/plugin-sdk/runtime-env";
15
16
  import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
16
17
  import { classifyTransientNetworkErrorCode } from "openclaw/plugin-sdk/retry-runtime";
17
18
  import { fetchWithRuntimeDispatcherOrMockedGlobal } from "openclaw/plugin-sdk/runtime-fetch";
18
- import { firstDefined } from "openclaw/plugin-sdk/allow-from";
19
19
  import { setTimeout as setTimeout$1 } from "node:timers/promises";
20
20
  import { MediaFetchError } from "openclaw/plugin-sdk/media-runtime";
21
21
  import { saveMediaStream } from "openclaw/plugin-sdk/media-store";
22
- import { createNonExitingRuntime, danger, logVerbose, shouldLogVerbose, waitForAbortSignal, warn } from "openclaw/plugin-sdk/runtime-env";
23
22
  import crypto from "node:crypto";
24
23
  import { recordChannelActivity } from "openclaw/plugin-sdk/channel-activity-runtime";
25
24
  import { resolveHumanDelayConfig } from "openclaw/plugin-sdk/agent-runtime";
26
25
  import { channelReadyPatch, channelStoppedPatch } from "openclaw/plugin-sdk/gateway-runtime";
27
- import { chunkMarkdownText } from "openclaw/plugin-sdk/reply-runtime";
28
- import { canonicalizeWebhookRouteKey, normalizePluginHttpPath, normalizeWebhookPath, registerWebhookTargetWithPluginRoute, resolveSingleWebhookTarget } from "openclaw/plugin-sdk/webhook-ingress";
26
+ import { canonicalizeWebhookRouteKey, registerWebhookTargetWithPluginRoute, resolveSingleWebhookTarget, resolveWebhookPath } from "openclaw/plugin-sdk/webhook-ingress";
29
27
  import { beginWebhookRequestPipelineOrReject, createWebhookInFlightLimiter, isRequestBodyLimitError, readRequestBodyWithLimit, requestBodyErrorToText, runDetachedWebhookWork, sendHttpRequestRejection } from "openclaw/plugin-sdk/webhook-request-guards";
30
28
  import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
31
- import { DEFAULT_GROUP_HISTORY_LIMIT, createChannelHistoryWindow } from "openclaw/plugin-sdk/reply-history";
29
+ import { chunkMarkdownText } from "openclaw/plugin-sdk/reply-runtime";
30
+ import { resolvePromptHistoryLimit } from "openclaw/plugin-sdk/number-runtime";
32
31
  import { getRuntimeConfig, getRuntimeConfigSnapshot, getRuntimeConfigSourceSnapshot, selectApplicableRuntimeConfig } from "openclaw/plugin-sdk/runtime-config-snapshot";
33
- import { resolveChannelImplicitMentions, resolveStableChannelMessageIngress } from "openclaw/plugin-sdk/channel-ingress-runtime";
32
+ import { fanInChannelIngressLifecycles, resolveChannelImplicitMentions } from "openclaw/plugin-sdk/channel-ingress-runtime";
34
33
  import { reportChannelRoomJoin } from "openclaw/plugin-sdk/channel-join-intro-runtime";
35
34
  import { hasControlCommand } from "openclaw/plugin-sdk/command-auth-native";
36
35
  import { ensureConfiguredBindingRouteReady, readChannelAllowFromStore, resolveConfiguredBindingRoute, resolvePairingIdLabel, resolvePinnedMainDmOwnerFromAllowlist, resolveRuntimeConversationBindingRoute, upsertChannelPairingRequest } from "openclaw/plugin-sdk/conversation-runtime";
36
+ import { DEFAULT_GROUP_HISTORY_LIMIT, createChannelHistoryWindow } from "openclaw/plugin-sdk/reply-history";
37
37
  import { resolveAgentRoute, resolveInboundLastRouteSessionKey } from "openclaw/plugin-sdk/routing";
38
38
  import { resolveAllowlistProviderRuntimeGroupPolicy, resolveDefaultGroupPolicy, warnMissingProviderGroupPolicyFallbackOnce } from "openclaw/plugin-sdk/runtime-group-policy";
39
+ import { enqueueKeyedTask } from "openclaw/plugin-sdk/keyed-async-queue";
39
40
  import { safeEqualSecret } from "openclaw/plugin-sdk/security-runtime";
40
- //#region extensions/line/src/bot-access.ts
41
- function normalizeLineAllowEntry(value) {
42
- const trimmed = String(value).trim();
43
- if (!trimmed) return "";
44
- if (trimmed === "*") return "*";
45
- return trimmed.replace(/^line:(?:user:)?/i, "");
46
- }
47
- const normalizeAllowFrom = (list) => {
48
- const entries = (list ?? []).map((value) => normalizeLineAllowEntry(value)).filter(Boolean);
49
- return {
50
- entries,
51
- hasWildcard: entries.includes("*"),
52
- hasEntries: entries.length > 0
53
- };
54
- };
55
- //#endregion
56
41
  //#region extensions/line/src/download.ts
57
42
  const CONTENT_READY_MAX_ATTEMPTS = 6;
58
43
  const CONTENT_READY_BASE_DELAY_MS = 500;
@@ -187,7 +172,7 @@ function markLineVisibleDeliveryError(error) {
187
172
  return visibleError;
188
173
  }
189
174
  async function deliverLineAutoReply(params) {
190
- const { payload, lineData, replyToken, accountId, to, textLimit, deps } = params;
175
+ const { payload, lineData, replyToken, accountId, to, textLimit } = params;
191
176
  let replyTokenUsed = params.replyTokenUsed;
192
177
  let visibleReplySent = false;
193
178
  const sendVisible = async (send) => {
@@ -201,14 +186,14 @@ async function deliverLineAutoReply(params) {
201
186
  throw error;
202
187
  }
203
188
  };
204
- const replyVisible = (...args) => sendVisible(() => deps.replyMessageLine(...args));
189
+ const replyVisible = (...args) => sendVisible(() => replyMessageLine(...args));
205
190
  const failedPushSegments = /* @__PURE__ */ new WeakMap();
206
191
  const pushLineMessages = async (messages, allowFailedBatchTextRecovery, externalTail = []) => {
207
192
  if (messages.length === 0) return;
208
193
  for (let i = 0; i < messages.length; i += 5) {
209
194
  const batch = messages.slice(i, i + 5);
210
195
  try {
211
- await sendVisible(() => deps.pushMessagesLine(to, batch, {
196
+ await sendVisible(() => pushMessagesLine(to, batch, {
212
197
  cfg: params.cfg,
213
198
  accountId
214
199
  }));
@@ -234,7 +219,7 @@ async function deliverLineAutoReply(params) {
234
219
  });
235
220
  } catch (err) {
236
221
  if (isChannelPartialDeliveryError(err) || !canFallbackAfterLineReplyFailure(err)) throw err;
237
- deps.onReplyError?.(err);
222
+ params.onReplyError?.(err);
238
223
  await pushLineMessages(replyBatch, findLineHttpError(err)?.status === 400, remaining.slice(replyBatch.length));
239
224
  } finally {
240
225
  replyTokenUsed = true;
@@ -253,23 +238,23 @@ async function deliverLineAutoReply(params) {
253
238
  }));
254
239
  const quickReplyLabels = quickReplyItems.map((item) => item.label);
255
240
  const hasQuickReplies = quickReplyItems.length > 0;
256
- if (lineData.flexMessage) richMessages.push(deps.createFlexMessage(lineData.flexMessage.altText, lineData.flexMessage.contents));
241
+ if (lineData.flexMessage) richMessages.push(createFlexMessage(lineData.flexMessage.altText, lineData.flexMessage.contents));
257
242
  if (lineData.templateMessage) {
258
- const templateMsg = deps.buildTemplateMessageFromPayload(lineData.templateMessage);
243
+ const templateMsg = buildTemplateMessageFromPayload(lineData.templateMessage);
259
244
  if (templateMsg) richMessages.push(templateMsg);
260
245
  }
261
- if (lineData.location) richMessages.push(deps.createLocationMessage(lineData.location));
246
+ if (lineData.location) richMessages.push(createLocationMessage(lineData.location));
262
247
  const visibleText = payload.text ? sanitizeAssistantVisibleText(payload.text) : "";
263
- const processed = visibleText ? deps.processLineMessage(visibleText) : {
248
+ const processed = visibleText ? processLineMessage(visibleText) : {
264
249
  text: "",
265
250
  flexMessages: []
266
251
  };
267
- if (!processed.segments) for (const flexMsg of processed.flexMessages) richMessages.push(deps.createFlexMessage(flexMsg.altText, flexMsg.contents));
268
- const orderedMessages = processed.segments?.flatMap((segment) => segment.type === "flex" ? [deps.createFlexMessage(segment.message.altText, segment.message.contents)] : deps.chunkMarkdownText(segment.text, textLimit).map((text) => ({
252
+ if (!processed.segments) for (const flexMsg of processed.flexMessages) richMessages.push(createFlexMessage(flexMsg.altText, flexMsg.contents));
253
+ const orderedMessages = processed.segments?.flatMap((segment) => segment.type === "flex" ? [createFlexMessage(segment.message.altText, segment.message.contents)] : chunkMarkdownText(segment.text, textLimit).map((text) => ({
269
254
  type: "text",
270
255
  text
271
256
  })));
272
- const chunks = orderedMessages ? orderedMessages.flatMap((message) => message.type === "text" ? [message.text] : []) : processed.text ? deps.chunkMarkdownText(processed.text, textLimit) : [];
257
+ const chunks = orderedMessages ? orderedMessages.flatMap((message) => message.type === "text" ? [message.text] : []) : processed.text ? chunkMarkdownText(processed.text, textLimit) : [];
273
258
  const mediaUrls = resolveSendableOutboundReplyParts(payload).mediaUrls;
274
259
  const mediaOpts = {
275
260
  mediaKind: lineData.mediaKind,
@@ -283,7 +268,7 @@ async function deliverLineAutoReply(params) {
283
268
  const url = rawUrl?.trim();
284
269
  if (!url) continue;
285
270
  try {
286
- mediaMessages.push(await deps.buildMediaMessage(url, mediaOpts, to));
271
+ mediaMessages.push(await buildLineMediaMessage(url, mediaOpts, to));
287
272
  } catch (err) {
288
273
  deliveryError ??= err;
289
274
  }
@@ -310,7 +295,15 @@ async function deliverLineAutoReply(params) {
310
295
  quickReply: createLineQuickReply(quickReplyItems)
311
296
  };
312
297
  }
313
- const messages = hasQuickReplies ? [...richMediaMessages, ...orderedDeliveryMessages ?? textMessages] : [...orderedDeliveryMessages ?? textMessages, ...richMediaMessages];
298
+ const ordered = hasQuickReplies ? [...richMediaMessages, ...orderedDeliveryMessages ?? textMessages] : [...orderedDeliveryMessages ?? textMessages, ...richMediaMessages];
299
+ const replyQuoteToken = resolveLineQuoteToken({
300
+ cfg: params.cfg,
301
+ accountId,
302
+ chatId: to,
303
+ messageId: payload.replyToId
304
+ });
305
+ if (replyQuoteToken && !ordered.some(canCarryLineQuoteToken)) reportLineQuoteCarrierMissing(to);
306
+ const messages = applyLineQuoteToken(ordered, replyQuoteToken);
314
307
  try {
315
308
  await sendLineMessages(messages, true);
316
309
  } catch (err) {
@@ -573,9 +566,7 @@ async function finalizeLineInboundContext(params) {
573
566
  label: conversationLabel
574
567
  },
575
568
  route: {
576
- agentId: params.route.agentId,
577
- dmScope: params.route.dmScope,
578
- accountId: params.route.accountId,
569
+ ...params.route,
579
570
  routeSessionKey: params.route.sessionKey
580
571
  },
581
572
  reply: {
@@ -660,11 +651,22 @@ async function buildLineMessageContext(params) {
660
651
  kind: nativeMediaKind
661
652
  })) : nativeMediaKind ? [{ kind: nativeMediaKind }] : [];
662
653
  const rawBody = textContent;
663
- const agentBody = mediaUnavailable ? formatInboundMediaUnavailableText({
654
+ const shortfallNotice = params.missingParts ? `[line: ${params.missingParts === 1 ? "1 more image in this send was" : `${params.missingParts} more images in this send were`} not delivered]` : void 0;
655
+ const withShortfall = shortfallNotice ? formatInboundMediaUnavailableText({
664
656
  body: rawBody,
665
- notice: "[line attachment unavailable]"
657
+ notice: shortfallNotice
666
658
  }) : rawBody;
659
+ const agentBody = mediaUnavailable ? formatInboundMediaUnavailableText({
660
+ body: withShortfall,
661
+ notice: "[line attachment unavailable]"
662
+ }) : withShortfall;
667
663
  if (!agentBody && mediaFacts.length === 0) return null;
664
+ recordLineQuoteToken({
665
+ accountId: account.accountId,
666
+ chatId: peerId,
667
+ messageId,
668
+ quoteToken: readLineQuoteToken(message)
669
+ });
668
670
  let locationContext;
669
671
  if (message.type === "location") {
670
672
  const loc = message;
@@ -836,6 +838,39 @@ function isDownloadableLineMessageType(messageType) {
836
838
  function normalizeLineIngressEntry(value) {
837
839
  return normalizeLineAllowEntry(value) || null;
838
840
  }
841
+ /**
842
+ * Say one line back to a sender, preferring their reply token so the answer costs no
843
+ * push quota, and falling back to a push when no token is usable. A partial-delivery
844
+ * failure means the reply was seen, so it never falls back.
845
+ */
846
+ async function sendLineHandlerText(params) {
847
+ const { context, logLabel, text } = params;
848
+ const sendOptions = {
849
+ cfg: context.cfg,
850
+ accountId: context.account.accountId,
851
+ channelAccessToken: context.account.channelAccessToken,
852
+ ...params.authorize ? { authorize: params.authorize } : {}
853
+ };
854
+ if (params.replyToken) {
855
+ if (params.authorize && !await params.authorize()) return;
856
+ try {
857
+ await replyMessageLine(params.replyToken, [{
858
+ type: "text",
859
+ text
860
+ }], sendOptions);
861
+ return;
862
+ } catch (err) {
863
+ logVerbose(`${logLabel}: ${String(err)}`);
864
+ if (isChannelPartialDeliveryError(err)) return;
865
+ }
866
+ }
867
+ if (params.authorize && !await params.authorize()) return;
868
+ try {
869
+ await pushMessageLine(params.pushTarget, text, sendOptions);
870
+ } catch (err) {
871
+ logVerbose(`${logLabel}: ${String(err)}`);
872
+ }
873
+ }
839
874
  async function sendLinePairingReply(params) {
840
875
  const { senderId, replyToken, context } = params;
841
876
  const idLabel = (() => {
@@ -860,33 +895,18 @@ async function sendLinePairingReply(params) {
860
895
  onCreated: () => {
861
896
  logVerbose(`line pairing request sender=${senderId}`);
862
897
  },
863
- sendPairingReply: async (text) => {
864
- if (replyToken) try {
865
- await replyMessageLine(replyToken, [{
866
- type: "text",
867
- text
868
- }], {
869
- cfg: context.cfg,
870
- accountId: context.account.accountId,
871
- channelAccessToken: context.account.channelAccessToken
872
- });
873
- return;
874
- } catch (err) {
875
- logVerbose(`line pairing reply failed for ${senderId}: ${String(err)}`);
876
- if (isChannelPartialDeliveryError(err)) return;
877
- }
878
- try {
879
- await pushMessageLine(`line:${senderId}`, text, {
880
- cfg: context.cfg,
881
- accountId: context.account.accountId,
882
- channelAccessToken: context.account.channelAccessToken
883
- });
884
- } catch (err) {
885
- logVerbose(`line pairing reply failed for ${senderId}: ${String(err)}`);
886
- }
887
- }
898
+ sendPairingReply: async (text) => await sendLineHandlerText({
899
+ context,
900
+ text,
901
+ replyToken,
902
+ pushTarget: `line:${senderId}`,
903
+ logLabel: `line pairing reply failed for ${senderId}`
904
+ })
888
905
  });
889
906
  }
907
+ function isLineEventAdmitted(access) {
908
+ return access.senderAccess.decision === "allow" && (access.ingress.admission === "dispatch" || access.ingress.admission === "observe" || access.ingress.admission === "skip");
909
+ }
890
910
  async function resolveLineEventAdmission(event, context) {
891
911
  const { cfg, account } = context;
892
912
  const { userId, groupId, roomId, isGroup } = getLineSourceInfo(event.source);
@@ -928,7 +948,7 @@ async function resolveLineEventAdmission(event, context) {
928
948
  implicitMentionKinds: implicitMentionKindWhen("quoted_bot", quotesLineBotMessage(account.accountId, resolveLineQuotedMessageId(event.message)))
929
949
  };
930
950
  })();
931
- const resolveAccess = async (contextBinding) => await resolveStableChannelMessageIngress({
951
+ const resolveAccess = async (contextBinding) => await getLineRuntime().channel.inbound.ingress.resolveStable({
932
952
  channelId: "line",
933
953
  accountId: account.accountId,
934
954
  identity: {
@@ -983,7 +1003,7 @@ async function resolveLineEventAdmission(event, context) {
983
1003
  access,
984
1004
  resolveBoundAccess: resolveAccess
985
1005
  } : null;
986
- if (access.senderAccess.decision === "allow" && (access.ingress.admission === "dispatch" || access.ingress.admission === "observe" || access.ingress.admission === "skip")) return {
1006
+ if (isLineEventAdmitted(access)) return {
987
1007
  access,
988
1008
  resolveBoundAccess: resolveAccess,
989
1009
  mentions: mentionFacts ? {
@@ -1048,7 +1068,7 @@ function resolveEventRawText(event) {
1048
1068
  if (event.type === "postback") return event.postback?.data?.trim() ?? "";
1049
1069
  return "";
1050
1070
  }
1051
- async function handleMessageEvent(event, context) {
1071
+ async function handleMessageEvent(event, context, setParts) {
1052
1072
  const { cfg, account, runtime, mediaMaxBytes, processMessage } = context;
1053
1073
  const message = event.message;
1054
1074
  const decision = await resolveLineEventAdmission(event, context);
@@ -1098,11 +1118,12 @@ async function handleMessageEvent(event, context) {
1098
1118
  try {
1099
1119
  const allMedia = [];
1100
1120
  let mediaUnavailable = false;
1101
- if (isDownloadableLineMessageType(message.type)) {
1102
- const abortSignal = context.turnAdoptionLifecycle?.abortSignal;
1121
+ const abortSignal = context.turnAdoptionLifecycle?.abortSignal;
1122
+ for (const part of orderedLineSetMessages(message, setParts)) {
1123
+ if (!isDownloadableLineMessageType(part.type)) continue;
1103
1124
  try {
1104
- const originalFilename = message.type === "file" ? normalizeOptionalString(message.fileName) : void 0;
1105
- const media = await downloadLineMedia(message.id, account.channelAccessToken, mediaMaxBytes, {
1125
+ const originalFilename = part.type === "file" ? normalizeOptionalString(part.fileName) : void 0;
1126
+ const media = await downloadLineMedia(part.id, account.channelAccessToken, mediaMaxBytes, {
1106
1127
  originalFilename,
1107
1128
  ...abortSignal ? { signal: abortSignal } : {}
1108
1129
  });
@@ -1117,14 +1138,15 @@ async function handleMessageEvent(event, context) {
1117
1138
  if (isRetryableLineInboundMediaError(err)) throw err;
1118
1139
  mediaUnavailable = true;
1119
1140
  const errMsg = String(err);
1120
- if (errMsg.includes("exceeds") && errMsg.includes("limit")) logVerbose(`line: media exceeds size limit for message ${message.id}`);
1141
+ if (errMsg.includes("exceeds") && errMsg.includes("limit")) logVerbose(`line: media exceeds size limit for message ${part.id}`);
1121
1142
  else runtime.error?.(danger(`line: failed to download media: ${errMsg}`));
1122
1143
  }
1123
1144
  }
1124
1145
  const messageContext = await buildLineMessageContext({
1125
- event,
1126
- allMedia,
1146
+ event: setParts.reduce((freshest, part) => part.timestamp > freshest.timestamp ? part : freshest, event),
1147
+ allMedia: [...allMedia],
1127
1148
  mediaUnavailable,
1149
+ ...context.missingParts === void 0 ? {} : { missingParts: context.missingParts },
1128
1150
  cfg,
1129
1151
  account,
1130
1152
  commandAuthorized: decision.access.commandAccess.authorized,
@@ -1133,15 +1155,14 @@ async function handleMessageEvent(event, context) {
1133
1155
  mentions: decision.mentions,
1134
1156
  buildContext: context.buildContext
1135
1157
  });
1136
- if (!messageContext) {
1137
- logVerbose("line: skipping empty message");
1138
- return;
1158
+ if (!messageContext) logVerbose("line: skipping empty message");
1159
+ else {
1160
+ await processMessage(messageContext, {
1161
+ cfg: context.cfg,
1162
+ ...context.turnAdoptionLifecycle ? { turnAdoptionLifecycle: context.turnAdoptionLifecycle } : {}
1163
+ });
1164
+ historyReservation.commit();
1139
1165
  }
1140
- await processMessage(messageContext, {
1141
- cfg,
1142
- ...context.turnAdoptionLifecycle ? { turnAdoptionLifecycle: context.turnAdoptionLifecycle } : {}
1143
- });
1144
- historyReservation.commit();
1145
1166
  } finally {
1146
1167
  historyReservation.release();
1147
1168
  }
@@ -1195,11 +1216,39 @@ async function handleLeaveEvent(event, _context) {
1195
1216
  const { groupId, roomId } = getLineSourceInfo(event.source);
1196
1217
  logVerbose(`line: bot left ${groupId ? `group ${groupId}` : `room ${roomId}`}`);
1197
1218
  }
1219
+ /** What a tap that did not answer the question has to tell the person who tapped. */
1220
+ function lineQuestionOutcomeNotice(status) {
1221
+ if (status === "already-terminal") return "That question is no longer waiting for an answer.";
1222
+ return "Could not record that answer. Reply with the option text instead.";
1223
+ }
1198
1224
  async function handlePostbackEvent(event, context) {
1199
1225
  const data = event.postback.data;
1200
1226
  logVerbose(`line: received postback: ${data}`);
1201
1227
  const decision = await resolveLineEventAdmission(event, context);
1202
1228
  if (!decision) return;
1229
+ const question = parseLineQuestionPostbackData(data ?? "");
1230
+ if (question) {
1231
+ const { userId, groupId, roomId } = getLineSourceInfo(event.source);
1232
+ const authorize = async () => isLineEventAdmitted(await decision.resolveBoundAccess());
1233
+ const outcome = await resolveLineQuestionPostback({
1234
+ cfg: context.cfg,
1235
+ callback: question,
1236
+ accountId: context.account.accountId,
1237
+ ...userId ? { senderId: userId } : {},
1238
+ authorize
1239
+ });
1240
+ const pushTarget = groupId ?? roomId ?? (userId ? `line:${userId}` : void 0);
1241
+ if (outcome.status === "answered" || outcome.status === "denied" || !pushTarget) return;
1242
+ await sendLineHandlerText({
1243
+ context,
1244
+ replyToken: event.replyToken,
1245
+ pushTarget,
1246
+ logLabel: "line: question answer notice failed",
1247
+ text: lineQuestionOutcomeNotice(outcome.status),
1248
+ authorize
1249
+ });
1250
+ return;
1251
+ }
1203
1252
  const postbackContext = await buildLinePostbackContext({
1204
1253
  event,
1205
1254
  cfg: context.cfg,
@@ -1214,20 +1263,31 @@ async function handlePostbackEvent(event, context) {
1214
1263
  ...context.turnAdoptionLifecycle ? { turnAdoptionLifecycle: context.turnAdoptionLifecycle } : {}
1215
1264
  });
1216
1265
  }
1266
+ /** Media reads in the order the sender picked, whatever order LINE delivered. */
1267
+ function orderedLineSetMessages(message, setParts) {
1268
+ const messages = [message, ...setParts.map((partEvent) => partEvent.message)];
1269
+ const indexOf = (part) => part.type === "image" ? part.imageSet?.index ?? Number.MAX_SAFE_INTEGER : 0;
1270
+ return messages.toSorted((left, right) => indexOf(left) - indexOf(right));
1271
+ }
1272
+ /**
1273
+ * Answers one delivery as one turn. The ingress spool decides which events share
1274
+ * a turn - a multi-image send is handed over as one delivery - so the first
1275
+ * event is the turn's own and the rest are the set parts behind it.
1276
+ */
1217
1277
  async function handleLineWebhookEvents(events, context) {
1218
- let firstError;
1219
- for (const event of events) try {
1220
- await handleLineWebhookEvent(event, context);
1278
+ const [event, ...setParts] = events;
1279
+ if (!event) return;
1280
+ try {
1281
+ await handleLineWebhookEvent(event, context, setParts);
1221
1282
  } catch (err) {
1222
1283
  context.runtime.error?.(danger(`line: event handler failed: ${String(err)}`));
1223
- firstError ??= err;
1284
+ throw toErrorObject(err, "Non-Error thrown");
1224
1285
  }
1225
- if (firstError) throw toErrorObject(firstError, "Non-Error thrown");
1226
1286
  }
1227
- async function handleLineWebhookEvent(event, context) {
1287
+ async function handleLineWebhookEvent(event, context, setParts = []) {
1228
1288
  switch (event.type) {
1229
1289
  case "message":
1230
- await handleMessageEvent(event, context);
1290
+ await handleMessageEvent(event, context, setParts.filter((part) => part.type === "message"));
1231
1291
  break;
1232
1292
  case "follow":
1233
1293
  await handleFollowEvent(event, context);
@@ -1248,6 +1308,125 @@ async function handleLineWebhookEvent(event, context) {
1248
1308
  }
1249
1309
  }
1250
1310
  //#endregion
1311
+ //#region extensions/line/src/inbound-image-set.ts
1312
+ const IMAGE_SET_FLUSH_DELAY_MS = 4e3;
1313
+ /**
1314
+ * Ordered by the index the sender picked, falling back to arrival.
1315
+ *
1316
+ * `index` is optional per part in LINE's contract, so a set can arrive partly
1317
+ * indexed. Choosing the key per pair would make the comparator intransitive and
1318
+ * the resulting order depend on insertion; ranking unindexed parts last keeps
1319
+ * one total order for every mix.
1320
+ */
1321
+ function orderedParts(pending) {
1322
+ return [...pending.parts.values()].toSorted((left, right) => (left.index ?? Number.MAX_SAFE_INTEGER) - (right.index ?? Number.MAX_SAFE_INTEGER) || left.arrivedAt - right.arrivedAt);
1323
+ }
1324
+ /**
1325
+ * Buffers the parts of a LINE image set until the set is whole.
1326
+ *
1327
+ * The first part becomes the set's holder: its call does not resolve until the
1328
+ * set completes or its wait expires, and it is the one that delivers. Keeping
1329
+ * that call open is what keeps the combined turn inside a live ingress
1330
+ * adoption - a turn dispatched after every part had returned is refused by
1331
+ * admission, so a set that never completes would never be delivered at all.
1332
+ */
1333
+ function createLineImageSetIngressBuffer() {
1334
+ const pendingBySet = /* @__PURE__ */ new Map();
1335
+ const deliveredBySet = /* @__PURE__ */ new Map();
1336
+ const pendingKey = (laneKey, senderKey, setId) => `${laneKey}\u0000${senderKey}\u0000${setId}`;
1337
+ const laneChain = /* @__PURE__ */ new Map();
1338
+ const enterLane = async (laneKey) => {
1339
+ let release = () => {};
1340
+ const held = new Promise((resolve) => {
1341
+ release = resolve;
1342
+ });
1343
+ let entered = () => {};
1344
+ const turn = new Promise((resolve) => {
1345
+ entered = resolve;
1346
+ });
1347
+ enqueueKeyedTask({
1348
+ tails: laneChain,
1349
+ key: laneKey,
1350
+ task: async () => {
1351
+ entered();
1352
+ await held;
1353
+ }
1354
+ });
1355
+ await turn;
1356
+ return release;
1357
+ };
1358
+ const admit = async (input) => {
1359
+ const part = {
1360
+ index: input.index,
1361
+ arrivedAt: Date.now(),
1362
+ event: input.event,
1363
+ lifecycle: input.lifecycle
1364
+ };
1365
+ const key = pendingKey(input.laneKey, input.senderKey, input.setId);
1366
+ const forming = pendingBySet.get(key);
1367
+ if (forming) {
1368
+ forming.parts.set(input.messageId, part);
1369
+ forming.total ??= input.total;
1370
+ if (forming.total !== void 0 && forming.parts.size >= forming.total) {
1371
+ forming.release();
1372
+ return null;
1373
+ }
1374
+ if (forming.timer) {
1375
+ clearTimeout(forming.timer);
1376
+ forming.timer = setTimeout(forming.release, forming.flushDelayMs);
1377
+ forming.timer.unref?.();
1378
+ }
1379
+ return null;
1380
+ }
1381
+ let release = () => {};
1382
+ const whole = new Promise((resolve) => {
1383
+ release = resolve;
1384
+ });
1385
+ const pending = {
1386
+ parts: /* @__PURE__ */ new Map([[input.messageId, part]]),
1387
+ total: input.total,
1388
+ flushDelayMs: input.flushDelayMs ?? IMAGE_SET_FLUSH_DELAY_MS,
1389
+ release: () => {
1390
+ clearTimeout(pending.timer);
1391
+ release();
1392
+ }
1393
+ };
1394
+ pendingBySet.set(key, pending);
1395
+ const carried = deliveredBySet.get(key);
1396
+ if (carried) {
1397
+ clearTimeout(carried.timer);
1398
+ deliveredBySet.delete(key);
1399
+ }
1400
+ const carriedMessageIds = carried?.messageIds ?? /* @__PURE__ */ new Set();
1401
+ const releaseLane = await enterLane(input.laneKey);
1402
+ pending.timer = setTimeout(pending.release, pending.flushDelayMs);
1403
+ pending.timer.unref?.();
1404
+ if (pending.total !== void 0 && pending.parts.size >= pending.total) pending.release();
1405
+ await whole;
1406
+ pendingBySet.delete(key);
1407
+ const ordered = orderedParts(pending);
1408
+ const deliveredMessageIds = /* @__PURE__ */ new Set([...carriedMessageIds, ...pending.parts.keys()]);
1409
+ const missing = pending.total === void 0 ? 0 : pending.total - deliveredMessageIds.size;
1410
+ if (missing > 0) {
1411
+ const carry = { messageIds: deliveredMessageIds };
1412
+ carry.timer = setTimeout(() => deliveredBySet.delete(key), pending.flushDelayMs * 5);
1413
+ carry.timer.unref?.();
1414
+ deliveredBySet.set(key, carry);
1415
+ }
1416
+ return {
1417
+ events: ordered.map((entry) => entry.event),
1418
+ lifecycles: ordered.map((entry) => entry.lifecycle),
1419
+ ...missing > 0 ? { missing } : {},
1420
+ finish: releaseLane
1421
+ };
1422
+ };
1423
+ return {
1424
+ admit,
1425
+ enterLane,
1426
+ isBusy: (laneKey) => laneChain.has(laneKey)
1427
+ };
1428
+ }
1429
+ //#endregion
1251
1430
  //#region extensions/line/src/webhook-spool.ts
1252
1431
  const LINE_WEBHOOK_DRAIN_INTERVAL_MS = 500;
1253
1432
  const LINE_WEBHOOK_MAX_CONCURRENT_DELIVERIES = 8;
@@ -1285,7 +1464,24 @@ async function waitForActiveDeliveriesBeforeDispose(activeDeliveries) {
1285
1464
  if (timeout) clearTimeout(timeout);
1286
1465
  }
1287
1466
  }
1467
+ /** The imageSet a LINE inbound event belongs to, when it reported one. */
1468
+ function senderKeyFor(event) {
1469
+ const source = event.source;
1470
+ return source && "userId" in source && source.userId ? `user:${source.userId}` : "anonymous";
1471
+ }
1472
+ function resolveLineInboundImageSet(event) {
1473
+ if (event.type !== "message" || event.message.type !== "image") return;
1474
+ const imageSet = event.message.imageSet;
1475
+ return imageSet?.id ? {
1476
+ setId: imageSet.id,
1477
+ senderKey: senderKeyFor(event),
1478
+ messageId: event.message.id,
1479
+ ...imageSet.index === void 0 ? {} : { index: imageSet.index },
1480
+ ...imageSet.total === void 0 ? {} : { total: imageSet.total }
1481
+ } : void 0;
1482
+ }
1288
1483
  function createLineWebhookSpool(options) {
1484
+ const imageSets = createLineImageSetIngressBuffer();
1289
1485
  const queue = options.queue ?? getLineRuntime().state.openChannelIngressQueue({ accountId: options.accountId });
1290
1486
  const activeDeliveries = /* @__PURE__ */ new Set();
1291
1487
  let acceptsDeferredClaims = true;
@@ -1326,39 +1522,90 @@ function createLineWebhookSpool(options) {
1326
1522
  createClaimError: (kind) => new LineWebhookPayloadError(kind === "invalid-version" ? LINE_WEBHOOK_SPOOL_INVALID_PAYLOAD_MESSAGE : "LINE webhook event identity changed after durable admission.")
1327
1523
  },
1328
1524
  deliver: async ({ event, destination }, lifecycle) => {
1329
- const boundLifecycle = bindIngressLifecycleToReplyOptions(lifecycle).turnAdoptionLifecycle;
1525
+ const laneKey = laneKeyFor(event, eventIdFor(event));
1526
+ const imageSet = resolveLineInboundImageSet(event);
1527
+ let turnEvents = [event];
1528
+ let turnLifecycles = [lifecycle];
1529
+ let releaseLane;
1530
+ let missingParts;
1531
+ if (imageSet) {
1532
+ if (!acceptsDeferredClaims) {
1533
+ await lifecycle.onAbandoned();
1534
+ return;
1535
+ }
1536
+ lifecycle.onDeferred();
1537
+ const set = await imageSets.admit({
1538
+ laneKey,
1539
+ setId: imageSet.setId,
1540
+ senderKey: imageSet.senderKey,
1541
+ messageId: imageSet.messageId,
1542
+ event,
1543
+ lifecycle,
1544
+ ...imageSet.index === void 0 ? {} : { index: imageSet.index },
1545
+ ...imageSet.total === void 0 ? {} : { total: imageSet.total }
1546
+ });
1547
+ if (!set) return;
1548
+ if (set.missing) {
1549
+ missingParts = set.missing;
1550
+ options.runtime.error?.(danger(`line: image set ${imageSet.setId} delivered ${set.events.length} of the send's parts, ${set.missing} still missing`));
1551
+ }
1552
+ turnEvents = set.events;
1553
+ turnLifecycles = set.lifecycles;
1554
+ releaseLane = set.finish;
1555
+ } else if (imageSets.isBusy(laneKey)) {
1556
+ if (!acceptsDeferredClaims) {
1557
+ await lifecycle.onAbandoned();
1558
+ return;
1559
+ }
1560
+ lifecycle.onDeferred();
1561
+ releaseLane = await imageSets.enterLane(laneKey);
1562
+ }
1563
+ const fannedIn = fanInChannelIngressLifecycles(turnLifecycles);
1564
+ const boundLifecycle = bindIngressLifecycleToReplyOptions(fannedIn.lifecycle ?? lifecycle).turnAdoptionLifecycle;
1330
1565
  let handedOff = false;
1331
- const delivery = options.deliver(event, destination, { turnAdoptionLifecycle: {
1332
- ...boundLifecycle,
1333
- onAdopted: async () => {
1334
- handedOff = true;
1335
- await boundLifecycle.onAdopted();
1336
- },
1337
- onDeferred: () => {
1338
- handedOff = true;
1339
- if (!acceptsDeferredClaims) {
1340
- Promise.resolve().then(() => boundLifecycle.onAbandoned()).catch((error) => {
1341
- options.runtime.error?.(danger(`line: failed to abandon a late webhook delivery: ${formatErrorMessage(error)}`));
1342
- });
1343
- return;
1566
+ const delivery = options.deliver(turnEvents, destination, {
1567
+ ...missingParts === void 0 ? {} : { missingParts },
1568
+ turnAdoptionLifecycle: {
1569
+ ...boundLifecycle,
1570
+ onAdopted: async () => {
1571
+ handedOff = true;
1572
+ await boundLifecycle.onAdopted();
1573
+ },
1574
+ onDeferred: () => {
1575
+ handedOff = true;
1576
+ if (!acceptsDeferredClaims) {
1577
+ Promise.resolve().then(() => boundLifecycle.onAbandoned()).catch((error) => {
1578
+ options.runtime.error?.(danger(`line: failed to abandon a late webhook delivery: ${formatErrorMessage(error)}`));
1579
+ });
1580
+ return;
1581
+ }
1582
+ boundLifecycle.onDeferred();
1583
+ },
1584
+ onAbandoned: async () => {
1585
+ handedOff = true;
1586
+ await boundLifecycle.onAbandoned();
1344
1587
  }
1345
- boundLifecycle.onDeferred();
1346
- },
1347
- onAbandoned: async () => {
1348
- handedOff = true;
1349
- await boundLifecycle.onAbandoned();
1350
1588
  }
1351
- } });
1589
+ });
1352
1590
  activeDeliveries.add(delivery);
1353
1591
  try {
1354
1592
  await delivery;
1593
+ } catch (error) {
1594
+ await fannedIn.abandon(error);
1595
+ handedOff = true;
1596
+ throw error;
1355
1597
  } finally {
1356
1598
  activeDeliveries.delete(delivery);
1599
+ releaseLane?.();
1600
+ }
1601
+ if (!handedOff && !stopTask) {
1602
+ await fannedIn.settle();
1603
+ handedOff = true;
1604
+ }
1605
+ if (stopTask && !handedOff) {
1606
+ await fannedIn.abandon();
1607
+ return;
1357
1608
  }
1358
- if (stopTask && !handedOff) return {
1359
- kind: "failed-retryable",
1360
- error: /* @__PURE__ */ new Error("LINE webhook spool stopped before delivery handoff.")
1361
- };
1362
1609
  },
1363
1610
  pollIntervalMs: LINE_WEBHOOK_DRAIN_INTERVAL_MS,
1364
1611
  retention: {
@@ -1374,6 +1621,7 @@ function createLineWebhookSpool(options) {
1374
1621
  admissionMode: "durable-after-stop",
1375
1622
  drain: {
1376
1623
  adoptionStallTimeoutMs: DEFAULT_INGRESS_ADOPTION_STALL_MS,
1624
+ deferredLaneOccupancy: "release",
1377
1625
  orderBy: "received",
1378
1626
  scanLimit: LINE_WEBHOOK_DRAIN_SCAN_LIMIT,
1379
1627
  startLimit: LINE_WEBHOOK_MAX_CONCURRENT_DELIVERIES,
@@ -1457,9 +1705,9 @@ function createLineBot(opts) {
1457
1705
  const spool = createLineWebhookSpool({
1458
1706
  accountId: account.accountId,
1459
1707
  runtime,
1460
- deliver: async (event, _destination, control) => {
1708
+ deliver: async (events, _destination, control) => {
1461
1709
  const cfg = resolveTurnConfig();
1462
- await handleLineWebhookEvents([event], {
1710
+ await handleLineWebhookEvents([...events], {
1463
1711
  cfg,
1464
1712
  account,
1465
1713
  runtime,
@@ -1467,8 +1715,9 @@ function createLineBot(opts) {
1467
1715
  mediaMaxBytes,
1468
1716
  processMessage,
1469
1717
  ...control.turnAdoptionLifecycle ? { turnAdoptionLifecycle: control.turnAdoptionLifecycle } : {},
1718
+ ...control.missingParts === void 0 ? {} : { missingParts: control.missingParts },
1470
1719
  groupHistories,
1471
- historyLimit: account.config.historyLimit ?? cfg.messages?.groupChat?.historyLimit ?? DEFAULT_GROUP_HISTORY_LIMIT
1720
+ historyLimit: resolvePromptHistoryLimit(account.config.historyLimit ?? cfg.messages?.groupChat?.historyLimit)
1472
1721
  });
1473
1722
  }
1474
1723
  });
@@ -1501,6 +1750,18 @@ function validateLineSignature(body, signature, channelSecret) {
1501
1750
  }
1502
1751
  //#endregion
1503
1752
  //#region extensions/line/src/webhook-utils.ts
1753
+ /** Route the gateway serves when an account configures no `webhookPath`. */
1754
+ const LINE_DEFAULT_WEBHOOK_PATH = "/line/webhook";
1755
+ /** The route this account's monitor serves, which is the one an operator has to register
1756
+ * with LINE. Every surface resolves it here so a warning cannot name a path the gateway
1757
+ * does not answer on. Route registration canonicalizes further, and matches requests the
1758
+ * same way, so a path resolved here always reaches the route the monitor registered. */
1759
+ function resolveLineWebhookPath(webhookPath) {
1760
+ return resolveWebhookPath({
1761
+ webhookPath,
1762
+ defaultPath: LINE_DEFAULT_WEBHOOK_PATH
1763
+ }) ?? LINE_DEFAULT_WEBHOOK_PATH;
1764
+ }
1504
1765
  function parseLineWebhookBody(rawBody) {
1505
1766
  try {
1506
1767
  return JSON.parse(rawBody);
@@ -1661,9 +1922,15 @@ async function monitorLineProvider(opts) {
1661
1922
  const ingressLifecycle = deliveryControl.turnAdoptionLifecycle;
1662
1923
  const turnAbortSignal = ingressLifecycle?.abortSignal;
1663
1924
  const skillFilter = ctx.skillFilter;
1664
- const replyOptions = turnAbortSignal || skillFilter ? {
1925
+ const blockStreaming = resolveChannelStreamingBlockEnabled(resolveLineAccount({
1926
+ cfg: turnConfig,
1927
+ accountId: route.accountId
1928
+ }).config) ?? resolveChannelStreamingBlockEnabled(turnConfig.channels?.line);
1929
+ const disableBlockStreaming = typeof blockStreaming === "boolean" ? !blockStreaming : void 0;
1930
+ const replyOptions = turnAbortSignal || skillFilter || disableBlockStreaming !== void 0 ? {
1665
1931
  ...turnAbortSignal ? { abortSignal: turnAbortSignal } : {},
1666
- ...skillFilter ? { skillFilter } : {}
1932
+ ...skillFilter ? { skillFilter } : {},
1933
+ ...disableBlockStreaming !== void 0 ? { disableBlockStreaming } : {}
1667
1934
  } : void 0;
1668
1935
  try {
1669
1936
  const textLimit = 5e3;
@@ -1698,7 +1965,7 @@ async function monitorLineProvider(opts) {
1698
1965
  dispatcherOptions: { humanDelay: resolveHumanDelayConfig(turnConfig, route.agentId) },
1699
1966
  ...replyOptions ? { replyOptions } : {},
1700
1967
  delivery: {
1701
- preparePayload: prepareLineReplyPayload,
1968
+ preparePayload: (payload) => prepareLineReplyPayload(payload, ctxPayload.From),
1702
1969
  durable: (payload, info) => resolveLineDurableReplyOptions({
1703
1970
  payload,
1704
1971
  infoKind: info.kind,
@@ -1721,18 +1988,8 @@ async function monitorLineProvider(opts) {
1721
1988
  accountId: ctx.accountId,
1722
1989
  cfg: turnConfig,
1723
1990
  textLimit,
1724
- deps: {
1725
- buildTemplateMessageFromPayload,
1726
- processLineMessage,
1727
- chunkMarkdownText,
1728
- replyMessageLine,
1729
- pushMessagesLine,
1730
- createFlexMessage,
1731
- buildMediaMessage: buildLineMediaMessage,
1732
- createLocationMessage,
1733
- onReplyError: (replyErr) => {
1734
- logVerbose(`line: reply token failed, falling back to push: ${String(replyErr)}`);
1735
- }
1991
+ onReplyError: (replyErr) => {
1992
+ logVerbose(`line: reply token failed, falling back to push: ${String(replyErr)}`);
1736
1993
  }
1737
1994
  });
1738
1995
  replyTokenUsed = deliveryResult.replyTokenUsed;
@@ -1757,7 +2014,7 @@ async function monitorLineProvider(opts) {
1757
2014
  }
1758
2015
  }
1759
2016
  });
1760
- const normalizedPath = normalizeWebhookPath(normalizePluginHttpPath(webhookPath, "/line/webhook") ?? "/line/webhook");
2017
+ const normalizedPath = resolveLineWebhookPath(webhookPath);
1761
2018
  const webhookRouteKey = canonicalizeWebhookRouteKey(normalizedPath);
1762
2019
  const createScopedLineWebhookHandler = (target) => createLineNodeWebhookHandler({
1763
2020
  channelSecret: target.channelSecret,
@@ -1885,4 +2142,4 @@ async function monitorLineProvider(opts) {
1885
2142
  };
1886
2143
  }
1887
2144
  //#endregion
1888
- export { validateLineSignature as a, normalizeAllowFrom as c, parseLineWebhookBody as i, createLineNodeWebhookHandler as n, downloadLineMedia as o, readLineWebhookRequestBody as r, firstDefined as s, monitorLineProvider as t };
2145
+ export { resolveLineWebhookPath as a, parseLineWebhookBody as i, createLineNodeWebhookHandler as n, validateLineSignature as o, readLineWebhookRequestBody as r, downloadLineMedia as s, monitorLineProvider as t };