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
|
@@ -26,6 +26,7 @@ const AUDIT_RETENTION_CLEANUP_MS = 6 * 60 * 60 * 1000;
|
|
|
26
26
|
const TOOL_INDEX_PREWARM_DELAY_MS = 0;
|
|
27
27
|
const USAGE_MAINTENANCE_MS = 60_000;
|
|
28
28
|
const APPROVAL_CONTINUATION_MS = 60_000;
|
|
29
|
+
const NOTIFICATION_OUTBOX_MS = 5_000;
|
|
29
30
|
|
|
30
31
|
// 兜底:定期把派发后长时间未回报的 dispatched 任务重排回队列(执行器/网络异常时不至于卡死)。
|
|
31
32
|
// 阈值需大于最长任务耗时(出厂能力档上限 6min),这里取 20min。
|
|
@@ -39,7 +40,7 @@ const TOOL_CALL_RETENTION_MS = 3 * 24 * 60 * 60 * 1000;
|
|
|
39
40
|
|
|
40
41
|
export interface RuntimeSchedulers {
|
|
41
42
|
stop(): void;
|
|
42
|
-
/**
|
|
43
|
+
/** Accepted scheduler producers must finish registering children before resources close. */
|
|
43
44
|
drain?(drainMs?: number): Promise<boolean>;
|
|
44
45
|
}
|
|
45
46
|
|
|
@@ -60,6 +61,8 @@ export interface RuntimeLifecycleDeps {
|
|
|
60
61
|
afterStoresInitialized?: () => Promise<void>;
|
|
61
62
|
/** Reconcile already-decided approvals; never creates a new user decision. */
|
|
62
63
|
reconcileApprovalContinuations?: () => Promise<void>;
|
|
64
|
+
/** Deliver saved notification intents; never re-executes the business job. */
|
|
65
|
+
reconcileNotifications?: () => Promise<void>;
|
|
63
66
|
/** 可嵌入宿主必须注入 Kernel 自己的 registry;默认实例仅服务旧 OSS 包装。 */
|
|
64
67
|
targetRegistry?: TargetRegistry;
|
|
65
68
|
}
|
|
@@ -126,6 +129,7 @@ async function runToolIndexPrewarmFor(deps: RuntimeLifecycleDeps): Promise<void>
|
|
|
126
129
|
interface RuntimeMaintenanceActions {
|
|
127
130
|
reconcileUsage(): Promise<void>;
|
|
128
131
|
reconcileApprovals(): Promise<void>;
|
|
132
|
+
reconcileNotifications(): Promise<void>;
|
|
129
133
|
prewarmToolIndexes(): Promise<void>;
|
|
130
134
|
refreshTargets(): Promise<void>;
|
|
131
135
|
drainInhub(maxClaims?: number): Promise<number>;
|
|
@@ -146,6 +150,7 @@ function runtimeMaintenanceActionsFor(deps: RuntimeLifecycleDeps): RuntimeMainte
|
|
|
146
150
|
return {
|
|
147
151
|
reconcileUsage: () => runUsageMaintenanceFor(deps.configStore?.usage ?? null),
|
|
148
152
|
reconcileApprovals: () => deps.reconcileApprovalContinuations?.() ?? Promise.resolve(),
|
|
153
|
+
reconcileNotifications: () => deps.reconcileNotifications?.() ?? Promise.resolve(),
|
|
149
154
|
prewarmToolIndexes: () => runToolIndexPrewarmFor(deps),
|
|
150
155
|
async refreshTargets() {
|
|
151
156
|
await deps.refreshTargets();
|
|
@@ -313,6 +318,7 @@ export function createManagedRuntimeMaintenanceFor(
|
|
|
313
318
|
// Neither task sends provider requests or restores client orchestration.
|
|
314
319
|
scheduled('usage-maintenance', 0, USAGE_MAINTENANCE_MS, actions.reconcileUsage, false),
|
|
315
320
|
scheduled('approval-continuations', 0, APPROVAL_CONTINUATION_MS, actions.reconcileApprovals, false),
|
|
321
|
+
scheduled('notification-outbox', 0, NOTIFICATION_OUTBOX_MS, actions.reconcileNotifications, false),
|
|
316
322
|
scheduled('boot-recovery', 2_000, null, actions.recoverBoot),
|
|
317
323
|
scheduled('target-refresh', TARGET_REFRESH_MS, TARGET_REFRESH_MS, actions.refreshTargets),
|
|
318
324
|
scheduled('monitor', MONITOR_DELAY_MS, MONITOR_INTERVAL_MS, actions.monitor),
|
|
@@ -393,60 +399,64 @@ export function createManagedRuntimeMaintenanceFor(
|
|
|
393
399
|
export function startRuntimeSchedulersFor(deps: RuntimeLifecycleDeps): RuntimeSchedulers {
|
|
394
400
|
const actions = runtimeMaintenanceActionsFor(deps);
|
|
395
401
|
const timers: Array<ReturnType<typeof setInterval> | ReturnType<typeof setTimeout>> = [];
|
|
396
|
-
const
|
|
402
|
+
const acceptedWork = new Set<Promise<unknown>>();
|
|
397
403
|
let stopped = false;
|
|
398
|
-
function reconcile(action: () => Promise<
|
|
404
|
+
function reconcile(action: () => Promise<unknown>): void {
|
|
399
405
|
if (stopped) return;
|
|
400
406
|
const work = Promise.resolve().then(action);
|
|
401
|
-
|
|
402
|
-
void work.finally(() =>
|
|
407
|
+
acceptedWork.add(work);
|
|
408
|
+
void work.finally(() => acceptedWork.delete(work)).catch(() => undefined);
|
|
403
409
|
}
|
|
404
410
|
const every = (fn: () => void, ms: number): void => {
|
|
411
|
+
if (stopped) return;
|
|
405
412
|
const timer = setInterval(fn, ms);
|
|
406
413
|
timer.unref();
|
|
407
414
|
timers.push(timer);
|
|
408
415
|
};
|
|
409
416
|
const later = (fn: () => void, ms: number): void => {
|
|
417
|
+
if (stopped) return;
|
|
410
418
|
const timer = setTimeout(fn, ms);
|
|
411
419
|
timer.unref();
|
|
412
420
|
timers.push(timer);
|
|
413
421
|
};
|
|
414
422
|
|
|
415
423
|
// 服务先启动,索引随后在后台预热;任何数据库/索引异常都不阻塞 HTTP 就绪。
|
|
416
|
-
later(() =>
|
|
424
|
+
later(() => reconcile(actions.prewarmToolIndexes), TOOL_INDEX_PREWARM_DELAY_MS);
|
|
417
425
|
later(() => reconcile(actions.reconcileUsage), 0);
|
|
418
426
|
later(() => reconcile(actions.reconcileApprovals), 0);
|
|
427
|
+
later(() => reconcile(actions.reconcileNotifications), 0);
|
|
419
428
|
every(() => reconcile(actions.reconcileUsage), USAGE_MAINTENANCE_MS);
|
|
420
429
|
every(() => reconcile(actions.reconcileApprovals), APPROVAL_CONTINUATION_MS);
|
|
430
|
+
every(() => reconcile(actions.reconcileNotifications), NOTIFICATION_OUTBOX_MS);
|
|
421
431
|
|
|
422
|
-
every(() =>
|
|
432
|
+
every(() => reconcile(actions.refreshTargets), TARGET_REFRESH_MS);
|
|
423
433
|
|
|
424
434
|
// inhub DB 调度器:llm 等中枢内目标也从 bz_jobs 队列认领,避免依赖建单进程的内存 promise。
|
|
425
435
|
// kick 提供低延迟,tick 提供兜底与多实例拾取;认领本身在 DB 里原子化。
|
|
426
|
-
every(() =>
|
|
436
|
+
every(() => reconcile(() => actions.drainInhub(1)), INHUB_DRAIN_MS);
|
|
427
437
|
|
|
428
438
|
// 自监控:启动 1 分钟后首跑,避开冷启动误报。
|
|
429
439
|
later(() => {
|
|
430
|
-
|
|
431
|
-
every(() =>
|
|
440
|
+
reconcile(actions.monitor);
|
|
441
|
+
every(() => reconcile(actions.monitor), MONITOR_INTERVAL_MS);
|
|
432
442
|
}, MONITOR_DELAY_MS);
|
|
433
443
|
|
|
434
444
|
// 工具源 spec 自动刷新:每分钟扫一遍,按各源 auto_refresh_min 节流。
|
|
435
|
-
every(() =>
|
|
445
|
+
every(() => reconcile(actions.refreshSpecs), SPEC_REFRESH_MS);
|
|
436
446
|
|
|
437
447
|
// 知识库数据源连接器:每分钟扫一遍到点的(变更/出错记审计,平稳无事不刷流水)。
|
|
438
448
|
if (deps.kbSync) {
|
|
439
|
-
every(() =>
|
|
449
|
+
every(() => reconcile(actions.syncKnowledgeBases), KB_SYNC_MS);
|
|
440
450
|
}
|
|
441
451
|
|
|
442
|
-
every(() =>
|
|
452
|
+
every(() => reconcile(actions.reapStaleWork), REAPER_INTERVAL_MS);
|
|
443
453
|
|
|
444
454
|
// 执行日志清理:只删除超龄且已确认 completed 的行;未决状态必须保留给人工对账。
|
|
445
|
-
every(() =>
|
|
455
|
+
every(() => reconcile(actions.cleanupToolCalls), TOOL_CALL_CLEANUP_MS);
|
|
446
456
|
|
|
447
457
|
if (deps.cfg.auditRetentionDays > 0) {
|
|
448
|
-
later(() =>
|
|
449
|
-
every(() =>
|
|
458
|
+
later(() => reconcile(actions.cleanupAudit), 60_000);
|
|
459
|
+
every(() => reconcile(actions.cleanupAudit), AUDIT_RETENTION_CLEANUP_MS);
|
|
450
460
|
}
|
|
451
461
|
|
|
452
462
|
return {
|
|
@@ -455,12 +465,12 @@ export function startRuntimeSchedulersFor(deps: RuntimeLifecycleDeps): RuntimeSc
|
|
|
455
465
|
for (const timer of timers.splice(0)) clearTimeout(timer);
|
|
456
466
|
},
|
|
457
467
|
async drain(drainMs = 30_000) {
|
|
458
|
-
if (
|
|
468
|
+
if (acceptedWork.size === 0) return true;
|
|
459
469
|
const bounded = Number.isFinite(drainMs) ? Math.max(0, Math.floor(drainMs)) : 0;
|
|
460
470
|
let timer: ReturnType<typeof setTimeout> | undefined;
|
|
461
471
|
try {
|
|
462
472
|
return await Promise.race([
|
|
463
|
-
Promise.allSettled([...
|
|
473
|
+
Promise.allSettled([...acceptedWork]).then(() => true),
|
|
464
474
|
new Promise<boolean>(resolve => { timer = setTimeout(() => resolve(false), bounded); }),
|
|
465
475
|
]);
|
|
466
476
|
} finally { if (timer) clearTimeout(timer); }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { randomUUID } from 'node:crypto';
|
|
2
|
-
import { outboundRuntimeDepsFor, postSignedWithDeps, secretForJobWithDeps } from './outbound';
|
|
2
|
+
import { outboundRuntimeDepsFor, postSignedWithDeps, postSignedNotificationWithDeps, secretForJobWithDeps, type NotificationSendOutcome } from './outbound';
|
|
3
3
|
import type { ApprovalDeps, ApprovalIntentSnap } from '../core/contracts/tools';
|
|
4
|
-
import { approvalConfig, type RouteToolsConfig, type ToolSourceConfig } from '../core/config/tools-config';
|
|
4
|
+
import { approvalConfig, type RouteToolsConfig, type ToolSourceConfig, type ToolApprovalConfig } from '../core/config/tools-config';
|
|
5
5
|
import type { Job, ToolProvider } from '../core/contracts/types';
|
|
6
6
|
import { defaultTargetRegistry, type TargetRegistry } from '../core/targets/registry';
|
|
7
7
|
import { subjectOf } from './tool-context';
|
|
@@ -9,6 +9,17 @@ import type { ConfigStoreContract } from '../infrastructure/config/configstore';
|
|
|
9
9
|
import type { RuntimeStateStore } from '../core/state/state-contracts';
|
|
10
10
|
import type { AppConfig } from '../core/config/config';
|
|
11
11
|
import { isAgentToolInvocationJob } from './agent-tool-job';
|
|
12
|
+
import { notificationBackgroundWorkFor } from '../core/runtime/notification-background-work';
|
|
13
|
+
import { wakeNotificationOutboxFor } from '../core/runtime/notification-outbox-work';
|
|
14
|
+
import type { ApprovalNotificationPayload } from '../core/contracts/notification-outbox';
|
|
15
|
+
import { createNotificationChildOnce } from './delivery';
|
|
16
|
+
|
|
17
|
+
function notificationDestination(tools: RouteToolsConfig, config: AppConfig): ToolApprovalConfig | undefined {
|
|
18
|
+
const value = approvalConfig(tools) ?? config.alerts;
|
|
19
|
+
if (!value?.type) return undefined;
|
|
20
|
+
// Freeze routing coordinates only; provider/channel credentials stay in their own stores.
|
|
21
|
+
return { type: value.type, ...(value.url ? { url: value.url } : {}), ...(value.to ? { to: value.to } : {}) };
|
|
22
|
+
}
|
|
12
23
|
|
|
13
24
|
/** 重跑时的"已批准调用清单"提示:审批车道 B 的另一半。 */
|
|
14
25
|
export async function approvedNoteForJobFor(config: ConfigStoreContract | null, jobId: string): Promise<string | undefined> {
|
|
@@ -59,15 +70,32 @@ export function approvalDepsForStores(
|
|
|
59
70
|
async create(snap) {
|
|
60
71
|
const onBehalfOf = subjectOf(job, sourceCfg);
|
|
61
72
|
const intent = approvalIntentFor(job, provider, sourceCfg, snap, onBehalfOf);
|
|
62
|
-
|
|
73
|
+
const approval = {
|
|
63
74
|
job_id: job.job_id, request_id: job.request_id, provider: provider.name,
|
|
64
75
|
tool: snap.tool, scope: snap.scope, risk: snap.risk, policy: snap.policy, reason: snap.reason,
|
|
65
76
|
method: snap.method, path: snap.path, summary: snap.summary,
|
|
66
77
|
args_json: snap.args_json, args_hash: snap.args_hash, intent, on_behalf_of: onBehalfOf || undefined,
|
|
67
|
-
}
|
|
78
|
+
};
|
|
79
|
+
if (cs.approvals.createWithNotification) {
|
|
80
|
+
const id = await cs.approvals.createWithNotification(approval, {
|
|
81
|
+
job, provider_name: provider.name, subject: onBehalfOf, subject_field: sourceCfg.subject_field,
|
|
82
|
+
snap, brand_name: appConfig.brand.name,
|
|
83
|
+
destination: notificationDestination(toolsCfg, appConfig),
|
|
84
|
+
});
|
|
85
|
+
wakeNotificationOutboxFor(state);
|
|
86
|
+
return id;
|
|
87
|
+
}
|
|
88
|
+
return cs.approvals.create(approval);
|
|
68
89
|
},
|
|
69
90
|
async notify(id, snap) {
|
|
70
|
-
|
|
91
|
+
if (cs.approvals.createWithNotification) { wakeNotificationOutboxFor(state); return; }
|
|
92
|
+
// Compatibility for external ledgers without the durable creation port.
|
|
93
|
+
await notificationBackgroundWorkFor(state).track('approval-notification', async () => {
|
|
94
|
+
await notifyApprovalPayloadFor(config, state, { approval_id: id, job, provider_name: provider.name,
|
|
95
|
+
subject: subjectOf(job, sourceCfg), subject_field: sourceCfg.subject_field, snap, brand_name: appConfig.brand.name,
|
|
96
|
+
destination: notificationDestination(toolsCfg, appConfig),
|
|
97
|
+
}, appConfig, nowFn, sleepFn, targetRegistry);
|
|
98
|
+
});
|
|
71
99
|
},
|
|
72
100
|
};
|
|
73
101
|
}
|
|
@@ -101,20 +129,27 @@ function approvalIntentFor(job: Job, provider: ToolProvider, sourceCfg: ToolSour
|
|
|
101
129
|
};
|
|
102
130
|
}
|
|
103
131
|
|
|
104
|
-
async function
|
|
132
|
+
export async function notifyApprovalPayloadFor(
|
|
105
133
|
config: ConfigStoreContract | null,
|
|
106
134
|
state: RuntimeStateStore,
|
|
107
|
-
|
|
108
|
-
provider: ToolProvider,
|
|
109
|
-
toolsCfg: RouteToolsConfig,
|
|
110
|
-
sourceCfg: ToolSourceConfig,
|
|
111
|
-
approvalId: number,
|
|
112
|
-
snap: ApprovalIntentSnap,
|
|
135
|
+
payload: ApprovalNotificationPayload,
|
|
113
136
|
appConfig: AppConfig,
|
|
114
137
|
nowFn: () => string,
|
|
115
138
|
sleepFn: (ms: number) => Promise<void>,
|
|
116
139
|
targetRegistry: TargetRegistry,
|
|
117
|
-
|
|
140
|
+
eventId?: string,
|
|
141
|
+
): Promise<NotificationSendOutcome> {
|
|
142
|
+
const { job, snap, approval_id: approvalId } = payload;
|
|
143
|
+
const provider = { name: payload.provider_name } as ToolProvider;
|
|
144
|
+
const sourceCfg = { provider: payload.provider_name, allow: [], subject_field: payload.subject_field };
|
|
145
|
+
const subject = payload.subject;
|
|
146
|
+
const brandName = payload.brand_name ?? appConfig.brand.name;
|
|
147
|
+
if (eventId) {
|
|
148
|
+
if (!config) return { status: 'failed', error: 'Approval repository unavailable' };
|
|
149
|
+
const approval = await config.approvals.get(approvalId);
|
|
150
|
+
if (!approval || approval.job_id !== job.job_id || approval.request_id !== job.request_id) return { status: 'failed', error: 'approval_notification_binding_conflict' };
|
|
151
|
+
if (approval.status !== 'pending') return { status: 'skipped', error: 'Approval already decided' };
|
|
152
|
+
}
|
|
118
153
|
const outboundRuntime = outboundRuntimeDepsFor({
|
|
119
154
|
cfg: appConfig,
|
|
120
155
|
configStore: config,
|
|
@@ -122,10 +157,9 @@ async function notifyApprovalFor(
|
|
|
122
157
|
now: nowFn,
|
|
123
158
|
sleep: sleepFn,
|
|
124
159
|
});
|
|
125
|
-
const subject = subjectOf(job, sourceCfg);
|
|
126
160
|
const intent = approvalIntentFor(job, provider, sourceCfg, snap, subject);
|
|
127
161
|
const content = [
|
|
128
|
-
`【${
|
|
162
|
+
`【${brandName}】工具调用待审批`,
|
|
129
163
|
`审批单:${approvalId}`,
|
|
130
164
|
...(snap.summary ? [`动作:${snap.summary}`] : []),
|
|
131
165
|
`触发原因:${snap.reason}`,
|
|
@@ -135,25 +169,31 @@ async function notifyApprovalFor(
|
|
|
135
169
|
isAgentToolInvocationJob(job)
|
|
136
170
|
? '请到控制台「工具审批」页处理;批准后由原本地 Agent 用 invocation_id 续执行,中枢不启动模型重跑。'
|
|
137
171
|
: '请到控制台「工具审批」页处理;批准后任务将自动重跑完成该操作。',
|
|
138
|
-
'', `—— ${
|
|
172
|
+
'', `—— ${brandName}`,
|
|
139
173
|
].join('\n');
|
|
140
|
-
const ap =
|
|
141
|
-
|
|
174
|
+
const ap = payload.destination;
|
|
175
|
+
const post = async (url: string, body: Record<string, unknown>, event: string): Promise<NotificationSendOutcome> => {
|
|
176
|
+
const secret = await secretForJobWithDeps(outboundRuntime, job);
|
|
177
|
+
const audit = { job_id: job.job_id, request_id: job.request_id, event };
|
|
178
|
+
if (eventId) return postSignedNotificationWithDeps(outboundRuntime, url, body, secret, eventId, audit);
|
|
179
|
+
void postSignedWithDeps(outboundRuntime, url, body, secret, audit);
|
|
180
|
+
return { status: 'completed' };
|
|
181
|
+
};
|
|
142
182
|
if (!ap || !ap['type']) {
|
|
143
183
|
await state.appendAudit({ ts: nowFn(), job_id: job.job_id, request_id: job.request_id, event: 'approval_notify_skipped', detail: { approval_id: approvalId, reason: '未配置审批通知渠道(路由 tools.approval 与 config alerts 均空),请在控制台「工具审批」处理' } });
|
|
144
|
-
return;
|
|
184
|
+
return { status: 'skipped', error: 'Approval destination not configured' };
|
|
145
185
|
}
|
|
146
186
|
const type = String(ap['type']);
|
|
147
187
|
if ((type === 'business_webhook' || type === 'approval_webhook') && ap['url']) {
|
|
148
188
|
let args: unknown = {};
|
|
149
189
|
try { args = JSON.parse(snap.args_json || '{}'); } catch { args = snap.args_json; }
|
|
150
|
-
|
|
190
|
+
return post(String(ap['url']), {
|
|
151
191
|
kind: 'tool_approval_request',
|
|
152
192
|
approval_id: approvalId,
|
|
153
193
|
job_id: job.job_id,
|
|
154
194
|
request_id: job.request_id,
|
|
155
195
|
route: job.dispatch?.route_name,
|
|
156
|
-
subject:
|
|
196
|
+
subject: subject || undefined,
|
|
157
197
|
provider: provider.name,
|
|
158
198
|
tool: snap.tool,
|
|
159
199
|
scope: snap.scope,
|
|
@@ -193,30 +233,28 @@ async function notifyApprovalFor(
|
|
|
193
233
|
},
|
|
194
234
|
},
|
|
195
235
|
metadata: job.metadata ?? {},
|
|
196
|
-
},
|
|
197
|
-
return;
|
|
236
|
+
}, 'approval_intent_webhook');
|
|
198
237
|
}
|
|
199
238
|
if (type === 'webhook' && ap['url']) {
|
|
200
|
-
|
|
239
|
+
return post(String(ap['url']), {
|
|
201
240
|
kind: 'tool_approval', approval_id: approvalId, job_id: job.job_id, request_id: job.request_id,
|
|
202
241
|
tool: snap.tool, scope: snap.scope, risk: snap.risk, policy: snap.policy, reason: snap.reason, args: snap.args_json, intent: { approval_id: approvalId, ...intent }, message: content,
|
|
203
|
-
},
|
|
204
|
-
return;
|
|
242
|
+
}, 'approval_notify');
|
|
205
243
|
}
|
|
206
244
|
const targetName = `${type}-notify`;
|
|
207
245
|
if (targetRegistry.get(targetName)?.kind !== 'executor' || !ap['to']) {
|
|
208
246
|
await state.appendAudit({ ts: nowFn(), job_id: job.job_id, request_id: job.request_id, event: 'approval_notify_skipped', detail: { approval_id: approvalId, reason: `送达类型 ${type} 不可用(需注册 ${targetName} 执行器目标且配收件人)` } });
|
|
209
|
-
return;
|
|
247
|
+
return { status: 'skipped', error: 'Approval notification executor or recipient unavailable' };
|
|
210
248
|
}
|
|
211
249
|
const reqId = `approval_${approvalId}`;
|
|
212
|
-
if (await state.findByRequestId(reqId)) return;
|
|
213
250
|
const child: Job = {
|
|
214
251
|
job_id: randomUUID(), request_id: reqId, status: 'queued',
|
|
215
252
|
target: targetName, profile: 'delivery', project: '', source: 'delivery',
|
|
216
253
|
session_id: randomUUID(), input_preview: content.slice(0, 200), input: content,
|
|
217
|
-
dispatch: { target_config: ap }, metadata: { to: String(ap['to']), approval_id: approvalId, parent_job_id: job.job_id },
|
|
254
|
+
dispatch: { target_config: ap }, metadata: { to: String(ap['to']), approval_id: approvalId, parent_job_id: job.job_id, ...(eventId ? { notification_event_id: eventId } : {}) },
|
|
218
255
|
created_at: nowFn(), updated_at: nowFn(),
|
|
219
256
|
};
|
|
220
|
-
await state
|
|
221
|
-
await state.appendAudit({ ts: nowFn(), job_id: job.job_id, request_id: job.request_id, event: 'approval_notify_queued', detail: { approval_id: approvalId, type, to: ap['to'], child_job: child.job_id } });
|
|
257
|
+
await createNotificationChildOnce(state, child);
|
|
258
|
+
await state.appendAudit({ ts: nowFn(), job_id: job.job_id, request_id: job.request_id, event: 'approval_notify_queued', detail: { approval_id: approvalId, type, to: ap['to'], child_job: child.job_id } }).catch(() => undefined);
|
|
259
|
+
return { status: 'completed' };
|
|
222
260
|
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Job } from './types';
|
|
2
|
+
import { truncateUtf8 } from '../platform/http-body';
|
|
3
|
+
|
|
4
|
+
export type DeliveryKind = 'native_channel' | 'executor_target';
|
|
5
|
+
export interface DeliveryDlqRecord {
|
|
6
|
+
id: number;
|
|
7
|
+
parent_job_id?: string;
|
|
8
|
+
channel: string;
|
|
9
|
+
recipient: string;
|
|
10
|
+
content: string;
|
|
11
|
+
resolved: boolean;
|
|
12
|
+
delivery_kind?: DeliveryKind | null;
|
|
13
|
+
notification_job_id?: string | null;
|
|
14
|
+
executor_replay_key?: string | null;
|
|
15
|
+
event_id?: string | null;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface DeliveryRequeueInput {
|
|
19
|
+
dlq_id: number;
|
|
20
|
+
replay_key: string;
|
|
21
|
+
job_id: string;
|
|
22
|
+
request_id: string;
|
|
23
|
+
target: string;
|
|
24
|
+
/** Non-SQL adapters recheck the original DLQ under their single-writer lock. */
|
|
25
|
+
isOriginalDelivery?: () => Promise<boolean>;
|
|
26
|
+
}
|
|
27
|
+
export type DeliveryRequeueOutcome = 'queued' | 'already_queued' | 'in_flight' | 'missing' | 'conflict';
|
|
28
|
+
|
|
29
|
+
export function deliveryReplayKey(dlqId: number): string {
|
|
30
|
+
if (!Number.isSafeInteger(dlqId) || dlqId <= 0) throw new Error('delivery_dlq_invalid_id');
|
|
31
|
+
return `delivery-dlq:${dlqId}`;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** A DLQ may only replay the original notification child, never its business parent. */
|
|
35
|
+
export function isOriginalExecutorDelivery(d: DeliveryDlqRecord, job: Job | null): boolean {
|
|
36
|
+
if (!job || job.source !== 'delivery' || !job.target?.endsWith('-notify') || d.channel !== job.target
|
|
37
|
+
|| d.parent_job_id !== job.job_id || (d.notification_job_id && d.notification_job_id !== job.job_id)
|
|
38
|
+
|| (d.delivery_kind && d.delivery_kind !== 'executor_target')) return false;
|
|
39
|
+
const recipient = String(job.metadata?.recipient ?? job.metadata?.to ?? '?').slice(0, 512);
|
|
40
|
+
const content = String(job.input ?? '');
|
|
41
|
+
return d.recipient === recipient && (d.content === truncateUtf8(content, 60000) || d.content === content.slice(0, 60000));
|
|
42
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { Job } from './types';
|
|
2
|
+
import type { ApprovalIntentSnap } from './tools';
|
|
3
|
+
import type { ToolApprovalConfig } from '../config/tools-config';
|
|
4
|
+
|
|
5
|
+
export const NOTIFICATION_KINDS = ['callback', 'delivery', 'approval-notification', 'delivery-dlq'] as const;
|
|
6
|
+
export type NotificationKind = typeof NOTIFICATION_KINDS[number];
|
|
7
|
+
export const NOTIFICATION_STATUSES = ['pending', 'processing', 'completed', 'skipped', 'failed', 'uncertain'] as const;
|
|
8
|
+
export type NotificationStatus = typeof NOTIFICATION_STATUSES[number];
|
|
9
|
+
export interface ApprovalNotificationDraft {
|
|
10
|
+
job: Job;
|
|
11
|
+
provider_name: string;
|
|
12
|
+
subject: string;
|
|
13
|
+
subject_field?: string;
|
|
14
|
+
snap: ApprovalIntentSnap;
|
|
15
|
+
destination?: ToolApprovalConfig;
|
|
16
|
+
brand_name?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface ApprovalNotificationPayload extends ApprovalNotificationDraft { approval_id: number }
|
|
19
|
+
export interface NotificationEvent {
|
|
20
|
+
event_id: string;
|
|
21
|
+
kind: NotificationKind;
|
|
22
|
+
job_id: string;
|
|
23
|
+
request_id: string;
|
|
24
|
+
payload: { job: Job; brand_name?: string } | ApprovalNotificationPayload;
|
|
25
|
+
status: NotificationStatus;
|
|
26
|
+
attempts: number;
|
|
27
|
+
cycle_attempts: number;
|
|
28
|
+
recovery: 'retry' | 'uncertain';
|
|
29
|
+
available_at: string;
|
|
30
|
+
created_at: string;
|
|
31
|
+
updated_at: string;
|
|
32
|
+
lease_token?: string;
|
|
33
|
+
lease_until?: string;
|
|
34
|
+
lease_owner?: string;
|
|
35
|
+
last_error?: string;
|
|
36
|
+
completed_at?: string;
|
|
37
|
+
}
|
|
38
|
+
export interface NotificationClaimOptions { owner: string; kinds?: NotificationKind[]; limit?: number; leaseMs?: number; now?: string }
|
|
39
|
+
export interface NotificationListOptions { kinds?: NotificationKind[]; statuses?: NotificationStatus[]; limit?: number; offset?: number }
|
|
40
|
+
export interface NotificationSnapshot {
|
|
41
|
+
counts: Record<NotificationStatus, number>;
|
|
42
|
+
oldestPendingAgeSeconds: number;
|
|
43
|
+
expiredLeases: number;
|
|
44
|
+
}
|
|
45
|
+
export interface NotificationOutboxRepository {
|
|
46
|
+
claim(options: NotificationClaimOptions): Promise<NotificationEvent[]>;
|
|
47
|
+
renew(eventId: string, leaseToken: string, leaseMs: number): Promise<boolean>;
|
|
48
|
+
complete(eventId: string, leaseToken: string, outcome?: 'completed' | 'skipped', note?: string): Promise<boolean>;
|
|
49
|
+
fail(eventId: string, leaseToken: string, options: { status: 'pending' | 'failed' | 'uncertain'; error: string; availableAt?: string }): Promise<boolean>;
|
|
50
|
+
retry(eventId: string, options?: { expectedStatus?: 'failed' | 'uncertain'; allowUncertain?: boolean; now?: string }): Promise<boolean>;
|
|
51
|
+
get(eventId: string): Promise<NotificationEvent | null>;
|
|
52
|
+
list(options?: NotificationListOptions): Promise<NotificationEvent[]>;
|
|
53
|
+
snapshot(options?: { kinds?: NotificationKind[]; now?: string }): Promise<NotificationSnapshot>;
|
|
54
|
+
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { test } from 'node:test';
|
|
4
4
|
import assert from 'node:assert/strict';
|
|
5
5
|
import { TOOL_DEFINITION_SCHEMA_VERSION, type ToolDefinition } from './tool-definition';
|
|
6
|
-
import { argsHash, buildToolRuntime, toolCallIdempotencyKey, type ToolExecutionJournalEntry, type ToolRuntimeDeps } from './tools';
|
|
6
|
+
import { argsHash, AUDIT_MAX_BYTES, buildToolRuntime, toolCallIdempotencyKey, type ToolExecutionJournalEntry, type ToolRuntimeDeps } from './tools';
|
|
7
7
|
|
|
8
8
|
function mkTool(over: Partial<ToolDefinition>): ToolDefinition {
|
|
9
9
|
return {
|
|
@@ -21,6 +21,7 @@ function mkRuntime(
|
|
|
21
21
|
tool: ToolDefinition,
|
|
22
22
|
audit: ToolRuntimeDeps['audit'] = async () => { /* noop */ },
|
|
23
23
|
ledger = new Map<string, ToolExecutionJournalEntry>(),
|
|
24
|
+
overrides: Partial<ToolRuntimeDeps> = {},
|
|
24
25
|
) {
|
|
25
26
|
const deps: ToolRuntimeDeps = {
|
|
26
27
|
provider: { name: 'p', base_url: 'http://x.invalid', secret: 's', timeout_ms: 5000, rate_limit_per_min: 0, log_payload: false } as any,
|
|
@@ -60,7 +61,7 @@ function mkRuntime(
|
|
|
60
61
|
},
|
|
61
62
|
},
|
|
62
63
|
};
|
|
63
|
-
return buildToolRuntime(deps);
|
|
64
|
+
return buildToolRuntime({ ...deps, ...overrides });
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
function mkRuntimeWithApprovals(tool: ToolDefinition) {
|
|
@@ -115,7 +116,7 @@ function mkRuntimeWithApprovals(tool: ToolDefinition) {
|
|
|
115
116
|
async function withFetchCounter(fn: (count: () => number) => Promise<void>): Promise<void> {
|
|
116
117
|
let n = 0;
|
|
117
118
|
const orig = globalThis.fetch;
|
|
118
|
-
globalThis.fetch = (async () => { n++; return
|
|
119
|
+
globalThis.fetch = (async () => { n++; return new Response('{"ok":true}', { status: 200 }); }) as typeof fetch;
|
|
119
120
|
try { await fn(() => n); } finally { globalThis.fetch = orig; }
|
|
120
121
|
}
|
|
121
122
|
|
|
@@ -222,6 +223,121 @@ test('副作用工具:下游超时后冻结执行,恢复或重跑不得再
|
|
|
222
223
|
}
|
|
223
224
|
});
|
|
224
225
|
|
|
226
|
+
test('工具响应传输:200/302/500 正文超限都取消并冻结,恢复不得重投写入', async (t) => {
|
|
227
|
+
for (const status of [200, 302, 500]) {
|
|
228
|
+
for (const declared of [false, true]) {
|
|
229
|
+
await t.test(`status=${status}, declared=${declared}`, async (t) => {
|
|
230
|
+
let calls = 0;
|
|
231
|
+
let pulls = 0;
|
|
232
|
+
let cancels = 0;
|
|
233
|
+
const audits: Array<{ event: string; detail: Record<string, unknown> }> = [];
|
|
234
|
+
t.mock.method(globalThis, 'fetch', async () => {
|
|
235
|
+
calls++;
|
|
236
|
+
return new Response(new ReadableStream<Uint8Array>({
|
|
237
|
+
pull(controller) {
|
|
238
|
+
pulls++;
|
|
239
|
+
controller.enqueue(new Uint8Array(pulls === 1 ? 32 : 1));
|
|
240
|
+
},
|
|
241
|
+
cancel() { cancels++; },
|
|
242
|
+
}, { highWaterMark: 0 }), { status, headers: declared ? { 'content-length': '33' } : {} });
|
|
243
|
+
});
|
|
244
|
+
const ledger = new Map<string, ToolExecutionJournalEntry>();
|
|
245
|
+
const runtime = mkRuntime(mkTool({}), async (event, detail) => { audits.push({ event, detail }); }, ledger, { maxResponseBodyBytes: 32 });
|
|
246
|
+
const first = await runtime.invoke('create_thing', { x: 1 });
|
|
247
|
+
assert.equal(first.ok, false);
|
|
248
|
+
assert.equal(first.status, 0, 'headers alone cannot confirm a write after body loss');
|
|
249
|
+
assert.equal(first.governance_state, 'reconciliation_required');
|
|
250
|
+
assert.equal(first.auto_retry_allowed, false);
|
|
251
|
+
assert.equal(runtime.executionUncertainty()?.state, 'uncertain');
|
|
252
|
+
assert.equal(cancels, 1);
|
|
253
|
+
assert.equal(pulls, declared ? 0 : 2);
|
|
254
|
+
assert.equal(audits.some((audit) => audit.event === 'tool_result'), false);
|
|
255
|
+
const recovered = mkRuntime(mkTool({}), undefined, ledger, { maxResponseBodyBytes: 32 });
|
|
256
|
+
assert.equal((await recovered.invoke('create_thing', { x: 1 })).ok, false);
|
|
257
|
+
assert.equal(calls, 1);
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
});
|
|
262
|
+
|
|
263
|
+
test('工具默认传输预算:超过固定5 MiB的声明也不能确认小正文写入', async (t) => {
|
|
264
|
+
t.mock.method(globalThis, 'fetch', async () => new Response('synthetic', {
|
|
265
|
+
status: 200, headers: { 'content-length': String(5 * 1024 * 1024 + 1) },
|
|
266
|
+
}));
|
|
267
|
+
const runtime = mkRuntime(mkTool({}));
|
|
268
|
+
const result = await runtime.invoke('create_thing', {});
|
|
269
|
+
assert.equal(result.ok, false);
|
|
270
|
+
assert.equal(result.governance_state, 'reconciliation_required');
|
|
271
|
+
assert.equal(result.auto_retry_allowed, false);
|
|
272
|
+
assert.equal(runtime.executionUncertainty()?.state, 'uncertain');
|
|
273
|
+
});
|
|
274
|
+
|
|
275
|
+
test('工具响应传输:body timeout 保留原信号和 unknown 结果,不记录半截成功', async (t) => {
|
|
276
|
+
let calls = 0;
|
|
277
|
+
const audits: Array<{ event: string; detail: Record<string, unknown> }> = [];
|
|
278
|
+
t.mock.method(globalThis, 'fetch', async (_url: unknown, init: RequestInit) => {
|
|
279
|
+
calls++;
|
|
280
|
+
return new Response(new ReadableStream<Uint8Array>({
|
|
281
|
+
start(controller) {
|
|
282
|
+
controller.enqueue(new TextEncoder().encode('{"ok":'));
|
|
283
|
+
init.signal!.addEventListener('abort', () => controller.error(init.signal!.reason), { once: true });
|
|
284
|
+
},
|
|
285
|
+
}), { status: 200 });
|
|
286
|
+
});
|
|
287
|
+
const runtime = mkRuntime(mkTool({ timeoutMs: 20 }), async (event, detail) => { audits.push({ event, detail }); });
|
|
288
|
+
const watchdog = setTimeout(() => undefined, 1000);
|
|
289
|
+
try {
|
|
290
|
+
const result = await runtime.invoke('create_thing', { x: 1 });
|
|
291
|
+
assert.equal(result.ok, false);
|
|
292
|
+
assert.equal(result.governance_state, 'reconciliation_required');
|
|
293
|
+
assert.match(runtime.executionUncertainty()?.reason ?? '', /超时/);
|
|
294
|
+
assert.equal(audits.some((audit) => audit.event === 'tool_result'), false);
|
|
295
|
+
await runtime.invoke('create_thing', { x: 1 });
|
|
296
|
+
assert.equal(calls, 1);
|
|
297
|
+
} finally { clearTimeout(watchdog); }
|
|
298
|
+
});
|
|
299
|
+
|
|
300
|
+
test('工具响应视图:中文的模型和审计 UTF-8 字节预算真实有界', async (t) => {
|
|
301
|
+
const audits: Array<{ event: string; detail: Record<string, unknown> }> = [];
|
|
302
|
+
const value = '汉'.repeat(AUDIT_MAX_BYTES);
|
|
303
|
+
t.mock.method(globalThis, 'fetch', async () => new Response(value));
|
|
304
|
+
const def = mkTool({ inputSchema: { type: 'object', properties: { x: { type: 'string' } } } });
|
|
305
|
+
const runtime = mkRuntime(def, async (event, detail) => { audits.push({ event, detail }); }, undefined,
|
|
306
|
+
{ provider: { name: 'p', base_url: 'https://synthetic.invalid', secret: 'synthetic', timeout_ms: 5000, rate_limit_per_min: 0, log_payload: true } as any });
|
|
307
|
+
const result = await runtime.invoke('create_thing', { x: value });
|
|
308
|
+
assert.equal(result.ok, true);
|
|
309
|
+
assert.equal(Buffer.byteLength(result.text), 8190);
|
|
310
|
+
assert.equal(result.text.includes('\ufffd'), false);
|
|
311
|
+
const call = audits.find((entry) => entry.event === 'tool_call')!.detail;
|
|
312
|
+
assert.equal(call.args_bytes, Buffer.byteLength(JSON.stringify({ x: value })));
|
|
313
|
+
assert.ok(Buffer.byteLength(String(call.args)) <= AUDIT_MAX_BYTES);
|
|
314
|
+
assert.equal(call.args_truncated, true);
|
|
315
|
+
const response = audits.find((entry) => entry.event === 'tool_result')!.detail;
|
|
316
|
+
assert.equal(response.resp_bytes, Buffer.byteLength(value));
|
|
317
|
+
assert.ok(Buffer.byteLength(String(response.resp)) <= AUDIT_MAX_BYTES);
|
|
318
|
+
assert.equal(response.resp_truncated, true);
|
|
319
|
+
});
|
|
320
|
+
|
|
321
|
+
test('工具响应视图:敏感工具仍脱敏,响应字节数保持实际输入计数', async (t) => {
|
|
322
|
+
const audits: Array<{ event: string; detail: Record<string, unknown> }> = [];
|
|
323
|
+
t.mock.method(globalThis, 'fetch', async () => new Response(new Uint8Array([255])));
|
|
324
|
+
const runtime = mkRuntime(mkTool({ sensitive: true }), async (event, detail) => { audits.push({ event, detail }); }, undefined,
|
|
325
|
+
{ provider: { name: 'p', base_url: 'https://synthetic.invalid', secret: 'synthetic', timeout_ms: 5000, rate_limit_per_min: 0, log_payload: true } as any });
|
|
326
|
+
await runtime.invoke('create_thing', { x: 42 });
|
|
327
|
+
const response = audits.find((entry) => entry.event === 'tool_result')!.detail;
|
|
328
|
+
assert.equal(response.resp_bytes, 1, 'replacement decoding must not alter consumed byte count');
|
|
329
|
+
assert.equal(response.resp, '<1 bytes>');
|
|
330
|
+
assert.equal(audits.find((entry) => entry.event === 'tool_call')!.detail.args, '["x"]');
|
|
331
|
+
});
|
|
332
|
+
|
|
333
|
+
test('工具响应视图:空响应 fallback 也遵守极小字节预算', async (t) => {
|
|
334
|
+
t.mock.method(globalThis, 'fetch', async () => new Response(null, { status: 204 }));
|
|
335
|
+
const runtime = mkRuntime(mkTool({}), undefined, undefined, { truncateBytes: 1 });
|
|
336
|
+
const result = await runtime.invoke('create_thing', {});
|
|
337
|
+
assert.equal(result.ok, true);
|
|
338
|
+
assert.ok(Buffer.byteLength(result.text) <= 1);
|
|
339
|
+
});
|
|
340
|
+
|
|
225
341
|
test('副作用工具:崩溃遗留 dispatching 占位时,新运行时 fail-closed 且不外发', async () => {
|
|
226
342
|
const callArgs = { x: 10 };
|
|
227
343
|
const hash = argsHash(callArgs);
|
|
@@ -268,7 +384,7 @@ test('副作用工具:发送稳定的下游幂等键,且该键与任务、
|
|
|
268
384
|
let seen = '';
|
|
269
385
|
globalThis.fetch = (async (_url, init) => {
|
|
270
386
|
seen = String((init?.headers as Record<string, string>)['x-bailing-idempotency-key'] ?? '');
|
|
271
|
-
return
|
|
387
|
+
return new Response('{"ok":true}', { status: 200 });
|
|
272
388
|
}) as typeof fetch;
|
|
273
389
|
try {
|
|
274
390
|
await rt.invoke('create_thing', { x: 9 });
|
|
@@ -347,7 +463,7 @@ test('工具调用:path/header/query/body 参数按 ToolDefinition.paramIn 组
|
|
|
347
463
|
seenUrl = String(url);
|
|
348
464
|
seenHeaders = init?.headers;
|
|
349
465
|
seenBody = init?.body;
|
|
350
|
-
return
|
|
466
|
+
return new Response('{"ok":true}', { status: 200 });
|
|
351
467
|
}) as typeof fetch;
|
|
352
468
|
try {
|
|
353
469
|
await rt.invoke('update_staff', { store_id: 's 1', staff_id: 'u/2', tenant: 't1', dry_run: true, name: 'Alice' });
|