bailinghub 0.9.3 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +8 -8
- package/docker-compose.images.yml +2 -2
- package/docs/AGENT_CLIENT_QUICKSTART.en.md +1 -3
- package/docs/AGENT_CLIENT_QUICKSTART.md +1 -1
- package/docs/AGENT_CLIENT_RUNTIME_API.en.md +87 -2
- package/docs/AGENT_CLIENT_RUNTIME_API.md +36 -2
- package/docs/AGENT_KNOWLEDGE_API.en.md +77 -0
- package/docs/AGENT_KNOWLEDGE_API.md +86 -0
- package/docs/AGENT_TASK_CONTROL.md +4 -4
- package/docs/AGENT_TASK_CONTROL_FOUNDATION.md +1 -1
- package/docs/ARCHITECTURE.md +4 -0
- package/docs/CHANGELOG.en.md +24 -1
- package/docs/CHANGELOG.md +24 -1
- package/docs/COMPATIBILITY.en.md +27 -1
- package/docs/CONTRACT.en.md +1 -1
- package/docs/CONTRACT.md +1 -1
- 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 +6 -4
- package/docs/INDEPENDENT_VALIDATION.md +6 -4
- package/docs/INTEGRATION_WALKTHROUGH.md +65 -0
- package/docs/MODEL_BILLING.en.md +2 -0
- package/docs/MODEL_BILLING.md +6 -2
- package/docs/MODEL_CONTINUATION.en.md +54 -0
- package/docs/MODEL_CONTINUATION.md +54 -0
- package/docs/MODEL_OUTPUT_BUDGET.en.md +69 -0
- package/docs/MODEL_OUTPUT_BUDGET.md +69 -0
- package/docs/NOTIFICATION_DURABILITY.en.md +47 -0
- package/docs/NOTIFICATION_DURABILITY.md +47 -0
- package/docs/OPERATIONS.en.md +22 -6
- package/docs/OPERATIONS.md +22 -6
- package/docs/QUICKSTART.md +1 -1
- package/docs/README.en.md +9 -0
- package/docs/README.md +9 -0
- package/docs/RELEASE_NOTES_NEXT.en.md +3 -3
- package/docs/RELEASE_NOTES_NEXT.md +3 -3
- package/docs/RELEASE_NOTES_v0.10.0.en.md +58 -0
- package/docs/RELEASE_NOTES_v0.10.0.md +58 -0
- package/docs/RELEASE_NOTES_v0.9.4.en.md +42 -0
- package/docs/RELEASE_NOTES_v0.9.4.md +42 -0
- package/docs/UPGRADE_PLAN.en.md +118 -0
- package/docs/UPGRADE_PLAN.md +124 -0
- package/docs/UPGRADE_v0.10.0.en.md +47 -0
- package/docs/UPGRADE_v0.10.0.md +47 -0
- package/docs/UPGRADE_v0.9.4.en.md +57 -0
- package/docs/UPGRADE_v0.9.4.md +57 -0
- package/docs//345/205/274/345/256/271/346/200/247/344/270/216/345/215/207/347/272/247.md +38 -22
- 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 +18 -7
- package/schemas/tool-definition.schema.json +13 -0
- package/scripts/check-doc-links.mjs +6 -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/doctor-upgrade-plan.test.ts +205 -0
- package/scripts/doctor-upgrade-plan.ts +276 -0
- package/scripts/doctor.ts +4 -1
- 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/e2e-console-approval-details.mjs +134 -0
- package/scripts/e2e-console-config-races.mjs +180 -0
- package/scripts/e2e-console-kb-audit.mjs +170 -0
- package/scripts/e2e-console-operations-audit.mjs +152 -0
- package/scripts/e2e-console-runtime-audit.mjs +179 -0
- package/scripts/e2e-console-settings-audit.mjs +125 -0
- package/scripts/e2e-console-troubleshooting-extra.mjs +267 -0
- package/scripts/e2e-console.mjs +476 -7
- 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/068_notification_outbox.sql +28 -0
- package/sql/README.en.md +8 -0
- package/sql/README.md +8 -0
- package/src/app/agent-client-runtime.test.ts +115 -2
- package/src/app/agent-client-runtime.ts +40 -11
- package/src/app/agent-knowledge.test.ts +171 -0
- package/src/app/agent-knowledge.ts +233 -0
- package/src/app/agent-tool-catalog-revision.test.ts +31 -0
- package/src/app/agent-tool-invocations.test.ts +7 -2
- package/src/app/agent-tool-invocations.ts +67 -7
- package/src/app/approval-continuations.mysql.test.ts +1 -1
- package/src/app/approval-continuations.test.ts +49 -1
- package/src/app/delivery-dlq-replay.mysql.test.ts +2 -2
- package/src/app/delivery.ts +115 -1
- package/src/app/engine.ts +5 -4
- package/src/app/http.test.ts +16 -1
- package/src/app/http.ts +3 -3
- package/src/app/kernel-boot-recovery.mysql.test.ts +132 -0
- package/src/app/kernel-boot-recovery.test.ts +157 -0
- package/src/app/kernel-usage-lifecycle.mysql.test.ts +1 -1
- package/src/app/kernel.ts +20 -8
- package/src/app/notification-outbox.test.ts +321 -0
- package/src/app/notification-outbox.ts +123 -0
- package/src/app/operational-metrics.test.ts +15 -0
- package/src/app/operational-metrics.ts +9 -0
- package/src/app/outbound.ts +28 -0
- package/src/app/readiness.mysql.test.ts +120 -0
- package/src/app/readiness.test.ts +111 -26
- package/src/app/readiness.ts +26 -22
- package/src/app/runtime-evidence-maintenance.test.ts +34 -1
- package/src/app/runtime-lifecycle-default.ts +7 -0
- package/src/app/runtime-lifecycle.ts +42 -3
- package/src/app/tool-approvals.test.ts +83 -0
- package/src/app/tool-approvals.ts +89 -34
- package/src/app/tool-proxy-payload.test.ts +81 -0
- package/src/app/tool-proxy.ts +24 -2
- package/src/core/config/console-diagnostic-location.test.ts +36 -0
- package/src/core/config/console-form-guard.test.ts +69 -0
- package/src/core/config/console-task-location.test.ts +64 -0
- package/src/core/contracts/delivery-replay.ts +1 -0
- package/src/core/contracts/notification-outbox.ts +54 -0
- package/src/core/contracts/openapi-tools.ts +16 -5
- package/src/core/contracts/schema-readiness.ts +11 -0
- package/src/core/contracts/tool-definition.ts +26 -0
- package/src/core/contracts/tool-guidance.test.ts +77 -0
- package/src/core/contracts/tool-guidance.ts +31 -0
- package/src/core/contracts/tool-input-limits.ts +15 -0
- package/src/core/contracts/tools-idempotency.test.ts +90 -0
- package/src/core/contracts/tools.ts +52 -9
- package/src/core/observability/openmetrics.test.ts +18 -0
- package/src/core/observability/openmetrics.ts +17 -0
- package/src/core/runtime/agent-execution-memory.test.ts +64 -0
- package/src/core/runtime/agent-execution-memory.ts +63 -0
- package/src/core/runtime/finish-runtime.test.ts +20 -0
- package/src/core/runtime/finish-runtime.ts +13 -5
- package/src/core/runtime/inhub-runtime.ts +10 -2
- package/src/core/runtime/notification-outbox-work.ts +15 -0
- package/src/core/state/notification-outbox.ts +66 -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 +26 -13
- package/src/infrastructure/config/config-observability-ledger.ts +2 -0
- package/src/infrastructure/config/configstore.ts +8 -4
- package/src/infrastructure/schema/schema-readiness.ts +29 -0
- 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 +64 -13
- package/src/infrastructure/state/state-mysql.ts +39 -5
- package/src/modules/usage/contracts.ts +7 -0
- package/src/modules/usage/http.ts +2 -0
- package/src/modules/usage/model-continuation.test.ts +109 -0
- package/src/modules/usage/model-gateway.ts +5 -1
- package/src/modules/usage/output-budget.mysql.test.ts +84 -0
- package/src/modules/usage/output-budget.test.ts +167 -0
- package/src/modules/usage/output-budget.ts +73 -0
- package/src/modules/usage/provider-stream.test.ts +22 -0
- package/src/modules/usage/provider.ts +2 -3
- package/src/modules/usage/repository.ts +6 -0
- package/src/modules/usage/test-harness.ts +4 -2
- package/src/routes/admin-approval-view.test.ts +109 -0
- package/src/routes/admin-approval-view.ts +36 -0
- package/src/routes/admin-notifications.test.ts +75 -0
- package/src/routes/admin-notifications.ts +77 -0
- package/src/routes/admin-readiness.test.ts +52 -0
- package/src/routes/admin-runtime-ux.test.ts +51 -0
- package/src/routes/admin-runtime-ux.ts +25 -0
- package/src/routes/admin-runtime.test.ts +25 -0
- package/src/routes/admin-runtime.ts +51 -8
- package/src/routes/admin.ts +10 -0
- package/src/routes/agent-api.test.ts +80 -1
- package/src/routes/agent-api.ts +63 -4
- package/src/routes/agent-tool-detail.test.ts +140 -0
- package/src/routes/public-default.ts +1 -1
- package/src/services/kb-agent.test.ts +84 -0
- package/src/services/kb.ts +73 -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-CjIBO3sU.css +1 -0
- package/web/console/assets/Accounts-Dhyw-7wF.js +3 -0
- package/web/console/assets/AgentClients-BA0M26-I.css +1 -0
- package/web/console/assets/AgentClients-DWxb8-ko.js +1 -0
- package/web/console/assets/AgentTasks-DOyxANnx.css +1 -0
- package/web/console/assets/AgentTasks-DUHD4dzr.js +2 -0
- package/web/console/assets/Approvals-Brl-2uJq.css +1 -0
- package/web/console/assets/Approvals-CQx1YWxW.js +1 -0
- package/web/console/assets/Audit--QcdVlMh.js +1 -0
- package/web/console/assets/Audit-DAdmOnIs.css +1 -0
- package/web/console/assets/{BrandLockup-BgASiRSE.js → BrandLockup-DQcaW4Nt.js} +1 -1
- package/web/console/assets/Channels-DJJU3ksE.css +1 -0
- package/web/console/assets/Channels-cGS5WfQ-.js +105 -0
- package/web/console/assets/ChatEntries-BYpji27B.css +1 -0
- package/web/console/assets/ChatEntries-nh23Iz5O.js +7 -0
- package/web/console/assets/Clients-CX5EeYio.js +3 -0
- package/web/console/assets/Clients-CbZAou8E.css +1 -0
- package/web/console/assets/Cost-C6oQvz9P.css +1 -0
- package/web/console/assets/Cost-DOZfdNS9.js +1 -0
- package/web/console/assets/Credentials--aHs57yV.css +1 -0
- package/web/console/assets/Credentials-sy6W9Sac.js +1 -0
- package/web/console/assets/Diagnostics-CKs27Dnv.css +1 -0
- package/web/console/assets/Diagnostics-CyoM1XrZ.js +1 -0
- package/web/console/assets/Executors-2Upi6bOS.css +1 -0
- package/web/console/assets/Executors-BQqqiFwt.js +1 -0
- package/web/console/assets/HelpTip-DLlhaGQp.js +1 -0
- package/web/console/assets/HelpTip-bbDEyuqV.css +1 -0
- package/web/console/assets/Kb-5R3ce4UU.js +5 -0
- package/web/console/assets/Kb-BM_PYi11.css +1 -0
- package/web/console/assets/{Login-DA6BASZd.js → Login-YKeUwdgo.js} +1 -1
- package/web/console/assets/Projects-DHwHrPT9.css +1 -0
- package/web/console/assets/Projects-Grgb6fOv.js +1 -0
- package/web/console/assets/Routes-DR_Yf02e.css +1 -0
- package/web/console/assets/Routes-DYgrXlRJ.js +138 -0
- package/web/console/assets/Runs-CwTddJJj.js +3 -0
- package/web/console/assets/Runs-D4FOvNfu.css +1 -0
- package/web/console/assets/Setup-Ca0b1d1-.css +1 -0
- package/web/console/assets/Setup-D_xUPNDq.js +1 -0
- package/web/console/assets/Shell-BTg8Vw_L.css +1 -0
- package/web/console/assets/Shell-Dfam2Uoj.js +1 -0
- package/web/console/assets/StorageBuckets-7QLBpV4a.css +1 -0
- package/web/console/assets/StorageBuckets-CP6e50wI.js +1 -0
- package/web/console/assets/SystemSettings-BRYKyJNa.js +1 -0
- package/web/console/assets/SystemSettings-HsXGx0aH.css +1 -0
- package/web/console/assets/SystemStatus-B-VfRsQd.css +1 -0
- package/web/console/assets/SystemStatus-CbPsDsGt.js +1 -0
- package/web/console/assets/Targets-1j4-g6rC.css +1 -0
- package/web/console/assets/Targets-C2LkR2AF.js +1 -0
- package/web/console/assets/Tools-C9HPJqJb.css +1 -0
- package/web/console/assets/Tools-C9JNJUS0.js +2 -0
- package/web/console/assets/Usage-D1Mv6vGY.js +1 -0
- package/web/console/assets/Usage-DMOzUsqh.css +1 -0
- package/web/console/assets/UsageAccess-77LmGCm6.js +1 -0
- package/web/console/assets/UsageAccess-C6ZGxEgJ.css +1 -0
- package/web/console/assets/{UsageHelp-BBKIvbQ5.js → UsageHelp-BmuiE1Ew.js} +1 -1
- package/web/console/assets/client-route-draft-DxZRxKPT.js +1 -0
- package/web/console/assets/console-location-Csv-xsnl.js +1 -0
- package/web/console/assets/form-guard-8GrFpry0.js +1 -0
- package/web/console/assets/{index-65JiiUr4.js → index-B_5UfiTw.js} +1 -1
- package/web/console/assets/index-MjZJEFIN.js +2 -0
- package/web/console/assets/{request-BpaimqEb.js → request-rqm6MT0s.js} +1 -1
- package/web/console/assets/runtime-feedback-gPfZVNvY.js +1 -0
- package/web/console/assets/{schema-D0Z4kFCZ.js → schema-o3mK4mid.js} +1 -1
- package/web/console/assets/task-page-location-DWiGtAln.js +1 -0
- package/web/console/assets/use-list-location-FvLFt0Tq.css +1 -0
- package/web/console/assets/use-list-location-cIPy2cKM.js +1 -0
- package/web/console/assets/use-unsaved-form-DScKD0h9.js +1 -0
- package/web/console/assets/{util-DZYfJ5Zo.js → util-B40VqOwl.js} +1 -1
- package/web/console/assets/{vendor-element-8cVcdt5T.js → vendor-element-BT8tHCFk.js} +1 -1
- package/web/console/assets/{vendor-mammoth-CnDA23N0.js → vendor-mammoth-CVIXVxTN.js} +1 -1
- package/web/console/assets/{vendor-vue-Co7x2FW6.js → vendor-vue-DhbG0vd4.js} +7 -7
- package/web/console/index.html +3 -3
- package/web-admin/package-lock.json +9 -27
- package/web-admin/package.json +2 -2
- package/web-admin/src/client-route-draft.ts +25 -0
- package/web-admin/src/components/AgentSetupPanel.vue +54 -41
- package/web-admin/src/components/HelpTip.vue +4 -1
- package/web-admin/src/components/ListLocationBar.vue +22 -0
- package/web-admin/src/components/NotificationOutboxPanel.vue +134 -0
- package/web-admin/src/console-entry.test.ts +26 -0
- package/web-admin/src/console-entry.ts +20 -0
- package/web-admin/src/console-location.ts +35 -0
- package/web-admin/src/form-guard.ts +35 -0
- package/web-admin/src/layout/Shell.vue +18 -65
- package/web-admin/src/onboarding-state.test.ts +174 -0
- package/web-admin/src/onboarding-state.ts +122 -0
- package/web-admin/src/pages/Accounts.vue +44 -24
- package/web-admin/src/pages/AgentClients.vue +47 -29
- package/web-admin/src/pages/AgentTasks.vue +57 -12
- package/web-admin/src/pages/Approvals.vue +105 -25
- package/web-admin/src/pages/Audit.vue +15 -6
- package/web-admin/src/pages/Channels.vue +136 -43
- package/web-admin/src/pages/ChatEntries.vue +96 -41
- package/web-admin/src/pages/Clients.vue +87 -26
- package/web-admin/src/pages/Cost.vue +15 -4
- package/web-admin/src/pages/Credentials.vue +63 -32
- package/web-admin/src/pages/Diagnostics.vue +103 -54
- package/web-admin/src/pages/Executors.vue +103 -40
- package/web-admin/src/pages/Kb.vue +278 -128
- package/web-admin/src/pages/Projects.vue +44 -16
- package/web-admin/src/pages/Routes.vue +168 -247
- package/web-admin/src/pages/Runs.vue +169 -91
- package/web-admin/src/pages/Setup.vue +182 -291
- package/web-admin/src/pages/StorageBuckets.vue +61 -25
- package/web-admin/src/pages/SystemSettings.vue +76 -51
- package/web-admin/src/pages/SystemStatus.vue +54 -30
- package/web-admin/src/pages/Targets.vue +45 -17
- package/web-admin/src/pages/Tools.vue +133 -68
- package/web-admin/src/pages/Usage.vue +64 -25
- package/web-admin/src/pages/UsageAccess.vue +11 -8
- package/web-admin/src/route-call-snippets.test.ts +82 -0
- package/web-admin/src/route-call-snippets.ts +178 -0
- package/web-admin/src/router.ts +11 -29
- package/web-admin/src/runtime-feedback.ts +43 -0
- package/web-admin/src/task-page-location.ts +66 -0
- package/web-admin/src/usage-output-budget.test.ts +26 -0
- package/web-admin/src/usage-output-budget.ts +46 -0
- package/web-admin/src/use-list-location.ts +24 -0
- package/web-admin/src/use-unsaved-form.ts +38 -0
- package/web-admin/tests/model-output-budget.browser.mjs +69 -0
- package/security/dependency-audit-exceptions.json +0 -192
- package/web/console/assets/Accounts-Bervi5JU.css +0 -1
- package/web/console/assets/Accounts-DKhw_QLr.js +0 -3
- package/web/console/assets/AgentClients-CM4_5HaA.js +0 -1
- package/web/console/assets/AgentClients-i52AI6YV.css +0 -1
- package/web/console/assets/AgentTasks-BsG850Il.css +0 -1
- package/web/console/assets/AgentTasks-CkQgZTU5.js +0 -2
- package/web/console/assets/Approvals-B9O9TkbO.js +0 -1
- package/web/console/assets/Approvals-DlTSHl_7.css +0 -1
- package/web/console/assets/Audit-2vDC1SPu.js +0 -1
- package/web/console/assets/Audit-CSu6_3oD.css +0 -1
- package/web/console/assets/Channels-A-GvkNBt.js +0 -105
- package/web/console/assets/Channels-CCn0L1jg.css +0 -1
- package/web/console/assets/ChatEntries-BLxymI67.js +0 -7
- package/web/console/assets/ChatEntries-DsYtcXN6.css +0 -1
- package/web/console/assets/Clients-CSHIsaWU.css +0 -1
- package/web/console/assets/Clients-DeNlmvS6.js +0 -3
- package/web/console/assets/Cost-CBq_L4Kz.js +0 -1
- package/web/console/assets/Cost-CjT39DSZ.css +0 -1
- package/web/console/assets/Credentials-DmtbctNj.js +0 -1
- package/web/console/assets/Credentials-ioLP0qYN.css +0 -1
- package/web/console/assets/Diagnostics-BbcRDiA-.js +0 -1
- package/web/console/assets/Diagnostics-Ya05PTDp.css +0 -1
- package/web/console/assets/Executors-CjhEM54c.css +0 -1
- package/web/console/assets/Executors-gGgmQrDt.js +0 -1
- package/web/console/assets/HelpTip-CA6Bm7Nx.css +0 -1
- package/web/console/assets/HelpTip-Dtdt2tKR.js +0 -1
- package/web/console/assets/Kb-CzIzd9xr.css +0 -1
- package/web/console/assets/Kb-lgY6OXUz.js +0 -5
- package/web/console/assets/Projects-Bm8AjsNx.css +0 -1
- package/web/console/assets/Projects-DEbmB_sT.js +0 -1
- package/web/console/assets/Routes-CyXV4Pba.css +0 -1
- package/web/console/assets/Routes-qS6LLoyS.js +0 -124
- package/web/console/assets/Runs-CvGTV8I-.css +0 -1
- package/web/console/assets/Runs-DG-VLRSc.js +0 -3
- package/web/console/assets/Setup-D7nxgn-9.css +0 -1
- package/web/console/assets/Setup-DEpVF5uw.js +0 -1
- package/web/console/assets/Shell-DgoPgK1E.js +0 -1
- package/web/console/assets/Shell-ykb-tUfo.css +0 -1
- package/web/console/assets/StorageBuckets-CVgpZRWY.css +0 -1
- package/web/console/assets/StorageBuckets-DJtNN769.js +0 -1
- package/web/console/assets/SystemSettings-0DEUgeTR.js +0 -1
- package/web/console/assets/SystemSettings-BjiHyrXO.css +0 -1
- package/web/console/assets/SystemStatus-CR1phiPE.js +0 -1
- package/web/console/assets/SystemStatus-I11I67rw.css +0 -1
- package/web/console/assets/Targets-D65l-IMB.js +0 -1
- package/web/console/assets/Targets-DTb5tn6z.css +0 -1
- package/web/console/assets/Tools-DU8ei6sd.css +0 -1
- package/web/console/assets/Tools-DqtrINrN.js +0 -2
- package/web/console/assets/Usage-B5njXNjx.js +0 -1
- package/web/console/assets/Usage-CAeDGjrb.css +0 -1
- package/web/console/assets/UsageAccess-CGGaWTuj.css +0 -1
- package/web/console/assets/UsageAccess-ChnB4pjb.js +0 -1
- package/web/console/assets/index-sLKrJd_p.js +0 -2
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import type { AppConfig } from '../core/config/config';
|
|
3
|
+
import type { NotificationEvent, NotificationOutboxRepository, NotificationKind, ApprovalNotificationPayload } from '../core/contracts/notification-outbox';
|
|
4
|
+
import type { RuntimeStateStore } from '../core/state/state-contracts';
|
|
5
|
+
import type { ConfigStoreContract } from '../infrastructure/config/configstore';
|
|
6
|
+
import { defaultTargetRegistry, type TargetRegistry } from '../core/targets/registry';
|
|
7
|
+
import { notificationBackgroundWorkFor } from '../core/runtime/notification-background-work';
|
|
8
|
+
import { deliveryFailureRecipient } from '../core/runtime/finish-runtime';
|
|
9
|
+
import { channelSendFor } from './channels';
|
|
10
|
+
import { deliverNotificationFor } from './delivery';
|
|
11
|
+
import { notifyApprovalPayloadFor } from './tool-approvals';
|
|
12
|
+
import { outboundRuntimeDepsFor, postSignedNotificationWithDeps, secretForJobWithDeps, type NotificationSendOutcome } from './outbound';
|
|
13
|
+
|
|
14
|
+
export interface NotificationOutboxDeps {
|
|
15
|
+
cfg: AppConfig;
|
|
16
|
+
configStore: ConfigStoreContract | null;
|
|
17
|
+
stateStore: RuntimeStateStore;
|
|
18
|
+
now: () => string;
|
|
19
|
+
sleep: (ms: number) => Promise<void>;
|
|
20
|
+
targetRegistry?: TargetRegistry;
|
|
21
|
+
channelSendFor?: typeof channelSendFor;
|
|
22
|
+
isClosing?: () => boolean;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const LEASE_MS = 90_000;
|
|
26
|
+
const MAX_CYCLE_ATTEMPTS = 6;
|
|
27
|
+
const flights = new WeakMap<object, Promise<void>>();
|
|
28
|
+
|
|
29
|
+
async function sendEvent(deps: NotificationOutboxDeps, event: NotificationEvent): Promise<NotificationSendOutcome> {
|
|
30
|
+
const job = event.payload.job;
|
|
31
|
+
if (event.kind === 'callback') {
|
|
32
|
+
if (!job.callback_url) return { status: 'skipped', error: 'Callback destination missing' };
|
|
33
|
+
const outbound = outboundRuntimeDepsFor(deps);
|
|
34
|
+
return postSignedNotificationWithDeps(outbound, job.callback_url, { ...job }, await secretForJobWithDeps(outbound, job), event.event_id,
|
|
35
|
+
{ job_id: job.job_id, request_id: job.request_id, event: 'callback' });
|
|
36
|
+
}
|
|
37
|
+
if (event.kind === 'delivery') return deliverNotificationFor(deps, job, event.event_id, event.payload.brand_name ?? 'BailingHub');
|
|
38
|
+
if (event.kind === 'approval-notification') {
|
|
39
|
+
if (!('approval_id' in event.payload)) return { status: 'failed', error: 'Invalid approval notification payload' };
|
|
40
|
+
return notifyApprovalPayloadFor(deps.configStore, deps.stateStore, event.payload as ApprovalNotificationPayload, deps.cfg,
|
|
41
|
+
deps.now, deps.sleep, deps.targetRegistry ?? defaultTargetRegistry, event.event_id);
|
|
42
|
+
}
|
|
43
|
+
if (!deps.configStore) return { status: 'failed', error: 'Delivery dead letter repository unavailable' };
|
|
44
|
+
await deps.configStore.deliveryDlq.record({ parentJobId: job.job_id, channel: String(job.target ?? ''),
|
|
45
|
+
recipient: deliveryFailureRecipient(job), content: job.input ?? '', error: String(job.error ?? 'Delivery failed').slice(0, 200),
|
|
46
|
+
deliveryKind: 'executor_target', notificationJobId: job.job_id, eventId: event.event_id });
|
|
47
|
+
return { status: 'completed' };
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
async function processEvent(deps: NotificationOutboxDeps, repository: NotificationOutboxRepository, event: NotificationEvent): Promise<void> {
|
|
51
|
+
const token = event.lease_token;
|
|
52
|
+
if (!token) throw new Error('Notification claim has no fencing token');
|
|
53
|
+
if (event.cycle_attempts > MAX_CYCLE_ATTEMPTS) {
|
|
54
|
+
// Repeated process crashes can consume claims without reaching fail().
|
|
55
|
+
await repository.fail(event.event_id, token, { status: 'failed', error: 'notification_attempt_limit' });
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
let lost = false;
|
|
59
|
+
let renewing: Promise<void> | null = null;
|
|
60
|
+
const renew = () => {
|
|
61
|
+
if (renewing || lost) return;
|
|
62
|
+
renewing = repository.renew(event.event_id, token, LEASE_MS)
|
|
63
|
+
.then(ok => { if (!ok) lost = true; }, () => { lost = true; })
|
|
64
|
+
.finally(() => { renewing = null; });
|
|
65
|
+
};
|
|
66
|
+
renew();
|
|
67
|
+
await renewing;
|
|
68
|
+
if (lost) return;
|
|
69
|
+
const timer = setInterval(renew, LEASE_MS / 3);
|
|
70
|
+
timer.unref();
|
|
71
|
+
let outcome: NotificationSendOutcome;
|
|
72
|
+
try {
|
|
73
|
+
try { outcome = await sendEvent(deps, event); }
|
|
74
|
+
catch {
|
|
75
|
+
// Native-channel acknowledgement or local bookkeeping can be ambiguous.
|
|
76
|
+
// Do not persist exception text containing destinations, SQL or credentials.
|
|
77
|
+
outcome = { status: event.recovery === 'uncertain' ? 'uncertain' : 'retry', error: 'Notification attempt interrupted' };
|
|
78
|
+
}
|
|
79
|
+
clearInterval(timer);
|
|
80
|
+
if (renewing) await renewing;
|
|
81
|
+
if (lost) return; // An expired owner cannot acknowledge a newer claim.
|
|
82
|
+
if (outcome.status === 'completed' || outcome.status === 'skipped') {
|
|
83
|
+
const completed = await repository.complete(event.event_id, token, outcome.status, outcome.error);
|
|
84
|
+
if (completed && event.kind === 'delivery') {
|
|
85
|
+
// Delivery is already acknowledged. A bookkeeping failure must not send it again.
|
|
86
|
+
await deps.configStore?.deliveryDlq.resolveByEventId?.(event.event_id).catch(() => undefined);
|
|
87
|
+
}
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
const retry = outcome.status === 'retry' && event.cycle_attempts < MAX_CYCLE_ATTEMPTS;
|
|
91
|
+
const status = retry ? 'pending' : outcome.status === 'uncertain' ? 'uncertain' : 'failed';
|
|
92
|
+
const delay = Math.min(300_000, 2_000 * 2 ** Math.max(0, event.cycle_attempts - 1));
|
|
93
|
+
await repository.fail(event.event_id, token, { status, error: outcome.error ?? 'Notification delivery failed',
|
|
94
|
+
...(retry ? { availableAt: new Date(Date.parse(deps.now()) + delay).toISOString() } : {}) });
|
|
95
|
+
} finally {
|
|
96
|
+
clearInterval(timer);
|
|
97
|
+
if (renewing) await renewing;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/** Bounded maintenance pass. Only persisted notification intents are scanned. */
|
|
102
|
+
export function reconcileNotificationOutboxFor(deps: NotificationOutboxDeps): Promise<void> {
|
|
103
|
+
const existing = flights.get(deps.stateStore);
|
|
104
|
+
if (existing) return existing;
|
|
105
|
+
const work = (async () => {
|
|
106
|
+
const sources: Array<{ repository: NotificationOutboxRepository; kinds: NotificationKind[] }> = [];
|
|
107
|
+
if (deps.stateStore.notificationOutbox) sources.push({ repository: deps.stateStore.notificationOutbox, kinds: ['callback', 'delivery', 'delivery-dlq'] });
|
|
108
|
+
if (deps.configStore?.notificationOutbox) sources.push({ repository: deps.configStore.notificationOutbox, kinds: ['approval-notification'] });
|
|
109
|
+
const owner = `notification:${randomUUID()}`;
|
|
110
|
+
for (const { repository, kinds } of sources) {
|
|
111
|
+
// Claim one at a time, so later rows do not lose leases while earlier I/O runs.
|
|
112
|
+
for (let count = 0; count < 10 && !deps.isClosing?.(); count++) {
|
|
113
|
+
const events = await repository.claim({ owner, kinds, limit: 1, leaseMs: LEASE_MS, now: deps.now() });
|
|
114
|
+
const event = events[0];
|
|
115
|
+
if (!event) break;
|
|
116
|
+
await notificationBackgroundWorkFor(deps.stateStore).track(event.kind, () => processEvent(deps, repository, event));
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
})();
|
|
120
|
+
flights.set(deps.stateStore, work);
|
|
121
|
+
void work.finally(() => { if (flights.get(deps.stateStore) === work) flights.delete(deps.stateStore); }).catch(() => undefined);
|
|
122
|
+
return work;
|
|
123
|
+
}
|
|
@@ -107,3 +107,18 @@ test('maintenance snapshot failures leave existing metrics available and redact
|
|
|
107
107
|
assert.match(logs[0]!, /"collector":"maintenance"/);
|
|
108
108
|
assert.doesNotMatch(logs[0]!, /PRIVATE|TENANT|ACCOUNT|JOB|ROUTE|PROMPT|TOKEN|BODY/);
|
|
109
109
|
});
|
|
110
|
+
|
|
111
|
+
test('durable notification scrape partitions shared-store aggregates without invoking delivery or exposing records', async () => {
|
|
112
|
+
const kinds: string[][] = [];
|
|
113
|
+
const repo = { async snapshot(options: { kinds: string[] }) {
|
|
114
|
+
kinds.push(options.kinds);
|
|
115
|
+
return { counts: { pending: options.kinds.includes('callback') ? 2 : 1, processing: 0, completed: 3, skipped: 0, failed: 0, uncertain: 1 }, oldestPendingAgeSeconds: 12, expiredLeases: 0 };
|
|
116
|
+
} };
|
|
117
|
+
const configStore = { approvals: { createWithNotification: async () => { throw new Error('must not create'); } }, notificationOutbox: repo, observability: {} } as unknown as ConfigStoreContract;
|
|
118
|
+
const store = { notificationOutbox: repo, completeJobWithNotifications: async () => { throw new Error('must not complete job'); } } as unknown as RuntimeStateStore;
|
|
119
|
+
const text = await endpoint({ store, configStore }).scrape();
|
|
120
|
+
assert.deepEqual(kinds, [['callback', 'delivery', 'delivery-dlq'], ['approval-notification']]);
|
|
121
|
+
assert.match(text, /bailinghub_notification_outbox_records\{source="jobs",status="pending"\} 2/);
|
|
122
|
+
assert.match(text, /bailinghub_notification_outbox_records\{source="approvals",status="pending"\} 1/);
|
|
123
|
+
assert.doesNotMatch(text, /notification_event_id|lease_token|payload_json/);
|
|
124
|
+
});
|
|
@@ -120,8 +120,17 @@ export function createOperationalMetricsEndpointFor(deps: OperationalMetricsDeps
|
|
|
120
120
|
async () => {
|
|
121
121
|
const usage = deps.configStore?.usage;
|
|
122
122
|
const approval = approvalContinuationMaintenanceSnapshotFor({ configStore: deps.configStore, stateStore: deps.store }, snapshotAt);
|
|
123
|
+
const jobOutbox = deps.store.completeJobWithNotifications ? deps.store.notificationOutbox : undefined;
|
|
124
|
+
const approvalOutbox = deps.configStore?.approvals?.createWithNotification ? deps.configStore.notificationOutbox : undefined;
|
|
125
|
+
const notificationOutbox: NonNullable<RuntimeMaintenanceMetricsSnapshot['notificationOutbox']> = await Promise.all([
|
|
126
|
+
(async () => ({ source: 'jobs' as const, available: !!jobOutbox,
|
|
127
|
+
...(jobOutbox ? { snapshot: await jobOutbox.snapshot({ kinds: ['callback', 'delivery', 'delivery-dlq'], now: new Date(snapshotAt).toISOString() }) } : {}) }))(),
|
|
128
|
+
(async () => ({ source: 'approvals' as const, available: !!approvalOutbox,
|
|
129
|
+
...(approvalOutbox ? { snapshot: await approvalOutbox.snapshot({ kinds: ['approval-notification'], now: new Date(snapshotAt).toISOString() }) } : {}) }))(),
|
|
130
|
+
]);
|
|
123
131
|
return {
|
|
124
132
|
capturedAtMs: snapshotAt,
|
|
133
|
+
notificationOutbox,
|
|
125
134
|
...(usage ? { usage: usage.backgroundWork.snapshot(snapshotAt), usageReconciliation: usageReconciliationSnapshotFor(usage),
|
|
126
135
|
usageRetry: usageMaintenanceSnapshotFor(usage) } : {}),
|
|
127
136
|
...(deps.notificationWork ? { notification: deps.notificationWork.snapshot(snapshotAt) } : {}),
|
package/src/app/outbound.ts
CHANGED
|
@@ -64,6 +64,34 @@ export async function secretForJobWithDeps(deps: Pick<OutboundRuntimeDeps, 'cfg'
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
const OUTBOUND_BACKOFF_MS = [0, 2000, 10_000]; // 共 3 次尝试
|
|
67
|
+
export type NotificationSendOutcome = { status: 'completed' | 'skipped' | 'retry' | 'failed' | 'uncertain'; error?: string };
|
|
68
|
+
|
|
69
|
+
/** One durable attempt. The outbox owns retries; the signed body binds the stable event ID. */
|
|
70
|
+
export async function postSignedNotificationWithDeps(
|
|
71
|
+
deps: Pick<OutboundRuntimeDeps, 'stateStore' | 'now' | 'fetch'>,
|
|
72
|
+
url: string, payload: Record<string, unknown>, secret: string, eventId: string,
|
|
73
|
+
audit: { job_id: string; request_id: string; event: string },
|
|
74
|
+
): Promise<NotificationSendOutcome> {
|
|
75
|
+
const body = JSON.stringify({ ...payload, notification_event_id: eventId });
|
|
76
|
+
const ts = Date.now().toString();
|
|
77
|
+
let outcome: NotificationSendOutcome;
|
|
78
|
+
try {
|
|
79
|
+
const response = await deps.fetch(url, {
|
|
80
|
+
method: 'POST', headers: { 'content-type': 'application/json', 'x-bailing-timestamp': ts,
|
|
81
|
+
'x-bailing-signature': `sha256=${signBody(secret, ts, body)}`, 'x-bailing-event-id': eventId },
|
|
82
|
+
body, signal: AbortSignal.timeout(10_000),
|
|
83
|
+
});
|
|
84
|
+
void response.body?.cancel().catch(() => undefined);
|
|
85
|
+
outcome = response.ok ? { status: 'completed' }
|
|
86
|
+
: { status: response.status === 429 || response.status >= 500 ? 'retry' : 'failed', error: `webhook_http_${response.status}` };
|
|
87
|
+
} catch {
|
|
88
|
+
// An acknowledgement may be lost. Receivers deduplicate the signed event ID.
|
|
89
|
+
outcome = { status: 'retry', error: 'webhook_acknowledgement_unavailable' };
|
|
90
|
+
}
|
|
91
|
+
await deps.stateStore.appendAudit({ ts: deps.now(), ...audit,
|
|
92
|
+
detail: { notification_event_id: eventId, outcome: outcome.status, ...(outcome.error ? { error: outcome.error } : {}) } }).catch(() => undefined);
|
|
93
|
+
return outcome;
|
|
94
|
+
}
|
|
67
95
|
export function postSignedWithDeps(deps: Pick<OutboundRuntimeDeps, 'stateStore' | 'now' | 'sleep' | 'fetch'>, url: string, payload: unknown, secret: string, audit: { job_id: string; request_id: string; event: string }): Promise<boolean> {
|
|
68
96
|
const kind: NotificationBackgroundKind = audit.event.startsWith('approval_') ? 'approval-notification'
|
|
69
97
|
: audit.event.startsWith('alert') ? 'alert' : audit.event === 'callback' ? 'callback' : 'delivery';
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import test from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { randomBytes } from 'node:crypto';
|
|
4
|
+
import { mkdtempSync, rmSync } from 'node:fs';
|
|
5
|
+
import { createServer } from 'node:http';
|
|
6
|
+
import { tmpdir } from 'node:os';
|
|
7
|
+
import { join } from 'node:path';
|
|
8
|
+
import { createBailingHubKernel } from './kernel';
|
|
9
|
+
import { createPool, type RowDataPacket } from 'mysql2/promise';
|
|
10
|
+
import type { AppConfig } from '../core/config/config';
|
|
11
|
+
import { BAILINGHUB_CORE_ARTIFACT_V1 as artifact } from '../kernel-api/v1/artifact';
|
|
12
|
+
import { migrateBailingHubCoreSchema } from '../infrastructure/schema/core-schema-migrator';
|
|
13
|
+
import { ConfigStore } from '../infrastructure/config/configstore';
|
|
14
|
+
import { MysqlStore } from '../infrastructure/state/state-mysql';
|
|
15
|
+
import { checkReadinessFor } from './readiness';
|
|
16
|
+
|
|
17
|
+
const enabled = process.env.BAILING_USAGE_TEST_MYSQL === '1';
|
|
18
|
+
|
|
19
|
+
test('readiness validates both real MySQL resources without mutating legacy or corrupt ledgers', { skip: !enabled, timeout: 120_000 }, async t => {
|
|
20
|
+
const prefix = `ready_${randomBytes(8).toString('hex')}`;
|
|
21
|
+
const names = [`${prefix}_state`, `${prefix}_config`];
|
|
22
|
+
const base = { host: '127.0.0.1', port: Number(process.env.BAILING_USAGE_TEST_MYSQL_PORT ?? 16307), user: 'root', password: '', connectionLimit: 2 };
|
|
23
|
+
const admin = createPool(base); const pools = names.map(database => createPool({ ...base, database }));
|
|
24
|
+
const created: string[] = [];
|
|
25
|
+
const state = new MysqlStore({ ...base, database: names[0]! }, { get: async () => pools[0]!, close: async () => {} });
|
|
26
|
+
const config = new ConfigStore({ ...base, database: names[1]! }, { get: async () => pools[1]!, close: async () => {} });
|
|
27
|
+
const sharedConfig = new ConfigStore({ ...base, database: names[0]! }, { get: async () => pools[0]!, close: async () => {} });
|
|
28
|
+
const cfg = { root: '/not-a-migration-directory', state: { backend: 'mysql', mysql: { ...base, database: names[0] } } } as AppConfig;
|
|
29
|
+
const latest = artifact.migrations.at(-1)!;
|
|
30
|
+
const ledger = async (index: number) => (await pools[index]!.query<RowDataPacket[]>('SELECT filename,checksum_sha256,applied_at FROM bz_schema_migrations ORDER BY filename'))[0];
|
|
31
|
+
try {
|
|
32
|
+
for (const name of names) {
|
|
33
|
+
assert.match(name, new RegExp(`^${prefix}_(state|config)$`));
|
|
34
|
+
await admin.query(`CREATE DATABASE \`${name}\` CHARACTER SET utf8mb4 COLLATE utf8mb4_bin`); created.push(name);
|
|
35
|
+
await migrateBailingHubCoreSchema({ mysql: { ...base, database: name }, logger: { log() {}, warn() {} } });
|
|
36
|
+
}
|
|
37
|
+
await state.init(); await config.init(); await sharedConfig.init();
|
|
38
|
+
await t.test('complete shared and split databases are ready', async () => {
|
|
39
|
+
assert.equal((await checkReadinessFor(cfg, config, state)).ready, true);
|
|
40
|
+
assert.equal((await checkReadinessFor(cfg, sharedConfig, state)).ready, true);
|
|
41
|
+
});
|
|
42
|
+
for (const [index, role] of ['state', 'configuration'].entries()) {
|
|
43
|
+
await t.test(`missing latest migration on ${role} returns not-ready`, async () => {
|
|
44
|
+
const before = await ledger(index); const row = before.find(item => item.filename === latest.filename)!;
|
|
45
|
+
await pools[index]!.query('DELETE FROM bz_schema_migrations WHERE filename=?', [latest.filename]);
|
|
46
|
+
const report = await checkReadinessFor(cfg, config, state);
|
|
47
|
+
assert.equal(report.ready, false); assert.deepEqual(report.checks.migrations, { status: 'pending', pending: 1 });
|
|
48
|
+
assert.equal((await ledger(index)).length, before.length - 1, 'readiness must not apply a migration');
|
|
49
|
+
await pools[index]!.query('INSERT INTO bz_schema_migrations(filename,checksum_sha256,applied_at) VALUES (?,?,?)', [row.filename, row.checksum_sha256, row.applied_at]);
|
|
50
|
+
assert.deepEqual(await ledger(index), before);
|
|
51
|
+
});
|
|
52
|
+
for (const checksum of [null, '0'.repeat(64)]) {
|
|
53
|
+
await t.test(`${role} ${checksum === null ? 'NULL' : 'conflicting'} checksum fails without backfill`, async () => {
|
|
54
|
+
await pools[index]!.query('UPDATE bz_schema_migrations SET checksum_sha256=? WHERE filename=?', [checksum, latest.filename]);
|
|
55
|
+
const before = await ledger(index); const report = await checkReadinessFor(cfg, config, state);
|
|
56
|
+
assert.equal(report.ready, false); assert.equal(report.checks.migrations.status, 'failed');
|
|
57
|
+
assert.deepEqual(await ledger(index), before, 'readiness cannot repair the ledger');
|
|
58
|
+
await pools[index]!.query('UPDATE bz_schema_migrations SET checksum_sha256=? WHERE filename=?', [latest.checksumSha256, latest.filename]);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
await t.test(`${role} unknown future record fails without dropping it`, async () => {
|
|
62
|
+
await pools[index]!.query('INSERT INTO bz_schema_migrations(filename,checksum_sha256) VALUES (?,?)', ['999_synthetic_future.sql', '0'.repeat(64)]);
|
|
63
|
+
const before = await ledger(index); const report = await checkReadinessFor(cfg, config, state);
|
|
64
|
+
assert.equal(report.ready, false); assert.equal(report.checks.migrations.status, 'failed'); assert.deepEqual(await ledger(index), before);
|
|
65
|
+
await pools[index]!.query('DELETE FROM bz_schema_migrations WHERE filename=?', ['999_synthetic_future.sql']);
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
await t.test('JSONL state still checks configuration; missing checksum column requires explicit migrator', async () => {
|
|
69
|
+
const jsonl = { ...cfg, state: { ...cfg.state, backend: 'jsonl' as const } };
|
|
70
|
+
assert.equal((await checkReadinessFor(jsonl, config)).ready, true);
|
|
71
|
+
await pools[1]!.query('ALTER TABLE bz_schema_migrations DROP COLUMN checksum_sha256');
|
|
72
|
+
assert.equal((await checkReadinessFor(jsonl, config)).ready, false);
|
|
73
|
+
const [columns] = await pools[1]!.query<RowDataPacket[]>('SHOW COLUMNS FROM bz_schema_migrations');
|
|
74
|
+
assert.equal(columns.some(row => row.Field === 'checksum_sha256'), false, 'probe must not add the checksum column');
|
|
75
|
+
const repaired = await migrateBailingHubCoreSchema({ mysql: { ...base, database: names[1]! }, logger: { log() {}, warn() {} } });
|
|
76
|
+
assert.equal(repaired.checksumBackfilledFiles.length, artifact.migrations.length); assert.deepEqual(repaired.appliedFiles, []);
|
|
77
|
+
assert.equal((await checkReadinessFor(jsonl, config)).ready, true);
|
|
78
|
+
});
|
|
79
|
+
await t.test('Kernel.readiness and real /health/ready expose the same ledger decision', async () => {
|
|
80
|
+
const dir = mkdtempSync(join(tmpdir(), 'readiness-kernel-'));
|
|
81
|
+
const runtime: AppConfig = { root: process.cwd(), runtimeRoot: dir, env: 'development',
|
|
82
|
+
server: { host: '127.0.0.1', port: 0, token: '' }, brand: { name: 'Synthetic readiness test' },
|
|
83
|
+
displayTz: 'Asia/Shanghai', displayTzLabel: '北京时间', auditRetentionDays: 0, alerts: null,
|
|
84
|
+
metrics: { enabled: false, token: '', scrapeTimeoutMs: 1000 }, bootstrapAdmin: null,
|
|
85
|
+
concurrency: 1, killSwitchFile: join(dir, '.paused'), claudeBin: 'synthetic-unused', defaultProfile: 'readonly', brainDir: join(dir, 'brain'),
|
|
86
|
+
state: { backend: 'mysql', jsonlPath: join(dir, 'jobs.jsonl'), mysql: { ...base, database: names[0]! } }, projects: {}, llmCredentials: {},
|
|
87
|
+
executor: { hubUrl: '', token: '', executorId: 'synthetic', targets: [], waitMs: 100, concurrency: 1, labels: [] } };
|
|
88
|
+
const kernel = createBailingHubKernel({ instanceKey: prefix, config: runtime, schedulerMode: 'managed', bootstrapLocalAdmin: false,
|
|
89
|
+
logger: { log() {}, warn() {}, error() {} } });
|
|
90
|
+
const server = createServer((req, res) => { void kernel.handle(req, res, new URL(req.url ?? '/', 'http://local')).catch(() => { res.statusCode = 500; res.end(); }); });
|
|
91
|
+
try {
|
|
92
|
+
await kernel.initialize();
|
|
93
|
+
await new Promise<void>(resolve => server.listen(0, '127.0.0.1', resolve));
|
|
94
|
+
const address = server.address(); assert.ok(address && typeof address !== 'string');
|
|
95
|
+
const url = `http://127.0.0.1:${address.port}/health/ready`;
|
|
96
|
+
assert.equal((await kernel.readiness()).ready, true); assert.equal((await fetch(url)).status, 200);
|
|
97
|
+
await pools[0]!.query('UPDATE bz_schema_migrations SET checksum_sha256=NULL WHERE filename=?', [latest.filename]);
|
|
98
|
+
assert.equal((await kernel.readiness()).ready, false);
|
|
99
|
+
const failed = await fetch(url); assert.equal(failed.status, 503);
|
|
100
|
+
const body = await failed.json() as { status: string; checks: { migrations: { status: string } } };
|
|
101
|
+
assert.equal(body.status, 'not_ready'); assert.equal(body.checks.migrations.status, 'failed');
|
|
102
|
+
assert.doesNotMatch(JSON.stringify(body), /password|127\.0\.0\.1|checksum_sha256/);
|
|
103
|
+
await pools[0]!.query('UPDATE bz_schema_migrations SET checksum_sha256=? WHERE filename=?', [latest.checksumSha256, latest.filename]);
|
|
104
|
+
assert.equal((await kernel.readiness()).ready, true); assert.equal((await fetch(url)).status, 200);
|
|
105
|
+
} finally {
|
|
106
|
+
server.closeAllConnections(); await new Promise<void>(resolve => server.close(() => resolve()));
|
|
107
|
+
await kernel.close(); rmSync(dir, { recursive: true, force: true });
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
await t.test('both existing pools remain usable after repeated readiness calls', async () => {
|
|
111
|
+
for (let i = 0; i < 3; i++) assert.equal((await checkReadinessFor(cfg, config, state)).ready, true);
|
|
112
|
+
for (const pool of pools) await pool.query('SELECT 1');
|
|
113
|
+
});
|
|
114
|
+
} finally {
|
|
115
|
+
for (const pool of pools) await pool.end();
|
|
116
|
+
for (const name of created) { assert.match(name, new RegExp(`^${prefix}_(state|config)$`)); await admin.query(`DROP DATABASE \`${name}\``); }
|
|
117
|
+
const [left] = await admin.query<RowDataPacket[]>('SELECT SCHEMA_NAME FROM information_schema.SCHEMATA WHERE SCHEMA_NAME LIKE ?', [`${prefix}_%`]);
|
|
118
|
+
assert.equal(left.length, 0); t.diagnostic(`cleaned ${created.length} random schemas; no leftovers`); await admin.end();
|
|
119
|
+
}
|
|
120
|
+
});
|
|
@@ -1,37 +1,122 @@
|
|
|
1
1
|
import test from 'node:test';
|
|
2
2
|
import assert from 'node:assert/strict';
|
|
3
|
-
import {
|
|
4
|
-
import { tmpdir } from 'node:os';
|
|
5
|
-
import { join } from 'node:path';
|
|
3
|
+
import type { Pool } from 'mysql2/promise';
|
|
6
4
|
import type { AppConfig } from '../core/config/config';
|
|
7
5
|
import type { ConfigStoreContract } from '../infrastructure/config/configstore';
|
|
6
|
+
import type { SchemaReadinessDatabase } from '../core/contracts/schema-readiness';
|
|
7
|
+
import { BAILINGHUB_CORE_ARTIFACT_V1 as artifact } from '../kernel-api/v1/artifact';
|
|
8
|
+
import { MysqlStore } from '../infrastructure/state/state-mysql';
|
|
8
9
|
import { checkReadinessFor } from './readiness';
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
11
|
+
const cfg = (backend: 'mysql' | 'jsonl' = 'mysql') => ({ root: '/not-the-installed-artifact', state: { backend } }) as AppConfig;
|
|
12
|
+
const rows = () => artifact.migrations.map(file => ({ filename: file.filename, checksum_sha256: file.checksumSha256 }));
|
|
13
|
+
function database(payload: unknown = rows(), fail?: 'connection' | 'ledger') {
|
|
14
|
+
const queries: string[] = [];
|
|
15
|
+
const db: SchemaReadinessDatabase = { query: async sql => {
|
|
16
|
+
queries.push(sql);
|
|
17
|
+
assert.ok(sql === 'SELECT 1' || sql === 'SELECT filename, checksum_sha256 FROM bz_schema_migrations ORDER BY filename', 'only fixed read-only queries');
|
|
18
|
+
if (fail === 'connection' || (fail === 'ledger' && sql !== 'SELECT 1')) throw new Error('mysql://secret@internal SQL error');
|
|
19
|
+
return [sql === 'SELECT 1' ? [{ one: 1 }] : payload, []];
|
|
20
|
+
} };
|
|
21
|
+
return { db, queries };
|
|
22
|
+
}
|
|
23
|
+
const config = (db: SchemaReadinessDatabase) => ({ db }) as ConfigStoreContract;
|
|
24
|
+
const state = (db: SchemaReadinessDatabase) => ({ schemaReadinessDb: db });
|
|
25
|
+
|
|
26
|
+
test('shared actual pool is checked once; installed artifact does not depend on cfg.root', async () => {
|
|
27
|
+
const { db, queries } = database();
|
|
28
|
+
assert.deepEqual(await checkReadinessFor(cfg(), config(db), state(db)), {
|
|
29
|
+
ready: true, checks: { state_backend: 'ok', database: 'ok', migrations: { status: 'ok', pending: 0 } },
|
|
30
|
+
});
|
|
31
|
+
assert.equal(queries.length, 2);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
for (const missing of ['state', 'configuration']) {
|
|
35
|
+
test(`split MySQL: missing migration on ${missing} prevents ready`, async () => {
|
|
36
|
+
const stateDb = database(missing === 'state' ? rows().slice(0, -1) : rows());
|
|
37
|
+
const configDb = database(missing === 'configuration' ? rows().slice(0, -1) : rows());
|
|
38
|
+
const report = await checkReadinessFor(cfg(), config(configDb.db), state(stateDb.db));
|
|
39
|
+
assert.equal(report.ready, false);
|
|
40
|
+
assert.deepEqual(report.checks.migrations, { status: 'pending', pending: 1 });
|
|
41
|
+
assert.equal(stateDb.queries.length, 2); assert.equal(configDb.queries.length, 2);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
test('pure JSONL skips SQL; JSONL state with a MySQL config still checks configuration', async () => {
|
|
46
|
+
assert.equal((await checkReadinessFor(cfg('jsonl'), null)).checks.database, 'skipped');
|
|
47
|
+
const incomplete = database(rows().slice(0, -1));
|
|
48
|
+
const report = await checkReadinessFor(cfg('jsonl'), config(incomplete.db));
|
|
49
|
+
assert.equal(report.ready, false); assert.equal(report.checks.migrations.pending, 1);
|
|
50
|
+
assert.equal(incomplete.queries.length, 2);
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
test('custom MySQL store without an actual probe fails closed; no fallback connection', async () => {
|
|
54
|
+
const { db, queries } = database();
|
|
55
|
+
const report = await checkReadinessFor(cfg(), config(db), {});
|
|
56
|
+
assert.equal(report.ready, false); assert.equal(report.checks.database, 'failed'); assert.equal(queries.length, 0);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
test('existing MysqlStore pool is reused across probes, never closed or reacquired by readiness', async () => {
|
|
60
|
+
const { db } = database(); let gets = 0; let closes = 0;
|
|
61
|
+
const store = new MysqlStore({} as AppConfig['state']['mysql'], { get: async () => { gets++; return db as Pool; }, close: async () => { closes++; } });
|
|
62
|
+
await store.init();
|
|
63
|
+
for (let index = 0; index < 3; index++) assert.equal((await checkReadinessFor(cfg(), config(db), store)).ready, true);
|
|
64
|
+
assert.equal(gets, 1); assert.equal(closes, 0); assert.equal(store.schemaReadinessDb, db);
|
|
65
|
+
await store.close(); assert.equal(closes, 1);
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
for (const value of [null, '', ' ', '0'.repeat(64), 'invalid', undefined, 123]) {
|
|
69
|
+
test(`missing/malformed/conflicting checksum (${String(value)}) is not ready and is never backfilled`, async () => {
|
|
70
|
+
const payload: Array<Record<string, unknown>> = rows(); payload[0] = { ...payload[0], checksum_sha256: value };
|
|
71
|
+
const original = structuredClone(payload); const { db } = database(payload);
|
|
72
|
+
const report = await checkReadinessFor(cfg(), config(db), state(db));
|
|
73
|
+
assert.equal(report.ready, false); assert.equal(report.checks.migrations.status, 'failed'); assert.deepEqual(payload, original);
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
test('unknown future and duplicate migration rows fail closed', async () => {
|
|
78
|
+
for (const payload of [[...rows(), { filename: '999_future.sql', checksum_sha256: '0'.repeat(64) }], [...rows(), rows()[0]]]) {
|
|
79
|
+
const { db } = database(payload);
|
|
80
|
+
assert.equal((await checkReadinessFor(cfg(), config(db), state(db))).checks.migrations.status, 'failed');
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
test('retired history is optional, never pending; a present retired record must match its checksum', async () => {
|
|
85
|
+
const retired = artifact.retiredMigrations[0]; assert.ok(retired);
|
|
86
|
+
for (const checksum of [retired.checksumSha256, '0'.repeat(64), null]) {
|
|
87
|
+
const { db } = database([...rows(), { filename: retired.filename, checksum_sha256: checksum }]);
|
|
88
|
+
const report = await checkReadinessFor(cfg(), config(db), state(db));
|
|
89
|
+
assert.equal(report.ready, checksum === retired.checksumSha256); assert.equal(report.checks.migrations.pending, 0);
|
|
27
90
|
}
|
|
28
91
|
});
|
|
29
92
|
|
|
30
|
-
test('
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
93
|
+
test('checksum normalization matches the migrator; invalid ledger shapes fail closed', async () => {
|
|
94
|
+
const upper = rows().map(row => ({ ...row, checksum_sha256: ` ${row.checksum_sha256.toUpperCase()} ` }));
|
|
95
|
+
const valid = database(upper).db; assert.equal((await checkReadinessFor(cfg(), config(valid), state(valid))).ready, true);
|
|
96
|
+
for (const payload of [undefined, {}, [null], [['invalid']], [{ filename: 1, checksum_sha256: '0'.repeat(64) }]]) {
|
|
97
|
+
const { db } = database(payload === undefined ? null : payload);
|
|
98
|
+
assert.equal((await checkReadinessFor(cfg(), config(db), state(db))).ready, false);
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
for (const fault of ['connection', 'ledger'] as const) {
|
|
103
|
+
test(`unreachable DB or absent ledger/checksum column (${fault}) exposes stable states only`, async () => {
|
|
104
|
+
const { db } = database(rows(), fault);
|
|
105
|
+
const report = await checkReadinessFor(cfg(), config(db), state(db));
|
|
106
|
+
assert.equal(report.ready, false); assert.equal(report.checks.database, fault === 'connection' ? 'failed' : 'ok');
|
|
107
|
+
assert.equal(report.checks.migrations.status, 'failed'); assert.doesNotMatch(JSON.stringify(report), /secret|internal|SQL/);
|
|
36
108
|
});
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
test('adapter getter failure is contained without leaking connection details', async () => {
|
|
112
|
+
const broken = { get schemaReadinessDb(): SchemaReadinessDatabase { throw new Error('mysql://secret@internal'); } };
|
|
113
|
+
const { db } = database(); const report = await checkReadinessFor(cfg(), config(db), broken);
|
|
114
|
+
assert.equal(report.ready, false); assert.doesNotMatch(JSON.stringify(report), /secret|internal/);
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
test('pending counts distinct missing files across distinct pools without skipping either probe', async () => {
|
|
118
|
+
const first = database(rows().slice(0, -1)); const second = database(rows().slice(0, -1));
|
|
119
|
+
const report = await checkReadinessFor(cfg(), config(first.db), state(second.db));
|
|
120
|
+
assert.equal(report.ready, false); assert.equal(report.checks.migrations.pending, 1);
|
|
121
|
+
assert.equal(first.queries.length, 2); assert.equal(second.queries.length, 2);
|
|
37
122
|
});
|
package/src/app/readiness.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { AppConfig } from '../core/config/config';
|
|
2
|
-
import { sqlMigrationFiles } from '../core/platform/version';
|
|
3
2
|
import type { ConfigStoreContract } from '../infrastructure/config/configstore';
|
|
3
|
+
import type { RuntimeStateStore } from '../core/state/state-contracts';
|
|
4
|
+
import type { SchemaReadinessDatabase } from '../core/contracts/schema-readiness';
|
|
5
|
+
import { inspectCoreSchemaReadiness } from '../infrastructure/schema/schema-readiness';
|
|
4
6
|
|
|
5
7
|
export interface ReadinessReport {
|
|
6
8
|
ready: boolean;
|
|
@@ -11,29 +13,31 @@ export interface ReadinessReport {
|
|
|
11
13
|
};
|
|
12
14
|
}
|
|
13
15
|
|
|
14
|
-
/**
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
if (cfg.state.backend !== 'mysql') {
|
|
19
|
-
return { ready: true, checks: { state_backend: 'ok', database: 'skipped', migrations: { status: 'skipped', pending: 0 } } };
|
|
20
|
-
}
|
|
21
|
-
if (!configStore) {
|
|
22
|
-
return { ready: false, checks: { state_backend: 'ok', database: 'failed', migrations: { status: 'failed', pending: 0 } } };
|
|
23
|
-
}
|
|
16
|
+
/** Shared storage only: external model, tool and channel failures belong to business diagnostics. */
|
|
17
|
+
export async function checkReadinessFor(
|
|
18
|
+
cfg: AppConfig, configStore: ConfigStoreContract | null, stateStore?: Pick<RuntimeStateStore, 'schemaReadinessDb'>,
|
|
19
|
+
): Promise<ReadinessReport> {
|
|
24
20
|
try {
|
|
25
|
-
|
|
21
|
+
// A custom MySQL state store must expose its actual resource. Guessing from
|
|
22
|
+
// config or checking only the configuration DB can admit a broken instance.
|
|
23
|
+
if (cfg.state.backend === 'mysql' && (!configStore || !stateStore?.schemaReadinessDb)) {
|
|
24
|
+
return { ready: false, checks: { state_backend: 'ok', database: 'failed', migrations: { status: 'failed', pending: 0 } } };
|
|
25
|
+
}
|
|
26
|
+
const resources = new Set<SchemaReadinessDatabase>();
|
|
27
|
+
if (stateStore?.schemaReadinessDb) resources.add(stateStore.schemaReadinessDb);
|
|
28
|
+
if (configStore) resources.add(configStore.db);
|
|
29
|
+
if (!resources.size) {
|
|
30
|
+
return { ready: true, checks: { state_backend: 'ok', database: 'skipped', migrations: { status: 'skipped', pending: 0 } } };
|
|
31
|
+
}
|
|
32
|
+
const checks = await Promise.all([...resources].map(inspectCoreSchemaReadiness));
|
|
33
|
+
const database = checks.some(check => check.database === 'failed') ? 'failed' : 'ok';
|
|
34
|
+
// Count distinct missing migration files, even when separate pool objects
|
|
35
|
+
// refer to one schema. Never merge resources by guessed connection settings.
|
|
36
|
+
const pending = new Set(checks.flatMap(check => check.pendingFilenames)).size;
|
|
37
|
+
const status = checks.some(check => check.migrations.status === 'failed') ? 'failed' : pending ? 'pending' : 'ok';
|
|
38
|
+
return { ready: database === 'ok' && status === 'ok', checks: { state_backend: 'ok', database, migrations: { status, pending } } };
|
|
26
39
|
} catch {
|
|
40
|
+
// Getter/adapter errors must not disclose connection strings or SQL details.
|
|
27
41
|
return { ready: false, checks: { state_backend: 'ok', database: 'failed', migrations: { status: 'failed', pending: 0 } } };
|
|
28
42
|
}
|
|
29
|
-
try {
|
|
30
|
-
const applied = new Set(await configStore.observability.listSchemaMigrations());
|
|
31
|
-
const pending = sqlMigrationFiles(cfg.root).filter((file) => !applied.has(file));
|
|
32
|
-
return {
|
|
33
|
-
ready: pending.length === 0,
|
|
34
|
-
checks: { state_backend: 'ok', database: 'ok', migrations: { status: pending.length ? 'pending' : 'ok', pending: pending.length } },
|
|
35
|
-
};
|
|
36
|
-
} catch {
|
|
37
|
-
return { ready: false, checks: { state_backend: 'ok', database: 'ok', migrations: { status: 'failed', pending: 0 } } };
|
|
38
|
-
}
|
|
39
43
|
}
|
|
@@ -2,7 +2,7 @@ import assert from 'node:assert/strict';
|
|
|
2
2
|
import test from 'node:test';
|
|
3
3
|
import type { AppConfig } from '../core/config/config';
|
|
4
4
|
import type { RuntimeStateStore } from '../core/state/state-contracts';
|
|
5
|
-
import { startRuntimeSchedulersFor, type RuntimeLifecycleDeps } from './runtime-lifecycle';
|
|
5
|
+
import { createManagedRuntimeMaintenanceFor, createManagedRuntimeMaintenanceStateV1, startRuntimeSchedulersFor, type RuntimeLifecycleDeps } from './runtime-lifecycle';
|
|
6
6
|
|
|
7
7
|
function deps(reconcileApprovalContinuations: () => Promise<void>): RuntimeLifecycleDeps {
|
|
8
8
|
return {
|
|
@@ -53,3 +53,36 @@ test('standalone stop before the first timer admits no persisted evidence work',
|
|
|
53
53
|
assert.equal(calls, 0);
|
|
54
54
|
assert.equal(await schedulers.drain!(1), true);
|
|
55
55
|
});
|
|
56
|
+
|
|
57
|
+
test('managed notification maintenance runs on each new owner, throttles ticks and drains an accepted claim', async () => {
|
|
58
|
+
const state = createManagedRuntimeMaintenanceStateV1();
|
|
59
|
+
let time = 100, calls = 0, release!: () => void;
|
|
60
|
+
let gate = new Promise<void>(resolve => { release = resolve; });
|
|
61
|
+
const dependencies = { ...deps(async () => {}), reconcileNotifications: async () => { calls++; await gate; } };
|
|
62
|
+
const first = createManagedRuntimeMaintenanceFor(dependencies, { nowMs: () => time, state });
|
|
63
|
+
await first.tick(); await first.tick();
|
|
64
|
+
assert.equal(calls, 1);
|
|
65
|
+
assert.equal(await first.stop(1), false);
|
|
66
|
+
release(); assert.equal(await first.stop(1000), true);
|
|
67
|
+
gate = Promise.resolve();
|
|
68
|
+
const second = createManagedRuntimeMaintenanceFor(dependencies, { nowMs: () => time, state });
|
|
69
|
+
await second.tick(); assert.equal(calls, 2, 'new owners recover persisted work on their first existing tick');
|
|
70
|
+
await second.tick(); assert.equal(calls, 2);
|
|
71
|
+
await new Promise<void>(resolve => setImmediate(resolve));
|
|
72
|
+
time += 5000;
|
|
73
|
+
await second.tick(); assert.equal(calls, 3);
|
|
74
|
+
assert.equal(await second.stop(1000), true);
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
test('standalone notification scan starts after listen and remains owned until drained', async () => {
|
|
78
|
+
let release!: () => void, entered!: () => void;
|
|
79
|
+
const gate = new Promise<void>(resolve => { release = resolve; });
|
|
80
|
+
const started = new Promise<void>(resolve => { entered = resolve; });
|
|
81
|
+
const schedulers = startRuntimeSchedulersFor({ ...deps(async () => {}), reconcileNotifications: async () => { entered(); await gate; } });
|
|
82
|
+
const guard = setTimeout(() => {}, 1000);
|
|
83
|
+
try {
|
|
84
|
+
await started; schedulers.stop();
|
|
85
|
+
assert.equal(await schedulers.drain!(1), false);
|
|
86
|
+
release(); assert.equal(await schedulers.drain!(1000), true);
|
|
87
|
+
} finally { clearTimeout(guard); schedulers.stop(); release(); }
|
|
88
|
+
});
|
|
@@ -13,8 +13,14 @@ import {
|
|
|
13
13
|
} from './runtime-lifecycle';
|
|
14
14
|
import { bootstrapInitialAdmin } from './admin-bootstrap';
|
|
15
15
|
import { reconcileApprovalContinuationsFor } from './approval-continuations';
|
|
16
|
+
import { reconcileNotificationOutboxFor } from './notification-outbox';
|
|
17
|
+
import { bindNotificationOutboxWake } from '../core/runtime/notification-outbox-work';
|
|
16
18
|
|
|
17
19
|
export function defaultRuntimeLifecycleDeps(): RuntimeLifecycleDeps {
|
|
20
|
+
const reconcileNotifications = () => reconcileNotificationOutboxFor({
|
|
21
|
+
cfg, configStore: cfgStore, stateStore: store, now, sleep, targetRegistry,
|
|
22
|
+
});
|
|
23
|
+
bindNotificationOutboxWake(store, reconcileNotifications);
|
|
18
24
|
return {
|
|
19
25
|
cfg,
|
|
20
26
|
configStore: cfgStore,
|
|
@@ -30,6 +36,7 @@ export function defaultRuntimeLifecycleDeps(): RuntimeLifecycleDeps {
|
|
|
30
36
|
now,
|
|
31
37
|
sleep,
|
|
32
38
|
targetRegistry,
|
|
39
|
+
reconcileNotifications,
|
|
33
40
|
reconcileApprovalContinuations: async () => {
|
|
34
41
|
await reconcileApprovalContinuationsFor({
|
|
35
42
|
configStore: cfgStore, stateStore: store,
|