bailinghub 0.9.2 → 0.9.4

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 (1071) hide show
  1. package/.dockerignore +1 -0
  2. package/.gitignore +1 -0
  3. package/.npmignore +1 -0
  4. package/Dockerfile +1 -0
  5. package/README.en.md +6 -6
  6. package/README.md +6 -6
  7. package/SECURITY.md +3 -3
  8. package/THIRD_PARTY_NOTICES.md +7 -7
  9. package/docker-compose.images.yml +2 -2
  10. package/docs/CHANGELOG.en.md +23 -1
  11. package/docs/CHANGELOG.md +23 -1
  12. package/docs/CORE_RELIABILITY.en.md +22 -2
  13. package/docs/CORE_RELIABILITY.md +22 -2
  14. package/docs/DOCX_DEPENDENCY.en.md +26 -0
  15. package/docs/DOCX_DEPENDENCY.md +26 -0
  16. package/docs/IMPLEMENTATION_STATUS.en.md +23 -15
  17. package/docs/IMPLEMENTATION_STATUS.md +23 -15
  18. package/docs/INDEPENDENT_VALIDATION.en.md +4 -4
  19. package/docs/INDEPENDENT_VALIDATION.md +4 -4
  20. package/docs/NOTIFICATION_DURABILITY.en.md +47 -0
  21. package/docs/NOTIFICATION_DURABILITY.md +47 -0
  22. package/docs/OPERATIONS.en.md +17 -0
  23. package/docs/OPERATIONS.md +16 -0
  24. package/docs/README.en.md +7 -1
  25. package/docs/README.md +7 -1
  26. package/docs/RELEASE_NOTES_NEXT.en.md +3 -3
  27. package/docs/RELEASE_NOTES_NEXT.md +3 -3
  28. package/docs/RELEASE_NOTES_v0.9.3.en.md +51 -0
  29. package/docs/RELEASE_NOTES_v0.9.3.md +51 -0
  30. package/docs/RELEASE_NOTES_v0.9.4.en.md +42 -0
  31. package/docs/RELEASE_NOTES_v0.9.4.md +42 -0
  32. package/docs/TOOLS_DESIGN.md +1 -0
  33. package/docs/UPGRADE_v0.9.3.en.md +63 -0
  34. package/docs/UPGRADE_v0.9.3.md +63 -0
  35. package/docs/UPGRADE_v0.9.4.en.md +57 -0
  36. package/docs/UPGRADE_v0.9.4.md +57 -0
  37. package/node_modules/@xmldom/xmldom/CHANGELOG.md +533 -0
  38. package/node_modules/@xmldom/xmldom/LICENSE +8 -0
  39. package/node_modules/@xmldom/xmldom/SECURITY.md +50 -0
  40. package/node_modules/@xmldom/xmldom/index.d.ts +96 -0
  41. package/node_modules/@xmldom/xmldom/lib/.eslintrc.yml +2 -0
  42. package/node_modules/@xmldom/xmldom/lib/conventions.js +214 -0
  43. package/node_modules/@xmldom/xmldom/lib/dom-parser.js +322 -0
  44. package/node_modules/@xmldom/xmldom/lib/dom.js +2266 -0
  45. package/node_modules/@xmldom/xmldom/lib/entities.js +2166 -0
  46. package/node_modules/@xmldom/xmldom/lib/index.js +4 -0
  47. package/node_modules/@xmldom/xmldom/lib/sax.js +683 -0
  48. package/node_modules/@xmldom/xmldom/package.json +75 -0
  49. package/node_modules/@xmldom/xmldom/readme.md +356 -0
  50. package/node_modules/base64-js/LICENSE +21 -0
  51. package/node_modules/base64-js/README.md +34 -0
  52. package/node_modules/base64-js/base64js.min.js +1 -0
  53. package/node_modules/base64-js/index.d.ts +3 -0
  54. package/node_modules/base64-js/index.js +150 -0
  55. package/node_modules/base64-js/package.json +47 -0
  56. package/node_modules/bluebird/LICENSE +21 -0
  57. package/node_modules/bluebird/README.md +51 -0
  58. package/node_modules/bluebird/changelog.md +1 -0
  59. package/node_modules/bluebird/js/browser/bluebird.core.js +3739 -0
  60. package/node_modules/bluebird/js/browser/bluebird.core.min.js +31 -0
  61. package/node_modules/bluebird/js/browser/bluebird.js +5581 -0
  62. package/node_modules/bluebird/js/browser/bluebird.min.js +31 -0
  63. package/node_modules/bluebird/js/release/any.js +21 -0
  64. package/node_modules/bluebird/js/release/assert.js +55 -0
  65. package/node_modules/bluebird/js/release/async.js +161 -0
  66. package/node_modules/bluebird/js/release/bind.js +67 -0
  67. package/node_modules/bluebird/js/release/bluebird.js +11 -0
  68. package/node_modules/bluebird/js/release/call_get.js +123 -0
  69. package/node_modules/bluebird/js/release/cancel.js +129 -0
  70. package/node_modules/bluebird/js/release/catch_filter.js +42 -0
  71. package/node_modules/bluebird/js/release/context.js +69 -0
  72. package/node_modules/bluebird/js/release/debuggability.js +916 -0
  73. package/node_modules/bluebird/js/release/direct_resolve.js +46 -0
  74. package/node_modules/bluebird/js/release/each.js +30 -0
  75. package/node_modules/bluebird/js/release/errors.js +116 -0
  76. package/node_modules/bluebird/js/release/es5.js +80 -0
  77. package/node_modules/bluebird/js/release/filter.js +12 -0
  78. package/node_modules/bluebird/js/release/finally.js +111 -0
  79. package/node_modules/bluebird/js/release/generators.js +223 -0
  80. package/node_modules/bluebird/js/release/join.js +168 -0
  81. package/node_modules/bluebird/js/release/map.js +168 -0
  82. package/node_modules/bluebird/js/release/method.js +55 -0
  83. package/node_modules/bluebird/js/release/nodeback.js +51 -0
  84. package/node_modules/bluebird/js/release/nodeify.js +58 -0
  85. package/node_modules/bluebird/js/release/promise.js +773 -0
  86. package/node_modules/bluebird/js/release/promise_array.js +184 -0
  87. package/node_modules/bluebird/js/release/promisify.js +314 -0
  88. package/node_modules/bluebird/js/release/props.js +118 -0
  89. package/node_modules/bluebird/js/release/queue.js +73 -0
  90. package/node_modules/bluebird/js/release/race.js +49 -0
  91. package/node_modules/bluebird/js/release/reduce.js +172 -0
  92. package/node_modules/bluebird/js/release/schedule.js +61 -0
  93. package/node_modules/bluebird/js/release/settle.js +43 -0
  94. package/node_modules/bluebird/js/release/some.js +148 -0
  95. package/node_modules/bluebird/js/release/synchronous_inspection.js +103 -0
  96. package/node_modules/bluebird/js/release/thenables.js +86 -0
  97. package/node_modules/bluebird/js/release/timers.js +93 -0
  98. package/node_modules/bluebird/js/release/using.js +226 -0
  99. package/node_modules/bluebird/js/release/util.js +379 -0
  100. package/node_modules/bluebird/package.json +76 -0
  101. package/node_modules/core-util-is/LICENSE +19 -0
  102. package/node_modules/core-util-is/README.md +3 -0
  103. package/node_modules/core-util-is/lib/util.js +107 -0
  104. package/node_modules/core-util-is/package.json +38 -0
  105. package/node_modules/dingbat-to-unicode/README.md +79 -0
  106. package/node_modules/dingbat-to-unicode/dist/dingbats.d.ts +8 -0
  107. package/node_modules/dingbat-to-unicode/dist/dingbats.js +1066 -0
  108. package/node_modules/dingbat-to-unicode/dist/index.d.ts +7 -0
  109. package/node_modules/dingbat-to-unicode/dist/index.js +44 -0
  110. package/node_modules/dingbat-to-unicode/package.json +39 -0
  111. package/node_modules/duck/LICENSE +22 -0
  112. package/node_modules/duck/README.md +184 -0
  113. package/node_modules/duck/index.js +267 -0
  114. package/node_modules/duck/makefile +4 -0
  115. package/node_modules/duck/package.json +23 -0
  116. package/node_modules/duck/test/duck.test.js +160 -0
  117. package/node_modules/immediate/LICENSE.txt +20 -0
  118. package/node_modules/immediate/README.md +93 -0
  119. package/node_modules/immediate/dist/immediate.js +75 -0
  120. package/node_modules/immediate/dist/immediate.min.js +1 -0
  121. package/node_modules/immediate/lib/browser.js +69 -0
  122. package/node_modules/immediate/lib/index.js +73 -0
  123. package/node_modules/immediate/package.json +42 -0
  124. package/node_modules/inherits/LICENSE +16 -0
  125. package/node_modules/inherits/README.md +42 -0
  126. package/node_modules/inherits/inherits.js +9 -0
  127. package/node_modules/inherits/inherits_browser.js +27 -0
  128. package/node_modules/inherits/package.json +29 -0
  129. package/node_modules/isarray/.npmignore +1 -0
  130. package/node_modules/isarray/.travis.yml +4 -0
  131. package/node_modules/isarray/Makefile +6 -0
  132. package/node_modules/isarray/README.md +60 -0
  133. package/node_modules/isarray/component.json +19 -0
  134. package/node_modules/isarray/index.js +5 -0
  135. package/node_modules/isarray/package.json +45 -0
  136. package/node_modules/isarray/test.js +20 -0
  137. package/node_modules/jszip/.codeclimate.yml +16 -0
  138. package/node_modules/jszip/.editorconfig +8 -0
  139. package/node_modules/jszip/.eslintrc.js +43 -0
  140. package/node_modules/jszip/.github/workflows/pr.yaml +58 -0
  141. package/node_modules/jszip/.jekyll-metadata +0 -0
  142. package/node_modules/jszip/.travis.yml +17 -0
  143. package/node_modules/jszip/CHANGES.md +204 -0
  144. package/node_modules/jszip/LICENSE.markdown +651 -0
  145. package/node_modules/jszip/README.markdown +33 -0
  146. package/node_modules/jszip/deps.js +37 -0
  147. package/node_modules/jszip/dist/jszip.js +11577 -0
  148. package/node_modules/jszip/dist/jszip.min.js +13 -0
  149. package/node_modules/jszip/graph.svg +601 -0
  150. package/node_modules/jszip/index.d.ts +330 -0
  151. package/node_modules/jszip/lib/base64.js +106 -0
  152. package/node_modules/jszip/lib/compressedObject.js +74 -0
  153. package/node_modules/jszip/lib/compressions.js +14 -0
  154. package/node_modules/jszip/lib/crc32.js +77 -0
  155. package/node_modules/jszip/lib/defaults.js +11 -0
  156. package/node_modules/jszip/lib/external.js +18 -0
  157. package/node_modules/jszip/lib/flate.js +85 -0
  158. package/node_modules/jszip/lib/generate/ZipFileWorker.js +539 -0
  159. package/node_modules/jszip/lib/generate/index.js +57 -0
  160. package/node_modules/jszip/lib/index.js +55 -0
  161. package/node_modules/jszip/lib/license_header.js +11 -0
  162. package/node_modules/jszip/lib/load.js +88 -0
  163. package/node_modules/jszip/lib/nodejs/NodejsStreamInputAdapter.js +74 -0
  164. package/node_modules/jszip/lib/nodejs/NodejsStreamOutputAdapter.js +42 -0
  165. package/node_modules/jszip/lib/nodejsUtils.js +57 -0
  166. package/node_modules/jszip/lib/object.js +384 -0
  167. package/node_modules/jszip/lib/readable-stream-browser.js +10 -0
  168. package/node_modules/jszip/lib/reader/ArrayReader.js +57 -0
  169. package/node_modules/jszip/lib/reader/DataReader.js +116 -0
  170. package/node_modules/jszip/lib/reader/NodeBufferReader.js +19 -0
  171. package/node_modules/jszip/lib/reader/StringReader.js +38 -0
  172. package/node_modules/jszip/lib/reader/Uint8ArrayReader.js +22 -0
  173. package/node_modules/jszip/lib/reader/readerFor.js +28 -0
  174. package/node_modules/jszip/lib/signature.js +7 -0
  175. package/node_modules/jszip/lib/stream/ConvertWorker.js +26 -0
  176. package/node_modules/jszip/lib/stream/Crc32Probe.js +24 -0
  177. package/node_modules/jszip/lib/stream/DataLengthProbe.js +29 -0
  178. package/node_modules/jszip/lib/stream/DataWorker.js +116 -0
  179. package/node_modules/jszip/lib/stream/GenericWorker.js +263 -0
  180. package/node_modules/jszip/lib/stream/StreamHelper.js +214 -0
  181. package/node_modules/jszip/lib/support.js +38 -0
  182. package/node_modules/jszip/lib/utf8.js +275 -0
  183. package/node_modules/jszip/lib/utils.js +501 -0
  184. package/node_modules/jszip/lib/zipEntries.js +261 -0
  185. package/node_modules/jszip/lib/zipEntry.js +293 -0
  186. package/node_modules/jszip/lib/zipObject.js +133 -0
  187. package/node_modules/jszip/package.json +67 -0
  188. package/node_modules/jszip/sponsors.md +21 -0
  189. package/node_modules/jszip/tsconfig.json +101 -0
  190. package/node_modules/jszip/vendor/FileSaver.js +247 -0
  191. package/node_modules/lie/README.md +62 -0
  192. package/node_modules/lie/dist/lie.js +350 -0
  193. package/node_modules/lie/dist/lie.min.js +1 -0
  194. package/node_modules/lie/dist/lie.polyfill.js +358 -0
  195. package/node_modules/lie/dist/lie.polyfill.min.js +1 -0
  196. package/node_modules/lie/lib/browser.js +273 -0
  197. package/node_modules/lie/lib/index.js +298 -0
  198. package/node_modules/lie/license.md +7 -0
  199. package/node_modules/lie/lie.d.ts +244 -0
  200. package/node_modules/lie/package.json +69 -0
  201. package/node_modules/lie/polyfill.js +4 -0
  202. package/node_modules/lop/LICENSE +22 -0
  203. package/node_modules/lop/README.md +248 -0
  204. package/node_modules/lop/index.js +18 -0
  205. package/node_modules/lop/lib/StringSource.js +53 -0
  206. package/node_modules/lop/lib/Token.js +7 -0
  207. package/node_modules/lop/lib/TokenIterator.js +28 -0
  208. package/node_modules/lop/lib/bottom-up.js +128 -0
  209. package/node_modules/lop/lib/errors.js +22 -0
  210. package/node_modules/lop/lib/lazy-iterators.js +81 -0
  211. package/node_modules/lop/lib/parser.js +11 -0
  212. package/node_modules/lop/lib/parsing-results.js +103 -0
  213. package/node_modules/lop/lib/regex-tokeniser.js +70 -0
  214. package/node_modules/lop/lib/rules.js +313 -0
  215. package/node_modules/lop/lib/testing.js +69 -0
  216. package/node_modules/lop/makefile +4 -0
  217. package/node_modules/lop/package.json +24 -0
  218. package/node_modules/lop/test/StringSource.test.js +21 -0
  219. package/node_modules/lop/test/TokenIterator.test.js +17 -0
  220. package/node_modules/lop/test/Tokeniser.js +50 -0
  221. package/node_modules/lop/test/Tokeniser.test.js +38 -0
  222. package/node_modules/lop/test/bottom-up.test.js +187 -0
  223. package/node_modules/lop/test/errors.test.js +36 -0
  224. package/node_modules/lop/test/lazy-iterators.test.js +53 -0
  225. package/node_modules/lop/test/lop.test.js +27 -0
  226. package/node_modules/lop/test/regex-tokeniser.test.js +114 -0
  227. package/node_modules/lop/test/results.test.js +8 -0
  228. package/node_modules/lop/test/rules.test.js +617 -0
  229. package/node_modules/mammoth/LICENSE +22 -0
  230. package/node_modules/mammoth/SOURCE.json +57 -0
  231. package/node_modules/mammoth/browser/docx/files.js +14 -0
  232. package/node_modules/mammoth/browser/unzip.js +12 -0
  233. package/node_modules/mammoth/lib/document-to-html.js +469 -0
  234. package/node_modules/mammoth/lib/documents.js +254 -0
  235. package/node_modules/mammoth/lib/docx/body-reader.js +798 -0
  236. package/node_modules/mammoth/lib/docx/comments-reader.js +31 -0
  237. package/node_modules/mammoth/lib/docx/content-types-reader.js +58 -0
  238. package/node_modules/mammoth/lib/docx/document-xml-reader.js +30 -0
  239. package/node_modules/mammoth/lib/docx/docx-reader.js +226 -0
  240. package/node_modules/mammoth/lib/docx/files.js +80 -0
  241. package/node_modules/mammoth/lib/docx/notes-reader.js +28 -0
  242. package/node_modules/mammoth/lib/docx/numbering-xml.js +111 -0
  243. package/node_modules/mammoth/lib/docx/office-xml-reader.js +73 -0
  244. package/node_modules/mammoth/lib/docx/relationships-reader.js +43 -0
  245. package/node_modules/mammoth/lib/docx/style-map.js +75 -0
  246. package/node_modules/mammoth/lib/docx/styles-reader.js +90 -0
  247. package/node_modules/mammoth/lib/docx/uris.js +21 -0
  248. package/node_modules/mammoth/lib/html/ast.js +51 -0
  249. package/node_modules/mammoth/lib/html/index.js +41 -0
  250. package/node_modules/mammoth/lib/html/simplify.js +88 -0
  251. package/node_modules/mammoth/lib/images.js +31 -0
  252. package/node_modules/mammoth/lib/index.d.ts +86 -0
  253. package/node_modules/mammoth/lib/index.js +111 -0
  254. package/node_modules/mammoth/lib/options-reader.js +107 -0
  255. package/node_modules/mammoth/lib/promises.js +42 -0
  256. package/node_modules/mammoth/lib/raw-text.js +14 -0
  257. package/node_modules/mammoth/lib/results.js +72 -0
  258. package/node_modules/mammoth/lib/style-reader.js +365 -0
  259. package/node_modules/mammoth/lib/styles/document-matchers.js +100 -0
  260. package/node_modules/mammoth/lib/styles/html-paths.js +75 -0
  261. package/node_modules/mammoth/lib/styles/parser/tokeniser.js +30 -0
  262. package/node_modules/mammoth/lib/transforms.js +62 -0
  263. package/node_modules/mammoth/lib/underline.js +11 -0
  264. package/node_modules/mammoth/lib/unzip.js +20 -0
  265. package/node_modules/mammoth/lib/writers/html-writer.js +159 -0
  266. package/node_modules/mammoth/lib/writers/index.js +14 -0
  267. package/node_modules/mammoth/lib/writers/markdown-writer.js +163 -0
  268. package/node_modules/mammoth/lib/xml/index.js +8 -0
  269. package/node_modules/mammoth/lib/xml/nodes.js +70 -0
  270. package/node_modules/mammoth/lib/xml/reader.js +69 -0
  271. package/node_modules/mammoth/lib/xml/writer.js +61 -0
  272. package/node_modules/mammoth/lib/xml/xmldom.js +23 -0
  273. package/node_modules/mammoth/lib/zipfile.js +72 -0
  274. package/node_modules/mammoth/package.json +39 -0
  275. package/node_modules/mammoth/upstream-package.json +64 -0
  276. package/node_modules/option/.npmignore +1 -0
  277. package/node_modules/option/LICENSE +22 -0
  278. package/node_modules/option/README.md +101 -0
  279. package/node_modules/option/index.js +88 -0
  280. package/node_modules/option/package.json +23 -0
  281. package/node_modules/option/test/options.test.js +174 -0
  282. package/node_modules/pako/CHANGELOG.md +164 -0
  283. package/node_modules/pako/LICENSE +21 -0
  284. package/node_modules/pako/README.md +191 -0
  285. package/node_modules/pako/dist/pako.js +6818 -0
  286. package/node_modules/pako/dist/pako.min.js +1 -0
  287. package/node_modules/pako/dist/pako_deflate.js +3997 -0
  288. package/node_modules/pako/dist/pako_deflate.min.js +1 -0
  289. package/node_modules/pako/dist/pako_inflate.js +3300 -0
  290. package/node_modules/pako/dist/pako_inflate.min.js +1 -0
  291. package/node_modules/pako/index.js +14 -0
  292. package/node_modules/pako/lib/deflate.js +400 -0
  293. package/node_modules/pako/lib/inflate.js +423 -0
  294. package/node_modules/pako/lib/utils/common.js +105 -0
  295. package/node_modules/pako/lib/utils/strings.js +187 -0
  296. package/node_modules/pako/lib/zlib/README +59 -0
  297. package/node_modules/pako/lib/zlib/adler32.js +51 -0
  298. package/node_modules/pako/lib/zlib/constants.js +68 -0
  299. package/node_modules/pako/lib/zlib/crc32.js +59 -0
  300. package/node_modules/pako/lib/zlib/deflate.js +1874 -0
  301. package/node_modules/pako/lib/zlib/gzheader.js +58 -0
  302. package/node_modules/pako/lib/zlib/inffast.js +345 -0
  303. package/node_modules/pako/lib/zlib/inflate.js +1556 -0
  304. package/node_modules/pako/lib/zlib/inftrees.js +343 -0
  305. package/node_modules/pako/lib/zlib/messages.js +32 -0
  306. package/node_modules/pako/lib/zlib/trees.js +1222 -0
  307. package/node_modules/pako/lib/zlib/zstream.js +47 -0
  308. package/node_modules/pako/package.json +44 -0
  309. package/node_modules/path-is-absolute/index.js +20 -0
  310. package/node_modules/path-is-absolute/license +21 -0
  311. package/node_modules/path-is-absolute/package.json +43 -0
  312. package/node_modules/path-is-absolute/readme.md +59 -0
  313. package/node_modules/process-nextick-args/index.js +45 -0
  314. package/node_modules/process-nextick-args/license.md +19 -0
  315. package/node_modules/process-nextick-args/package.json +25 -0
  316. package/node_modules/process-nextick-args/readme.md +18 -0
  317. package/node_modules/readable-stream/.travis.yml +34 -0
  318. package/node_modules/readable-stream/CONTRIBUTING.md +38 -0
  319. package/node_modules/readable-stream/GOVERNANCE.md +136 -0
  320. package/node_modules/readable-stream/LICENSE +47 -0
  321. package/node_modules/readable-stream/README.md +58 -0
  322. package/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +60 -0
  323. package/node_modules/readable-stream/duplex-browser.js +1 -0
  324. package/node_modules/readable-stream/duplex.js +1 -0
  325. package/node_modules/readable-stream/lib/_stream_duplex.js +131 -0
  326. package/node_modules/readable-stream/lib/_stream_passthrough.js +47 -0
  327. package/node_modules/readable-stream/lib/_stream_readable.js +1019 -0
  328. package/node_modules/readable-stream/lib/_stream_transform.js +214 -0
  329. package/node_modules/readable-stream/lib/_stream_writable.js +685 -0
  330. package/node_modules/readable-stream/lib/internal/streams/BufferList.js +78 -0
  331. package/node_modules/readable-stream/lib/internal/streams/destroy.js +84 -0
  332. package/node_modules/readable-stream/lib/internal/streams/stream-browser.js +1 -0
  333. package/node_modules/readable-stream/lib/internal/streams/stream.js +1 -0
  334. package/node_modules/readable-stream/package.json +52 -0
  335. package/node_modules/readable-stream/passthrough.js +1 -0
  336. package/node_modules/readable-stream/readable-browser.js +7 -0
  337. package/node_modules/readable-stream/readable.js +19 -0
  338. package/node_modules/readable-stream/transform.js +1 -0
  339. package/node_modules/readable-stream/writable-browser.js +1 -0
  340. package/node_modules/readable-stream/writable.js +8 -0
  341. package/node_modules/safe-buffer/LICENSE +21 -0
  342. package/node_modules/safe-buffer/README.md +584 -0
  343. package/node_modules/safe-buffer/index.d.ts +187 -0
  344. package/node_modules/safe-buffer/index.js +62 -0
  345. package/node_modules/safe-buffer/package.json +37 -0
  346. package/node_modules/setimmediate/LICENSE.txt +20 -0
  347. package/node_modules/setimmediate/package.json +30 -0
  348. package/node_modules/setimmediate/setImmediate.js +186 -0
  349. package/node_modules/string_decoder/.travis.yml +50 -0
  350. package/node_modules/string_decoder/LICENSE +48 -0
  351. package/node_modules/string_decoder/README.md +47 -0
  352. package/node_modules/string_decoder/lib/string_decoder.js +296 -0
  353. package/node_modules/string_decoder/package.json +31 -0
  354. package/node_modules/underscore/LICENSE +22 -0
  355. package/node_modules/underscore/README.md +34 -0
  356. package/node_modules/underscore/amd/_baseCreate.js +21 -0
  357. package/node_modules/underscore/amd/_baseIteratee.js +15 -0
  358. package/node_modules/underscore/amd/_cb.js +12 -0
  359. package/node_modules/underscore/amd/_chainResult.js +10 -0
  360. package/node_modules/underscore/amd/_collectNonEnumProps.js +42 -0
  361. package/node_modules/underscore/amd/_createAssigner.js +24 -0
  362. package/node_modules/underscore/amd/_createEscaper.js +21 -0
  363. package/node_modules/underscore/amd/_createIndexFinder.js +30 -0
  364. package/node_modules/underscore/amd/_createPredicateIndexFinder.js +18 -0
  365. package/node_modules/underscore/amd/_createReduce.js +30 -0
  366. package/node_modules/underscore/amd/_createSizePropertyCheck.js +13 -0
  367. package/node_modules/underscore/amd/_deepGet.js +15 -0
  368. package/node_modules/underscore/amd/_escapeMap.js +15 -0
  369. package/node_modules/underscore/amd/_executeBound.js +16 -0
  370. package/node_modules/underscore/amd/_flatten.js +32 -0
  371. package/node_modules/underscore/amd/_getByteLength.js +8 -0
  372. package/node_modules/underscore/amd/_getLength.js +8 -0
  373. package/node_modules/underscore/amd/_group.js +18 -0
  374. package/node_modules/underscore/amd/_has.js +10 -0
  375. package/node_modules/underscore/amd/_hasObjectTag.js +7 -0
  376. package/node_modules/underscore/amd/_isArrayLike.js +11 -0
  377. package/node_modules/underscore/amd/_isBufferLike.js +9 -0
  378. package/node_modules/underscore/amd/_keyInObj.js +11 -0
  379. package/node_modules/underscore/amd/_methodFingerprint.js +44 -0
  380. package/node_modules/underscore/amd/_optimizeCb.js +27 -0
  381. package/node_modules/underscore/amd/_setup.js +70 -0
  382. package/node_modules/underscore/amd/_shallowProperty.js +12 -0
  383. package/node_modules/underscore/amd/_stringTagBug.js +19 -0
  384. package/node_modules/underscore/amd/_tagTester.js +13 -0
  385. package/node_modules/underscore/amd/_toBufferView.js +15 -0
  386. package/node_modules/underscore/amd/_toPath.js +11 -0
  387. package/node_modules/underscore/amd/_unescapeMap.js +8 -0
  388. package/node_modules/underscore/amd/after.js +14 -0
  389. package/node_modules/underscore/amd/allKeys.js +15 -0
  390. package/node_modules/underscore/amd/before.js +18 -0
  391. package/node_modules/underscore/amd/bind.js +15 -0
  392. package/node_modules/underscore/amd/bindAll.js +19 -0
  393. package/node_modules/underscore/amd/chain.js +12 -0
  394. package/node_modules/underscore/amd/chunk.js +17 -0
  395. package/node_modules/underscore/amd/clone.js +11 -0
  396. package/node_modules/underscore/amd/compact.js +10 -0
  397. package/node_modules/underscore/amd/compose.js +18 -0
  398. package/node_modules/underscore/amd/constant.js +12 -0
  399. package/node_modules/underscore/amd/contains.js +12 -0
  400. package/node_modules/underscore/amd/countBy.js +12 -0
  401. package/node_modules/underscore/amd/create.js +14 -0
  402. package/node_modules/underscore/amd/debounce.js +43 -0
  403. package/node_modules/underscore/amd/defaults.js +8 -0
  404. package/node_modules/underscore/amd/defer.js +9 -0
  405. package/node_modules/underscore/amd/delay.js +13 -0
  406. package/node_modules/underscore/amd/difference.js +14 -0
  407. package/node_modules/underscore/amd/each.js +25 -0
  408. package/node_modules/underscore/amd/escape.js +8 -0
  409. package/node_modules/underscore/amd/every.js +17 -0
  410. package/node_modules/underscore/amd/extend.js +8 -0
  411. package/node_modules/underscore/amd/extendOwn.js +10 -0
  412. package/node_modules/underscore/amd/filter.js +15 -0
  413. package/node_modules/underscore/amd/find.js +12 -0
  414. package/node_modules/underscore/amd/findIndex.js +8 -0
  415. package/node_modules/underscore/amd/findKey.js +15 -0
  416. package/node_modules/underscore/amd/findLastIndex.js +8 -0
  417. package/node_modules/underscore/amd/findWhere.js +11 -0
  418. package/node_modules/underscore/amd/first.js +13 -0
  419. package/node_modules/underscore/amd/flatten.js +11 -0
  420. package/node_modules/underscore/amd/functions.js +14 -0
  421. package/node_modules/underscore/amd/get.js +14 -0
  422. package/node_modules/underscore/amd/groupBy.js +11 -0
  423. package/node_modules/underscore/amd/has.js +19 -0
  424. package/node_modules/underscore/amd/identity.js +10 -0
  425. package/node_modules/underscore/amd/index-default.js +12 -0
  426. package/node_modules/underscore/amd/index.js +154 -0
  427. package/node_modules/underscore/amd/indexBy.js +11 -0
  428. package/node_modules/underscore/amd/indexOf.js +11 -0
  429. package/node_modules/underscore/amd/initial.js +12 -0
  430. package/node_modules/underscore/amd/intersection.js +22 -0
  431. package/node_modules/underscore/amd/invert.js +15 -0
  432. package/node_modules/underscore/amd/invoke.js +28 -0
  433. package/node_modules/underscore/amd/isArguments.js +19 -0
  434. package/node_modules/underscore/amd/isArray.js +9 -0
  435. package/node_modules/underscore/amd/isArrayBuffer.js +7 -0
  436. package/node_modules/underscore/amd/isBoolean.js +10 -0
  437. package/node_modules/underscore/amd/isDataView.js +17 -0
  438. package/node_modules/underscore/amd/isDate.js +7 -0
  439. package/node_modules/underscore/amd/isElement.js +10 -0
  440. package/node_modules/underscore/amd/isEmpty.js +18 -0
  441. package/node_modules/underscore/amd/isEqual.js +133 -0
  442. package/node_modules/underscore/amd/isError.js +7 -0
  443. package/node_modules/underscore/amd/isFinite.js +10 -0
  444. package/node_modules/underscore/amd/isFunction.js +18 -0
  445. package/node_modules/underscore/amd/isMap.js +7 -0
  446. package/node_modules/underscore/amd/isMatch.js +17 -0
  447. package/node_modules/underscore/amd/isNaN.js +10 -0
  448. package/node_modules/underscore/amd/isNull.js +10 -0
  449. package/node_modules/underscore/amd/isNumber.js +7 -0
  450. package/node_modules/underscore/amd/isObject.js +11 -0
  451. package/node_modules/underscore/amd/isRegExp.js +7 -0
  452. package/node_modules/underscore/amd/isSet.js +7 -0
  453. package/node_modules/underscore/amd/isString.js +7 -0
  454. package/node_modules/underscore/amd/isSymbol.js +7 -0
  455. package/node_modules/underscore/amd/isTypedArray.js +16 -0
  456. package/node_modules/underscore/amd/isUndefined.js +10 -0
  457. package/node_modules/underscore/amd/isWeakMap.js +7 -0
  458. package/node_modules/underscore/amd/isWeakSet.js +7 -0
  459. package/node_modules/underscore/amd/iteratee.js +13 -0
  460. package/node_modules/underscore/amd/keys.js +17 -0
  461. package/node_modules/underscore/amd/last.js +13 -0
  462. package/node_modules/underscore/amd/lastIndexOf.js +9 -0
  463. package/node_modules/underscore/amd/map.js +18 -0
  464. package/node_modules/underscore/amd/mapObject.js +19 -0
  465. package/node_modules/underscore/amd/matcher.js +14 -0
  466. package/node_modules/underscore/amd/max.js +30 -0
  467. package/node_modules/underscore/amd/memoize.js +17 -0
  468. package/node_modules/underscore/amd/min.js +30 -0
  469. package/node_modules/underscore/amd/mixin.js +18 -0
  470. package/node_modules/underscore/amd/negate.js +12 -0
  471. package/node_modules/underscore/amd/noop.js +8 -0
  472. package/node_modules/underscore/amd/now.js +10 -0
  473. package/node_modules/underscore/amd/object.js +20 -0
  474. package/node_modules/underscore/amd/omit.js +20 -0
  475. package/node_modules/underscore/amd/once.js +9 -0
  476. package/node_modules/underscore/amd/pairs.js +17 -0
  477. package/node_modules/underscore/amd/partial.js +25 -0
  478. package/node_modules/underscore/amd/partition.js +11 -0
  479. package/node_modules/underscore/amd/pick.js +25 -0
  480. package/node_modules/underscore/amd/pipe.js +13 -0
  481. package/node_modules/underscore/amd/pluck.js +10 -0
  482. package/node_modules/underscore/amd/property.js +14 -0
  483. package/node_modules/underscore/amd/propertyOf.js +13 -0
  484. package/node_modules/underscore/amd/random.js +14 -0
  485. package/node_modules/underscore/amd/range.js +27 -0
  486. package/node_modules/underscore/amd/reduce.js +9 -0
  487. package/node_modules/underscore/amd/reduceRight.js +8 -0
  488. package/node_modules/underscore/amd/reject.js +10 -0
  489. package/node_modules/underscore/amd/rest.js +12 -0
  490. package/node_modules/underscore/amd/restArguments.js +33 -0
  491. package/node_modules/underscore/amd/result.js +25 -0
  492. package/node_modules/underscore/amd/sample.js +27 -0
  493. package/node_modules/underscore/amd/shuffle.js +10 -0
  494. package/node_modules/underscore/amd/size.js +11 -0
  495. package/node_modules/underscore/amd/some.js +17 -0
  496. package/node_modules/underscore/amd/sortBy.js +26 -0
  497. package/node_modules/underscore/amd/sortedIndex.js +18 -0
  498. package/node_modules/underscore/amd/tap.js +13 -0
  499. package/node_modules/underscore/amd/template.js +103 -0
  500. package/node_modules/underscore/amd/templateSettings.js +13 -0
  501. package/node_modules/underscore/amd/throttle.js +51 -0
  502. package/node_modules/underscore/amd/times.js +13 -0
  503. package/node_modules/underscore/amd/toArray.js +18 -0
  504. package/node_modules/underscore/amd/toPath.js +12 -0
  505. package/node_modules/underscore/amd/underscore-array-methods.js +30 -0
  506. package/node_modules/underscore/amd/underscore.js +29 -0
  507. package/node_modules/underscore/amd/unescape.js +8 -0
  508. package/node_modules/underscore/amd/union.js +11 -0
  509. package/node_modules/underscore/amd/uniq.js +37 -0
  510. package/node_modules/underscore/amd/uniqueId.js +13 -0
  511. package/node_modules/underscore/amd/unzip.js +17 -0
  512. package/node_modules/underscore/amd/values.js +16 -0
  513. package/node_modules/underscore/amd/where.js +11 -0
  514. package/node_modules/underscore/amd/without.js +10 -0
  515. package/node_modules/underscore/amd/wrap.js +12 -0
  516. package/node_modules/underscore/amd/zip.js +9 -0
  517. package/node_modules/underscore/cjs/_baseCreate.js +20 -0
  518. package/node_modules/underscore/cjs/_baseIteratee.js +19 -0
  519. package/node_modules/underscore/cjs/_cb.js +12 -0
  520. package/node_modules/underscore/cjs/_chainResult.js +8 -0
  521. package/node_modules/underscore/cjs/_collectNonEnumProps.js +42 -0
  522. package/node_modules/underscore/cjs/_createAssigner.js +20 -0
  523. package/node_modules/underscore/cjs/_createEscaper.js +19 -0
  524. package/node_modules/underscore/cjs/_createIndexFinder.js +30 -0
  525. package/node_modules/underscore/cjs/_createPredicateIndexFinder.js +17 -0
  526. package/node_modules/underscore/cjs/_createReduce.js +30 -0
  527. package/node_modules/underscore/cjs/_createSizePropertyCheck.js +11 -0
  528. package/node_modules/underscore/cjs/_deepGet.js +11 -0
  529. package/node_modules/underscore/cjs/_escapeMap.js +11 -0
  530. package/node_modules/underscore/cjs/_executeBound.js +15 -0
  531. package/node_modules/underscore/cjs/_flatten.js +33 -0
  532. package/node_modules/underscore/cjs/_getByteLength.js +6 -0
  533. package/node_modules/underscore/cjs/_getLength.js +6 -0
  534. package/node_modules/underscore/cjs/_group.js +17 -0
  535. package/node_modules/underscore/cjs/_has.js +8 -0
  536. package/node_modules/underscore/cjs/_hasObjectTag.js +5 -0
  537. package/node_modules/underscore/cjs/_isArrayLike.js +10 -0
  538. package/node_modules/underscore/cjs/_isBufferLike.js +8 -0
  539. package/node_modules/underscore/cjs/_keyInObj.js +7 -0
  540. package/node_modules/underscore/cjs/_methodFingerprint.js +44 -0
  541. package/node_modules/underscore/cjs/_optimizeCb.js +23 -0
  542. package/node_modules/underscore/cjs/_setup.js +66 -0
  543. package/node_modules/underscore/cjs/_shallowProperty.js +8 -0
  544. package/node_modules/underscore/cjs/_stringTagBug.js +18 -0
  545. package/node_modules/underscore/cjs/_tagTester.js +11 -0
  546. package/node_modules/underscore/cjs/_toBufferView.js +13 -0
  547. package/node_modules/underscore/cjs/_toPath.js +10 -0
  548. package/node_modules/underscore/cjs/_unescapeMap.js +7 -0
  549. package/node_modules/underscore/cjs/after.js +10 -0
  550. package/node_modules/underscore/cjs/allKeys.js +15 -0
  551. package/node_modules/underscore/cjs/before.js +14 -0
  552. package/node_modules/underscore/cjs/bind.js +15 -0
  553. package/node_modules/underscore/cjs/bindAll.js +19 -0
  554. package/node_modules/underscore/cjs/chain.js +10 -0
  555. package/node_modules/underscore/cjs/chunk.js +15 -0
  556. package/node_modules/underscore/cjs/clone.js +11 -0
  557. package/node_modules/underscore/cjs/compact.js +8 -0
  558. package/node_modules/underscore/cjs/compose.js +14 -0
  559. package/node_modules/underscore/cjs/constant.js +8 -0
  560. package/node_modules/underscore/cjs/contains.js +12 -0
  561. package/node_modules/underscore/cjs/countBy.js +11 -0
  562. package/node_modules/underscore/cjs/create.js +13 -0
  563. package/node_modules/underscore/cjs/debounce.js +42 -0
  564. package/node_modules/underscore/cjs/defaults.js +7 -0
  565. package/node_modules/underscore/cjs/defer.js +9 -0
  566. package/node_modules/underscore/cjs/delay.js +11 -0
  567. package/node_modules/underscore/cjs/difference.js +15 -0
  568. package/node_modules/underscore/cjs/each.js +25 -0
  569. package/node_modules/underscore/cjs/escape.js +7 -0
  570. package/node_modules/underscore/cjs/every.js +17 -0
  571. package/node_modules/underscore/cjs/extend.js +7 -0
  572. package/node_modules/underscore/cjs/extendOwn.js +9 -0
  573. package/node_modules/underscore/cjs/filter.js +14 -0
  574. package/node_modules/underscore/cjs/find.js +12 -0
  575. package/node_modules/underscore/cjs/findIndex.js +6 -0
  576. package/node_modules/underscore/cjs/findKey.js +14 -0
  577. package/node_modules/underscore/cjs/findLastIndex.js +6 -0
  578. package/node_modules/underscore/cjs/findWhere.js +10 -0
  579. package/node_modules/underscore/cjs/first.js +11 -0
  580. package/node_modules/underscore/cjs/flatten.js +9 -0
  581. package/node_modules/underscore/cjs/functions.js +12 -0
  582. package/node_modules/underscore/cjs/get.js +14 -0
  583. package/node_modules/underscore/cjs/groupBy.js +10 -0
  584. package/node_modules/underscore/cjs/has.js +18 -0
  585. package/node_modules/underscore/cjs/identity.js +6 -0
  586. package/node_modules/underscore/cjs/index-default.js +11 -0
  587. package/node_modules/underscore/cjs/index.js +278 -0
  588. package/node_modules/underscore/cjs/indexBy.js +9 -0
  589. package/node_modules/underscore/cjs/indexOf.js +11 -0
  590. package/node_modules/underscore/cjs/initial.js +10 -0
  591. package/node_modules/underscore/cjs/intersection.js +21 -0
  592. package/node_modules/underscore/cjs/invert.js +13 -0
  593. package/node_modules/underscore/cjs/invoke.js +30 -0
  594. package/node_modules/underscore/cjs/isArguments.js +18 -0
  595. package/node_modules/underscore/cjs/isArray.js +8 -0
  596. package/node_modules/underscore/cjs/isArrayBuffer.js +5 -0
  597. package/node_modules/underscore/cjs/isBoolean.js +8 -0
  598. package/node_modules/underscore/cjs/isDataView.js +18 -0
  599. package/node_modules/underscore/cjs/isDate.js +5 -0
  600. package/node_modules/underscore/cjs/isElement.js +6 -0
  601. package/node_modules/underscore/cjs/isEmpty.js +20 -0
  602. package/node_modules/underscore/cjs/isEqual.js +140 -0
  603. package/node_modules/underscore/cjs/isError.js +5 -0
  604. package/node_modules/underscore/cjs/isFinite.js +9 -0
  605. package/node_modules/underscore/cjs/isFunction.js +17 -0
  606. package/node_modules/underscore/cjs/isMap.js +7 -0
  607. package/node_modules/underscore/cjs/isMatch.js +15 -0
  608. package/node_modules/underscore/cjs/isNaN.js +9 -0
  609. package/node_modules/underscore/cjs/isNull.js +6 -0
  610. package/node_modules/underscore/cjs/isNumber.js +5 -0
  611. package/node_modules/underscore/cjs/isObject.js +7 -0
  612. package/node_modules/underscore/cjs/isRegExp.js +5 -0
  613. package/node_modules/underscore/cjs/isSet.js +7 -0
  614. package/node_modules/underscore/cjs/isString.js +5 -0
  615. package/node_modules/underscore/cjs/isSymbol.js +5 -0
  616. package/node_modules/underscore/cjs/isTypedArray.js +17 -0
  617. package/node_modules/underscore/cjs/isUndefined.js +6 -0
  618. package/node_modules/underscore/cjs/isWeakMap.js +7 -0
  619. package/node_modules/underscore/cjs/isWeakSet.js +5 -0
  620. package/node_modules/underscore/cjs/iteratee.js +12 -0
  621. package/node_modules/underscore/cjs/keys.js +18 -0
  622. package/node_modules/underscore/cjs/last.js +11 -0
  623. package/node_modules/underscore/cjs/lastIndexOf.js +8 -0
  624. package/node_modules/underscore/cjs/map.js +18 -0
  625. package/node_modules/underscore/cjs/mapObject.js +18 -0
  626. package/node_modules/underscore/cjs/matcher.js +13 -0
  627. package/node_modules/underscore/cjs/max.js +31 -0
  628. package/node_modules/underscore/cjs/memoize.js +15 -0
  629. package/node_modules/underscore/cjs/min.js +31 -0
  630. package/node_modules/underscore/cjs/mixin.js +20 -0
  631. package/node_modules/underscore/cjs/negate.js +8 -0
  632. package/node_modules/underscore/cjs/noop.js +4 -0
  633. package/node_modules/underscore/cjs/now.js +6 -0
  634. package/node_modules/underscore/cjs/object.js +18 -0
  635. package/node_modules/underscore/cjs/omit.js +24 -0
  636. package/node_modules/underscore/cjs/once.js +8 -0
  637. package/node_modules/underscore/cjs/pairs.js +15 -0
  638. package/node_modules/underscore/cjs/partial.js +25 -0
  639. package/node_modules/underscore/cjs/partition.js +9 -0
  640. package/node_modules/underscore/cjs/pick.js +28 -0
  641. package/node_modules/underscore/cjs/pipe.js +12 -0
  642. package/node_modules/underscore/cjs/pluck.js +9 -0
  643. package/node_modules/underscore/cjs/property.js +13 -0
  644. package/node_modules/underscore/cjs/propertyOf.js +12 -0
  645. package/node_modules/underscore/cjs/random.js +10 -0
  646. package/node_modules/underscore/cjs/range.js +23 -0
  647. package/node_modules/underscore/cjs/reduce.js +7 -0
  648. package/node_modules/underscore/cjs/reduceRight.js +6 -0
  649. package/node_modules/underscore/cjs/reject.js +10 -0
  650. package/node_modules/underscore/cjs/rest.js +10 -0
  651. package/node_modules/underscore/cjs/restArguments.js +29 -0
  652. package/node_modules/underscore/cjs/result.js +24 -0
  653. package/node_modules/underscore/cjs/sample.js +29 -0
  654. package/node_modules/underscore/cjs/shuffle.js +8 -0
  655. package/node_modules/underscore/cjs/size.js +10 -0
  656. package/node_modules/underscore/cjs/some.js +17 -0
  657. package/node_modules/underscore/cjs/sortBy.js +26 -0
  658. package/node_modules/underscore/cjs/sortedIndex.js +17 -0
  659. package/node_modules/underscore/cjs/tap.js +9 -0
  660. package/node_modules/underscore/cjs/template.js +103 -0
  661. package/node_modules/underscore/cjs/templateSettings.js +11 -0
  662. package/node_modules/underscore/cjs/throttle.js +49 -0
  663. package/node_modules/underscore/cjs/times.js +11 -0
  664. package/node_modules/underscore/cjs/toArray.js +22 -0
  665. package/node_modules/underscore/cjs/toPath.js +11 -0
  666. package/node_modules/underscore/cjs/underscore-array-methods.js +31 -0
  667. package/node_modules/underscore/cjs/underscore.js +27 -0
  668. package/node_modules/underscore/cjs/unescape.js +7 -0
  669. package/node_modules/underscore/cjs/union.js +11 -0
  670. package/node_modules/underscore/cjs/uniq.js +38 -0
  671. package/node_modules/underscore/cjs/uniqueId.js +9 -0
  672. package/node_modules/underscore/cjs/unzip.js +17 -0
  673. package/node_modules/underscore/cjs/values.js +14 -0
  674. package/node_modules/underscore/cjs/where.js +10 -0
  675. package/node_modules/underscore/cjs/without.js +9 -0
  676. package/node_modules/underscore/cjs/wrap.js +10 -0
  677. package/node_modules/underscore/cjs/zip.js +8 -0
  678. package/node_modules/underscore/modules/.eslintrc +21 -0
  679. package/node_modules/underscore/modules/_baseCreate.js +18 -0
  680. package/node_modules/underscore/modules/_baseIteratee.js +17 -0
  681. package/node_modules/underscore/modules/_cb.js +10 -0
  682. package/node_modules/underscore/modules/_chainResult.js +6 -0
  683. package/node_modules/underscore/modules/_collectNonEnumProps.js +40 -0
  684. package/node_modules/underscore/modules/_createAssigner.js +18 -0
  685. package/node_modules/underscore/modules/_createEscaper.js +17 -0
  686. package/node_modules/underscore/modules/_createIndexFinder.js +28 -0
  687. package/node_modules/underscore/modules/_createPredicateIndexFinder.js +15 -0
  688. package/node_modules/underscore/modules/_createReduce.js +28 -0
  689. package/node_modules/underscore/modules/_createSizePropertyCheck.js +9 -0
  690. package/node_modules/underscore/modules/_deepGet.js +9 -0
  691. package/node_modules/underscore/modules/_escapeMap.js +9 -0
  692. package/node_modules/underscore/modules/_executeBound.js +13 -0
  693. package/node_modules/underscore/modules/_flatten.js +33 -0
  694. package/node_modules/underscore/modules/_getByteLength.js +4 -0
  695. package/node_modules/underscore/modules/_getLength.js +4 -0
  696. package/node_modules/underscore/modules/_group.js +15 -0
  697. package/node_modules/underscore/modules/_has.js +6 -0
  698. package/node_modules/underscore/modules/_hasObjectTag.js +3 -0
  699. package/node_modules/underscore/modules/_isArrayLike.js +8 -0
  700. package/node_modules/underscore/modules/_isBufferLike.js +6 -0
  701. package/node_modules/underscore/modules/_keyInObj.js +5 -0
  702. package/node_modules/underscore/modules/_methodFingerprint.js +37 -0
  703. package/node_modules/underscore/modules/_optimizeCb.js +21 -0
  704. package/node_modules/underscore/modules/_setup.js +43 -0
  705. package/node_modules/underscore/modules/_shallowProperty.js +6 -0
  706. package/node_modules/underscore/modules/_stringTagBug.js +13 -0
  707. package/node_modules/underscore/modules/_tagTester.js +9 -0
  708. package/node_modules/underscore/modules/_toBufferView.js +11 -0
  709. package/node_modules/underscore/modules/_toPath.js +8 -0
  710. package/node_modules/underscore/modules/_unescapeMap.js +5 -0
  711. package/node_modules/underscore/modules/after.js +8 -0
  712. package/node_modules/underscore/modules/allKeys.js +13 -0
  713. package/node_modules/underscore/modules/before.js +12 -0
  714. package/node_modules/underscore/modules/bind.js +13 -0
  715. package/node_modules/underscore/modules/bindAll.js +17 -0
  716. package/node_modules/underscore/modules/chain.js +8 -0
  717. package/node_modules/underscore/modules/chunk.js +13 -0
  718. package/node_modules/underscore/modules/clone.js +9 -0
  719. package/node_modules/underscore/modules/compact.js +6 -0
  720. package/node_modules/underscore/modules/compose.js +12 -0
  721. package/node_modules/underscore/modules/constant.js +6 -0
  722. package/node_modules/underscore/modules/contains.js +10 -0
  723. package/node_modules/underscore/modules/countBy.js +9 -0
  724. package/node_modules/underscore/modules/create.js +11 -0
  725. package/node_modules/underscore/modules/debounce.js +40 -0
  726. package/node_modules/underscore/modules/defaults.js +5 -0
  727. package/node_modules/underscore/modules/defer.js +7 -0
  728. package/node_modules/underscore/modules/delay.js +9 -0
  729. package/node_modules/underscore/modules/difference.js +13 -0
  730. package/node_modules/underscore/modules/each.js +23 -0
  731. package/node_modules/underscore/modules/escape.js +5 -0
  732. package/node_modules/underscore/modules/every.js +15 -0
  733. package/node_modules/underscore/modules/extend.js +5 -0
  734. package/node_modules/underscore/modules/extendOwn.js +7 -0
  735. package/node_modules/underscore/modules/filter.js +12 -0
  736. package/node_modules/underscore/modules/find.js +10 -0
  737. package/node_modules/underscore/modules/findIndex.js +4 -0
  738. package/node_modules/underscore/modules/findKey.js +12 -0
  739. package/node_modules/underscore/modules/findLastIndex.js +4 -0
  740. package/node_modules/underscore/modules/findWhere.js +8 -0
  741. package/node_modules/underscore/modules/first.js +9 -0
  742. package/node_modules/underscore/modules/flatten.js +7 -0
  743. package/node_modules/underscore/modules/functions.js +10 -0
  744. package/node_modules/underscore/modules/get.js +12 -0
  745. package/node_modules/underscore/modules/groupBy.js +8 -0
  746. package/node_modules/underscore/modules/has.js +16 -0
  747. package/node_modules/underscore/modules/identity.js +4 -0
  748. package/node_modules/underscore/modules/index-all.js +18 -0
  749. package/node_modules/underscore/modules/index-default.js +27 -0
  750. package/node_modules/underscore/modules/index.js +200 -0
  751. package/node_modules/underscore/modules/indexBy.js +7 -0
  752. package/node_modules/underscore/modules/indexOf.js +9 -0
  753. package/node_modules/underscore/modules/initial.js +8 -0
  754. package/node_modules/underscore/modules/intersection.js +19 -0
  755. package/node_modules/underscore/modules/invert.js +11 -0
  756. package/node_modules/underscore/modules/invoke.js +28 -0
  757. package/node_modules/underscore/modules/isArguments.js +16 -0
  758. package/node_modules/underscore/modules/isArray.js +6 -0
  759. package/node_modules/underscore/modules/isArrayBuffer.js +3 -0
  760. package/node_modules/underscore/modules/isBoolean.js +6 -0
  761. package/node_modules/underscore/modules/isDataView.js +16 -0
  762. package/node_modules/underscore/modules/isDate.js +3 -0
  763. package/node_modules/underscore/modules/isElement.js +4 -0
  764. package/node_modules/underscore/modules/isEmpty.js +18 -0
  765. package/node_modules/underscore/modules/isEqual.js +153 -0
  766. package/node_modules/underscore/modules/isError.js +3 -0
  767. package/node_modules/underscore/modules/isFinite.js +7 -0
  768. package/node_modules/underscore/modules/isFunction.js +15 -0
  769. package/node_modules/underscore/modules/isMap.js +5 -0
  770. package/node_modules/underscore/modules/isMatch.js +13 -0
  771. package/node_modules/underscore/modules/isNaN.js +7 -0
  772. package/node_modules/underscore/modules/isNull.js +4 -0
  773. package/node_modules/underscore/modules/isNumber.js +3 -0
  774. package/node_modules/underscore/modules/isObject.js +5 -0
  775. package/node_modules/underscore/modules/isRegExp.js +3 -0
  776. package/node_modules/underscore/modules/isSet.js +5 -0
  777. package/node_modules/underscore/modules/isString.js +3 -0
  778. package/node_modules/underscore/modules/isSymbol.js +3 -0
  779. package/node_modules/underscore/modules/isTypedArray.js +15 -0
  780. package/node_modules/underscore/modules/isUndefined.js +4 -0
  781. package/node_modules/underscore/modules/isWeakMap.js +5 -0
  782. package/node_modules/underscore/modules/isWeakSet.js +3 -0
  783. package/node_modules/underscore/modules/iteratee.js +10 -0
  784. package/node_modules/underscore/modules/keys.js +16 -0
  785. package/node_modules/underscore/modules/last.js +9 -0
  786. package/node_modules/underscore/modules/lastIndexOf.js +6 -0
  787. package/node_modules/underscore/modules/map.js +16 -0
  788. package/node_modules/underscore/modules/mapObject.js +16 -0
  789. package/node_modules/underscore/modules/matcher.js +11 -0
  790. package/node_modules/underscore/modules/max.js +29 -0
  791. package/node_modules/underscore/modules/memoize.js +13 -0
  792. package/node_modules/underscore/modules/min.js +29 -0
  793. package/node_modules/underscore/modules/mixin.js +18 -0
  794. package/node_modules/underscore/modules/negate.js +6 -0
  795. package/node_modules/underscore/modules/noop.js +2 -0
  796. package/node_modules/underscore/modules/now.js +4 -0
  797. package/node_modules/underscore/modules/object.js +16 -0
  798. package/node_modules/underscore/modules/omit.js +22 -0
  799. package/node_modules/underscore/modules/once.js +6 -0
  800. package/node_modules/underscore/modules/package.json +1 -0
  801. package/node_modules/underscore/modules/pairs.js +13 -0
  802. package/node_modules/underscore/modules/partial.js +24 -0
  803. package/node_modules/underscore/modules/partition.js +7 -0
  804. package/node_modules/underscore/modules/pick.js +26 -0
  805. package/node_modules/underscore/modules/pluck.js +7 -0
  806. package/node_modules/underscore/modules/property.js +11 -0
  807. package/node_modules/underscore/modules/propertyOf.js +10 -0
  808. package/node_modules/underscore/modules/random.js +8 -0
  809. package/node_modules/underscore/modules/range.js +21 -0
  810. package/node_modules/underscore/modules/reduce.js +5 -0
  811. package/node_modules/underscore/modules/reduceRight.js +4 -0
  812. package/node_modules/underscore/modules/reject.js +8 -0
  813. package/node_modules/underscore/modules/rest.js +8 -0
  814. package/node_modules/underscore/modules/restArguments.js +27 -0
  815. package/node_modules/underscore/modules/result.js +22 -0
  816. package/node_modules/underscore/modules/sample.js +27 -0
  817. package/node_modules/underscore/modules/shuffle.js +6 -0
  818. package/node_modules/underscore/modules/size.js +8 -0
  819. package/node_modules/underscore/modules/some.js +15 -0
  820. package/node_modules/underscore/modules/sortBy.js +24 -0
  821. package/node_modules/underscore/modules/sortedIndex.js +15 -0
  822. package/node_modules/underscore/modules/tap.js +7 -0
  823. package/node_modules/underscore/modules/template.js +101 -0
  824. package/node_modules/underscore/modules/templateSettings.js +9 -0
  825. package/node_modules/underscore/modules/throttle.js +47 -0
  826. package/node_modules/underscore/modules/times.js +9 -0
  827. package/node_modules/underscore/modules/toArray.js +20 -0
  828. package/node_modules/underscore/modules/toPath.js +9 -0
  829. package/node_modules/underscore/modules/underscore-array-methods.js +31 -0
  830. package/node_modules/underscore/modules/underscore.js +25 -0
  831. package/node_modules/underscore/modules/unescape.js +5 -0
  832. package/node_modules/underscore/modules/union.js +9 -0
  833. package/node_modules/underscore/modules/uniq.js +36 -0
  834. package/node_modules/underscore/modules/uniqueId.js +7 -0
  835. package/node_modules/underscore/modules/unzip.js +15 -0
  836. package/node_modules/underscore/modules/values.js +12 -0
  837. package/node_modules/underscore/modules/where.js +8 -0
  838. package/node_modules/underscore/modules/without.js +7 -0
  839. package/node_modules/underscore/modules/wrap.js +8 -0
  840. package/node_modules/underscore/modules/zip.js +6 -0
  841. package/node_modules/underscore/package.json +124 -0
  842. package/node_modules/underscore/underscore-esm-min.js +5 -0
  843. package/node_modules/underscore/underscore-esm-min.js.map +1 -0
  844. package/node_modules/underscore/underscore-esm.js +2056 -0
  845. package/node_modules/underscore/underscore-esm.js.map +1 -0
  846. package/node_modules/underscore/underscore-min.js +6 -0
  847. package/node_modules/underscore/underscore-min.js.map +1 -0
  848. package/node_modules/underscore/underscore-node-f.cjs +2180 -0
  849. package/node_modules/underscore/underscore-node-f.cjs.map +1 -0
  850. package/node_modules/underscore/underscore-node.cjs +11 -0
  851. package/node_modules/underscore/underscore-node.cjs.map +1 -0
  852. package/node_modules/underscore/underscore-node.mjs +7 -0
  853. package/node_modules/underscore/underscore-node.mjs.map +1 -0
  854. package/node_modules/underscore/underscore-umd-min.js +6 -0
  855. package/node_modules/underscore/underscore-umd-min.js.map +1 -0
  856. package/node_modules/underscore/underscore-umd.js +2064 -0
  857. package/node_modules/underscore/underscore-umd.js.map +1 -0
  858. package/node_modules/underscore/underscore.js +2064 -0
  859. package/node_modules/util-deprecate/History.md +16 -0
  860. package/node_modules/util-deprecate/LICENSE +24 -0
  861. package/node_modules/util-deprecate/README.md +53 -0
  862. package/node_modules/util-deprecate/browser.js +67 -0
  863. package/node_modules/util-deprecate/node.js +6 -0
  864. package/node_modules/util-deprecate/package.json +27 -0
  865. package/node_modules/xmlbuilder/CHANGELOG.md +438 -0
  866. package/node_modules/xmlbuilder/LICENSE +21 -0
  867. package/node_modules/xmlbuilder/README.md +86 -0
  868. package/node_modules/xmlbuilder/appveyor.yml +20 -0
  869. package/node_modules/xmlbuilder/lib/Utility.js +83 -0
  870. package/node_modules/xmlbuilder/lib/XMLAttribute.js +41 -0
  871. package/node_modules/xmlbuilder/lib/XMLCData.js +32 -0
  872. package/node_modules/xmlbuilder/lib/XMLComment.js +32 -0
  873. package/node_modules/xmlbuilder/lib/XMLDTDAttList.js +50 -0
  874. package/node_modules/xmlbuilder/lib/XMLDTDElement.js +35 -0
  875. package/node_modules/xmlbuilder/lib/XMLDTDEntity.js +56 -0
  876. package/node_modules/xmlbuilder/lib/XMLDTDNotation.js +37 -0
  877. package/node_modules/xmlbuilder/lib/XMLDeclaration.js +40 -0
  878. package/node_modules/xmlbuilder/lib/XMLDocType.js +108 -0
  879. package/node_modules/xmlbuilder/lib/XMLDocument.js +49 -0
  880. package/node_modules/xmlbuilder/lib/XMLDocumentCB.js +414 -0
  881. package/node_modules/xmlbuilder/lib/XMLDummy.js +29 -0
  882. package/node_modules/xmlbuilder/lib/XMLElement.js +111 -0
  883. package/node_modules/xmlbuilder/lib/XMLNode.js +467 -0
  884. package/node_modules/xmlbuilder/lib/XMLProcessingInstruction.js +35 -0
  885. package/node_modules/xmlbuilder/lib/XMLRaw.js +32 -0
  886. package/node_modules/xmlbuilder/lib/XMLStreamWriter.js +287 -0
  887. package/node_modules/xmlbuilder/lib/XMLStringWriter.js +341 -0
  888. package/node_modules/xmlbuilder/lib/XMLStringifier.js +163 -0
  889. package/node_modules/xmlbuilder/lib/XMLText.js +32 -0
  890. package/node_modules/xmlbuilder/lib/XMLWriterBase.js +90 -0
  891. package/node_modules/xmlbuilder/lib/index.js +53 -0
  892. package/node_modules/xmlbuilder/package.json +37 -0
  893. package/package.json +13 -5
  894. package/scripts/check-doc-links.mjs +4 -0
  895. package/scripts/check-image-tags.sh +1 -1
  896. package/scripts/check-package-artifact.mjs +19 -0
  897. package/scripts/check-release-consistency.test.mjs +2 -2
  898. package/scripts/dependency-audit.mjs +49 -96
  899. package/scripts/dependency-audit.test.mjs +70 -106
  900. package/scripts/docx-browser-test.mjs +56 -0
  901. package/scripts/docx-compatibility.test.mjs +39 -0
  902. package/scripts/docx-fixtures.mjs +19 -0
  903. package/scripts/export-oss.mjs +3 -0
  904. package/scripts/generate-third-party-notices.mjs +6 -2
  905. package/scripts/install.sh +1 -1
  906. package/scripts/notification-console-test.mjs +172 -0
  907. package/scripts/oss-boundary-check.mjs +3 -1
  908. package/scripts/publish-images.sh +1 -1
  909. package/scripts/release-audit.mjs +9 -1
  910. package/scripts/vendor-mammoth.mjs +130 -0
  911. package/scripts/verify-github-repo.mjs +8 -0
  912. package/scripts/verify-oss-export.mjs +3 -0
  913. package/sql/067_delivery_dlq_replay.sql +10 -0
  914. package/sql/068_notification_outbox.sql +28 -0
  915. package/sql/README.en.md +14 -0
  916. package/sql/README.md +14 -0
  917. package/src/adapters/llm/file.test.ts +59 -0
  918. package/src/adapters/llm/file.ts +11 -4
  919. package/src/app/agent-tool-invocations.test.ts +3 -1
  920. package/src/app/approval-continuations.mysql.test.ts +1 -1
  921. package/src/app/approval-continuations.test.ts +27 -1
  922. package/src/app/approval-continuations.ts +44 -3
  923. package/src/app/channels-attachments.test.ts +63 -0
  924. package/src/app/channels.ts +7 -4
  925. package/src/app/delivery-dlq-replay.mysql.test.ts +139 -0
  926. package/src/app/delivery-dlq-replay.test.ts +75 -0
  927. package/src/app/delivery-dlq-replay.ts +41 -0
  928. package/src/app/delivery.ts +118 -3
  929. package/src/app/engine.ts +5 -4
  930. package/src/app/kernel-notification-lifecycle.test.ts +49 -0
  931. package/src/app/kernel-usage-lifecycle.mysql.test.ts +1 -1
  932. package/src/app/kernel.ts +17 -0
  933. package/src/app/notification-outbound.test.ts +53 -0
  934. package/src/app/notification-outbox.test.ts +321 -0
  935. package/src/app/notification-outbox.ts +123 -0
  936. package/src/app/operational-metrics.test.ts +52 -1
  937. package/src/app/operational-metrics.ts +34 -2
  938. package/src/app/outbound.ts +41 -2
  939. package/src/app/runtime-evidence-maintenance.test.ts +34 -1
  940. package/src/app/runtime-lifecycle-default.ts +7 -0
  941. package/src/app/runtime-lifecycle.test.ts +89 -0
  942. package/src/app/runtime-lifecycle.ts +28 -18
  943. package/src/app/tool-approvals.ts +69 -31
  944. package/src/core/contracts/delivery-replay.ts +42 -0
  945. package/src/core/contracts/notification-outbox.ts +54 -0
  946. package/src/core/contracts/tools-idempotency.test.ts +121 -5
  947. package/src/core/contracts/tools.ts +21 -11
  948. package/src/core/contracts/types.ts +2 -0
  949. package/src/core/observability/openmetrics.test.ts +46 -0
  950. package/src/core/observability/openmetrics.ts +108 -0
  951. package/src/core/platform/http-body.test.ts +185 -0
  952. package/src/core/platform/http-body.ts +58 -0
  953. package/src/core/runtime/finish-runtime.test.ts +22 -0
  954. package/src/core/runtime/finish-runtime.ts +21 -10
  955. package/src/core/runtime/inhub-runtime.ts +10 -2
  956. package/src/core/runtime/notification-background-work.test.ts +50 -0
  957. package/src/core/runtime/notification-background-work.ts +101 -0
  958. package/src/core/runtime/notification-outbox-work.ts +15 -0
  959. package/src/core/state/delivery-replay.ts +19 -0
  960. package/src/core/state/notification-outbox.ts +66 -0
  961. package/src/core/state/state-codec.ts +1 -0
  962. package/src/core/state/state-contracts.ts +7 -0
  963. package/src/infrastructure/config/config-approval-ledger.ts +23 -1
  964. package/src/infrastructure/config/config-delivery-dlq-ledger.ts +51 -12
  965. package/src/infrastructure/config/configstore.ts +8 -3
  966. package/src/infrastructure/state/notification-outbox-jsonl.ts +80 -0
  967. package/src/infrastructure/state/notification-outbox-mysql.ts +100 -0
  968. package/src/infrastructure/state/notification-outbox-storage.test.ts +325 -0
  969. package/src/infrastructure/state/state-jsonl.ts +80 -14
  970. package/src/infrastructure/state/state-mysql.ts +63 -5
  971. package/src/modules/usage/background-work.test.ts +28 -0
  972. package/src/modules/usage/background-work.ts +43 -7
  973. package/src/modules/usage/billing-reconciliation.test.ts +16 -2
  974. package/src/modules/usage/billing-repository.ts +9 -0
  975. package/src/modules/usage/maintenance.test.ts +18 -2
  976. package/src/modules/usage/maintenance.ts +8 -0
  977. package/src/routes/admin-notifications.test.ts +75 -0
  978. package/src/routes/admin-notifications.ts +77 -0
  979. package/src/routes/admin-runtime.test.ts +25 -0
  980. package/src/routes/admin-runtime.ts +29 -0
  981. package/src/routes/admin.ts +1 -0
  982. package/src/test-support/notification-outbox-journal-crash-child.ts +20 -0
  983. package/vendor/bailinghub-mammoth-library-1.12.0-bailinghub.1.tgz +0 -0
  984. package/vendor/mammoth-library/LICENSE +22 -0
  985. package/vendor/mammoth-library/SOURCE.json +57 -0
  986. package/vendor/mammoth-library/browser/docx/files.js +14 -0
  987. package/vendor/mammoth-library/browser/unzip.js +12 -0
  988. package/vendor/mammoth-library/lib/document-to-html.js +469 -0
  989. package/vendor/mammoth-library/lib/documents.js +254 -0
  990. package/vendor/mammoth-library/lib/docx/body-reader.js +798 -0
  991. package/vendor/mammoth-library/lib/docx/comments-reader.js +31 -0
  992. package/vendor/mammoth-library/lib/docx/content-types-reader.js +58 -0
  993. package/vendor/mammoth-library/lib/docx/document-xml-reader.js +30 -0
  994. package/vendor/mammoth-library/lib/docx/docx-reader.js +226 -0
  995. package/vendor/mammoth-library/lib/docx/files.js +80 -0
  996. package/vendor/mammoth-library/lib/docx/notes-reader.js +28 -0
  997. package/vendor/mammoth-library/lib/docx/numbering-xml.js +111 -0
  998. package/vendor/mammoth-library/lib/docx/office-xml-reader.js +73 -0
  999. package/vendor/mammoth-library/lib/docx/relationships-reader.js +43 -0
  1000. package/vendor/mammoth-library/lib/docx/style-map.js +75 -0
  1001. package/vendor/mammoth-library/lib/docx/styles-reader.js +90 -0
  1002. package/vendor/mammoth-library/lib/docx/uris.js +21 -0
  1003. package/vendor/mammoth-library/lib/html/ast.js +51 -0
  1004. package/vendor/mammoth-library/lib/html/index.js +41 -0
  1005. package/vendor/mammoth-library/lib/html/simplify.js +88 -0
  1006. package/vendor/mammoth-library/lib/images.js +31 -0
  1007. package/vendor/mammoth-library/lib/index.d.ts +86 -0
  1008. package/vendor/mammoth-library/lib/index.js +111 -0
  1009. package/vendor/mammoth-library/lib/options-reader.js +107 -0
  1010. package/vendor/mammoth-library/lib/promises.js +42 -0
  1011. package/vendor/mammoth-library/lib/raw-text.js +14 -0
  1012. package/vendor/mammoth-library/lib/results.js +72 -0
  1013. package/vendor/mammoth-library/lib/style-reader.js +365 -0
  1014. package/vendor/mammoth-library/lib/styles/document-matchers.js +100 -0
  1015. package/vendor/mammoth-library/lib/styles/html-paths.js +75 -0
  1016. package/vendor/mammoth-library/lib/styles/parser/tokeniser.js +30 -0
  1017. package/vendor/mammoth-library/lib/transforms.js +62 -0
  1018. package/vendor/mammoth-library/lib/underline.js +11 -0
  1019. package/vendor/mammoth-library/lib/unzip.js +20 -0
  1020. package/vendor/mammoth-library/lib/writers/html-writer.js +159 -0
  1021. package/vendor/mammoth-library/lib/writers/index.js +14 -0
  1022. package/vendor/mammoth-library/lib/writers/markdown-writer.js +163 -0
  1023. package/vendor/mammoth-library/lib/xml/index.js +8 -0
  1024. package/vendor/mammoth-library/lib/xml/nodes.js +70 -0
  1025. package/vendor/mammoth-library/lib/xml/reader.js +69 -0
  1026. package/vendor/mammoth-library/lib/xml/writer.js +61 -0
  1027. package/vendor/mammoth-library/lib/xml/xmldom.js +23 -0
  1028. package/vendor/mammoth-library/lib/zipfile.js +72 -0
  1029. package/vendor/mammoth-library/package.json +39 -0
  1030. package/vendor/mammoth-library/upstream-package.json +64 -0
  1031. package/vendor/mammoth-library-distribution.json +4 -0
  1032. package/web/console/assets/{Accounts-DKhw_QLr.js → Accounts-Dhj6PjXP.js} +1 -1
  1033. package/web/console/assets/{AgentClients-CM4_5HaA.js → AgentClients-CMy8StAH.js} +1 -1
  1034. package/web/console/assets/{AgentTasks-CkQgZTU5.js → AgentTasks-DA1xZdmP.js} +1 -1
  1035. package/web/console/assets/{Approvals-B9O9TkbO.js → Approvals-DIsd7R8N.js} +1 -1
  1036. package/web/console/assets/{Audit-2vDC1SPu.js → Audit-AUDABLTX.js} +1 -1
  1037. package/web/console/assets/{BrandLockup-BgASiRSE.js → BrandLockup-CffORQse.js} +1 -1
  1038. package/web/console/assets/{Channels-A-GvkNBt.js → Channels-B8rjsM0S.js} +1 -1
  1039. package/web/console/assets/{ChatEntries-BLxymI67.js → ChatEntries-iZjJMEUZ.js} +1 -1
  1040. package/web/console/assets/{Clients-DeNlmvS6.js → Clients-CwgpGCSD.js} +1 -1
  1041. package/web/console/assets/{Cost-CBq_L4Kz.js → Cost-B2tNxu71.js} +1 -1
  1042. package/web/console/assets/{Credentials-DmtbctNj.js → Credentials-BuwFB-fV.js} +1 -1
  1043. package/web/console/assets/{Diagnostics-BbcRDiA-.js → Diagnostics-z5glms11.js} +1 -1
  1044. package/web/console/assets/{Executors-gGgmQrDt.js → Executors-Bc4SvjeH.js} +1 -1
  1045. package/web/console/assets/{Kb-lgY6OXUz.js → Kb-BRbRHxLy.js} +1 -1
  1046. package/web/console/assets/{Login-DA6BASZd.js → Login-CGgLGTE1.js} +1 -1
  1047. package/web/console/assets/{Projects-DEbmB_sT.js → Projects-CPWw3con.js} +1 -1
  1048. package/web/console/assets/{Routes-qS6LLoyS.js → Routes-CMIaE0Bx.js} +1 -1
  1049. package/web/console/assets/Runs-B8HuE700.js +3 -0
  1050. package/web/console/assets/Runs-Bv6CV_Hk.css +1 -0
  1051. package/web/console/assets/{Setup-DEpVF5uw.js → Setup-G8RKzliR.js} +1 -1
  1052. package/web/console/assets/{Shell-DgoPgK1E.js → Shell-DimHgraJ.js} +1 -1
  1053. package/web/console/assets/{StorageBuckets-DJtNN769.js → StorageBuckets-CiVYXIE2.js} +1 -1
  1054. package/web/console/assets/{SystemSettings-0DEUgeTR.js → SystemSettings-DF8sZNen.js} +1 -1
  1055. package/web/console/assets/{SystemStatus-CR1phiPE.js → SystemStatus-BlHywK13.js} +1 -1
  1056. package/web/console/assets/{Targets-D65l-IMB.js → Targets-BXaoPoAJ.js} +1 -1
  1057. package/web/console/assets/{Tools-DqtrINrN.js → Tools-B22lNHXq.js} +1 -1
  1058. package/web/console/assets/{Usage-B5njXNjx.js → Usage-C02EzoI2.js} +1 -1
  1059. package/web/console/assets/{UsageAccess-ChnB4pjb.js → UsageAccess-DOb-cyPE.js} +1 -1
  1060. package/web/console/assets/{UsageHelp-BBKIvbQ5.js → UsageHelp-CzS2gI40.js} +1 -1
  1061. package/web/console/assets/{index-sLKrJd_p.js → index-CK0ZCTZv.js} +2 -2
  1062. package/web/console/assets/{request-BpaimqEb.js → request-DKycpD7z.js} +1 -1
  1063. package/web/console/assets/{schema-D0Z4kFCZ.js → schema-SCiNxBlR.js} +1 -1
  1064. package/web/console/index.html +1 -1
  1065. package/web-admin/package-lock.json +5 -23
  1066. package/web-admin/package.json +1 -1
  1067. package/web-admin/src/components/NotificationOutboxPanel.vue +106 -0
  1068. package/web-admin/src/pages/Runs.vue +8 -2
  1069. package/security/dependency-audit-exceptions.json +0 -192
  1070. package/web/console/assets/Runs-CvGTV8I-.css +0 -1
  1071. package/web/console/assets/Runs-DG-VLRSc.js +0 -3
@@ -2,9 +2,12 @@
2
2
  // 不依赖 runtime 单例;engine 只注入收尾所需的状态仓库、会话账本、送达死信账本与出站能力。
3
3
  import type { AuditEntry } from '../contracts/types';
4
4
  import type { Job } from '../contracts/types';
5
+ import { notificationBackgroundWorkFor } from './notification-background-work';
6
+ import { wakeNotificationOutboxFor } from './notification-outbox-work';
5
7
 
6
8
  export interface FinishStateStoreLike {
7
9
  updateJob(jobId: string, patch: Partial<Job>): Promise<Job | null>;
10
+ completeJobWithNotifications?(original: Job, patch: Partial<Job>, context?: { brandName?: string }): Promise<Job | null>;
8
11
  appendAudit(entry: AuditEntry): Promise<void>;
9
12
  }
10
13
 
@@ -13,10 +16,11 @@ export interface FinishConversationLedgerLike {
13
16
  }
14
17
 
15
18
  export interface FinishDeliveryDlqLike {
16
- record(d: { parentJobId: string; channel: string; recipient: string; content: string; error: string }): Promise<void>;
19
+ record(d: { parentJobId: string; channel: string; recipient: string; content: string; error: string; deliveryKind?: 'native_channel' | 'executor_target'; notificationJobId?: string }): Promise<void>;
17
20
  }
18
21
 
19
22
  export interface FinishRuntimeDeps {
23
+ brandName?: string;
20
24
  store: FinishStateStoreLike;
21
25
  conversationLedger?: FinishConversationLedgerLike | null;
22
26
  deliveryDlq?: FinishDeliveryDlqLike | null;
@@ -39,15 +43,21 @@ export function deliveryFailureRecipient(job: Job): string {
39
43
  }
40
44
 
41
45
  export async function finishJob(job: Job, patch: Partial<Job>, deps: FinishRuntimeDeps): Promise<Job | null> {
46
+ const notifications = notificationBackgroundWorkFor(deps.store);
42
47
  const terminal = patch.status === 'done' || patch.status === 'error' || patch.status === 'rejected';
43
48
  const finalPatch: Partial<Job> = terminal
44
49
  ? { ...patch, executor_id: undefined, claimed_at: undefined, lease_until: undefined, dispatched_at: undefined, claim_token: undefined }
45
50
  : patch;
46
- const updated = await deps.store.updateJob(job.job_id, finalPatch);
51
+ const durable = terminal && !!deps.store.completeJobWithNotifications;
52
+ const updated = durable
53
+ ? await deps.store.completeJobWithNotifications!(job, finalPatch, { brandName: deps.brandName })
54
+ : await deps.store.updateJob(job.job_id, finalPatch);
55
+ if (!updated) return null; // A stale completion must neither send nor seal a newer run.
56
+ if (durable) wakeNotificationOutboxFor(deps.store);
47
57
  await deps.store.appendAudit({
48
58
  ts: deps.now(), job_id: job.job_id, request_id: job.request_id, event: 'finished',
49
59
  detail: { status: patch.status, cost_usd: updated?.usage?.cost_usd ?? 0 },
50
- });
60
+ }).catch(() => undefined); // The committed terminal/outbox must not be overwritten by an outer error handler.
51
61
 
52
62
  const threadId = updated?.thread_id ?? job.thread_id;
53
63
  // 总账记出站(done 才记;失败不阻塞)。必须 await 后再交棒,保证同会话下一条装配能看到本条回复。
@@ -60,23 +70,24 @@ export async function finishJob(job: Job, patch: Partial<Job>, deps: FinishRunti
60
70
  }
61
71
  }
62
72
 
63
- if (updated && job.callback_url) void deps.fireCallback(job.callback_url, updated);
73
+ if (!durable && job.callback_url) void notifications.track('callback', () => deps.fireCallback(job.callback_url!, updated));
64
74
 
65
75
  // 送达层:done 或 error 都进(spawnDeliveryJob 内裁决:失败只回调 webhook 不推人渠道)。
66
- if (updated && (updated.status === 'done' || updated.status === 'error')) {
67
- void deps.spawnDeliveryJob(updated).catch(async (e) => {
76
+ if (!durable && (updated.status === 'done' || updated.status === 'error')) {
77
+ void notifications.track('delivery', async () => { try { await deps.spawnDeliveryJob(updated); } catch (e) {
68
78
  await deps.store.appendAudit({ ts: deps.now(), job_id: job.job_id, request_id: job.request_id, event: 'delivery_error', detail: { error: String(e) } });
69
- });
79
+ throw e;
80
+ } });
70
81
  }
71
82
 
72
83
  // 送达子任务(executor-notify 渠道)重试耗尽 → 终态 error:必须告警 + 落 DLQ。
73
84
  if (updated && updated.status === 'error' && (job.source === 'delivery' || (job.target ?? '').endsWith('-notify'))) {
74
85
  const to = deliveryFailureRecipient(job);
75
86
  const err = String(patch.error ?? updated.error ?? '未知错误').slice(0, 200);
76
- void deps.sendAlert(`delivery_failed_${job.target}`,
87
+ void notifications.track('alert', () => deps.sendAlert(`delivery_failed_${job.target}`,
77
88
  `送达任务最终失败(渠道 ${job.target},收件人 ${to}):${err}。收件人可能未收到结果,请到控制台「任务」查 ${job.job_id} 并手动补发。`)
78
- .catch(() => { /* 告警失败不影响主流程 */ });
79
- void deps.deliveryDlq?.record({ parentJobId: job.job_id, channel: String(job.target ?? ''), recipient: to, content: job.input ?? '', error: err }).catch(() => undefined);
89
+ );
90
+ if (!durable && deps.deliveryDlq) void notifications.track('delivery-dlq', () => deps.deliveryDlq!.record({ parentJobId: job.job_id, channel: String(job.target ?? ''), recipient: to, content: job.input ?? '', error: err, deliveryKind: 'executor_target', notificationJobId: job.job_id }));
80
91
  }
81
92
 
82
93
  return updated;
@@ -2,6 +2,7 @@
2
2
  // 不依赖 runtime 单例,也不 import engine;engine 只把 processJob 回调注入进来。
3
3
  import type { RetryDecision } from './execution-runtime';
4
4
  import type { AuditEntry, Job, Route, SessionTarget } from '../contracts/types';
5
+ import { wakeNotificationOutboxFor } from './notification-outbox-work';
5
6
 
6
7
  export type InhubProcessJob = (
7
8
  job: Job,
@@ -13,6 +14,7 @@ export type InhubProcessJob = (
13
14
 
14
15
  export interface InhubStoreLike {
15
16
  updateJob(jobId: string, patch: Partial<Job>): Promise<Job | null>;
17
+ completeJobWithNotifications?(original: Job, patch: Partial<Job>): Promise<Job | null>;
16
18
  updateJobIfStatus(jobId: string, expectedStatuses: Array<Job['status']>, patch: Partial<Job>): Promise<Job | null>;
17
19
  claimNextInhubJob(targets: string[], workerId: string, leaseMs: number): Promise<Job | null>;
18
20
  listJobsByStatus(statuses: Array<Job['status']>, olderThanMs?: number): Promise<Job[]>;
@@ -64,6 +66,12 @@ export function createInhubRuntime(deps: InhubRuntimeDeps): InhubRuntime {
64
66
  const retryTimers = new Set<InhubTimeoutHandle>();
65
67
  const activeRuns = new Set<Promise<void>>();
66
68
  let drainInFlight: Promise<number> | null = null;
69
+ const failClaimed = async (job: Job, error: string) => {
70
+ const patch: Partial<Job> = { status: 'error', error, executor_id: undefined, claimed_at: undefined, lease_until: undefined, claim_token: undefined };
71
+ if (deps.store.completeJobWithNotifications) {
72
+ if (await deps.store.completeJobWithNotifications(job, patch)) wakeNotificationOutboxFor(deps.store);
73
+ } else await deps.store.updateJobIfStatus(job.job_id, ['running', 'queued'], patch);
74
+ };
67
75
 
68
76
  const cancelTimer = deps.clearTimeoutFn ?? ((timer: InhubTimeoutHandle) => {
69
77
  clearTimeout(timer as ReturnType<typeof setTimeout>);
@@ -90,7 +98,7 @@ export function createInhubRuntime(deps: InhubRuntimeDeps): InhubRuntime {
90
98
 
91
99
  const run = (job: Job, route: Route | null, projectPath: string | null, fullInput: string, session: SessionTarget) => {
92
100
  const work = deps.runSerial(job.thread_id, () => deps.processJob(job, route, projectPath, fullInput, session)).catch(async (e) => {
93
- await deps.store.updateJob(job.job_id, { status: 'error', error: `处理异常:${String(e)}`, executor_id: undefined, claimed_at: undefined, lease_until: undefined, claim_token: undefined });
101
+ await failClaimed(job, `处理异常:${String(e)}`);
94
102
  });
95
103
  activeRuns.add(work);
96
104
  void work.finally(() => activeRuns.delete(work)).catch(() => undefined);
@@ -117,7 +125,7 @@ export function createInhubRuntime(deps: InhubRuntimeDeps): InhubRuntime {
117
125
  const prepared = await deps.prepareClaimedJob(claimed);
118
126
  run(prepared.job, prepared.route, prepared.projectPath, prepared.fullInput, prepared.session);
119
127
  } catch (e) {
120
- await deps.store.updateJob(claimed.job_id, { status: 'error', error: `装配异常:${String(e)}`, executor_id: undefined, claimed_at: undefined, lease_until: undefined, claim_token: undefined });
128
+ await failClaimed(claimed, `装配异常:${String(e)}`);
121
129
  }
122
130
  }
123
131
  return n;
@@ -0,0 +1,50 @@
1
+ import test from 'node:test';
2
+ import assert from 'node:assert/strict';
3
+ import { NotificationBackgroundWork, notificationBackgroundWorkFor, bindNotificationBackgroundWork } from './notification-background-work';
4
+
5
+ test('notification drain includes children accepted during drain and retries a timeout', async () => {
6
+ const work = new NotificationBackgroundWork();
7
+ let releaseParent!: () => void, releaseChild!: () => void;
8
+ const parentGate = new Promise<void>(resolve => { releaseParent = resolve; });
9
+ const childGate = new Promise<void>(resolve => { releaseChild = resolve; });
10
+ void work.track('delivery', async () => {
11
+ await parentGate;
12
+ void work.track('delivery-dlq', () => childGate);
13
+ });
14
+ work.beginDrain();
15
+ assert.equal(await work.drain(1), false);
16
+ releaseParent();
17
+ await new Promise(resolve => setImmediate(resolve));
18
+ assert.equal(work.snapshot().kinds.find(x => x.kind === 'delivery-dlq')?.inFlight, 1);
19
+ assert.equal(await work.drain(1), false);
20
+ releaseChild();
21
+ assert.equal(await work.drain(100), true);
22
+ assert.equal(work.snapshot().drainTimeouts, 2);
23
+ assert.equal(work.snapshot().kinds.find(x => x.kind === 'delivery-dlq')?.completed, 1);
24
+ });
25
+
26
+ test('notification failure diagnostics expose only fixed kinds and guard outcome predicates', async () => {
27
+ const work = new NotificationBackgroundWork();
28
+ const kinds: string[] = [];
29
+ work.setFailureReporter(kind => { kinds.push(kind); throw new Error('diagnostic sink unavailable'); });
30
+ await assert.rejects(work.track('callback', async () => { throw new Error('private payload'); }));
31
+ assert.equal(await work.track('alert', async () => false, sent => !sent), false);
32
+ assert.equal(await work.track('delivery', async () => true, () => { throw new Error('bad predicate'); }), true);
33
+ assert.equal(await work.drain(100), true);
34
+ assert.deepEqual(kinds, ['callback', 'alert', 'delivery']);
35
+ assert.equal(work.snapshot().kinds.reduce((sum, x) => sum + x.failed, 0), 3);
36
+ assert.equal(JSON.stringify(work.snapshot()).includes('private'), false);
37
+ });
38
+
39
+ test('notification tracking belongs to one store/Kernel and snapshot handles large pending sets', async () => {
40
+ const one = {}, two = {};
41
+ const work = new NotificationBackgroundWork();
42
+ bindNotificationBackgroundWork(one, work);
43
+ assert.equal(notificationBackgroundWorkFor(one), work);
44
+ assert.notEqual(notificationBackgroundWorkFor(two), work);
45
+ let release!: () => void;
46
+ const gate = new Promise<void>(resolve => { release = resolve; });
47
+ for (let i = 0; i < 10000; i++) void work.track('callback', () => gate);
48
+ assert.equal(work.snapshot().kinds.find(x => x.kind === 'callback')?.inFlight, 10000);
49
+ release(); await work.drain(1000);
50
+ });
@@ -0,0 +1,101 @@
1
+ export const NOTIFICATION_BACKGROUND_KINDS = ['callback', 'delivery', 'approval-notification', 'alert', 'delivery-dlq'] as const;
2
+ export type NotificationBackgroundKind = typeof NOTIFICATION_BACKGROUND_KINDS[number];
3
+
4
+ export interface NotificationBackgroundKindSnapshot {
5
+ kind: NotificationBackgroundKind;
6
+ inFlight: number;
7
+ completed: number;
8
+ failed: number;
9
+ oldestPendingAgeMs: number;
10
+ lastStartedAt: string | null;
11
+ lastCompletedAt: string | null;
12
+ lastFailedAt: string | null;
13
+ }
14
+
15
+ export interface NotificationBackgroundSnapshot {
16
+ draining: boolean;
17
+ drainTimeouts: number;
18
+ kinds: NotificationBackgroundKindSnapshot[];
19
+ }
20
+
21
+ /** One Kernel owns its accepted notifications, including children registered during drain. */
22
+ export class NotificationBackgroundWork {
23
+ private readonly pending = new Map<Promise<unknown>, { kind: NotificationBackgroundKind; startedAt: number }>();
24
+ private readonly counters = new Map(NOTIFICATION_BACKGROUND_KINDS.map(kind => [kind, {
25
+ completed: 0, failed: 0, lastStartedAt: null as string | null,
26
+ lastCompletedAt: null as string | null, lastFailedAt: null as string | null,
27
+ }]));
28
+ private draining = false;
29
+ private drainTimeouts = 0;
30
+ private failureReporter: ((kind: NotificationBackgroundKind) => void) | undefined;
31
+
32
+ setFailureReporter(reporter: (kind: NotificationBackgroundKind) => void): void { this.failureReporter = reporter; }
33
+ beginDrain(): void { this.draining = true; }
34
+
35
+ track<T>(kind: NotificationBackgroundKind, run: () => Promise<T>, failed?: (value: T) => boolean): Promise<T> {
36
+ // Register before run, and allow accepted continuations to register children
37
+ // after beginDrain. Kernel admission, not this tracker, stops new producers.
38
+ const startedAt = Date.now();
39
+ const counters = this.counters.get(kind)!;
40
+ counters.lastStartedAt = new Date(startedAt).toISOString();
41
+ const work = Promise.resolve().then(run);
42
+ this.pending.set(work, { kind, startedAt });
43
+ const finish = (isFailure: boolean) => {
44
+ this.pending.delete(work);
45
+ if (isFailure) {
46
+ counters.failed++;
47
+ counters.lastFailedAt = new Date().toISOString();
48
+ try { this.failureReporter?.(kind); } catch { /* diagnostic only */ }
49
+ } else {
50
+ counters.completed++;
51
+ counters.lastCompletedAt = new Date().toISOString();
52
+ }
53
+ };
54
+ // Attach a rejection handler immediately so detached callers cannot leak an
55
+ // unhandled rejection; awaited callers still receive the original rejection.
56
+ void work.then(value => {
57
+ let isFailure = false;
58
+ try { isFailure = failed?.(value) ?? false; } catch { isFailure = true; }
59
+ finish(isFailure);
60
+ }, () => finish(true));
61
+ return work;
62
+ }
63
+
64
+ snapshot(now = Date.now()): NotificationBackgroundSnapshot {
65
+ return { draining: this.draining, drainTimeouts: this.drainTimeouts,
66
+ kinds: NOTIFICATION_BACKGROUND_KINDS.map(kind => {
67
+ let inFlight = 0, oldestStartedAt = now;
68
+ for (const work of this.pending.values()) if (work.kind === kind) {
69
+ inFlight++; oldestStartedAt = Math.min(oldestStartedAt, work.startedAt);
70
+ }
71
+ return { kind, ...this.counters.get(kind)!, inFlight,
72
+ oldestPendingAgeMs: inFlight ? Math.max(0, now - oldestStartedAt) : 0 };
73
+ }) };
74
+ }
75
+
76
+ async drain(drainMs: number): Promise<boolean> {
77
+ const deadline = Date.now() + Math.max(0, drainMs);
78
+ while (this.pending.size) {
79
+ const remaining = deadline - Date.now();
80
+ if (remaining <= 0) { this.drainTimeouts++; return false; }
81
+ let timer: ReturnType<typeof setTimeout> | undefined;
82
+ try {
83
+ const drained = await Promise.race([
84
+ Promise.allSettled([...this.pending.keys()]).then(() => true),
85
+ new Promise<boolean>(resolve => { timer = setTimeout(() => resolve(false), remaining); }),
86
+ ]);
87
+ if (!drained) { this.drainTimeouts++; return false; }
88
+ } finally { if (timer) clearTimeout(timer); }
89
+ // Recheck the live set: finishing work can register later SQL or webhook work.
90
+ }
91
+ return true;
92
+ }
93
+ }
94
+
95
+ const workByStore = new WeakMap<object, NotificationBackgroundWork>();
96
+ export function bindNotificationBackgroundWork(store: object, work: NotificationBackgroundWork): void { workByStore.set(store, work); }
97
+ export function notificationBackgroundWorkFor(store: object): NotificationBackgroundWork {
98
+ let work = workByStore.get(store);
99
+ if (!work) { work = new NotificationBackgroundWork(); workByStore.set(store, work); }
100
+ return work;
101
+ }
@@ -0,0 +1,15 @@
1
+ import { notificationBackgroundWorkFor } from './notification-background-work';
2
+
3
+ const wakes = new WeakMap<object, () => void | Promise<void>>();
4
+
5
+ /** A wake is only a latency hint; the persistent maintenance scan owns recovery. */
6
+ export function bindNotificationOutboxWake(store: object, wake: (() => void | Promise<void>) | null): void {
7
+ if (wake) wakes.set(store, wake); else wakes.delete(store);
8
+ }
9
+
10
+ export function wakeNotificationOutboxFor(store: object): void {
11
+ const wake = wakes.get(store);
12
+ if (!wake) return;
13
+ // Include the claim query itself in shutdown drain, not only the later send.
14
+ void notificationBackgroundWorkFor(store).track('delivery', async () => { await wake(); }).catch(() => undefined);
15
+ }
@@ -0,0 +1,19 @@
1
+ import type { Job } from '../contracts/types';
2
+ import { deliveryReplayKey, type DeliveryRequeueInput, type DeliveryRequeueOutcome } from '../contracts/delivery-replay';
3
+
4
+ export function deliveryRequeuePlan(job: Job | null, input: DeliveryRequeueInput): { outcome: DeliveryRequeueOutcome; patch?: Partial<Job> } {
5
+ if (!job) return { outcome: 'missing' };
6
+ if (!Number.isSafeInteger(input.dlq_id) || input.dlq_id <= 0 || input.replay_key !== deliveryReplayKey(input.dlq_id)
7
+ || job.job_id !== input.job_id || job.request_id !== input.request_id || job.source !== 'delivery'
8
+ || job.target !== input.target || !job.target.endsWith('-notify')) return { outcome: 'conflict' };
9
+ const previous = job.delivery_replay_keys?.[String(input.dlq_id)];
10
+ if (previous !== undefined) return { outcome: previous === input.replay_key ? 'already_queued' : 'conflict' };
11
+ if (['queued', 'running', 'dispatched'].includes(job.status)) return { outcome: 'in_flight' };
12
+ if (job.status !== 'error') return { outcome: 'conflict' };
13
+ return { outcome: 'queued', patch: {
14
+ status: 'queued', attempts: 0, run_after: undefined, error: undefined,
15
+ executor_id: undefined, claimed_at: undefined, lease_until: undefined,
16
+ dispatched_at: undefined, claim_token: undefined,
17
+ delivery_replay_keys: { ...job.delivery_replay_keys, [String(input.dlq_id)]: input.replay_key },
18
+ } };
19
+ }
@@ -0,0 +1,66 @@
1
+ import { randomUUID } from 'node:crypto';
2
+ import type { Job } from '../contracts/types';
3
+ import { NOTIFICATION_KINDS, NOTIFICATION_STATUSES, type NotificationEvent, type NotificationKind, type NotificationSnapshot, type NotificationStatus } from '../contracts/notification-outbox';
4
+
5
+ export function copyNotification<T>(value: T): T { return JSON.parse(JSON.stringify(value)) as T; }
6
+ export function terminalJob(job: Job): boolean { return ['done', 'error', 'rejected'].includes(job.status); }
7
+ export function completionMatches(current: Job | null, original: Job): boolean {
8
+ return !!current && !terminalJob(current) && current.job_id === original.job_id && current.request_id === original.request_id
9
+ && current.status === original.status && (current.claim_token ?? null) === (original.claim_token ?? null)
10
+ && (current.executor_id ?? null) === (original.executor_id ?? null)
11
+ && (current.claimed_at ?? null) === (original.claimed_at ?? null);
12
+ }
13
+ export function newNotification(eventId: string, kind: NotificationKind, payload: NotificationEvent['payload'], now: string,
14
+ recovery: NotificationEvent['recovery'] = 'retry'): NotificationEvent {
15
+ return { event_id: eventId, kind, job_id: payload.job.job_id, request_id: payload.job.request_id,
16
+ payload: copyNotification(payload), status: 'pending', attempts: 0, cycle_attempts: 0, recovery,
17
+ available_at: now, created_at: now, updated_at: now };
18
+ }
19
+ /** Called only in the store's atomic nonterminal -> terminal write, never during recovery scans. */
20
+ export function terminalNotifications(previous: Job, next: Job, context?: { brandName?: string }): NotificationEvent[] {
21
+ if (terminalJob(previous) || !terminalJob(next)) return [];
22
+ const prefix = `job:${randomUUID()}`;
23
+ const events: NotificationEvent[] = [];
24
+ const add = (kind: NotificationKind, recovery: NotificationEvent['recovery'] = 'retry') =>
25
+ events.push(newNotification(`${prefix}:${kind}`, kind, { job: next, brand_name: context?.brandName ?? 'BailingHub' }, next.updated_at, recovery));
26
+ if (next.callback_url) add('callback');
27
+ const deliveryType = String(next.dispatch?.delivery?.['type'] ?? '');
28
+ const native = next.source.startsWith('wecom:') || deliveryType === 'channel';
29
+ if ((next.status === 'done' || next.status === 'error') && next.source !== 'delivery' && !next.metadata?.['no_delivery']
30
+ && (deliveryType || next.source.startsWith('wecom:'))) add('delivery', native ? 'uncertain' : 'retry');
31
+ if (next.status === 'error' && (next.source === 'delivery' || next.target?.endsWith('-notify'))) add('delivery-dlq');
32
+ return events;
33
+ }
34
+ // Only codes produced by Core itself may cross the persisted status/UI boundary.
35
+ // Sources: the outbox worker and lease recovery, delivery/approval binding checks,
36
+ // and postSignedNotificationWithDeps. Provider error text is never an error code.
37
+ const SAFE_NOTIFICATION_ERROR_CODES = new Set([
38
+ 'notification_delivery_failed',
39
+ 'notification_delivery_uncertain',
40
+ 'notification_attempt_limit',
41
+ 'notification_child_binding_conflict',
42
+ 'approval_notification_binding_conflict',
43
+ 'webhook_acknowledgement_unavailable',
44
+ ]);
45
+
46
+ export function safeNotificationError(value: string | undefined): string | undefined {
47
+ if (value === undefined) return undefined;
48
+ return SAFE_NOTIFICATION_ERROR_CODES.has(value) || (value.length === 16 && /^webhook_http_[1-5][0-9]{2}$/.test(value))
49
+ ? value : 'notification_delivery_failed';
50
+ }
51
+ export function notificationLimit(value: number | undefined): number { return Math.min(100, Math.max(1, Math.trunc(value ?? 25) || 25)); }
52
+ export function notificationOffset(value: number | undefined): number { return Number.isSafeInteger(value) && value! >= 0 ? Math.min(value!, 1_000_000) : 0; }
53
+ export function notificationKinds(kinds?: NotificationKind[]): NotificationKind[] { return kinds === undefined ? [...NOTIFICATION_KINDS] : [...new Set(kinds.filter(kind => NOTIFICATION_KINDS.includes(kind)))]; }
54
+ export function notificationStatuses(statuses?: NotificationStatus[]): NotificationStatus[] { return statuses === undefined ? [...NOTIFICATION_STATUSES] : [...new Set(statuses.filter(status => NOTIFICATION_STATUSES.includes(status)))]; }
55
+ export function notificationLeaseMs(ms?: number): number { return Math.min(600_000, Math.max(100, Math.trunc(ms ?? 60_000) || 60_000)); }
56
+ export function notificationSnapshot(events: NotificationEvent[], now: string): NotificationSnapshot {
57
+ const counts = Object.fromEntries(NOTIFICATION_STATUSES.map(status => [status, 0])) as NotificationSnapshot['counts'];
58
+ let oldest = Infinity, expiredLeases = 0;
59
+ const stamp = Date.parse(now);
60
+ for (const event of events) {
61
+ counts[event.status]++;
62
+ if (event.status === 'pending') oldest = Math.min(oldest, Date.parse(event.created_at));
63
+ if (event.status === 'processing' && Date.parse(event.lease_until ?? '') <= stamp) expiredLeases++;
64
+ }
65
+ return { counts, oldestPendingAgeSeconds: Number.isFinite(oldest) ? Math.max(0, (stamp - oldest) / 1000) : 0, expiredLeases };
66
+ }
@@ -32,6 +32,7 @@ export function rowToJob(r: any): Job {
32
32
  error: r.error ?? undefined,
33
33
  metadata: parse(r.metadata) ?? {},
34
34
  approval_continuation_keys: parse(r.approval_continuation_keys),
35
+ delivery_replay_keys: parse(r.delivery_replay_keys),
35
36
  callback_url: r.callback_url ?? undefined,
36
37
  dispatch: parse(r.dispatch),
37
38
  attempts: r.attempts != null ? Number(r.attempts) : 0,
@@ -1,5 +1,7 @@
1
1
  import type { AuditEntry, Job, JobStatus } from '../contracts/types';
2
2
  import type { ApprovalRequeueInput, ApprovalRequeueOutcome } from '../contracts/approval-continuation';
3
+ import type { DeliveryRequeueInput, DeliveryRequeueOutcome } from '../contracts/delivery-replay';
4
+ import type { NotificationOutboxRepository } from '../contracts/notification-outbox';
3
5
 
4
6
  export interface JobOperationalMetricsSnapshot {
5
7
  byStatus: Record<JobStatus, number>;
@@ -49,8 +51,13 @@ export interface RuntimeLockRepository {
49
51
  }
50
52
 
51
53
  export interface RuntimeStateStore extends JobRepository, AuditLedger, RuntimeLockRepository {
54
+ readonly notificationOutbox?: NotificationOutboxRepository;
55
+ /** Fenced terminal transition and notification intentions in the same durable write. */
56
+ completeJobWithNotifications?(original: Job, patch: Partial<Job>, context?: { brandName?: string }): Promise<Job | null>;
52
57
  /** Atomic original-job queue transition + permanent decision marker; no substitute operation. */
53
58
  requeueApprovedJobOnce?(input: ApprovalRequeueInput): Promise<ApprovalRequeueOutcome>;
59
+ /** Original failed notification child + permanent DLQ key in one state transaction. */
60
+ requeueDeliveryJobOnce?(input: DeliveryRequeueInput): Promise<DeliveryRequeueOutcome>;
54
61
  init(): Promise<void>;
55
62
  /** Kernel 释放时关闭自己拥有的资源;外部实现可不提供。 */
56
63
  close?(): Promise<void>;
@@ -1,6 +1,9 @@
1
1
  import { dt, rowToolApproval } from '../../core/config/config-codec';
2
2
  import type { ToolApproval } from '../../core/contracts/types';
3
3
  import type { ApprovalContinuation, ApprovalContinuationDecisionOptions } from '../../core/contracts/approval-continuation';
4
+ import type { ApprovalNotificationDraft } from '../../core/contracts/notification-outbox';
5
+ import { newNotification } from '../../core/state/notification-outbox';
6
+ import { insertNotificationEvents } from '../state/notification-outbox-mysql';
4
7
 
5
8
  export class ApprovalLedger {
6
9
  private continuationCursor = 0;
@@ -9,7 +12,26 @@ export class ApprovalLedger {
9
12
  private get pool(): any { return this.poolOf(); }
10
13
 
11
14
  async create(a: Omit<ToolApproval, 'id' | 'status' | 'created_at'>): Promise<number> {
12
- const [r]: any = await this.pool.query(
15
+ return this.insertApproval(this.pool, a);
16
+ }
17
+
18
+ async createWithNotification(a: Omit<ToolApproval, 'id' | 'status' | 'created_at'>, draft: ApprovalNotificationDraft): Promise<number> {
19
+ if (draft.job.job_id !== a.job_id || draft.job.request_id !== a.request_id || draft.snap.args_hash !== a.args_hash
20
+ || draft.snap.tool !== a.tool || draft.provider_name !== a.provider) throw new Error('approval_notification_binding_mismatch');
21
+ const connection = await this.pool.getConnection();
22
+ try {
23
+ await connection.beginTransaction();
24
+ const id = await this.insertApproval(connection, a);
25
+ await insertNotificationEvents(connection, [newNotification(`approval:${id}`, 'approval-notification',
26
+ { ...draft, approval_id: id }, new Date().toISOString())]);
27
+ await connection.commit();
28
+ return id;
29
+ } catch (error) { await connection.rollback().catch(() => undefined); throw error; }
30
+ finally { connection.release(); }
31
+ }
32
+
33
+ private async insertApproval(connection: any, a: Omit<ToolApproval, 'id' | 'status' | 'created_at'>): Promise<number> {
34
+ const [r]: any = await connection.query(
13
35
  'INSERT INTO bz_tool_approvals (job_id,request_id,provider,tool,scope,risk,policy,reason,method,path,summary,args_json,args_hash,intent_json,on_behalf_of,status,created_at) ' +
14
36
  "VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,'pending',?)",
15
37
  [a.job_id, a.request_id, a.provider, a.tool, a.scope, a.risk, a.policy ?? null, a.reason ?? null,
@@ -1,46 +1,85 @@
1
1
  import { dt } from '../../core/config/config-codec';
2
+ import { deliveryReplayKey, type DeliveryKind, type DeliveryDlqRecord } from '../../core/contracts/delivery-replay';
3
+ import { truncateUtf8 } from '../../core/platform/http-body';
2
4
 
3
5
  export class DeliveryDlqLedger {
4
6
  constructor(private readonly poolOf: () => any) {}
5
7
 
6
8
  private get pool(): any { return this.poolOf(); }
7
9
 
8
- async record(d: { parentJobId: string; channel: string; recipient: string; content: string; error: string }): Promise<void> {
9
- await this.pool.query(
10
- 'INSERT INTO bz_delivery_dlq (parent_job_id,channel,recipient,content,error,resolved,created_at) VALUES (?,?,?,?,?,0,?)',
11
- [d.parentJobId.slice(0, 191), d.channel.slice(0, 191), d.recipient.slice(0, 512), String(d.content ?? '').slice(0, 60000), String(d.error ?? '').slice(0, 2000), dt()],
12
- );
10
+ async record(d: { parentJobId: string; channel: string; recipient: string; content: string; error: string; deliveryKind?: DeliveryKind; notificationJobId?: string; eventId?: string }): Promise<void> {
11
+ if (d.eventId !== undefined && (!d.eventId || d.eventId.length > 191)) throw new Error('notification_dlq_event_invalid');
12
+ const binding = [d.parentJobId.slice(0, 191), d.channel.slice(0, 191), d.recipient.slice(0, 512), truncateUtf8(String(d.content ?? ''), 60000)];
13
+ try {
14
+ await this.pool.query(
15
+ `INSERT INTO bz_delivery_dlq (parent_job_id,channel,recipient,content,error,delivery_kind,notification_job_id,resolved,created_at${d.eventId ? ',event_id' : ''}) VALUES (?,?,?,?,?,?,?,0,?${d.eventId ? ',?' : ''})`,
16
+ [...binding, String(d.error ?? '').slice(0, 2000), d.deliveryKind ?? null, d.notificationJobId?.slice(0, 191) ?? null, dt(), ...(d.eventId ? [d.eventId] : [])]);
17
+ } catch (error) {
18
+ if (!d.eventId || (error as { code?: string }).code !== 'ER_DUP_ENTRY') throw error;
19
+ const [rows]: any = await this.pool.query('SELECT parent_job_id,channel,recipient,content,delivery_kind,notification_job_id FROM bz_delivery_dlq WHERE event_id=?', [d.eventId]);
20
+ const row = rows[0];
21
+ if (!row || JSON.stringify([row.parent_job_id, row.channel, row.recipient, row.content]) !== JSON.stringify(binding)
22
+ || (row.delivery_kind ?? null) !== (d.deliveryKind ?? null) || (row.notification_job_id ?? null) !== (d.notificationJobId?.slice(0, 191) ?? null)) throw new Error('notification_dlq_identity_conflict');
23
+ }
13
24
  }
14
25
 
15
- async list(includeResolved = false, limit = 100): Promise<Array<{ id: number; parent_job_id: string; channel: string; recipient: string; content_preview: string; error: string; resolved: boolean; created_at: string; resolved_at: string | null }>> {
26
+ async list(includeResolved = false, limit = 100): Promise<Array<{ id: number; parent_job_id: string; channel: string; recipient: string; content_preview: string; error: string; resolved: boolean; created_at: string; resolved_at: string | null; delivery_kind?: DeliveryKind | null; notification_job_id?: string | null; executor_replay_key?: string | null; event_id?: string | null }>> {
16
27
  const n = Math.min(Math.max(Number(limit) || 100, 1), 500);
17
28
  const [rows] = await this.pool.query(
18
- `SELECT id,parent_job_id,channel,recipient,LEFT(content,500) AS content_preview,error,resolved,created_at,resolved_at FROM bz_delivery_dlq ${includeResolved ? '' : 'WHERE resolved=0'} ORDER BY id DESC LIMIT ${n}`,
29
+ `SELECT id,parent_job_id,channel,recipient,LEFT(content,500) AS content_preview,error,resolved,created_at,resolved_at,delivery_kind,notification_job_id,executor_replay_key,event_id FROM bz_delivery_dlq ${includeResolved ? '' : 'WHERE resolved=0'} ORDER BY id DESC LIMIT ${n}`,
19
30
  );
20
31
  return (rows as any[]).map((r) => ({
21
32
  id: Number(r.id), parent_job_id: r.parent_job_id, channel: r.channel, recipient: r.recipient,
22
33
  content_preview: r.content_preview ?? '', error: r.error ?? '', resolved: !!r.resolved,
34
+ delivery_kind: r.delivery_kind, notification_job_id: r.notification_job_id, executor_replay_key: r.executor_replay_key, event_id: r.event_id,
23
35
  created_at: new Date(r.created_at).toISOString(), resolved_at: r.resolved_at ? new Date(r.resolved_at).toISOString() : null,
24
36
  }));
25
37
  }
26
38
 
27
- async listByParentJob(parentJobId: string, includeResolved = true, limit = 100): Promise<Array<{ id: number; parent_job_id: string; channel: string; recipient: string; content_preview: string; error: string; resolved: boolean; created_at: string; resolved_at: string | null }>> {
39
+ async listByParentJob(parentJobId: string, includeResolved = true, limit = 100): Promise<Array<{ id: number; parent_job_id: string; channel: string; recipient: string; content_preview: string; error: string; resolved: boolean; created_at: string; resolved_at: string | null; delivery_kind?: DeliveryKind | null; notification_job_id?: string | null; executor_replay_key?: string | null; event_id?: string | null }>> {
28
40
  const n = Math.min(Math.max(Number(limit) || 100, 1), 500);
29
41
  const [rows] = await this.pool.query(
30
- `SELECT id,parent_job_id,channel,recipient,LEFT(content,500) AS content_preview,error,resolved,created_at,resolved_at FROM bz_delivery_dlq WHERE parent_job_id=? ${includeResolved ? '' : 'AND resolved=0'} ORDER BY id DESC LIMIT ${n}`,
42
+ `SELECT id,parent_job_id,channel,recipient,LEFT(content,500) AS content_preview,error,resolved,created_at,resolved_at,delivery_kind,notification_job_id,executor_replay_key,event_id FROM bz_delivery_dlq WHERE parent_job_id=? ${includeResolved ? '' : 'AND resolved=0'} ORDER BY id DESC LIMIT ${n}`,
31
43
  [parentJobId],
32
44
  );
33
45
  return (rows as any[]).map((r) => ({
34
46
  id: Number(r.id), parent_job_id: r.parent_job_id, channel: r.channel, recipient: r.recipient,
35
47
  content_preview: r.content_preview ?? '', error: r.error ?? '', resolved: !!r.resolved,
48
+ delivery_kind: r.delivery_kind, notification_job_id: r.notification_job_id, executor_replay_key: r.executor_replay_key, event_id: r.event_id,
36
49
  created_at: new Date(r.created_at).toISOString(), resolved_at: r.resolved_at ? new Date(r.resolved_at).toISOString() : null,
37
50
  }));
38
51
  }
39
52
 
40
- async get(id: number): Promise<{ id: number; channel: string; recipient: string; content: string; resolved: boolean } | null> {
41
- const [rows] = await this.pool.query('SELECT id,channel,recipient,content,resolved FROM bz_delivery_dlq WHERE id=? LIMIT 1', [id]);
53
+ async get(id: number): Promise<DeliveryDlqRecord | null> {
54
+ const [rows] = await this.pool.query('SELECT id,parent_job_id,channel,recipient,content,resolved,delivery_kind,notification_job_id,executor_replay_key,event_id FROM bz_delivery_dlq WHERE id=? LIMIT 1', [id]);
42
55
  const r = (rows as any[])[0];
43
- return r ? { id: Number(r.id), channel: r.channel, recipient: r.recipient, content: r.content ?? '', resolved: !!r.resolved } : null;
56
+ return r ? { id: Number(r.id), parent_job_id: r.parent_job_id, channel: r.channel, recipient: r.recipient,
57
+ content: r.content ?? '', resolved: !!r.resolved, delivery_kind: r.delivery_kind,
58
+ notification_job_id: r.notification_job_id, executor_replay_key: r.executor_replay_key, event_id: r.event_id } : null;
59
+ }
60
+
61
+ /** Stable replay identity is initialized once; it never acts as an expiring owner lease. */
62
+ async ensureExecutorReplay(id: number, notificationJobId: string): Promise<{ key: string; created: boolean } | null> {
63
+ const key = deliveryReplayKey(id);
64
+ const conn = await this.pool.getConnection();
65
+ try {
66
+ await conn.beginTransaction();
67
+ const [rows] = await conn.query('SELECT * FROM bz_delivery_dlq WHERE id=? FOR UPDATE', [id]);
68
+ const row = (rows as any[])[0];
69
+ if (!row || row.resolved) { await conn.commit(); return null; }
70
+ if (row.parent_job_id !== notificationJobId || (row.notification_job_id && row.notification_job_id !== notificationJobId)
71
+ || (row.delivery_kind && row.delivery_kind !== 'executor_target') || (row.executor_replay_key && row.executor_replay_key !== key)) throw new Error('delivery_dlq_replay_conflict');
72
+ const created = !row.executor_replay_key;
73
+ if (created) await conn.query("UPDATE bz_delivery_dlq SET delivery_kind='executor_target',notification_job_id=?,executor_replay_key=? WHERE id=?", [notificationJobId, key, id]);
74
+ await conn.commit();
75
+ return { key, created };
76
+ } catch (error) {
77
+ await conn.rollback().catch(() => undefined); throw error;
78
+ } finally { conn.release(); }
79
+ }
80
+
81
+ async resolveByEventId(eventId: string): Promise<void> {
82
+ await this.pool.query('UPDATE bz_delivery_dlq SET resolved=1, resolved_at=COALESCE(resolved_at,?) WHERE event_id=?', [dt(), eventId]);
44
83
  }
45
84
 
46
85
  async resolve(id: number): Promise<void> {
@@ -14,6 +14,8 @@ import { AlertRuleRepository } from './config-alert-rule-repository';
14
14
  import { ChatConfigRepository } from './config-chat-repository';
15
15
  import { RateLimitLedger } from './config-rate-limit-ledger';
16
16
  import { ApprovalLedger } from './config-approval-ledger';
17
+ import type { NotificationOutboxRepository } from '../../core/contracts/notification-outbox';
18
+ import { MysqlNotificationOutbox } from '../state/notification-outbox-mysql';
17
19
  import { ConversationLedger } from './config-conversation-ledger';
18
20
  import { ExecutorLedger } from './config-executor-ledger';
19
21
  import { ToolCallLedger } from './config-tool-call-ledger';
@@ -53,8 +55,8 @@ export type ChatConfigRepositoryContract = Pick<ChatConfigRepository, keyof Chat
53
55
  export type RateLimitLedgerContract = Omit<Pick<RateLimitLedger, keyof RateLimitLedger>, 'consumeAll'>
54
56
  & Partial<Pick<RateLimitLedger, 'consumeAll'>>;
55
57
  export type ApprovalLedgerContract =
56
- Omit<Pick<ApprovalLedger, keyof ApprovalLedger>, 'forJobs' | 'decideWithContinuation' | 'getContinuation' | 'pendingContinuations' | 'markContinuationAuditRecorded' | 'completeContinuation'>
57
- & Partial<Pick<ApprovalLedger, 'forJobs' | 'decideWithContinuation' | 'getContinuation' | 'pendingContinuations' | 'markContinuationAuditRecorded' | 'completeContinuation'>>;
58
+ Omit<Pick<ApprovalLedger, keyof ApprovalLedger>, 'forJobs' | 'decideWithContinuation' | 'getContinuation' | 'pendingContinuations' | 'markContinuationAuditRecorded' | 'completeContinuation' | 'createWithNotification'>
59
+ & Partial<Pick<ApprovalLedger, 'forJobs' | 'decideWithContinuation' | 'getContinuation' | 'pendingContinuations' | 'markContinuationAuditRecorded' | 'completeContinuation' | 'createWithNotification'>>;
58
60
  export type ConversationLedgerContract = Pick<ConversationLedger, keyof ConversationLedger>;
59
61
  export type ExecutorLedgerContract = Pick<ExecutorLedger, keyof ExecutorLedger>;
60
62
  export type ToolCallLedgerContract = Pick<ToolCallLedger, keyof ToolCallLedger>;
@@ -63,7 +65,8 @@ export type ToolEmbeddingRepositoryContract = ToolEmbeddingRepository;
63
65
  export type KnowledgeRepositoryContract = Pick<MysqlKnowledgeRepository, keyof MysqlKnowledgeRepository>;
64
66
  export type KbDatasourceRepositoryContract = Pick<MysqlKbDatasourceRepository, keyof MysqlKbDatasourceRepository>;
65
67
  export type { InstanceBrandingRepositoryContract };
66
- export type DeliveryDlqLedgerContract = Pick<DeliveryDlqLedger, keyof DeliveryDlqLedger>;
68
+ export type DeliveryDlqLedgerContract = Pick<DeliveryDlqLedger, Exclude<keyof DeliveryDlqLedger, 'ensureExecutorReplay' | 'resolveByEventId'>>
69
+ & Partial<Pick<DeliveryDlqLedger, 'ensureExecutorReplay' | 'resolveByEventId'>>;
67
70
  export type ObservabilityLedgerContract =
68
71
  Omit<Pick<ObservabilityLedger, keyof ObservabilityLedger>, 'operationalMetricsSnapshot' | 'agentToolJobCandidatesForRun' | 'auditsForJobs'>
69
72
  & Partial<Pick<ObservabilityLedger, 'operationalMetricsSnapshot' | 'agentToolJobCandidatesForRun' | 'auditsForJobs'>>;
@@ -73,6 +76,7 @@ export type AgentConversationAuditRepositoryContract = Omit<Pick<AgentConversati
73
76
  & Partial<Pick<AgentConversationAuditRepository, 'createCrossBinding' | 'supportsCrossBindingMembers'>>;
74
77
 
75
78
  export interface ConfigStoreContract {
79
+ readonly notificationOutbox?: NotificationOutboxRepository;
76
80
  readonly routes: RouteRepositoryContract;
77
81
  readonly clients: ClientRepositoryContract;
78
82
  readonly credentials: CredentialRepositoryContract;
@@ -130,6 +134,7 @@ export class ConfigStore implements ConfigStoreContract {
130
134
  readonly chatEntries = new ChatConfigRepository(() => this.pool);
131
135
  readonly rateLimits = new RateLimitLedger(() => this.pool);
132
136
  readonly approvals = new ApprovalLedger(() => this.pool);
137
+ readonly notificationOutbox = new MysqlNotificationOutbox(() => this.pool);
133
138
  readonly conversations = new ConversationLedger(() => this.pool);
134
139
  readonly executors = new ExecutorLedger(() => this.pool);
135
140
  readonly toolCalls = new ToolCallLedger(() => this.pool);