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.
- package/.dockerignore +1 -0
- package/.gitignore +1 -0
- package/.npmignore +1 -0
- package/Dockerfile +1 -0
- package/README.en.md +6 -6
- package/README.md +6 -6
- package/SECURITY.md +3 -3
- package/THIRD_PARTY_NOTICES.md +7 -7
- package/docker-compose.images.yml +2 -2
- package/docs/CHANGELOG.en.md +23 -1
- package/docs/CHANGELOG.md +23 -1
- package/docs/CORE_RELIABILITY.en.md +22 -2
- package/docs/CORE_RELIABILITY.md +22 -2
- package/docs/DOCX_DEPENDENCY.en.md +26 -0
- package/docs/DOCX_DEPENDENCY.md +26 -0
- package/docs/IMPLEMENTATION_STATUS.en.md +23 -15
- package/docs/IMPLEMENTATION_STATUS.md +23 -15
- package/docs/INDEPENDENT_VALIDATION.en.md +4 -4
- package/docs/INDEPENDENT_VALIDATION.md +4 -4
- package/docs/NOTIFICATION_DURABILITY.en.md +47 -0
- package/docs/NOTIFICATION_DURABILITY.md +47 -0
- package/docs/OPERATIONS.en.md +17 -0
- package/docs/OPERATIONS.md +16 -0
- package/docs/README.en.md +7 -1
- package/docs/README.md +7 -1
- package/docs/RELEASE_NOTES_NEXT.en.md +3 -3
- package/docs/RELEASE_NOTES_NEXT.md +3 -3
- package/docs/RELEASE_NOTES_v0.9.3.en.md +51 -0
- package/docs/RELEASE_NOTES_v0.9.3.md +51 -0
- package/docs/RELEASE_NOTES_v0.9.4.en.md +42 -0
- package/docs/RELEASE_NOTES_v0.9.4.md +42 -0
- package/docs/TOOLS_DESIGN.md +1 -0
- package/docs/UPGRADE_v0.9.3.en.md +63 -0
- package/docs/UPGRADE_v0.9.3.md +63 -0
- package/docs/UPGRADE_v0.9.4.en.md +57 -0
- package/docs/UPGRADE_v0.9.4.md +57 -0
- package/node_modules/@xmldom/xmldom/CHANGELOG.md +533 -0
- package/node_modules/@xmldom/xmldom/LICENSE +8 -0
- package/node_modules/@xmldom/xmldom/SECURITY.md +50 -0
- package/node_modules/@xmldom/xmldom/index.d.ts +96 -0
- package/node_modules/@xmldom/xmldom/lib/.eslintrc.yml +2 -0
- package/node_modules/@xmldom/xmldom/lib/conventions.js +214 -0
- package/node_modules/@xmldom/xmldom/lib/dom-parser.js +322 -0
- package/node_modules/@xmldom/xmldom/lib/dom.js +2266 -0
- package/node_modules/@xmldom/xmldom/lib/entities.js +2166 -0
- package/node_modules/@xmldom/xmldom/lib/index.js +4 -0
- package/node_modules/@xmldom/xmldom/lib/sax.js +683 -0
- package/node_modules/@xmldom/xmldom/package.json +75 -0
- package/node_modules/@xmldom/xmldom/readme.md +356 -0
- package/node_modules/base64-js/LICENSE +21 -0
- package/node_modules/base64-js/README.md +34 -0
- package/node_modules/base64-js/base64js.min.js +1 -0
- package/node_modules/base64-js/index.d.ts +3 -0
- package/node_modules/base64-js/index.js +150 -0
- package/node_modules/base64-js/package.json +47 -0
- package/node_modules/bluebird/LICENSE +21 -0
- package/node_modules/bluebird/README.md +51 -0
- package/node_modules/bluebird/changelog.md +1 -0
- package/node_modules/bluebird/js/browser/bluebird.core.js +3739 -0
- package/node_modules/bluebird/js/browser/bluebird.core.min.js +31 -0
- package/node_modules/bluebird/js/browser/bluebird.js +5581 -0
- package/node_modules/bluebird/js/browser/bluebird.min.js +31 -0
- package/node_modules/bluebird/js/release/any.js +21 -0
- package/node_modules/bluebird/js/release/assert.js +55 -0
- package/node_modules/bluebird/js/release/async.js +161 -0
- package/node_modules/bluebird/js/release/bind.js +67 -0
- package/node_modules/bluebird/js/release/bluebird.js +11 -0
- package/node_modules/bluebird/js/release/call_get.js +123 -0
- package/node_modules/bluebird/js/release/cancel.js +129 -0
- package/node_modules/bluebird/js/release/catch_filter.js +42 -0
- package/node_modules/bluebird/js/release/context.js +69 -0
- package/node_modules/bluebird/js/release/debuggability.js +916 -0
- package/node_modules/bluebird/js/release/direct_resolve.js +46 -0
- package/node_modules/bluebird/js/release/each.js +30 -0
- package/node_modules/bluebird/js/release/errors.js +116 -0
- package/node_modules/bluebird/js/release/es5.js +80 -0
- package/node_modules/bluebird/js/release/filter.js +12 -0
- package/node_modules/bluebird/js/release/finally.js +111 -0
- package/node_modules/bluebird/js/release/generators.js +223 -0
- package/node_modules/bluebird/js/release/join.js +168 -0
- package/node_modules/bluebird/js/release/map.js +168 -0
- package/node_modules/bluebird/js/release/method.js +55 -0
- package/node_modules/bluebird/js/release/nodeback.js +51 -0
- package/node_modules/bluebird/js/release/nodeify.js +58 -0
- package/node_modules/bluebird/js/release/promise.js +773 -0
- package/node_modules/bluebird/js/release/promise_array.js +184 -0
- package/node_modules/bluebird/js/release/promisify.js +314 -0
- package/node_modules/bluebird/js/release/props.js +118 -0
- package/node_modules/bluebird/js/release/queue.js +73 -0
- package/node_modules/bluebird/js/release/race.js +49 -0
- package/node_modules/bluebird/js/release/reduce.js +172 -0
- package/node_modules/bluebird/js/release/schedule.js +61 -0
- package/node_modules/bluebird/js/release/settle.js +43 -0
- package/node_modules/bluebird/js/release/some.js +148 -0
- package/node_modules/bluebird/js/release/synchronous_inspection.js +103 -0
- package/node_modules/bluebird/js/release/thenables.js +86 -0
- package/node_modules/bluebird/js/release/timers.js +93 -0
- package/node_modules/bluebird/js/release/using.js +226 -0
- package/node_modules/bluebird/js/release/util.js +379 -0
- package/node_modules/bluebird/package.json +76 -0
- package/node_modules/core-util-is/LICENSE +19 -0
- package/node_modules/core-util-is/README.md +3 -0
- package/node_modules/core-util-is/lib/util.js +107 -0
- package/node_modules/core-util-is/package.json +38 -0
- package/node_modules/dingbat-to-unicode/README.md +79 -0
- package/node_modules/dingbat-to-unicode/dist/dingbats.d.ts +8 -0
- package/node_modules/dingbat-to-unicode/dist/dingbats.js +1066 -0
- package/node_modules/dingbat-to-unicode/dist/index.d.ts +7 -0
- package/node_modules/dingbat-to-unicode/dist/index.js +44 -0
- package/node_modules/dingbat-to-unicode/package.json +39 -0
- package/node_modules/duck/LICENSE +22 -0
- package/node_modules/duck/README.md +184 -0
- package/node_modules/duck/index.js +267 -0
- package/node_modules/duck/makefile +4 -0
- package/node_modules/duck/package.json +23 -0
- package/node_modules/duck/test/duck.test.js +160 -0
- package/node_modules/immediate/LICENSE.txt +20 -0
- package/node_modules/immediate/README.md +93 -0
- package/node_modules/immediate/dist/immediate.js +75 -0
- package/node_modules/immediate/dist/immediate.min.js +1 -0
- package/node_modules/immediate/lib/browser.js +69 -0
- package/node_modules/immediate/lib/index.js +73 -0
- package/node_modules/immediate/package.json +42 -0
- package/node_modules/inherits/LICENSE +16 -0
- package/node_modules/inherits/README.md +42 -0
- package/node_modules/inherits/inherits.js +9 -0
- package/node_modules/inherits/inherits_browser.js +27 -0
- package/node_modules/inherits/package.json +29 -0
- package/node_modules/isarray/.npmignore +1 -0
- package/node_modules/isarray/.travis.yml +4 -0
- package/node_modules/isarray/Makefile +6 -0
- package/node_modules/isarray/README.md +60 -0
- package/node_modules/isarray/component.json +19 -0
- package/node_modules/isarray/index.js +5 -0
- package/node_modules/isarray/package.json +45 -0
- package/node_modules/isarray/test.js +20 -0
- package/node_modules/jszip/.codeclimate.yml +16 -0
- package/node_modules/jszip/.editorconfig +8 -0
- package/node_modules/jszip/.eslintrc.js +43 -0
- package/node_modules/jszip/.github/workflows/pr.yaml +58 -0
- package/node_modules/jszip/.jekyll-metadata +0 -0
- package/node_modules/jszip/.travis.yml +17 -0
- package/node_modules/jszip/CHANGES.md +204 -0
- package/node_modules/jszip/LICENSE.markdown +651 -0
- package/node_modules/jszip/README.markdown +33 -0
- package/node_modules/jszip/deps.js +37 -0
- package/node_modules/jszip/dist/jszip.js +11577 -0
- package/node_modules/jszip/dist/jszip.min.js +13 -0
- package/node_modules/jszip/graph.svg +601 -0
- package/node_modules/jszip/index.d.ts +330 -0
- package/node_modules/jszip/lib/base64.js +106 -0
- package/node_modules/jszip/lib/compressedObject.js +74 -0
- package/node_modules/jszip/lib/compressions.js +14 -0
- package/node_modules/jszip/lib/crc32.js +77 -0
- package/node_modules/jszip/lib/defaults.js +11 -0
- package/node_modules/jszip/lib/external.js +18 -0
- package/node_modules/jszip/lib/flate.js +85 -0
- package/node_modules/jszip/lib/generate/ZipFileWorker.js +539 -0
- package/node_modules/jszip/lib/generate/index.js +57 -0
- package/node_modules/jszip/lib/index.js +55 -0
- package/node_modules/jszip/lib/license_header.js +11 -0
- package/node_modules/jszip/lib/load.js +88 -0
- package/node_modules/jszip/lib/nodejs/NodejsStreamInputAdapter.js +74 -0
- package/node_modules/jszip/lib/nodejs/NodejsStreamOutputAdapter.js +42 -0
- package/node_modules/jszip/lib/nodejsUtils.js +57 -0
- package/node_modules/jszip/lib/object.js +384 -0
- package/node_modules/jszip/lib/readable-stream-browser.js +10 -0
- package/node_modules/jszip/lib/reader/ArrayReader.js +57 -0
- package/node_modules/jszip/lib/reader/DataReader.js +116 -0
- package/node_modules/jszip/lib/reader/NodeBufferReader.js +19 -0
- package/node_modules/jszip/lib/reader/StringReader.js +38 -0
- package/node_modules/jszip/lib/reader/Uint8ArrayReader.js +22 -0
- package/node_modules/jszip/lib/reader/readerFor.js +28 -0
- package/node_modules/jszip/lib/signature.js +7 -0
- package/node_modules/jszip/lib/stream/ConvertWorker.js +26 -0
- package/node_modules/jszip/lib/stream/Crc32Probe.js +24 -0
- package/node_modules/jszip/lib/stream/DataLengthProbe.js +29 -0
- package/node_modules/jszip/lib/stream/DataWorker.js +116 -0
- package/node_modules/jszip/lib/stream/GenericWorker.js +263 -0
- package/node_modules/jszip/lib/stream/StreamHelper.js +214 -0
- package/node_modules/jszip/lib/support.js +38 -0
- package/node_modules/jszip/lib/utf8.js +275 -0
- package/node_modules/jszip/lib/utils.js +501 -0
- package/node_modules/jszip/lib/zipEntries.js +261 -0
- package/node_modules/jszip/lib/zipEntry.js +293 -0
- package/node_modules/jszip/lib/zipObject.js +133 -0
- package/node_modules/jszip/package.json +67 -0
- package/node_modules/jszip/sponsors.md +21 -0
- package/node_modules/jszip/tsconfig.json +101 -0
- package/node_modules/jszip/vendor/FileSaver.js +247 -0
- package/node_modules/lie/README.md +62 -0
- package/node_modules/lie/dist/lie.js +350 -0
- package/node_modules/lie/dist/lie.min.js +1 -0
- package/node_modules/lie/dist/lie.polyfill.js +358 -0
- package/node_modules/lie/dist/lie.polyfill.min.js +1 -0
- package/node_modules/lie/lib/browser.js +273 -0
- package/node_modules/lie/lib/index.js +298 -0
- package/node_modules/lie/license.md +7 -0
- package/node_modules/lie/lie.d.ts +244 -0
- package/node_modules/lie/package.json +69 -0
- package/node_modules/lie/polyfill.js +4 -0
- package/node_modules/lop/LICENSE +22 -0
- package/node_modules/lop/README.md +248 -0
- package/node_modules/lop/index.js +18 -0
- package/node_modules/lop/lib/StringSource.js +53 -0
- package/node_modules/lop/lib/Token.js +7 -0
- package/node_modules/lop/lib/TokenIterator.js +28 -0
- package/node_modules/lop/lib/bottom-up.js +128 -0
- package/node_modules/lop/lib/errors.js +22 -0
- package/node_modules/lop/lib/lazy-iterators.js +81 -0
- package/node_modules/lop/lib/parser.js +11 -0
- package/node_modules/lop/lib/parsing-results.js +103 -0
- package/node_modules/lop/lib/regex-tokeniser.js +70 -0
- package/node_modules/lop/lib/rules.js +313 -0
- package/node_modules/lop/lib/testing.js +69 -0
- package/node_modules/lop/makefile +4 -0
- package/node_modules/lop/package.json +24 -0
- package/node_modules/lop/test/StringSource.test.js +21 -0
- package/node_modules/lop/test/TokenIterator.test.js +17 -0
- package/node_modules/lop/test/Tokeniser.js +50 -0
- package/node_modules/lop/test/Tokeniser.test.js +38 -0
- package/node_modules/lop/test/bottom-up.test.js +187 -0
- package/node_modules/lop/test/errors.test.js +36 -0
- package/node_modules/lop/test/lazy-iterators.test.js +53 -0
- package/node_modules/lop/test/lop.test.js +27 -0
- package/node_modules/lop/test/regex-tokeniser.test.js +114 -0
- package/node_modules/lop/test/results.test.js +8 -0
- package/node_modules/lop/test/rules.test.js +617 -0
- package/node_modules/mammoth/LICENSE +22 -0
- package/node_modules/mammoth/SOURCE.json +57 -0
- package/node_modules/mammoth/browser/docx/files.js +14 -0
- package/node_modules/mammoth/browser/unzip.js +12 -0
- package/node_modules/mammoth/lib/document-to-html.js +469 -0
- package/node_modules/mammoth/lib/documents.js +254 -0
- package/node_modules/mammoth/lib/docx/body-reader.js +798 -0
- package/node_modules/mammoth/lib/docx/comments-reader.js +31 -0
- package/node_modules/mammoth/lib/docx/content-types-reader.js +58 -0
- package/node_modules/mammoth/lib/docx/document-xml-reader.js +30 -0
- package/node_modules/mammoth/lib/docx/docx-reader.js +226 -0
- package/node_modules/mammoth/lib/docx/files.js +80 -0
- package/node_modules/mammoth/lib/docx/notes-reader.js +28 -0
- package/node_modules/mammoth/lib/docx/numbering-xml.js +111 -0
- package/node_modules/mammoth/lib/docx/office-xml-reader.js +73 -0
- package/node_modules/mammoth/lib/docx/relationships-reader.js +43 -0
- package/node_modules/mammoth/lib/docx/style-map.js +75 -0
- package/node_modules/mammoth/lib/docx/styles-reader.js +90 -0
- package/node_modules/mammoth/lib/docx/uris.js +21 -0
- package/node_modules/mammoth/lib/html/ast.js +51 -0
- package/node_modules/mammoth/lib/html/index.js +41 -0
- package/node_modules/mammoth/lib/html/simplify.js +88 -0
- package/node_modules/mammoth/lib/images.js +31 -0
- package/node_modules/mammoth/lib/index.d.ts +86 -0
- package/node_modules/mammoth/lib/index.js +111 -0
- package/node_modules/mammoth/lib/options-reader.js +107 -0
- package/node_modules/mammoth/lib/promises.js +42 -0
- package/node_modules/mammoth/lib/raw-text.js +14 -0
- package/node_modules/mammoth/lib/results.js +72 -0
- package/node_modules/mammoth/lib/style-reader.js +365 -0
- package/node_modules/mammoth/lib/styles/document-matchers.js +100 -0
- package/node_modules/mammoth/lib/styles/html-paths.js +75 -0
- package/node_modules/mammoth/lib/styles/parser/tokeniser.js +30 -0
- package/node_modules/mammoth/lib/transforms.js +62 -0
- package/node_modules/mammoth/lib/underline.js +11 -0
- package/node_modules/mammoth/lib/unzip.js +20 -0
- package/node_modules/mammoth/lib/writers/html-writer.js +159 -0
- package/node_modules/mammoth/lib/writers/index.js +14 -0
- package/node_modules/mammoth/lib/writers/markdown-writer.js +163 -0
- package/node_modules/mammoth/lib/xml/index.js +8 -0
- package/node_modules/mammoth/lib/xml/nodes.js +70 -0
- package/node_modules/mammoth/lib/xml/reader.js +69 -0
- package/node_modules/mammoth/lib/xml/writer.js +61 -0
- package/node_modules/mammoth/lib/xml/xmldom.js +23 -0
- package/node_modules/mammoth/lib/zipfile.js +72 -0
- package/node_modules/mammoth/package.json +39 -0
- package/node_modules/mammoth/upstream-package.json +64 -0
- package/node_modules/option/.npmignore +1 -0
- package/node_modules/option/LICENSE +22 -0
- package/node_modules/option/README.md +101 -0
- package/node_modules/option/index.js +88 -0
- package/node_modules/option/package.json +23 -0
- package/node_modules/option/test/options.test.js +174 -0
- package/node_modules/pako/CHANGELOG.md +164 -0
- package/node_modules/pako/LICENSE +21 -0
- package/node_modules/pako/README.md +191 -0
- package/node_modules/pako/dist/pako.js +6818 -0
- package/node_modules/pako/dist/pako.min.js +1 -0
- package/node_modules/pako/dist/pako_deflate.js +3997 -0
- package/node_modules/pako/dist/pako_deflate.min.js +1 -0
- package/node_modules/pako/dist/pako_inflate.js +3300 -0
- package/node_modules/pako/dist/pako_inflate.min.js +1 -0
- package/node_modules/pako/index.js +14 -0
- package/node_modules/pako/lib/deflate.js +400 -0
- package/node_modules/pako/lib/inflate.js +423 -0
- package/node_modules/pako/lib/utils/common.js +105 -0
- package/node_modules/pako/lib/utils/strings.js +187 -0
- package/node_modules/pako/lib/zlib/README +59 -0
- package/node_modules/pako/lib/zlib/adler32.js +51 -0
- package/node_modules/pako/lib/zlib/constants.js +68 -0
- package/node_modules/pako/lib/zlib/crc32.js +59 -0
- package/node_modules/pako/lib/zlib/deflate.js +1874 -0
- package/node_modules/pako/lib/zlib/gzheader.js +58 -0
- package/node_modules/pako/lib/zlib/inffast.js +345 -0
- package/node_modules/pako/lib/zlib/inflate.js +1556 -0
- package/node_modules/pako/lib/zlib/inftrees.js +343 -0
- package/node_modules/pako/lib/zlib/messages.js +32 -0
- package/node_modules/pako/lib/zlib/trees.js +1222 -0
- package/node_modules/pako/lib/zlib/zstream.js +47 -0
- package/node_modules/pako/package.json +44 -0
- package/node_modules/path-is-absolute/index.js +20 -0
- package/node_modules/path-is-absolute/license +21 -0
- package/node_modules/path-is-absolute/package.json +43 -0
- package/node_modules/path-is-absolute/readme.md +59 -0
- package/node_modules/process-nextick-args/index.js +45 -0
- package/node_modules/process-nextick-args/license.md +19 -0
- package/node_modules/process-nextick-args/package.json +25 -0
- package/node_modules/process-nextick-args/readme.md +18 -0
- package/node_modules/readable-stream/.travis.yml +34 -0
- package/node_modules/readable-stream/CONTRIBUTING.md +38 -0
- package/node_modules/readable-stream/GOVERNANCE.md +136 -0
- package/node_modules/readable-stream/LICENSE +47 -0
- package/node_modules/readable-stream/README.md +58 -0
- package/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +60 -0
- package/node_modules/readable-stream/duplex-browser.js +1 -0
- package/node_modules/readable-stream/duplex.js +1 -0
- package/node_modules/readable-stream/lib/_stream_duplex.js +131 -0
- package/node_modules/readable-stream/lib/_stream_passthrough.js +47 -0
- package/node_modules/readable-stream/lib/_stream_readable.js +1019 -0
- package/node_modules/readable-stream/lib/_stream_transform.js +214 -0
- package/node_modules/readable-stream/lib/_stream_writable.js +685 -0
- package/node_modules/readable-stream/lib/internal/streams/BufferList.js +78 -0
- package/node_modules/readable-stream/lib/internal/streams/destroy.js +84 -0
- package/node_modules/readable-stream/lib/internal/streams/stream-browser.js +1 -0
- package/node_modules/readable-stream/lib/internal/streams/stream.js +1 -0
- package/node_modules/readable-stream/package.json +52 -0
- package/node_modules/readable-stream/passthrough.js +1 -0
- package/node_modules/readable-stream/readable-browser.js +7 -0
- package/node_modules/readable-stream/readable.js +19 -0
- package/node_modules/readable-stream/transform.js +1 -0
- package/node_modules/readable-stream/writable-browser.js +1 -0
- package/node_modules/readable-stream/writable.js +8 -0
- package/node_modules/safe-buffer/LICENSE +21 -0
- package/node_modules/safe-buffer/README.md +584 -0
- package/node_modules/safe-buffer/index.d.ts +187 -0
- package/node_modules/safe-buffer/index.js +62 -0
- package/node_modules/safe-buffer/package.json +37 -0
- package/node_modules/setimmediate/LICENSE.txt +20 -0
- package/node_modules/setimmediate/package.json +30 -0
- package/node_modules/setimmediate/setImmediate.js +186 -0
- package/node_modules/string_decoder/.travis.yml +50 -0
- package/node_modules/string_decoder/LICENSE +48 -0
- package/node_modules/string_decoder/README.md +47 -0
- package/node_modules/string_decoder/lib/string_decoder.js +296 -0
- package/node_modules/string_decoder/package.json +31 -0
- package/node_modules/underscore/LICENSE +22 -0
- package/node_modules/underscore/README.md +34 -0
- package/node_modules/underscore/amd/_baseCreate.js +21 -0
- package/node_modules/underscore/amd/_baseIteratee.js +15 -0
- package/node_modules/underscore/amd/_cb.js +12 -0
- package/node_modules/underscore/amd/_chainResult.js +10 -0
- package/node_modules/underscore/amd/_collectNonEnumProps.js +42 -0
- package/node_modules/underscore/amd/_createAssigner.js +24 -0
- package/node_modules/underscore/amd/_createEscaper.js +21 -0
- package/node_modules/underscore/amd/_createIndexFinder.js +30 -0
- package/node_modules/underscore/amd/_createPredicateIndexFinder.js +18 -0
- package/node_modules/underscore/amd/_createReduce.js +30 -0
- package/node_modules/underscore/amd/_createSizePropertyCheck.js +13 -0
- package/node_modules/underscore/amd/_deepGet.js +15 -0
- package/node_modules/underscore/amd/_escapeMap.js +15 -0
- package/node_modules/underscore/amd/_executeBound.js +16 -0
- package/node_modules/underscore/amd/_flatten.js +32 -0
- package/node_modules/underscore/amd/_getByteLength.js +8 -0
- package/node_modules/underscore/amd/_getLength.js +8 -0
- package/node_modules/underscore/amd/_group.js +18 -0
- package/node_modules/underscore/amd/_has.js +10 -0
- package/node_modules/underscore/amd/_hasObjectTag.js +7 -0
- package/node_modules/underscore/amd/_isArrayLike.js +11 -0
- package/node_modules/underscore/amd/_isBufferLike.js +9 -0
- package/node_modules/underscore/amd/_keyInObj.js +11 -0
- package/node_modules/underscore/amd/_methodFingerprint.js +44 -0
- package/node_modules/underscore/amd/_optimizeCb.js +27 -0
- package/node_modules/underscore/amd/_setup.js +70 -0
- package/node_modules/underscore/amd/_shallowProperty.js +12 -0
- package/node_modules/underscore/amd/_stringTagBug.js +19 -0
- package/node_modules/underscore/amd/_tagTester.js +13 -0
- package/node_modules/underscore/amd/_toBufferView.js +15 -0
- package/node_modules/underscore/amd/_toPath.js +11 -0
- package/node_modules/underscore/amd/_unescapeMap.js +8 -0
- package/node_modules/underscore/amd/after.js +14 -0
- package/node_modules/underscore/amd/allKeys.js +15 -0
- package/node_modules/underscore/amd/before.js +18 -0
- package/node_modules/underscore/amd/bind.js +15 -0
- package/node_modules/underscore/amd/bindAll.js +19 -0
- package/node_modules/underscore/amd/chain.js +12 -0
- package/node_modules/underscore/amd/chunk.js +17 -0
- package/node_modules/underscore/amd/clone.js +11 -0
- package/node_modules/underscore/amd/compact.js +10 -0
- package/node_modules/underscore/amd/compose.js +18 -0
- package/node_modules/underscore/amd/constant.js +12 -0
- package/node_modules/underscore/amd/contains.js +12 -0
- package/node_modules/underscore/amd/countBy.js +12 -0
- package/node_modules/underscore/amd/create.js +14 -0
- package/node_modules/underscore/amd/debounce.js +43 -0
- package/node_modules/underscore/amd/defaults.js +8 -0
- package/node_modules/underscore/amd/defer.js +9 -0
- package/node_modules/underscore/amd/delay.js +13 -0
- package/node_modules/underscore/amd/difference.js +14 -0
- package/node_modules/underscore/amd/each.js +25 -0
- package/node_modules/underscore/amd/escape.js +8 -0
- package/node_modules/underscore/amd/every.js +17 -0
- package/node_modules/underscore/amd/extend.js +8 -0
- package/node_modules/underscore/amd/extendOwn.js +10 -0
- package/node_modules/underscore/amd/filter.js +15 -0
- package/node_modules/underscore/amd/find.js +12 -0
- package/node_modules/underscore/amd/findIndex.js +8 -0
- package/node_modules/underscore/amd/findKey.js +15 -0
- package/node_modules/underscore/amd/findLastIndex.js +8 -0
- package/node_modules/underscore/amd/findWhere.js +11 -0
- package/node_modules/underscore/amd/first.js +13 -0
- package/node_modules/underscore/amd/flatten.js +11 -0
- package/node_modules/underscore/amd/functions.js +14 -0
- package/node_modules/underscore/amd/get.js +14 -0
- package/node_modules/underscore/amd/groupBy.js +11 -0
- package/node_modules/underscore/amd/has.js +19 -0
- package/node_modules/underscore/amd/identity.js +10 -0
- package/node_modules/underscore/amd/index-default.js +12 -0
- package/node_modules/underscore/amd/index.js +154 -0
- package/node_modules/underscore/amd/indexBy.js +11 -0
- package/node_modules/underscore/amd/indexOf.js +11 -0
- package/node_modules/underscore/amd/initial.js +12 -0
- package/node_modules/underscore/amd/intersection.js +22 -0
- package/node_modules/underscore/amd/invert.js +15 -0
- package/node_modules/underscore/amd/invoke.js +28 -0
- package/node_modules/underscore/amd/isArguments.js +19 -0
- package/node_modules/underscore/amd/isArray.js +9 -0
- package/node_modules/underscore/amd/isArrayBuffer.js +7 -0
- package/node_modules/underscore/amd/isBoolean.js +10 -0
- package/node_modules/underscore/amd/isDataView.js +17 -0
- package/node_modules/underscore/amd/isDate.js +7 -0
- package/node_modules/underscore/amd/isElement.js +10 -0
- package/node_modules/underscore/amd/isEmpty.js +18 -0
- package/node_modules/underscore/amd/isEqual.js +133 -0
- package/node_modules/underscore/amd/isError.js +7 -0
- package/node_modules/underscore/amd/isFinite.js +10 -0
- package/node_modules/underscore/amd/isFunction.js +18 -0
- package/node_modules/underscore/amd/isMap.js +7 -0
- package/node_modules/underscore/amd/isMatch.js +17 -0
- package/node_modules/underscore/amd/isNaN.js +10 -0
- package/node_modules/underscore/amd/isNull.js +10 -0
- package/node_modules/underscore/amd/isNumber.js +7 -0
- package/node_modules/underscore/amd/isObject.js +11 -0
- package/node_modules/underscore/amd/isRegExp.js +7 -0
- package/node_modules/underscore/amd/isSet.js +7 -0
- package/node_modules/underscore/amd/isString.js +7 -0
- package/node_modules/underscore/amd/isSymbol.js +7 -0
- package/node_modules/underscore/amd/isTypedArray.js +16 -0
- package/node_modules/underscore/amd/isUndefined.js +10 -0
- package/node_modules/underscore/amd/isWeakMap.js +7 -0
- package/node_modules/underscore/amd/isWeakSet.js +7 -0
- package/node_modules/underscore/amd/iteratee.js +13 -0
- package/node_modules/underscore/amd/keys.js +17 -0
- package/node_modules/underscore/amd/last.js +13 -0
- package/node_modules/underscore/amd/lastIndexOf.js +9 -0
- package/node_modules/underscore/amd/map.js +18 -0
- package/node_modules/underscore/amd/mapObject.js +19 -0
- package/node_modules/underscore/amd/matcher.js +14 -0
- package/node_modules/underscore/amd/max.js +30 -0
- package/node_modules/underscore/amd/memoize.js +17 -0
- package/node_modules/underscore/amd/min.js +30 -0
- package/node_modules/underscore/amd/mixin.js +18 -0
- package/node_modules/underscore/amd/negate.js +12 -0
- package/node_modules/underscore/amd/noop.js +8 -0
- package/node_modules/underscore/amd/now.js +10 -0
- package/node_modules/underscore/amd/object.js +20 -0
- package/node_modules/underscore/amd/omit.js +20 -0
- package/node_modules/underscore/amd/once.js +9 -0
- package/node_modules/underscore/amd/pairs.js +17 -0
- package/node_modules/underscore/amd/partial.js +25 -0
- package/node_modules/underscore/amd/partition.js +11 -0
- package/node_modules/underscore/amd/pick.js +25 -0
- package/node_modules/underscore/amd/pipe.js +13 -0
- package/node_modules/underscore/amd/pluck.js +10 -0
- package/node_modules/underscore/amd/property.js +14 -0
- package/node_modules/underscore/amd/propertyOf.js +13 -0
- package/node_modules/underscore/amd/random.js +14 -0
- package/node_modules/underscore/amd/range.js +27 -0
- package/node_modules/underscore/amd/reduce.js +9 -0
- package/node_modules/underscore/amd/reduceRight.js +8 -0
- package/node_modules/underscore/amd/reject.js +10 -0
- package/node_modules/underscore/amd/rest.js +12 -0
- package/node_modules/underscore/amd/restArguments.js +33 -0
- package/node_modules/underscore/amd/result.js +25 -0
- package/node_modules/underscore/amd/sample.js +27 -0
- package/node_modules/underscore/amd/shuffle.js +10 -0
- package/node_modules/underscore/amd/size.js +11 -0
- package/node_modules/underscore/amd/some.js +17 -0
- package/node_modules/underscore/amd/sortBy.js +26 -0
- package/node_modules/underscore/amd/sortedIndex.js +18 -0
- package/node_modules/underscore/amd/tap.js +13 -0
- package/node_modules/underscore/amd/template.js +103 -0
- package/node_modules/underscore/amd/templateSettings.js +13 -0
- package/node_modules/underscore/amd/throttle.js +51 -0
- package/node_modules/underscore/amd/times.js +13 -0
- package/node_modules/underscore/amd/toArray.js +18 -0
- package/node_modules/underscore/amd/toPath.js +12 -0
- package/node_modules/underscore/amd/underscore-array-methods.js +30 -0
- package/node_modules/underscore/amd/underscore.js +29 -0
- package/node_modules/underscore/amd/unescape.js +8 -0
- package/node_modules/underscore/amd/union.js +11 -0
- package/node_modules/underscore/amd/uniq.js +37 -0
- package/node_modules/underscore/amd/uniqueId.js +13 -0
- package/node_modules/underscore/amd/unzip.js +17 -0
- package/node_modules/underscore/amd/values.js +16 -0
- package/node_modules/underscore/amd/where.js +11 -0
- package/node_modules/underscore/amd/without.js +10 -0
- package/node_modules/underscore/amd/wrap.js +12 -0
- package/node_modules/underscore/amd/zip.js +9 -0
- package/node_modules/underscore/cjs/_baseCreate.js +20 -0
- package/node_modules/underscore/cjs/_baseIteratee.js +19 -0
- package/node_modules/underscore/cjs/_cb.js +12 -0
- package/node_modules/underscore/cjs/_chainResult.js +8 -0
- package/node_modules/underscore/cjs/_collectNonEnumProps.js +42 -0
- package/node_modules/underscore/cjs/_createAssigner.js +20 -0
- package/node_modules/underscore/cjs/_createEscaper.js +19 -0
- package/node_modules/underscore/cjs/_createIndexFinder.js +30 -0
- package/node_modules/underscore/cjs/_createPredicateIndexFinder.js +17 -0
- package/node_modules/underscore/cjs/_createReduce.js +30 -0
- package/node_modules/underscore/cjs/_createSizePropertyCheck.js +11 -0
- package/node_modules/underscore/cjs/_deepGet.js +11 -0
- package/node_modules/underscore/cjs/_escapeMap.js +11 -0
- package/node_modules/underscore/cjs/_executeBound.js +15 -0
- package/node_modules/underscore/cjs/_flatten.js +33 -0
- package/node_modules/underscore/cjs/_getByteLength.js +6 -0
- package/node_modules/underscore/cjs/_getLength.js +6 -0
- package/node_modules/underscore/cjs/_group.js +17 -0
- package/node_modules/underscore/cjs/_has.js +8 -0
- package/node_modules/underscore/cjs/_hasObjectTag.js +5 -0
- package/node_modules/underscore/cjs/_isArrayLike.js +10 -0
- package/node_modules/underscore/cjs/_isBufferLike.js +8 -0
- package/node_modules/underscore/cjs/_keyInObj.js +7 -0
- package/node_modules/underscore/cjs/_methodFingerprint.js +44 -0
- package/node_modules/underscore/cjs/_optimizeCb.js +23 -0
- package/node_modules/underscore/cjs/_setup.js +66 -0
- package/node_modules/underscore/cjs/_shallowProperty.js +8 -0
- package/node_modules/underscore/cjs/_stringTagBug.js +18 -0
- package/node_modules/underscore/cjs/_tagTester.js +11 -0
- package/node_modules/underscore/cjs/_toBufferView.js +13 -0
- package/node_modules/underscore/cjs/_toPath.js +10 -0
- package/node_modules/underscore/cjs/_unescapeMap.js +7 -0
- package/node_modules/underscore/cjs/after.js +10 -0
- package/node_modules/underscore/cjs/allKeys.js +15 -0
- package/node_modules/underscore/cjs/before.js +14 -0
- package/node_modules/underscore/cjs/bind.js +15 -0
- package/node_modules/underscore/cjs/bindAll.js +19 -0
- package/node_modules/underscore/cjs/chain.js +10 -0
- package/node_modules/underscore/cjs/chunk.js +15 -0
- package/node_modules/underscore/cjs/clone.js +11 -0
- package/node_modules/underscore/cjs/compact.js +8 -0
- package/node_modules/underscore/cjs/compose.js +14 -0
- package/node_modules/underscore/cjs/constant.js +8 -0
- package/node_modules/underscore/cjs/contains.js +12 -0
- package/node_modules/underscore/cjs/countBy.js +11 -0
- package/node_modules/underscore/cjs/create.js +13 -0
- package/node_modules/underscore/cjs/debounce.js +42 -0
- package/node_modules/underscore/cjs/defaults.js +7 -0
- package/node_modules/underscore/cjs/defer.js +9 -0
- package/node_modules/underscore/cjs/delay.js +11 -0
- package/node_modules/underscore/cjs/difference.js +15 -0
- package/node_modules/underscore/cjs/each.js +25 -0
- package/node_modules/underscore/cjs/escape.js +7 -0
- package/node_modules/underscore/cjs/every.js +17 -0
- package/node_modules/underscore/cjs/extend.js +7 -0
- package/node_modules/underscore/cjs/extendOwn.js +9 -0
- package/node_modules/underscore/cjs/filter.js +14 -0
- package/node_modules/underscore/cjs/find.js +12 -0
- package/node_modules/underscore/cjs/findIndex.js +6 -0
- package/node_modules/underscore/cjs/findKey.js +14 -0
- package/node_modules/underscore/cjs/findLastIndex.js +6 -0
- package/node_modules/underscore/cjs/findWhere.js +10 -0
- package/node_modules/underscore/cjs/first.js +11 -0
- package/node_modules/underscore/cjs/flatten.js +9 -0
- package/node_modules/underscore/cjs/functions.js +12 -0
- package/node_modules/underscore/cjs/get.js +14 -0
- package/node_modules/underscore/cjs/groupBy.js +10 -0
- package/node_modules/underscore/cjs/has.js +18 -0
- package/node_modules/underscore/cjs/identity.js +6 -0
- package/node_modules/underscore/cjs/index-default.js +11 -0
- package/node_modules/underscore/cjs/index.js +278 -0
- package/node_modules/underscore/cjs/indexBy.js +9 -0
- package/node_modules/underscore/cjs/indexOf.js +11 -0
- package/node_modules/underscore/cjs/initial.js +10 -0
- package/node_modules/underscore/cjs/intersection.js +21 -0
- package/node_modules/underscore/cjs/invert.js +13 -0
- package/node_modules/underscore/cjs/invoke.js +30 -0
- package/node_modules/underscore/cjs/isArguments.js +18 -0
- package/node_modules/underscore/cjs/isArray.js +8 -0
- package/node_modules/underscore/cjs/isArrayBuffer.js +5 -0
- package/node_modules/underscore/cjs/isBoolean.js +8 -0
- package/node_modules/underscore/cjs/isDataView.js +18 -0
- package/node_modules/underscore/cjs/isDate.js +5 -0
- package/node_modules/underscore/cjs/isElement.js +6 -0
- package/node_modules/underscore/cjs/isEmpty.js +20 -0
- package/node_modules/underscore/cjs/isEqual.js +140 -0
- package/node_modules/underscore/cjs/isError.js +5 -0
- package/node_modules/underscore/cjs/isFinite.js +9 -0
- package/node_modules/underscore/cjs/isFunction.js +17 -0
- package/node_modules/underscore/cjs/isMap.js +7 -0
- package/node_modules/underscore/cjs/isMatch.js +15 -0
- package/node_modules/underscore/cjs/isNaN.js +9 -0
- package/node_modules/underscore/cjs/isNull.js +6 -0
- package/node_modules/underscore/cjs/isNumber.js +5 -0
- package/node_modules/underscore/cjs/isObject.js +7 -0
- package/node_modules/underscore/cjs/isRegExp.js +5 -0
- package/node_modules/underscore/cjs/isSet.js +7 -0
- package/node_modules/underscore/cjs/isString.js +5 -0
- package/node_modules/underscore/cjs/isSymbol.js +5 -0
- package/node_modules/underscore/cjs/isTypedArray.js +17 -0
- package/node_modules/underscore/cjs/isUndefined.js +6 -0
- package/node_modules/underscore/cjs/isWeakMap.js +7 -0
- package/node_modules/underscore/cjs/isWeakSet.js +5 -0
- package/node_modules/underscore/cjs/iteratee.js +12 -0
- package/node_modules/underscore/cjs/keys.js +18 -0
- package/node_modules/underscore/cjs/last.js +11 -0
- package/node_modules/underscore/cjs/lastIndexOf.js +8 -0
- package/node_modules/underscore/cjs/map.js +18 -0
- package/node_modules/underscore/cjs/mapObject.js +18 -0
- package/node_modules/underscore/cjs/matcher.js +13 -0
- package/node_modules/underscore/cjs/max.js +31 -0
- package/node_modules/underscore/cjs/memoize.js +15 -0
- package/node_modules/underscore/cjs/min.js +31 -0
- package/node_modules/underscore/cjs/mixin.js +20 -0
- package/node_modules/underscore/cjs/negate.js +8 -0
- package/node_modules/underscore/cjs/noop.js +4 -0
- package/node_modules/underscore/cjs/now.js +6 -0
- package/node_modules/underscore/cjs/object.js +18 -0
- package/node_modules/underscore/cjs/omit.js +24 -0
- package/node_modules/underscore/cjs/once.js +8 -0
- package/node_modules/underscore/cjs/pairs.js +15 -0
- package/node_modules/underscore/cjs/partial.js +25 -0
- package/node_modules/underscore/cjs/partition.js +9 -0
- package/node_modules/underscore/cjs/pick.js +28 -0
- package/node_modules/underscore/cjs/pipe.js +12 -0
- package/node_modules/underscore/cjs/pluck.js +9 -0
- package/node_modules/underscore/cjs/property.js +13 -0
- package/node_modules/underscore/cjs/propertyOf.js +12 -0
- package/node_modules/underscore/cjs/random.js +10 -0
- package/node_modules/underscore/cjs/range.js +23 -0
- package/node_modules/underscore/cjs/reduce.js +7 -0
- package/node_modules/underscore/cjs/reduceRight.js +6 -0
- package/node_modules/underscore/cjs/reject.js +10 -0
- package/node_modules/underscore/cjs/rest.js +10 -0
- package/node_modules/underscore/cjs/restArguments.js +29 -0
- package/node_modules/underscore/cjs/result.js +24 -0
- package/node_modules/underscore/cjs/sample.js +29 -0
- package/node_modules/underscore/cjs/shuffle.js +8 -0
- package/node_modules/underscore/cjs/size.js +10 -0
- package/node_modules/underscore/cjs/some.js +17 -0
- package/node_modules/underscore/cjs/sortBy.js +26 -0
- package/node_modules/underscore/cjs/sortedIndex.js +17 -0
- package/node_modules/underscore/cjs/tap.js +9 -0
- package/node_modules/underscore/cjs/template.js +103 -0
- package/node_modules/underscore/cjs/templateSettings.js +11 -0
- package/node_modules/underscore/cjs/throttle.js +49 -0
- package/node_modules/underscore/cjs/times.js +11 -0
- package/node_modules/underscore/cjs/toArray.js +22 -0
- package/node_modules/underscore/cjs/toPath.js +11 -0
- package/node_modules/underscore/cjs/underscore-array-methods.js +31 -0
- package/node_modules/underscore/cjs/underscore.js +27 -0
- package/node_modules/underscore/cjs/unescape.js +7 -0
- package/node_modules/underscore/cjs/union.js +11 -0
- package/node_modules/underscore/cjs/uniq.js +38 -0
- package/node_modules/underscore/cjs/uniqueId.js +9 -0
- package/node_modules/underscore/cjs/unzip.js +17 -0
- package/node_modules/underscore/cjs/values.js +14 -0
- package/node_modules/underscore/cjs/where.js +10 -0
- package/node_modules/underscore/cjs/without.js +9 -0
- package/node_modules/underscore/cjs/wrap.js +10 -0
- package/node_modules/underscore/cjs/zip.js +8 -0
- package/node_modules/underscore/modules/.eslintrc +21 -0
- package/node_modules/underscore/modules/_baseCreate.js +18 -0
- package/node_modules/underscore/modules/_baseIteratee.js +17 -0
- package/node_modules/underscore/modules/_cb.js +10 -0
- package/node_modules/underscore/modules/_chainResult.js +6 -0
- package/node_modules/underscore/modules/_collectNonEnumProps.js +40 -0
- package/node_modules/underscore/modules/_createAssigner.js +18 -0
- package/node_modules/underscore/modules/_createEscaper.js +17 -0
- package/node_modules/underscore/modules/_createIndexFinder.js +28 -0
- package/node_modules/underscore/modules/_createPredicateIndexFinder.js +15 -0
- package/node_modules/underscore/modules/_createReduce.js +28 -0
- package/node_modules/underscore/modules/_createSizePropertyCheck.js +9 -0
- package/node_modules/underscore/modules/_deepGet.js +9 -0
- package/node_modules/underscore/modules/_escapeMap.js +9 -0
- package/node_modules/underscore/modules/_executeBound.js +13 -0
- package/node_modules/underscore/modules/_flatten.js +33 -0
- package/node_modules/underscore/modules/_getByteLength.js +4 -0
- package/node_modules/underscore/modules/_getLength.js +4 -0
- package/node_modules/underscore/modules/_group.js +15 -0
- package/node_modules/underscore/modules/_has.js +6 -0
- package/node_modules/underscore/modules/_hasObjectTag.js +3 -0
- package/node_modules/underscore/modules/_isArrayLike.js +8 -0
- package/node_modules/underscore/modules/_isBufferLike.js +6 -0
- package/node_modules/underscore/modules/_keyInObj.js +5 -0
- package/node_modules/underscore/modules/_methodFingerprint.js +37 -0
- package/node_modules/underscore/modules/_optimizeCb.js +21 -0
- package/node_modules/underscore/modules/_setup.js +43 -0
- package/node_modules/underscore/modules/_shallowProperty.js +6 -0
- package/node_modules/underscore/modules/_stringTagBug.js +13 -0
- package/node_modules/underscore/modules/_tagTester.js +9 -0
- package/node_modules/underscore/modules/_toBufferView.js +11 -0
- package/node_modules/underscore/modules/_toPath.js +8 -0
- package/node_modules/underscore/modules/_unescapeMap.js +5 -0
- package/node_modules/underscore/modules/after.js +8 -0
- package/node_modules/underscore/modules/allKeys.js +13 -0
- package/node_modules/underscore/modules/before.js +12 -0
- package/node_modules/underscore/modules/bind.js +13 -0
- package/node_modules/underscore/modules/bindAll.js +17 -0
- package/node_modules/underscore/modules/chain.js +8 -0
- package/node_modules/underscore/modules/chunk.js +13 -0
- package/node_modules/underscore/modules/clone.js +9 -0
- package/node_modules/underscore/modules/compact.js +6 -0
- package/node_modules/underscore/modules/compose.js +12 -0
- package/node_modules/underscore/modules/constant.js +6 -0
- package/node_modules/underscore/modules/contains.js +10 -0
- package/node_modules/underscore/modules/countBy.js +9 -0
- package/node_modules/underscore/modules/create.js +11 -0
- package/node_modules/underscore/modules/debounce.js +40 -0
- package/node_modules/underscore/modules/defaults.js +5 -0
- package/node_modules/underscore/modules/defer.js +7 -0
- package/node_modules/underscore/modules/delay.js +9 -0
- package/node_modules/underscore/modules/difference.js +13 -0
- package/node_modules/underscore/modules/each.js +23 -0
- package/node_modules/underscore/modules/escape.js +5 -0
- package/node_modules/underscore/modules/every.js +15 -0
- package/node_modules/underscore/modules/extend.js +5 -0
- package/node_modules/underscore/modules/extendOwn.js +7 -0
- package/node_modules/underscore/modules/filter.js +12 -0
- package/node_modules/underscore/modules/find.js +10 -0
- package/node_modules/underscore/modules/findIndex.js +4 -0
- package/node_modules/underscore/modules/findKey.js +12 -0
- package/node_modules/underscore/modules/findLastIndex.js +4 -0
- package/node_modules/underscore/modules/findWhere.js +8 -0
- package/node_modules/underscore/modules/first.js +9 -0
- package/node_modules/underscore/modules/flatten.js +7 -0
- package/node_modules/underscore/modules/functions.js +10 -0
- package/node_modules/underscore/modules/get.js +12 -0
- package/node_modules/underscore/modules/groupBy.js +8 -0
- package/node_modules/underscore/modules/has.js +16 -0
- package/node_modules/underscore/modules/identity.js +4 -0
- package/node_modules/underscore/modules/index-all.js +18 -0
- package/node_modules/underscore/modules/index-default.js +27 -0
- package/node_modules/underscore/modules/index.js +200 -0
- package/node_modules/underscore/modules/indexBy.js +7 -0
- package/node_modules/underscore/modules/indexOf.js +9 -0
- package/node_modules/underscore/modules/initial.js +8 -0
- package/node_modules/underscore/modules/intersection.js +19 -0
- package/node_modules/underscore/modules/invert.js +11 -0
- package/node_modules/underscore/modules/invoke.js +28 -0
- package/node_modules/underscore/modules/isArguments.js +16 -0
- package/node_modules/underscore/modules/isArray.js +6 -0
- package/node_modules/underscore/modules/isArrayBuffer.js +3 -0
- package/node_modules/underscore/modules/isBoolean.js +6 -0
- package/node_modules/underscore/modules/isDataView.js +16 -0
- package/node_modules/underscore/modules/isDate.js +3 -0
- package/node_modules/underscore/modules/isElement.js +4 -0
- package/node_modules/underscore/modules/isEmpty.js +18 -0
- package/node_modules/underscore/modules/isEqual.js +153 -0
- package/node_modules/underscore/modules/isError.js +3 -0
- package/node_modules/underscore/modules/isFinite.js +7 -0
- package/node_modules/underscore/modules/isFunction.js +15 -0
- package/node_modules/underscore/modules/isMap.js +5 -0
- package/node_modules/underscore/modules/isMatch.js +13 -0
- package/node_modules/underscore/modules/isNaN.js +7 -0
- package/node_modules/underscore/modules/isNull.js +4 -0
- package/node_modules/underscore/modules/isNumber.js +3 -0
- package/node_modules/underscore/modules/isObject.js +5 -0
- package/node_modules/underscore/modules/isRegExp.js +3 -0
- package/node_modules/underscore/modules/isSet.js +5 -0
- package/node_modules/underscore/modules/isString.js +3 -0
- package/node_modules/underscore/modules/isSymbol.js +3 -0
- package/node_modules/underscore/modules/isTypedArray.js +15 -0
- package/node_modules/underscore/modules/isUndefined.js +4 -0
- package/node_modules/underscore/modules/isWeakMap.js +5 -0
- package/node_modules/underscore/modules/isWeakSet.js +3 -0
- package/node_modules/underscore/modules/iteratee.js +10 -0
- package/node_modules/underscore/modules/keys.js +16 -0
- package/node_modules/underscore/modules/last.js +9 -0
- package/node_modules/underscore/modules/lastIndexOf.js +6 -0
- package/node_modules/underscore/modules/map.js +16 -0
- package/node_modules/underscore/modules/mapObject.js +16 -0
- package/node_modules/underscore/modules/matcher.js +11 -0
- package/node_modules/underscore/modules/max.js +29 -0
- package/node_modules/underscore/modules/memoize.js +13 -0
- package/node_modules/underscore/modules/min.js +29 -0
- package/node_modules/underscore/modules/mixin.js +18 -0
- package/node_modules/underscore/modules/negate.js +6 -0
- package/node_modules/underscore/modules/noop.js +2 -0
- package/node_modules/underscore/modules/now.js +4 -0
- package/node_modules/underscore/modules/object.js +16 -0
- package/node_modules/underscore/modules/omit.js +22 -0
- package/node_modules/underscore/modules/once.js +6 -0
- package/node_modules/underscore/modules/package.json +1 -0
- package/node_modules/underscore/modules/pairs.js +13 -0
- package/node_modules/underscore/modules/partial.js +24 -0
- package/node_modules/underscore/modules/partition.js +7 -0
- package/node_modules/underscore/modules/pick.js +26 -0
- package/node_modules/underscore/modules/pluck.js +7 -0
- package/node_modules/underscore/modules/property.js +11 -0
- package/node_modules/underscore/modules/propertyOf.js +10 -0
- package/node_modules/underscore/modules/random.js +8 -0
- package/node_modules/underscore/modules/range.js +21 -0
- package/node_modules/underscore/modules/reduce.js +5 -0
- package/node_modules/underscore/modules/reduceRight.js +4 -0
- package/node_modules/underscore/modules/reject.js +8 -0
- package/node_modules/underscore/modules/rest.js +8 -0
- package/node_modules/underscore/modules/restArguments.js +27 -0
- package/node_modules/underscore/modules/result.js +22 -0
- package/node_modules/underscore/modules/sample.js +27 -0
- package/node_modules/underscore/modules/shuffle.js +6 -0
- package/node_modules/underscore/modules/size.js +8 -0
- package/node_modules/underscore/modules/some.js +15 -0
- package/node_modules/underscore/modules/sortBy.js +24 -0
- package/node_modules/underscore/modules/sortedIndex.js +15 -0
- package/node_modules/underscore/modules/tap.js +7 -0
- package/node_modules/underscore/modules/template.js +101 -0
- package/node_modules/underscore/modules/templateSettings.js +9 -0
- package/node_modules/underscore/modules/throttle.js +47 -0
- package/node_modules/underscore/modules/times.js +9 -0
- package/node_modules/underscore/modules/toArray.js +20 -0
- package/node_modules/underscore/modules/toPath.js +9 -0
- package/node_modules/underscore/modules/underscore-array-methods.js +31 -0
- package/node_modules/underscore/modules/underscore.js +25 -0
- package/node_modules/underscore/modules/unescape.js +5 -0
- package/node_modules/underscore/modules/union.js +9 -0
- package/node_modules/underscore/modules/uniq.js +36 -0
- package/node_modules/underscore/modules/uniqueId.js +7 -0
- package/node_modules/underscore/modules/unzip.js +15 -0
- package/node_modules/underscore/modules/values.js +12 -0
- package/node_modules/underscore/modules/where.js +8 -0
- package/node_modules/underscore/modules/without.js +7 -0
- package/node_modules/underscore/modules/wrap.js +8 -0
- package/node_modules/underscore/modules/zip.js +6 -0
- package/node_modules/underscore/package.json +124 -0
- package/node_modules/underscore/underscore-esm-min.js +5 -0
- package/node_modules/underscore/underscore-esm-min.js.map +1 -0
- package/node_modules/underscore/underscore-esm.js +2056 -0
- package/node_modules/underscore/underscore-esm.js.map +1 -0
- package/node_modules/underscore/underscore-min.js +6 -0
- package/node_modules/underscore/underscore-min.js.map +1 -0
- package/node_modules/underscore/underscore-node-f.cjs +2180 -0
- package/node_modules/underscore/underscore-node-f.cjs.map +1 -0
- package/node_modules/underscore/underscore-node.cjs +11 -0
- package/node_modules/underscore/underscore-node.cjs.map +1 -0
- package/node_modules/underscore/underscore-node.mjs +7 -0
- package/node_modules/underscore/underscore-node.mjs.map +1 -0
- package/node_modules/underscore/underscore-umd-min.js +6 -0
- package/node_modules/underscore/underscore-umd-min.js.map +1 -0
- package/node_modules/underscore/underscore-umd.js +2064 -0
- package/node_modules/underscore/underscore-umd.js.map +1 -0
- package/node_modules/underscore/underscore.js +2064 -0
- package/node_modules/util-deprecate/History.md +16 -0
- package/node_modules/util-deprecate/LICENSE +24 -0
- package/node_modules/util-deprecate/README.md +53 -0
- package/node_modules/util-deprecate/browser.js +67 -0
- package/node_modules/util-deprecate/node.js +6 -0
- package/node_modules/util-deprecate/package.json +27 -0
- package/node_modules/xmlbuilder/CHANGELOG.md +438 -0
- package/node_modules/xmlbuilder/LICENSE +21 -0
- package/node_modules/xmlbuilder/README.md +86 -0
- package/node_modules/xmlbuilder/appveyor.yml +20 -0
- package/node_modules/xmlbuilder/lib/Utility.js +83 -0
- package/node_modules/xmlbuilder/lib/XMLAttribute.js +41 -0
- package/node_modules/xmlbuilder/lib/XMLCData.js +32 -0
- package/node_modules/xmlbuilder/lib/XMLComment.js +32 -0
- package/node_modules/xmlbuilder/lib/XMLDTDAttList.js +50 -0
- package/node_modules/xmlbuilder/lib/XMLDTDElement.js +35 -0
- package/node_modules/xmlbuilder/lib/XMLDTDEntity.js +56 -0
- package/node_modules/xmlbuilder/lib/XMLDTDNotation.js +37 -0
- package/node_modules/xmlbuilder/lib/XMLDeclaration.js +40 -0
- package/node_modules/xmlbuilder/lib/XMLDocType.js +108 -0
- package/node_modules/xmlbuilder/lib/XMLDocument.js +49 -0
- package/node_modules/xmlbuilder/lib/XMLDocumentCB.js +414 -0
- package/node_modules/xmlbuilder/lib/XMLDummy.js +29 -0
- package/node_modules/xmlbuilder/lib/XMLElement.js +111 -0
- package/node_modules/xmlbuilder/lib/XMLNode.js +467 -0
- package/node_modules/xmlbuilder/lib/XMLProcessingInstruction.js +35 -0
- package/node_modules/xmlbuilder/lib/XMLRaw.js +32 -0
- package/node_modules/xmlbuilder/lib/XMLStreamWriter.js +287 -0
- package/node_modules/xmlbuilder/lib/XMLStringWriter.js +341 -0
- package/node_modules/xmlbuilder/lib/XMLStringifier.js +163 -0
- package/node_modules/xmlbuilder/lib/XMLText.js +32 -0
- package/node_modules/xmlbuilder/lib/XMLWriterBase.js +90 -0
- package/node_modules/xmlbuilder/lib/index.js +53 -0
- package/node_modules/xmlbuilder/package.json +37 -0
- package/package.json +13 -5
- package/scripts/check-doc-links.mjs +4 -0
- package/scripts/check-image-tags.sh +1 -1
- package/scripts/check-package-artifact.mjs +19 -0
- package/scripts/check-release-consistency.test.mjs +2 -2
- package/scripts/dependency-audit.mjs +49 -96
- package/scripts/dependency-audit.test.mjs +70 -106
- package/scripts/docx-browser-test.mjs +56 -0
- package/scripts/docx-compatibility.test.mjs +39 -0
- package/scripts/docx-fixtures.mjs +19 -0
- package/scripts/export-oss.mjs +3 -0
- package/scripts/generate-third-party-notices.mjs +6 -2
- package/scripts/install.sh +1 -1
- package/scripts/notification-console-test.mjs +172 -0
- package/scripts/oss-boundary-check.mjs +3 -1
- package/scripts/publish-images.sh +1 -1
- package/scripts/release-audit.mjs +9 -1
- package/scripts/vendor-mammoth.mjs +130 -0
- package/scripts/verify-github-repo.mjs +8 -0
- package/scripts/verify-oss-export.mjs +3 -0
- package/sql/067_delivery_dlq_replay.sql +10 -0
- package/sql/068_notification_outbox.sql +28 -0
- package/sql/README.en.md +14 -0
- package/sql/README.md +14 -0
- package/src/adapters/llm/file.test.ts +59 -0
- package/src/adapters/llm/file.ts +11 -4
- package/src/app/agent-tool-invocations.test.ts +3 -1
- package/src/app/approval-continuations.mysql.test.ts +1 -1
- package/src/app/approval-continuations.test.ts +27 -1
- package/src/app/approval-continuations.ts +44 -3
- package/src/app/channels-attachments.test.ts +63 -0
- package/src/app/channels.ts +7 -4
- package/src/app/delivery-dlq-replay.mysql.test.ts +139 -0
- package/src/app/delivery-dlq-replay.test.ts +75 -0
- package/src/app/delivery-dlq-replay.ts +41 -0
- package/src/app/delivery.ts +118 -3
- package/src/app/engine.ts +5 -4
- package/src/app/kernel-notification-lifecycle.test.ts +49 -0
- package/src/app/kernel-usage-lifecycle.mysql.test.ts +1 -1
- package/src/app/kernel.ts +17 -0
- package/src/app/notification-outbound.test.ts +53 -0
- package/src/app/notification-outbox.test.ts +321 -0
- package/src/app/notification-outbox.ts +123 -0
- package/src/app/operational-metrics.test.ts +52 -1
- package/src/app/operational-metrics.ts +34 -2
- package/src/app/outbound.ts +41 -2
- package/src/app/runtime-evidence-maintenance.test.ts +34 -1
- package/src/app/runtime-lifecycle-default.ts +7 -0
- package/src/app/runtime-lifecycle.test.ts +89 -0
- package/src/app/runtime-lifecycle.ts +28 -18
- package/src/app/tool-approvals.ts +69 -31
- package/src/core/contracts/delivery-replay.ts +42 -0
- package/src/core/contracts/notification-outbox.ts +54 -0
- package/src/core/contracts/tools-idempotency.test.ts +121 -5
- package/src/core/contracts/tools.ts +21 -11
- package/src/core/contracts/types.ts +2 -0
- package/src/core/observability/openmetrics.test.ts +46 -0
- package/src/core/observability/openmetrics.ts +108 -0
- package/src/core/platform/http-body.test.ts +185 -0
- package/src/core/platform/http-body.ts +58 -0
- package/src/core/runtime/finish-runtime.test.ts +22 -0
- package/src/core/runtime/finish-runtime.ts +21 -10
- package/src/core/runtime/inhub-runtime.ts +10 -2
- package/src/core/runtime/notification-background-work.test.ts +50 -0
- package/src/core/runtime/notification-background-work.ts +101 -0
- package/src/core/runtime/notification-outbox-work.ts +15 -0
- package/src/core/state/delivery-replay.ts +19 -0
- package/src/core/state/notification-outbox.ts +66 -0
- package/src/core/state/state-codec.ts +1 -0
- package/src/core/state/state-contracts.ts +7 -0
- package/src/infrastructure/config/config-approval-ledger.ts +23 -1
- package/src/infrastructure/config/config-delivery-dlq-ledger.ts +51 -12
- package/src/infrastructure/config/configstore.ts +8 -3
- package/src/infrastructure/state/notification-outbox-jsonl.ts +80 -0
- package/src/infrastructure/state/notification-outbox-mysql.ts +100 -0
- package/src/infrastructure/state/notification-outbox-storage.test.ts +325 -0
- package/src/infrastructure/state/state-jsonl.ts +80 -14
- package/src/infrastructure/state/state-mysql.ts +63 -5
- package/src/modules/usage/background-work.test.ts +28 -0
- package/src/modules/usage/background-work.ts +43 -7
- package/src/modules/usage/billing-reconciliation.test.ts +16 -2
- package/src/modules/usage/billing-repository.ts +9 -0
- package/src/modules/usage/maintenance.test.ts +18 -2
- package/src/modules/usage/maintenance.ts +8 -0
- package/src/routes/admin-notifications.test.ts +75 -0
- package/src/routes/admin-notifications.ts +77 -0
- package/src/routes/admin-runtime.test.ts +25 -0
- package/src/routes/admin-runtime.ts +29 -0
- package/src/routes/admin.ts +1 -0
- package/src/test-support/notification-outbox-journal-crash-child.ts +20 -0
- package/vendor/bailinghub-mammoth-library-1.12.0-bailinghub.1.tgz +0 -0
- package/vendor/mammoth-library/LICENSE +22 -0
- package/vendor/mammoth-library/SOURCE.json +57 -0
- package/vendor/mammoth-library/browser/docx/files.js +14 -0
- package/vendor/mammoth-library/browser/unzip.js +12 -0
- package/vendor/mammoth-library/lib/document-to-html.js +469 -0
- package/vendor/mammoth-library/lib/documents.js +254 -0
- package/vendor/mammoth-library/lib/docx/body-reader.js +798 -0
- package/vendor/mammoth-library/lib/docx/comments-reader.js +31 -0
- package/vendor/mammoth-library/lib/docx/content-types-reader.js +58 -0
- package/vendor/mammoth-library/lib/docx/document-xml-reader.js +30 -0
- package/vendor/mammoth-library/lib/docx/docx-reader.js +226 -0
- package/vendor/mammoth-library/lib/docx/files.js +80 -0
- package/vendor/mammoth-library/lib/docx/notes-reader.js +28 -0
- package/vendor/mammoth-library/lib/docx/numbering-xml.js +111 -0
- package/vendor/mammoth-library/lib/docx/office-xml-reader.js +73 -0
- package/vendor/mammoth-library/lib/docx/relationships-reader.js +43 -0
- package/vendor/mammoth-library/lib/docx/style-map.js +75 -0
- package/vendor/mammoth-library/lib/docx/styles-reader.js +90 -0
- package/vendor/mammoth-library/lib/docx/uris.js +21 -0
- package/vendor/mammoth-library/lib/html/ast.js +51 -0
- package/vendor/mammoth-library/lib/html/index.js +41 -0
- package/vendor/mammoth-library/lib/html/simplify.js +88 -0
- package/vendor/mammoth-library/lib/images.js +31 -0
- package/vendor/mammoth-library/lib/index.d.ts +86 -0
- package/vendor/mammoth-library/lib/index.js +111 -0
- package/vendor/mammoth-library/lib/options-reader.js +107 -0
- package/vendor/mammoth-library/lib/promises.js +42 -0
- package/vendor/mammoth-library/lib/raw-text.js +14 -0
- package/vendor/mammoth-library/lib/results.js +72 -0
- package/vendor/mammoth-library/lib/style-reader.js +365 -0
- package/vendor/mammoth-library/lib/styles/document-matchers.js +100 -0
- package/vendor/mammoth-library/lib/styles/html-paths.js +75 -0
- package/vendor/mammoth-library/lib/styles/parser/tokeniser.js +30 -0
- package/vendor/mammoth-library/lib/transforms.js +62 -0
- package/vendor/mammoth-library/lib/underline.js +11 -0
- package/vendor/mammoth-library/lib/unzip.js +20 -0
- package/vendor/mammoth-library/lib/writers/html-writer.js +159 -0
- package/vendor/mammoth-library/lib/writers/index.js +14 -0
- package/vendor/mammoth-library/lib/writers/markdown-writer.js +163 -0
- package/vendor/mammoth-library/lib/xml/index.js +8 -0
- package/vendor/mammoth-library/lib/xml/nodes.js +70 -0
- package/vendor/mammoth-library/lib/xml/reader.js +69 -0
- package/vendor/mammoth-library/lib/xml/writer.js +61 -0
- package/vendor/mammoth-library/lib/xml/xmldom.js +23 -0
- package/vendor/mammoth-library/lib/zipfile.js +72 -0
- package/vendor/mammoth-library/package.json +39 -0
- package/vendor/mammoth-library/upstream-package.json +64 -0
- package/vendor/mammoth-library-distribution.json +4 -0
- package/web/console/assets/{Accounts-DKhw_QLr.js → Accounts-Dhj6PjXP.js} +1 -1
- package/web/console/assets/{AgentClients-CM4_5HaA.js → AgentClients-CMy8StAH.js} +1 -1
- package/web/console/assets/{AgentTasks-CkQgZTU5.js → AgentTasks-DA1xZdmP.js} +1 -1
- package/web/console/assets/{Approvals-B9O9TkbO.js → Approvals-DIsd7R8N.js} +1 -1
- package/web/console/assets/{Audit-2vDC1SPu.js → Audit-AUDABLTX.js} +1 -1
- package/web/console/assets/{BrandLockup-BgASiRSE.js → BrandLockup-CffORQse.js} +1 -1
- package/web/console/assets/{Channels-A-GvkNBt.js → Channels-B8rjsM0S.js} +1 -1
- package/web/console/assets/{ChatEntries-BLxymI67.js → ChatEntries-iZjJMEUZ.js} +1 -1
- package/web/console/assets/{Clients-DeNlmvS6.js → Clients-CwgpGCSD.js} +1 -1
- package/web/console/assets/{Cost-CBq_L4Kz.js → Cost-B2tNxu71.js} +1 -1
- package/web/console/assets/{Credentials-DmtbctNj.js → Credentials-BuwFB-fV.js} +1 -1
- package/web/console/assets/{Diagnostics-BbcRDiA-.js → Diagnostics-z5glms11.js} +1 -1
- package/web/console/assets/{Executors-gGgmQrDt.js → Executors-Bc4SvjeH.js} +1 -1
- package/web/console/assets/{Kb-lgY6OXUz.js → Kb-BRbRHxLy.js} +1 -1
- package/web/console/assets/{Login-DA6BASZd.js → Login-CGgLGTE1.js} +1 -1
- package/web/console/assets/{Projects-DEbmB_sT.js → Projects-CPWw3con.js} +1 -1
- package/web/console/assets/{Routes-qS6LLoyS.js → Routes-CMIaE0Bx.js} +1 -1
- package/web/console/assets/Runs-B8HuE700.js +3 -0
- package/web/console/assets/Runs-Bv6CV_Hk.css +1 -0
- package/web/console/assets/{Setup-DEpVF5uw.js → Setup-G8RKzliR.js} +1 -1
- package/web/console/assets/{Shell-DgoPgK1E.js → Shell-DimHgraJ.js} +1 -1
- package/web/console/assets/{StorageBuckets-DJtNN769.js → StorageBuckets-CiVYXIE2.js} +1 -1
- package/web/console/assets/{SystemSettings-0DEUgeTR.js → SystemSettings-DF8sZNen.js} +1 -1
- package/web/console/assets/{SystemStatus-CR1phiPE.js → SystemStatus-BlHywK13.js} +1 -1
- package/web/console/assets/{Targets-D65l-IMB.js → Targets-BXaoPoAJ.js} +1 -1
- package/web/console/assets/{Tools-DqtrINrN.js → Tools-B22lNHXq.js} +1 -1
- package/web/console/assets/{Usage-B5njXNjx.js → Usage-C02EzoI2.js} +1 -1
- package/web/console/assets/{UsageAccess-ChnB4pjb.js → UsageAccess-DOb-cyPE.js} +1 -1
- package/web/console/assets/{UsageHelp-BBKIvbQ5.js → UsageHelp-CzS2gI40.js} +1 -1
- package/web/console/assets/{index-sLKrJd_p.js → index-CK0ZCTZv.js} +2 -2
- package/web/console/assets/{request-BpaimqEb.js → request-DKycpD7z.js} +1 -1
- package/web/console/assets/{schema-D0Z4kFCZ.js → schema-SCiNxBlR.js} +1 -1
- package/web/console/index.html +1 -1
- package/web-admin/package-lock.json +5 -23
- package/web-admin/package.json +1 -1
- package/web-admin/src/components/NotificationOutboxPanel.vue +106 -0
- package/web-admin/src/pages/Runs.vue +8 -2
- package/security/dependency-audit-exceptions.json +0 -192
- package/web/console/assets/Runs-CvGTV8I-.css +0 -1
- package/web/console/assets/Runs-DG-VLRSc.js +0 -3
package/src/app/engine.ts
CHANGED
|
@@ -273,14 +273,14 @@ export function createEngineRuntime(deps: EngineRuntimeDeps): EngineRuntime {
|
|
|
273
273
|
async function processJob(job: Job, route: Route | null, projectPath: string | null, fullInput: string, session: SessionTarget): Promise<void> {
|
|
274
274
|
await deps.queue.run(async () => {
|
|
275
275
|
if (deps.isPaused()) {
|
|
276
|
-
await
|
|
277
|
-
deps.jobStream?.seal(job.job_id);
|
|
276
|
+
await finish(job, { status: 'rejected', error: 'kill switch 暂停' });
|
|
278
277
|
return;
|
|
279
278
|
}
|
|
280
279
|
const claimed = job.status === 'running'
|
|
281
280
|
? job
|
|
282
281
|
: await deps.stateStore.updateJobIfStatus(job.job_id, ['queued'], {
|
|
283
282
|
status: 'running',
|
|
283
|
+
claim_token: randomUUID(),
|
|
284
284
|
run_after: undefined,
|
|
285
285
|
claimed_at: deps.now(),
|
|
286
286
|
lease_until: new Date(Date.now() + INHUB_JOB_LEASE_MS).toISOString(),
|
|
@@ -392,7 +392,8 @@ export function createEngineRuntime(deps: EngineRuntimeDeps): EngineRuntime {
|
|
|
392
392
|
sleep: deps.sleep,
|
|
393
393
|
channelSendFor: deps.channelSendFor,
|
|
394
394
|
});
|
|
395
|
-
await finishJob(job, patch, {
|
|
395
|
+
const completed = await finishJob(job, patch, {
|
|
396
|
+
brandName: deps.cfg.brand.name,
|
|
396
397
|
store: deps.stateStore,
|
|
397
398
|
conversationLedger: deps.configStore?.conversations,
|
|
398
399
|
deliveryDlq: deps.configStore?.deliveryDlq,
|
|
@@ -410,7 +411,7 @@ export function createEngineRuntime(deps: EngineRuntimeDeps): EngineRuntime {
|
|
|
410
411
|
sendAlert: (key, text) => sendAlertWithDeps(outboundRuntime, key, text),
|
|
411
412
|
summarizeThread: summaryRuntime.maybeSummarizeThread,
|
|
412
413
|
});
|
|
413
|
-
deps.jobStream?.seal(job.job_id);
|
|
414
|
+
if (completed) deps.jobStream?.seal(job.job_id);
|
|
414
415
|
}
|
|
415
416
|
|
|
416
417
|
return {
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { mkdtemp, writeFile, readFile, rm } from 'node:fs/promises';
|
|
4
|
+
import { tmpdir } from 'node:os';
|
|
5
|
+
import { join } from 'node:path';
|
|
6
|
+
import { Readable } from 'node:stream';
|
|
7
|
+
import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
8
|
+
import type { AppConfig } from '../core/config/config';
|
|
9
|
+
import { createBailingHubKernel } from './kernel';
|
|
10
|
+
|
|
11
|
+
test('Kernel close drains detached callback before resource release; timeout permits retry', async () => {
|
|
12
|
+
const dir = await mkdtemp(join(tmpdir(), 'kernel-notification-test-'));
|
|
13
|
+
const cfg: AppConfig = { root: process.cwd(), runtimeRoot: dir, env: 'development',
|
|
14
|
+
server: { host: '127.0.0.1', port: 0, token: 'synthetic-only' }, brand: { name: 'Synthetic' },
|
|
15
|
+
displayTz: 'Asia/Shanghai', displayTzLabel: '北京时间', auditRetentionDays: 0, alerts: null,
|
|
16
|
+
metrics: { enabled: false, token: '', scrapeTimeoutMs: 1000 }, bootstrapAdmin: null,
|
|
17
|
+
concurrency: 1, killSwitchFile: join(dir, '.paused'), claudeBin: 'synthetic-unused', defaultProfile: 'readonly', brainDir: join(dir, 'brain'),
|
|
18
|
+
state: { backend: 'jsonl', jsonlPath: join(dir, 'jobs.jsonl'), mysql: { host: '', port: 3306, database: '', user: '', password: '', connectionLimit: 2 } },
|
|
19
|
+
projects: {}, llmCredentials: {}, executor: { hubUrl: '', token: '', executorId: 'synthetic', targets: [], waitMs: 100, concurrency: 1, labels: [] } };
|
|
20
|
+
const job = { job_id: 'synthetic-notification-job', request_id: 'synthetic-notification-request', status: 'dispatched', target: 'synthetic-executor',
|
|
21
|
+
source: 'test', profile: 'readonly', project: '', input_preview: '', metadata: {}, callback_url: 'https://synthetic.invalid/callback',
|
|
22
|
+
created_at: new Date().toISOString(), updated_at: new Date().toISOString() };
|
|
23
|
+
await writeFile(cfg.state.jsonlPath, JSON.stringify({ kind: 'job', job }) + '\n');
|
|
24
|
+
const originalFetch = globalThis.fetch;
|
|
25
|
+
let started!: () => void, release!: () => void, completed = false;
|
|
26
|
+
const startedGate = new Promise<void>(resolve => { started = resolve; });
|
|
27
|
+
const gate = new Promise<void>(resolve => { release = resolve; });
|
|
28
|
+
globalThis.fetch = async () => { started(); await gate; completed = true; return new Response('', { status: 200 }); };
|
|
29
|
+
const kernel = createBailingHubKernel({ instanceKey: 'notification:test', config: cfg, bootstrapLocalAdmin: false });
|
|
30
|
+
try {
|
|
31
|
+
const req = Readable.from([Buffer.from(JSON.stringify({ job_id: job.job_id, ok: true, output: { text: 'synthetic result' } }))]) as IncomingMessage;
|
|
32
|
+
req.method = 'POST'; req.url = '/executor/result'; req.headers = { host: 'localhost', authorization: 'Bearer synthetic-only' };
|
|
33
|
+
let responseStatus = 0;
|
|
34
|
+
await kernel.handle(req, { writeHead(code: number) { responseStatus = code; }, end() {} } as unknown as ServerResponse, new URL('http://localhost/executor/result'));
|
|
35
|
+
await startedGate;
|
|
36
|
+
assert.equal(responseStatus, 200);
|
|
37
|
+
await assert.rejects(kernel.close(2), /notification background drain timed out/);
|
|
38
|
+
assert.equal(completed, false);
|
|
39
|
+
const pendingClose = kernel.close(1000);
|
|
40
|
+
release(); await pendingClose;
|
|
41
|
+
assert.equal(completed, true);
|
|
42
|
+
const records = (await readFile(cfg.state.jsonlPath, 'utf8')).trim().split('\n').map(line => JSON.parse(line));
|
|
43
|
+
assert.equal(records.filter(x => x.kind === 'job').at(-1).job.status, 'done');
|
|
44
|
+
assert.equal(records.filter(x => x.kind === 'audit' && x.entry.event === 'callback').length, 1);
|
|
45
|
+
await kernel.close(0);
|
|
46
|
+
} finally {
|
|
47
|
+
release(); await kernel.close(1000); globalThis.fetch = originalFetch; await rm(dir, { recursive: true, force: true });
|
|
48
|
+
}
|
|
49
|
+
});
|
|
@@ -32,7 +32,7 @@ async function until(predicate: () => boolean, message: string) {
|
|
|
32
32
|
async function fixture(schedulerMode: 'managed' | 'standalone' = 'managed') {
|
|
33
33
|
const database = `kernel_usage_${randomUUID().replaceAll('-', '')}`;
|
|
34
34
|
const dir = mkdtempSync(join(tmpdir(), 'bailinghub-usage-lifecycle-'));
|
|
35
|
-
const mysql = { host: '127.0.0.1', port: 16307, user: 'root', password: '', connectionLimit: 8 };
|
|
35
|
+
const mysql = { host: '127.0.0.1', port: Number(process.env.BAILING_USAGE_TEST_MYSQL_PORT ?? 16307), user: 'root', password: '', connectionLimit: 8 };
|
|
36
36
|
const admin = createPool(mysql);
|
|
37
37
|
const providerGate = gate();
|
|
38
38
|
const cleanup: Array<() => void | Promise<unknown>> = [() => rmSync(dir, { recursive: true, force: true }), () => admin.end()];
|
package/src/app/kernel.ts
CHANGED
|
@@ -63,6 +63,9 @@ import { handleSendFor, type SendApiDeps } from '../routes/send';
|
|
|
63
63
|
import { handleWecomInboundFor, WecomRuntimeState, type WecomApiDeps } from '../routes/wecom';
|
|
64
64
|
import { WecomAccessTokenCache } from '../adapters/channels/wecom-api';
|
|
65
65
|
import { DemoDatasetService } from '../services/demo-dataset';
|
|
66
|
+
import { NotificationBackgroundWork, bindNotificationBackgroundWork } from '../core/runtime/notification-background-work';
|
|
67
|
+
import { bindNotificationOutboxWake } from '../core/runtime/notification-outbox-work';
|
|
68
|
+
import { reconcileNotificationOutboxFor } from './notification-outbox';
|
|
66
69
|
|
|
67
70
|
const timezoneClaims = new Map<string, number>();
|
|
68
71
|
const MAX_KERNEL_CLOSE_DRAIN_MS = 10 * 60_000;
|
|
@@ -184,6 +187,11 @@ export function createBailingHubKernel(input: CreateBailingHubKernelInputV1): Ba
|
|
|
184
187
|
composition.cfgStore?.usage?.backgroundWork.setFailureReporter(kind => {
|
|
185
188
|
logger.warn?.(`[Kernel ${instanceKey}] usage background ${kind} failed; original durable evidence is retained`);
|
|
186
189
|
});
|
|
190
|
+
const notificationWork = new NotificationBackgroundWork();
|
|
191
|
+
bindNotificationBackgroundWork(composition.store, notificationWork);
|
|
192
|
+
notificationWork.setFailureReporter(kind => {
|
|
193
|
+
logger.warn?.(`[Kernel ${instanceKey}] notification background ${kind} failed`);
|
|
194
|
+
});
|
|
187
195
|
const demoDataset = composition.cfgStore ? new DemoDatasetService(composition.cfgStore, cfg.demoDataset) : null;
|
|
188
196
|
const runtimeHelpers = createRuntimeContextHelpers({
|
|
189
197
|
cfg,
|
|
@@ -235,6 +243,10 @@ export function createBailingHubKernel(input: CreateBailingHubKernelInputV1): Ba
|
|
|
235
243
|
now,
|
|
236
244
|
sleep,
|
|
237
245
|
targetRegistry,
|
|
246
|
+
reconcileNotifications: async () => {
|
|
247
|
+
await reconcileNotificationOutboxFor({ cfg, configStore: composition.cfgStore, stateStore: composition.store,
|
|
248
|
+
now, sleep, targetRegistry, channelSendFor: kernelChannelSendFor, isClosing: () => closing || closed });
|
|
249
|
+
},
|
|
238
250
|
reconcileApprovalContinuations: async () => {
|
|
239
251
|
await reconcileApprovalContinuationsFor({
|
|
240
252
|
configStore: composition.cfgStore,
|
|
@@ -249,6 +261,8 @@ export function createBailingHubKernel(input: CreateBailingHubKernelInputV1): Ba
|
|
|
249
261
|
: async () => { await bootstrapInitialAdmin(cfg.bootstrapAdmin, { admins: composition.cfgStore?.admins ?? null }); },
|
|
250
262
|
};
|
|
251
263
|
|
|
264
|
+
bindNotificationOutboxWake(composition.store, () => lifecycleDeps.reconcileNotifications!());
|
|
265
|
+
|
|
252
266
|
const brandingProvider = input.brandingProvider ?? edition.brandingProvider;
|
|
253
267
|
const metrics = createOperationalMetricsEndpointFor({
|
|
254
268
|
cfg,
|
|
@@ -258,6 +272,7 @@ export function createBailingHubKernel(input: CreateBailingHubKernelInputV1): Ba
|
|
|
258
272
|
isPaused,
|
|
259
273
|
auditFailures: edition.auditFailures,
|
|
260
274
|
logger,
|
|
275
|
+
notificationWork,
|
|
261
276
|
});
|
|
262
277
|
|
|
263
278
|
const runDeps: RunApiDeps = {
|
|
@@ -505,6 +520,8 @@ export function createBailingHubKernel(input: CreateBailingHubKernelInputV1): Ba
|
|
|
505
520
|
usageWork.beginDrain();
|
|
506
521
|
if (!await usageWork.drain(remainingDrainMs())) throw new Error(`Kernel ${instanceKey} usage background drain timed out`);
|
|
507
522
|
}
|
|
523
|
+
notificationWork.beginDrain();
|
|
524
|
+
if (!await notificationWork.drain(remainingDrainMs())) throw new Error(`Kernel ${instanceKey} notification background drain timed out`);
|
|
508
525
|
targetRegistry.bindStore(null);
|
|
509
526
|
wecomRuntimeState.dispose();
|
|
510
527
|
wecomAccessTokenCache.dispose();
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import type { AppConfig } from '../core/config/config';
|
|
4
|
+
import type { Job } from '../core/contracts/types';
|
|
5
|
+
import type { RuntimeStateStore } from '../core/state/state-contracts';
|
|
6
|
+
import type { ConfigStoreContract } from '../infrastructure/config/configstore';
|
|
7
|
+
import { notificationBackgroundWorkFor } from '../core/runtime/notification-background-work';
|
|
8
|
+
import { finishJob } from '../core/runtime/finish-runtime';
|
|
9
|
+
import { approvalDepsForStores } from './tool-approvals';
|
|
10
|
+
import { spawnDeliveryJobFor } from './delivery';
|
|
11
|
+
import { outboundRuntimeDepsFor, sendAlertWithDeps } from './outbound';
|
|
12
|
+
|
|
13
|
+
const cfg = { server: { token: 'synthetic-only' }, brand: { name: 'Synthetic' }, alerts: null } as AppConfig;
|
|
14
|
+
const now = () => new Date().toISOString();
|
|
15
|
+
const job: Job = { job_id: 'fixture', request_id: 'fixture', status: 'done', source: 'test', profile: 'fixture', project: '',
|
|
16
|
+
input_preview: '', created_at: now(), updated_at: now(), result: { text: 'synthetic' }, metadata: {} };
|
|
17
|
+
|
|
18
|
+
for (const kind of ['delivery', 'approval', 'alert'] as const) test(`notification tracker retains innermost detached ${kind} webhook`, async () => {
|
|
19
|
+
const originalFetch = globalThis.fetch;
|
|
20
|
+
let release!: () => void, started!: () => void;
|
|
21
|
+
const gate = new Promise<void>(resolve => { release = resolve; });
|
|
22
|
+
const startedGate = new Promise<void>(resolve => { started = resolve; });
|
|
23
|
+
globalThis.fetch = async () => { started(); await gate; return new Response('', { status: 200 }); };
|
|
24
|
+
const state = { appendAudit: async () => {} } as unknown as RuntimeStateStore;
|
|
25
|
+
const work = notificationBackgroundWorkFor(state);
|
|
26
|
+
try {
|
|
27
|
+
if (kind === 'delivery') await spawnDeliveryJobFor({ cfg, configStore: null, stateStore: state, now, sleep: async () => {} },
|
|
28
|
+
{ ...job, dispatch: { delivery: { type: 'webhook', url: 'https://synthetic.invalid/delivery' } } });
|
|
29
|
+
if (kind === 'approval') {
|
|
30
|
+
const approvals = approvalDepsForStores({ approvals: {} } as ConfigStoreContract, state, job, { name: 'fixture' } as any,
|
|
31
|
+
{ approval: { type: 'business_webhook', url: 'https://synthetic.invalid/approval' } }, { provider: 'fixture', allow: ['*'] }, cfg, now, async () => {});
|
|
32
|
+
await approvals!.notify(1, { tool: 'fixture', scope: 'fixture', risk: 'high', policy: 'always', reason: 'fixture', method: 'POST', path: '/', args_hash: 'fixture', args_json: '{}' });
|
|
33
|
+
}
|
|
34
|
+
if (kind === 'alert') await sendAlertWithDeps(outboundRuntimeDepsFor({ cfg: { ...cfg, alerts: { type: 'webhook', url: 'https://synthetic.invalid/alert', cooldown_min: 0 } },
|
|
35
|
+
configStore: null, stateStore: state, now, sleep: async () => {} }), 'fixture', 'synthetic');
|
|
36
|
+
await startedGate;
|
|
37
|
+
work.beginDrain(); assert.equal(await work.drain(1), false);
|
|
38
|
+
release(); assert.equal(await work.drain(100), true);
|
|
39
|
+
} finally { release(); await work.drain(100); globalThis.fetch = originalFetch; }
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
test('finish tracks a DLQ insertion through drain and reports a failed insert', async () => {
|
|
43
|
+
const state = { updateJob: async (_id: string, patch: Partial<Job>) => ({ ...job, ...patch }), appendAudit: async () => {} };
|
|
44
|
+
const work = notificationBackgroundWorkFor(state);
|
|
45
|
+
const failures: string[] = []; work.setFailureReporter(kind => failures.push(kind));
|
|
46
|
+
let release!: () => void;
|
|
47
|
+
const gate = new Promise<void>(resolve => { release = resolve; });
|
|
48
|
+
await finishJob({ ...job, source: 'delivery', target: 'sms-notify' }, { status: 'error' }, { store: state, now,
|
|
49
|
+
fireCallback: async () => {}, spawnDeliveryJob: async () => {}, sendAlert: async () => {},
|
|
50
|
+
deliveryDlq: { async record() { await gate; throw new Error('private SQL error'); } } });
|
|
51
|
+
assert.equal(await work.drain(1), false); release(); assert.equal(await work.drain(100), true);
|
|
52
|
+
assert.ok(failures.includes('delivery-dlq'));
|
|
53
|
+
});
|
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { createServer, type IncomingMessage, type ServerResponse } from 'node:http';
|
|
4
|
+
import { mkdtemp, rm } from 'node:fs/promises';
|
|
5
|
+
import { tmpdir } from 'node:os';
|
|
6
|
+
import { join } from 'node:path';
|
|
7
|
+
import { spawn } from 'node:child_process';
|
|
8
|
+
import { once } from 'node:events';
|
|
9
|
+
import { createHmac } from 'node:crypto';
|
|
10
|
+
import { JsonlStore } from '../infrastructure/state/state-jsonl';
|
|
11
|
+
import { JsonlNotificationOutbox } from '../infrastructure/state/notification-outbox-jsonl';
|
|
12
|
+
import { newNotification } from '../core/state/notification-outbox';
|
|
13
|
+
import type { Job } from '../core/contracts/types';
|
|
14
|
+
import type { AppConfig } from '../core/config/config';
|
|
15
|
+
import type { ConfigStoreContract } from '../infrastructure/config/configstore';
|
|
16
|
+
import type { ApprovalNotificationPayload } from '../core/contracts/notification-outbox';
|
|
17
|
+
import { reconcileNotificationOutboxFor, type NotificationOutboxDeps } from './notification-outbox';
|
|
18
|
+
import { createNotificationChildOnce } from './delivery';
|
|
19
|
+
import { defaultTargetRegistry } from '../core/targets/registry';
|
|
20
|
+
import { notifyApprovalPayloadFor, approvalDepsForStores } from './tool-approvals';
|
|
21
|
+
import { notificationBackgroundWorkFor } from '../core/runtime/notification-background-work';
|
|
22
|
+
|
|
23
|
+
const cfg = { server: { token: 'synthetic-notification-secret' }, brand: { name: 'Synthetic' }, alerts: null } as AppConfig;
|
|
24
|
+
const now = () => new Date().toISOString();
|
|
25
|
+
const job = (extra: Partial<Job> = {}): Job => ({ job_id: 'synthetic-parent', request_id: 'synthetic-request', status: 'running',
|
|
26
|
+
source: 'test', target: 'llm', profile: 'test', project: '', input_preview: '', metadata: {}, created_at: now(), updated_at: now(), ...extra });
|
|
27
|
+
async function fixture() {
|
|
28
|
+
const dir = await mkdtemp(join(tmpdir(), 'notification-outbox-'));
|
|
29
|
+
const path = join(dir, 'state.jsonl'); const state = new JsonlStore(path); await state.init();
|
|
30
|
+
return { dir, path, state, deps: { cfg, configStore: null, stateStore: state, now, sleep: async () => {} } as NotificationOutboxDeps };
|
|
31
|
+
}
|
|
32
|
+
async function receiver(handle: (req: IncomingMessage, res: ServerResponse, body: string) => void) {
|
|
33
|
+
const server = createServer(async (req, res) => { let body = ''; for await (const part of req) body += part; handle(req, res, body); });
|
|
34
|
+
server.listen(0, '127.0.0.1'); await once(server, 'listening');
|
|
35
|
+
const url = `http://127.0.0.1:${(server.address() as { port: number }).port}/notification`;
|
|
36
|
+
return { url, close: async () => { server.closeAllConnections(); await new Promise<void>(resolve => server.close(() => resolve())); } };
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
test('cold restart sends frozen terminal snapshot; signature covers stable ID and retry preserves it', async () => {
|
|
40
|
+
const f = await fixture(); const received: Array<{ id: string; body: any }> = []; let status = 503;
|
|
41
|
+
const http = await receiver((req, res, raw) => {
|
|
42
|
+
const parsed = JSON.parse(raw); const id = String(req.headers['x-bailing-event-id']);
|
|
43
|
+
assert.equal(parsed.notification_event_id, id);
|
|
44
|
+
assert.equal(req.headers['x-bailing-signature'], `sha256=${createHmac('sha256', cfg.server.token).update(`${req.headers['x-bailing-timestamp']}.${raw}`).digest('hex')}`);
|
|
45
|
+
received.push({ id, body: parsed }); res.writeHead(status).end();
|
|
46
|
+
});
|
|
47
|
+
try {
|
|
48
|
+
const original = job({ callback_url: http.url }); await f.state.createJob(original);
|
|
49
|
+
await f.state.completeJobWithNotifications(original, { status: 'done', result: { text: 'frozen-result' } });
|
|
50
|
+
const restarted = new JsonlStore(f.path); await restarted.init();
|
|
51
|
+
const deps = { ...f.deps, stateStore: restarted };
|
|
52
|
+
await reconcileNotificationOutboxFor(deps);
|
|
53
|
+
const event = (await restarted.notificationOutbox.list())[0]!;
|
|
54
|
+
assert.equal(event.status, 'pending'); assert.equal(event.cycle_attempts, 1);
|
|
55
|
+
await restarted.updateJob(original.job_id, { result: { text: 'later mutable value' } });
|
|
56
|
+
status = 200;
|
|
57
|
+
await reconcileNotificationOutboxFor({ ...deps, now: () => new Date(Date.now() + 3600_000).toISOString() });
|
|
58
|
+
assert.equal((await restarted.notificationOutbox.get(event.event_id))?.status, 'completed');
|
|
59
|
+
assert.equal(received.length, 2); assert.equal(received[0]!.id, received[1]!.id);
|
|
60
|
+
assert.equal(received[1]!.body.result.text, 'frozen-result');
|
|
61
|
+
assert.equal((await restarted.getJob(original.job_id))?.status, 'done');
|
|
62
|
+
await reconcileNotificationOutboxFor(deps); assert.equal(received.length, 2);
|
|
63
|
+
} finally { await http.close(); await rm(f.dir, { recursive: true, force: true }); }
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
test('explicit rejection stops; retryable failures stop after six attempts and manual retry resets the cycle', async () => {
|
|
67
|
+
const f = await fixture(); let calls = 0, status = 403;
|
|
68
|
+
const http = await receiver((_req, res) => { calls++; res.writeHead(status).end(); });
|
|
69
|
+
try {
|
|
70
|
+
const original = job({ callback_url: http.url }); await f.state.createJob(original);
|
|
71
|
+
await f.state.completeJobWithNotifications(original, { status: 'done' });
|
|
72
|
+
await reconcileNotificationOutboxFor(f.deps);
|
|
73
|
+
const id = (await f.state.notificationOutbox.list())[0]!.event_id;
|
|
74
|
+
assert.equal((await f.state.notificationOutbox.get(id))?.status, 'failed'); assert.equal(calls, 1);
|
|
75
|
+
await reconcileNotificationOutboxFor(f.deps); assert.equal(calls, 1);
|
|
76
|
+
await f.state.notificationOutbox.retry(id); status = 500;
|
|
77
|
+
for (let attempt = 0; attempt < 6; attempt++) await reconcileNotificationOutboxFor({ ...f.deps, now: () => new Date(Date.now() + (attempt + 1) * 3600_000).toISOString() });
|
|
78
|
+
const failed = await f.state.notificationOutbox.get(id);
|
|
79
|
+
assert.equal(failed?.status, 'failed'); assert.equal(failed?.cycle_attempts, 6); assert.equal(calls, 7);
|
|
80
|
+
await f.state.notificationOutbox.retry(id); status = 200;
|
|
81
|
+
await reconcileNotificationOutboxFor(f.deps);
|
|
82
|
+
assert.equal((await f.state.notificationOutbox.get(id))?.status, 'completed');
|
|
83
|
+
assert.equal((await f.state.notificationOutbox.get(id))?.cycle_attempts, 1);
|
|
84
|
+
} finally { await http.close(); await rm(f.dir, { recursive: true, force: true }); }
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
test('SIGKILL after receiver ACK before durable ACK replays only the same notification', { skip: process.platform === 'win32' }, async () => {
|
|
88
|
+
const f = await fixture(); const ids: string[] = [];
|
|
89
|
+
const http = await receiver((req, res) => { ids.push(String(req.headers['x-bailing-event-id'])); res.writeHead(200).end(); });
|
|
90
|
+
try {
|
|
91
|
+
const original = job({ callback_url: http.url }); await f.state.createJob(original);
|
|
92
|
+
await f.state.completeJobWithNotifications(original, { status: 'done', result: { text: 'one business execution' } });
|
|
93
|
+
const script = `import {JsonlStore} from './src/infrastructure/state/state-jsonl.ts'; import {reconcileNotificationOutboxFor} from './src/app/notification-outbox.ts';
|
|
94
|
+
const state = new JsonlStore(${JSON.stringify(f.path)}); await state.init(); state.notificationOutbox.complete = async () => { process.kill(process.pid, 'SIGKILL'); return false; };
|
|
95
|
+
await reconcileNotificationOutboxFor({cfg:${JSON.stringify(cfg)},configStore:null,stateStore:state,now:()=>new Date().toISOString(),sleep:async()=>{}});`;
|
|
96
|
+
const child = spawn(process.execPath, ['--import', 'tsx', '--input-type=module', '--eval', script], { cwd: process.cwd(), stdio: 'pipe' });
|
|
97
|
+
let stderr = ''; child.stderr.on('data', chunk => { stderr += String(chunk); });
|
|
98
|
+
const [, signal] = await once(child, 'exit'); assert.equal(signal, 'SIGKILL', stderr);
|
|
99
|
+
const restarted = new JsonlStore(f.path); await restarted.init();
|
|
100
|
+
await reconcileNotificationOutboxFor({ ...f.deps, stateStore: restarted, now: () => new Date(Date.now() + 120_000).toISOString() });
|
|
101
|
+
assert.equal(ids.length, 2); assert.equal(ids[0], ids[1]);
|
|
102
|
+
assert.equal((await restarted.notificationOutbox.list())[0]?.status, 'completed');
|
|
103
|
+
assert.equal((await restarted.getJob(original.job_id))?.status, 'done');
|
|
104
|
+
assert.equal((await restarted.listJobsByStatus(['queued', 'running'])).length, 0);
|
|
105
|
+
} finally { await http.close(); await rm(f.dir, { recursive: true, force: true }); }
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
test('native partial delivery remains uncertain and records one event-bound DLQ without automatic resend', async () => {
|
|
109
|
+
const f = await fixture(); let calls = 0; const dlqs: any[] = [];
|
|
110
|
+
const config = { deliveryDlq: { record: async (record: unknown) => { dlqs.push(record); } } } as unknown as ConfigStoreContract;
|
|
111
|
+
try {
|
|
112
|
+
const original = job({ dispatch: { delivery: { type: 'channel', channel: 'synthetic', to: 'person' } } });
|
|
113
|
+
await f.state.createJob(original); await f.state.completeJobWithNotifications(original, { status: 'done', result: { text: 'notification' } });
|
|
114
|
+
const deps = { ...f.deps, configStore: config, channelSendFor: async () => { calls++; return { ok: false, error: 'partial', mayHaveCommitted: true }; } };
|
|
115
|
+
await reconcileNotificationOutboxFor(deps); await reconcileNotificationOutboxFor(deps);
|
|
116
|
+
const event = (await f.state.notificationOutbox.list())[0]!;
|
|
117
|
+
assert.equal(event.status, 'uncertain'); assert.equal(calls, 1); assert.equal(dlqs.length, 1); assert.equal(dlqs[0].eventId, event.event_id);
|
|
118
|
+
assert.equal(await f.state.notificationOutbox.retry(event.event_id), false);
|
|
119
|
+
} finally { await rm(f.dir, { recursive: true, force: true }); }
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
test('approval notification uses its frozen destination and skips already decided approval', async () => {
|
|
123
|
+
const f = await fixture(); let calls = 0;
|
|
124
|
+
const http = await receiver((_req, res, body) => { calls++; assert.equal(JSON.parse(body).notification_event_id, 'approval:7'); res.writeHead(200).end(); });
|
|
125
|
+
try {
|
|
126
|
+
let status = 'approved'; const j = job();
|
|
127
|
+
const config = { approvals: { get: async () => ({ job_id: j.job_id, request_id: j.request_id, status }) } } as unknown as ConfigStoreContract;
|
|
128
|
+
const payload: ApprovalNotificationPayload = { approval_id: 7, job: j, provider_name: 'synthetic', subject: 'user', brand_name: 'frozen',
|
|
129
|
+
destination: { type: 'business_webhook', url: http.url }, snap: { tool: 'synthetic', scope: 'test', risk: 'high', policy: 'always', reason: 'test', method: 'POST', path: '/', args_json: '{}', args_hash: 'test' } };
|
|
130
|
+
assert.equal((await notifyApprovalPayloadFor(config, f.state, payload, cfg, now, async () => {}, defaultTargetRegistry, 'approval:7')).status, 'skipped');
|
|
131
|
+
assert.equal(calls, 0); status = 'pending';
|
|
132
|
+
const outbox = new JsonlNotificationOutbox(async work => work(), async () => {});
|
|
133
|
+
outbox.publish([newNotification('approval:7', 'approval-notification', payload, now())]);
|
|
134
|
+
await reconcileNotificationOutboxFor({ ...f.deps, configStore: { ...config, notificationOutbox: outbox } });
|
|
135
|
+
assert.equal(calls, 1); assert.equal((await outbox.get('approval:7'))?.status, 'completed');
|
|
136
|
+
} finally { await http.close(); await rm(f.dir, { recursive: true, force: true }); }
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
test('notification child create acknowledgement loss rereads exact binding; conflict never substitutes business work', async () => {
|
|
140
|
+
const f = await fixture();
|
|
141
|
+
try {
|
|
142
|
+
const child = job({ job_id: 'notification-child', request_id: 'approval_9', status: 'queued', source: 'delivery', target: 'test-notify', input: 'frozen', metadata: { parent_job_id: 'business-parent', approval_id: 9 } });
|
|
143
|
+
const create = f.state.createJob.bind(f.state);
|
|
144
|
+
f.state.createJob = async value => { await create(value); throw new Error('commit ACK lost'); };
|
|
145
|
+
assert.equal((await createNotificationChildOnce(f.state, child)).job_id, child.job_id);
|
|
146
|
+
await assert.rejects(createNotificationChildOnce(f.state, { ...child, input: 'different' }), /binding_conflict/);
|
|
147
|
+
assert.equal((await f.state.listJobsByStatus(['queued'])).length, 1);
|
|
148
|
+
} finally { await rm(f.dir, { recursive: true, force: true }); }
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
test('approval producer uses the atomic creation port, stores references and never sends before commit', async () => {
|
|
152
|
+
const f = await fixture(); let draft: any;
|
|
153
|
+
try {
|
|
154
|
+
const config = { approvals: { createWithNotification: async (_a: unknown, value: unknown) => { draft = structuredClone(value); return 5; }, create: async () => { throw new Error('legacy create forbidden'); } } } as unknown as ConfigStoreContract;
|
|
155
|
+
const approval = approvalDepsForStores(config, f.state, job(), { name: 'provider', secret: 'must-not-persist' } as any,
|
|
156
|
+
{ approval: { type: 'webhook', url: 'https://synthetic.invalid/approval' } }, { provider: 'provider', allow: [] }, cfg, now, async () => {});
|
|
157
|
+
const snap = { tool: 'test', scope: 'test', risk: 'high', policy: 'always', reason: 'test', method: 'POST', path: '/', args_json: '{}', args_hash: 'hash' };
|
|
158
|
+
assert.equal(await approval!.create(snap), 5); await approval!.notify(5, snap);
|
|
159
|
+
assert.equal(draft.provider_name, 'provider'); assert.equal(draft.brand_name, 'Synthetic');
|
|
160
|
+
assert.equal(JSON.stringify(draft).includes('must-not-persist'), false);
|
|
161
|
+
assert.equal(JSON.stringify(draft).includes(cfg.server.token), false);
|
|
162
|
+
} finally { await rm(f.dir, { recursive: true, force: true }); }
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
test('lost notification lease fences sending and acknowledgement; closing never claims new work', async () => {
|
|
166
|
+
const f = await fixture(); let sent = 0;
|
|
167
|
+
const http = await receiver((_req, res) => { sent++; res.writeHead(200).end(); });
|
|
168
|
+
try {
|
|
169
|
+
const original = job({ callback_url: http.url }); await f.state.createJob(original);
|
|
170
|
+
await f.state.completeJobWithNotifications(original, { status: 'done' });
|
|
171
|
+
await reconcileNotificationOutboxFor({ ...f.deps, isClosing: () => true });
|
|
172
|
+
const pending = (await f.state.notificationOutbox.list())[0]!; assert.equal(pending.status, 'pending'); assert.equal(pending.attempts, 0);
|
|
173
|
+
f.state.notificationOutbox.renew = async () => false;
|
|
174
|
+
await reconcileNotificationOutboxFor(f.deps);
|
|
175
|
+
assert.equal(sent, 0); assert.equal((await f.state.notificationOutbox.get(pending.event_id))?.status, 'processing');
|
|
176
|
+
} finally { await http.close(); await rm(f.dir, { recursive: true, force: true }); }
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
test('a replacement worker fences the old send acknowledgement even after HTTP succeeds', async () => {
|
|
180
|
+
const f = await fixture(); let replacementToken = '';
|
|
181
|
+
const http = await receiver((_req, res) => {
|
|
182
|
+
void f.state.notificationOutbox.claim({ owner: 'replacement', kinds: ['callback'], now: new Date(Date.now() + 120_000).toISOString(), leaseMs: 300_000 })
|
|
183
|
+
.then(events => { replacementToken = events[0]!.lease_token!; res.writeHead(200).end(); });
|
|
184
|
+
});
|
|
185
|
+
try {
|
|
186
|
+
const original = job({ callback_url: http.url }); await f.state.createJob(original);
|
|
187
|
+
await f.state.completeJobWithNotifications(original, { status: 'done' });
|
|
188
|
+
await reconcileNotificationOutboxFor(f.deps);
|
|
189
|
+
const current = (await f.state.notificationOutbox.list())[0]!;
|
|
190
|
+
assert.equal(current.status, 'processing'); assert.equal(current.lease_owner, 'replacement'); assert.equal(current.lease_token, replacementToken);
|
|
191
|
+
assert.equal(current.attempts, 2);
|
|
192
|
+
} finally { await http.close(); await rm(f.dir, { recursive: true, force: true }); }
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
test('two legitimate terminal transitions get distinct callback IDs and preserve the original notification child', async () => {
|
|
196
|
+
const f = await fixture(); const callbackIds: string[] = [];
|
|
197
|
+
const http = await receiver((req, res) => { callbackIds.push(String(req.headers['x-bailing-event-id'])); res.writeHead(200).end(); });
|
|
198
|
+
try {
|
|
199
|
+
const { TargetRegistry } = await import('../core/targets/registry'); const registry = new TargetRegistry();
|
|
200
|
+
registry.setTargets([{ name: 'synthetic-notify', kind: 'executor', stateless: true, needs_project: false, timeout_ms: 1000, enabled: true }]);
|
|
201
|
+
const original = job({ callback_url: http.url, dispatch: { delivery: { type: 'synthetic', to: 'person' } } });
|
|
202
|
+
await f.state.createJob(original); await f.state.completeJobWithNotifications(original, { status: 'done', result: { text: 'first result' } });
|
|
203
|
+
await reconcileNotificationOutboxFor({ ...f.deps, targetRegistry: registry });
|
|
204
|
+
const firstChild = await f.state.findByRequestId(`deliver_${original.job_id}`); assert.ok(firstChild);
|
|
205
|
+
const next = await f.state.updateJob(original.job_id, { status: 'running', claim_token: 'second-run' }); assert.ok(next);
|
|
206
|
+
await f.state.completeJobWithNotifications(next, { status: 'done', result: { text: 'second result' } });
|
|
207
|
+
await reconcileNotificationOutboxFor({ ...f.deps, targetRegistry: registry });
|
|
208
|
+
assert.equal(callbackIds.length, 2); assert.notEqual(callbackIds[0], callbackIds[1]);
|
|
209
|
+
assert.equal((await f.state.findByRequestId(`deliver_${original.job_id}`))?.job_id, firstChild.job_id);
|
|
210
|
+
const deliveries = await f.state.notificationOutbox.list({ kinds: ['delivery'] });
|
|
211
|
+
assert.equal(deliveries.length, 2); assert.deepEqual(deliveries.map(event => event.status).sort(), ['completed', 'skipped']);
|
|
212
|
+
assert.equal((await f.state.listJobsByStatus(['queued'])).length, 1);
|
|
213
|
+
} finally { await http.close(); await rm(f.dir, { recursive: true, force: true }); }
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
test('native delivery completion precedes DLQ resolution and resolution failure cannot replay the message', async () => {
|
|
217
|
+
const f = await fixture(); let sends = 0, resolutions = 0;
|
|
218
|
+
try {
|
|
219
|
+
const original = job({ dispatch: { delivery: { type: 'channel', channel: 'synthetic', to: 'person' } } });
|
|
220
|
+
await f.state.createJob(original); await f.state.completeJobWithNotifications(original, { status: 'done', result: { text: 'notification' } });
|
|
221
|
+
const config = { channels: { get: async () => null }, deliveryDlq: { resolveByEventId: async () => { resolutions++; throw new Error('resolution ACK lost'); } } } as unknown as ConfigStoreContract;
|
|
222
|
+
const deps = { ...f.deps, configStore: config, channelSendFor: async () => { sends++; return { ok: true }; } };
|
|
223
|
+
await reconcileNotificationOutboxFor(deps); await reconcileNotificationOutboxFor(deps);
|
|
224
|
+
assert.equal(sends, 1); assert.equal(resolutions, 1); assert.equal((await f.state.notificationOutbox.list())[0]?.status, 'completed');
|
|
225
|
+
} finally { await rm(f.dir, { recursive: true, force: true }); }
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
test('crash recovery cannot bypass the six-attempt cycle limit', async () => {
|
|
229
|
+
const f = await fixture(); let sends = 0;
|
|
230
|
+
const http = await receiver((_req, res) => { sends++; res.writeHead(200).end(); });
|
|
231
|
+
try {
|
|
232
|
+
const event = newNotification('synthetic-crash-exhausted', 'callback', { job: job({ status: 'done', callback_url: http.url }) }, now());
|
|
233
|
+
event.status = 'processing'; event.cycle_attempts = 6; event.attempts = 6; event.lease_token = 'expired'; event.lease_until = new Date(Date.now() - 1000).toISOString();
|
|
234
|
+
f.state.notificationOutbox.publish([event]);
|
|
235
|
+
await reconcileNotificationOutboxFor(f.deps);
|
|
236
|
+
assert.equal(sends, 0); assert.equal((await f.state.notificationOutbox.get(event.event_id))?.status, 'failed');
|
|
237
|
+
} finally { await http.close(); await rm(f.dir, { recursive: true, force: true }); }
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
test('native replies preserve successive approved completions while an ambiguous ACK cannot resend the same event', async () => {
|
|
241
|
+
const f = await fixture(); const sends: string[] = [];
|
|
242
|
+
try {
|
|
243
|
+
const original = job({ source: 'wecom:synthetic-channel', metadata: { wecom_userid: 'synthetic-user' } });
|
|
244
|
+
await f.state.createJob(original);
|
|
245
|
+
await f.state.completeJobWithNotifications(original, { status: 'done', result: { text: 'First action complete; another approval pending' } });
|
|
246
|
+
const deps = { ...f.deps, channelSendFor: async (_config: unknown, _channel: string, _recipient: string, message: unknown) => {
|
|
247
|
+
sends.push(String(message)); return { ok: true };
|
|
248
|
+
} };
|
|
249
|
+
const complete = f.state.notificationOutbox.complete.bind(f.state.notificationOutbox);
|
|
250
|
+
f.state.notificationOutbox.complete = async () => { throw new Error('synthetic ACK failure'); };
|
|
251
|
+
await assert.rejects(reconcileNotificationOutboxFor(deps), /synthetic ACK failure/);
|
|
252
|
+
f.state.notificationOutbox.complete = complete;
|
|
253
|
+
const first = (await f.state.notificationOutbox.list({ kinds: ['delivery'] }))[0]!;
|
|
254
|
+
await f.state.notificationOutbox.claim({ owner: 'recovery', kinds: ['delivery'], now: new Date(Date.now() + 120_000).toISOString() });
|
|
255
|
+
assert.equal((await f.state.notificationOutbox.get(first.event_id))?.status, 'uncertain');
|
|
256
|
+
assert.equal(await f.state.notificationOutbox.retry(first.event_id, { expectedStatus: 'uncertain', allowUncertain: true }), true);
|
|
257
|
+
await reconcileNotificationOutboxFor(deps);
|
|
258
|
+
assert.equal(sends.length, 1);
|
|
259
|
+
assert.equal((await f.state.notificationOutbox.get(first.event_id))?.status, 'skipped');
|
|
260
|
+
const next = await f.state.updateJob(original.job_id, { status: 'running', claim_token: 'next-approved-continuation' });
|
|
261
|
+
assert.ok(next);
|
|
262
|
+
await f.state.completeJobWithNotifications(next, { status: 'done', result: { text: 'All approved actions complete' } });
|
|
263
|
+
await reconcileNotificationOutboxFor(deps);
|
|
264
|
+
await reconcileNotificationOutboxFor(deps);
|
|
265
|
+
assert.deepEqual(sends, ['First action complete; another approval pending', 'All approved actions complete']);
|
|
266
|
+
const events = await f.state.notificationOutbox.list({ kinds: ['delivery'] });
|
|
267
|
+
assert.equal(events.length, 2);
|
|
268
|
+
const children = await Promise.all(events.map(event => f.state.findByRequestId(`deliver_${event.event_id}`)));
|
|
269
|
+
assert.ok(children.every(child => child?.status === 'done'));
|
|
270
|
+
assert.notEqual(children[0]!.job_id, children[1]!.job_id);
|
|
271
|
+
} finally { await rm(f.dir, { recursive: true, force: true }); }
|
|
272
|
+
});
|
|
273
|
+
|
|
274
|
+
test('an explicit channel route still delivers once per parent across terminal transitions', async () => {
|
|
275
|
+
const f = await fixture(); let sends = 0;
|
|
276
|
+
try {
|
|
277
|
+
const original = job({ dispatch: { delivery: { type: 'channel', channel: 'synthetic', to: 'person' } } });
|
|
278
|
+
await f.state.createJob(original);
|
|
279
|
+
await f.state.completeJobWithNotifications(original, { status: 'done', result: { text: 'first result' } });
|
|
280
|
+
const deps = { ...f.deps, channelSendFor: async () => { sends++; return { ok: true }; } };
|
|
281
|
+
await reconcileNotificationOutboxFor(deps);
|
|
282
|
+
const firstChild = await f.state.findByRequestId(`deliver_${original.job_id}`); assert.ok(firstChild);
|
|
283
|
+
const next = await f.state.updateJob(original.job_id, { status: 'running', claim_token: 'second-run' }); assert.ok(next);
|
|
284
|
+
await f.state.completeJobWithNotifications(next, { status: 'done', result: { text: 'second result' } });
|
|
285
|
+
await reconcileNotificationOutboxFor(deps);
|
|
286
|
+
assert.equal(sends, 1);
|
|
287
|
+
assert.equal((await f.state.findByRequestId(`deliver_${original.job_id}`))?.job_id, firstChild.job_id);
|
|
288
|
+
assert.deepEqual((await f.state.notificationOutbox.list({ kinds: ['delivery'] })).map(event => event.status).sort(), ['completed', 'skipped']);
|
|
289
|
+
} finally { await rm(f.dir, { recursive: true, force: true }); }
|
|
290
|
+
});
|
|
291
|
+
|
|
292
|
+
test('native delivery retains tracked best-effort failure alerts without changing its saved outcome', async () => {
|
|
293
|
+
for (const breakAlertAudit of [false, true]) {
|
|
294
|
+
const f = await fixture(); let alerts = 0;
|
|
295
|
+
const http = await receiver((_req, res, raw) => {
|
|
296
|
+
const payload = JSON.parse(raw); assert.equal(payload.kind, 'alert');
|
|
297
|
+
assert.equal(payload.key, 'delivery_failed_synthetic'); alerts++; res.writeHead(200).end();
|
|
298
|
+
});
|
|
299
|
+
try {
|
|
300
|
+
const appendAudit = f.state.appendAudit.bind(f.state);
|
|
301
|
+
f.state.appendAudit = async entry => {
|
|
302
|
+
if (breakAlertAudit && entry.event === 'alert') throw new Error('synthetic alert audit unavailable');
|
|
303
|
+
await appendAudit(entry);
|
|
304
|
+
};
|
|
305
|
+
const original = job({ dispatch: { delivery: { type: 'channel', channel: 'synthetic', to: 'person' } } });
|
|
306
|
+
await f.state.createJob(original);
|
|
307
|
+
await f.state.completeJobWithNotifications(original, { status: 'done', result: { text: 'notification' } });
|
|
308
|
+
const config = { alertRules: { matching: async () => [] }, deliveryDlq: { record: async () => {} } } as unknown as ConfigStoreContract;
|
|
309
|
+
await reconcileNotificationOutboxFor({ ...f.deps, configStore: config, cfg: { ...cfg, alerts: { type: 'webhook', url: http.url, cooldown_min: 0 } },
|
|
310
|
+
channelSendFor: async () => ({ ok: false, error: 'synthetic_channel_rejected' }) });
|
|
311
|
+
const work = notificationBackgroundWorkFor(f.state);
|
|
312
|
+
assert.equal(await work.drain(2000), true);
|
|
313
|
+
assert.equal((await f.state.notificationOutbox.list({ kinds: ['delivery'] }))[0]?.status, 'failed');
|
|
314
|
+
assert.equal(alerts, breakAlertAudit ? 0 : 1);
|
|
315
|
+
const alert = work.snapshot().kinds.find(row => row.kind === 'alert')!;
|
|
316
|
+
assert.equal(alert.inFlight, 0);
|
|
317
|
+
if (breakAlertAudit) assert.equal(alert.failed, 1);
|
|
318
|
+
else assert.ok(alert.completed >= 1);
|
|
319
|
+
} finally { await notificationBackgroundWorkFor(f.state).drain(2000); await http.close(); await rm(f.dir, { recursive: true, force: true }); }
|
|
320
|
+
}
|
|
321
|
+
});
|