bailinghub 0.9.3 → 0.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.dockerignore +1 -0
- package/.gitignore +1 -0
- package/.npmignore +1 -0
- package/Dockerfile +1 -0
- package/README.en.md +6 -6
- package/README.md +6 -6
- package/SECURITY.md +3 -3
- package/THIRD_PARTY_NOTICES.md +7 -7
- package/docker-compose.images.yml +2 -2
- package/docs/CHANGELOG.en.md +12 -1
- package/docs/CHANGELOG.md +12 -1
- package/docs/DOCX_DEPENDENCY.en.md +26 -0
- package/docs/DOCX_DEPENDENCY.md +26 -0
- package/docs/IMPLEMENTATION_STATUS.en.md +19 -15
- package/docs/IMPLEMENTATION_STATUS.md +19 -15
- package/docs/INDEPENDENT_VALIDATION.en.md +4 -4
- package/docs/INDEPENDENT_VALIDATION.md +4 -4
- package/docs/NOTIFICATION_DURABILITY.en.md +47 -0
- package/docs/NOTIFICATION_DURABILITY.md +47 -0
- package/docs/OPERATIONS.en.md +6 -2
- package/docs/OPERATIONS.md +6 -2
- package/docs/README.en.md +4 -0
- package/docs/README.md +4 -0
- package/docs/RELEASE_NOTES_NEXT.en.md +3 -3
- package/docs/RELEASE_NOTES_NEXT.md +3 -3
- package/docs/RELEASE_NOTES_v0.9.4.en.md +42 -0
- package/docs/RELEASE_NOTES_v0.9.4.md +42 -0
- package/docs/UPGRADE_v0.9.4.en.md +57 -0
- package/docs/UPGRADE_v0.9.4.md +57 -0
- package/node_modules/@xmldom/xmldom/CHANGELOG.md +533 -0
- package/node_modules/@xmldom/xmldom/LICENSE +8 -0
- package/node_modules/@xmldom/xmldom/SECURITY.md +50 -0
- package/node_modules/@xmldom/xmldom/index.d.ts +96 -0
- package/node_modules/@xmldom/xmldom/lib/.eslintrc.yml +2 -0
- package/node_modules/@xmldom/xmldom/lib/conventions.js +214 -0
- package/node_modules/@xmldom/xmldom/lib/dom-parser.js +322 -0
- package/node_modules/@xmldom/xmldom/lib/dom.js +2266 -0
- package/node_modules/@xmldom/xmldom/lib/entities.js +2166 -0
- package/node_modules/@xmldom/xmldom/lib/index.js +4 -0
- package/node_modules/@xmldom/xmldom/lib/sax.js +683 -0
- package/node_modules/@xmldom/xmldom/package.json +75 -0
- package/node_modules/@xmldom/xmldom/readme.md +356 -0
- package/node_modules/base64-js/LICENSE +21 -0
- package/node_modules/base64-js/README.md +34 -0
- package/node_modules/base64-js/base64js.min.js +1 -0
- package/node_modules/base64-js/index.d.ts +3 -0
- package/node_modules/base64-js/index.js +150 -0
- package/node_modules/base64-js/package.json +47 -0
- package/node_modules/bluebird/LICENSE +21 -0
- package/node_modules/bluebird/README.md +51 -0
- package/node_modules/bluebird/changelog.md +1 -0
- package/node_modules/bluebird/js/browser/bluebird.core.js +3739 -0
- package/node_modules/bluebird/js/browser/bluebird.core.min.js +31 -0
- package/node_modules/bluebird/js/browser/bluebird.js +5581 -0
- package/node_modules/bluebird/js/browser/bluebird.min.js +31 -0
- package/node_modules/bluebird/js/release/any.js +21 -0
- package/node_modules/bluebird/js/release/assert.js +55 -0
- package/node_modules/bluebird/js/release/async.js +161 -0
- package/node_modules/bluebird/js/release/bind.js +67 -0
- package/node_modules/bluebird/js/release/bluebird.js +11 -0
- package/node_modules/bluebird/js/release/call_get.js +123 -0
- package/node_modules/bluebird/js/release/cancel.js +129 -0
- package/node_modules/bluebird/js/release/catch_filter.js +42 -0
- package/node_modules/bluebird/js/release/context.js +69 -0
- package/node_modules/bluebird/js/release/debuggability.js +916 -0
- package/node_modules/bluebird/js/release/direct_resolve.js +46 -0
- package/node_modules/bluebird/js/release/each.js +30 -0
- package/node_modules/bluebird/js/release/errors.js +116 -0
- package/node_modules/bluebird/js/release/es5.js +80 -0
- package/node_modules/bluebird/js/release/filter.js +12 -0
- package/node_modules/bluebird/js/release/finally.js +111 -0
- package/node_modules/bluebird/js/release/generators.js +223 -0
- package/node_modules/bluebird/js/release/join.js +168 -0
- package/node_modules/bluebird/js/release/map.js +168 -0
- package/node_modules/bluebird/js/release/method.js +55 -0
- package/node_modules/bluebird/js/release/nodeback.js +51 -0
- package/node_modules/bluebird/js/release/nodeify.js +58 -0
- package/node_modules/bluebird/js/release/promise.js +773 -0
- package/node_modules/bluebird/js/release/promise_array.js +184 -0
- package/node_modules/bluebird/js/release/promisify.js +314 -0
- package/node_modules/bluebird/js/release/props.js +118 -0
- package/node_modules/bluebird/js/release/queue.js +73 -0
- package/node_modules/bluebird/js/release/race.js +49 -0
- package/node_modules/bluebird/js/release/reduce.js +172 -0
- package/node_modules/bluebird/js/release/schedule.js +61 -0
- package/node_modules/bluebird/js/release/settle.js +43 -0
- package/node_modules/bluebird/js/release/some.js +148 -0
- package/node_modules/bluebird/js/release/synchronous_inspection.js +103 -0
- package/node_modules/bluebird/js/release/thenables.js +86 -0
- package/node_modules/bluebird/js/release/timers.js +93 -0
- package/node_modules/bluebird/js/release/using.js +226 -0
- package/node_modules/bluebird/js/release/util.js +379 -0
- package/node_modules/bluebird/package.json +76 -0
- package/node_modules/core-util-is/LICENSE +19 -0
- package/node_modules/core-util-is/README.md +3 -0
- package/node_modules/core-util-is/lib/util.js +107 -0
- package/node_modules/core-util-is/package.json +38 -0
- package/node_modules/dingbat-to-unicode/README.md +79 -0
- package/node_modules/dingbat-to-unicode/dist/dingbats.d.ts +8 -0
- package/node_modules/dingbat-to-unicode/dist/dingbats.js +1066 -0
- package/node_modules/dingbat-to-unicode/dist/index.d.ts +7 -0
- package/node_modules/dingbat-to-unicode/dist/index.js +44 -0
- package/node_modules/dingbat-to-unicode/package.json +39 -0
- package/node_modules/duck/LICENSE +22 -0
- package/node_modules/duck/README.md +184 -0
- package/node_modules/duck/index.js +267 -0
- package/node_modules/duck/makefile +4 -0
- package/node_modules/duck/package.json +23 -0
- package/node_modules/duck/test/duck.test.js +160 -0
- package/node_modules/immediate/LICENSE.txt +20 -0
- package/node_modules/immediate/README.md +93 -0
- package/node_modules/immediate/dist/immediate.js +75 -0
- package/node_modules/immediate/dist/immediate.min.js +1 -0
- package/node_modules/immediate/lib/browser.js +69 -0
- package/node_modules/immediate/lib/index.js +73 -0
- package/node_modules/immediate/package.json +42 -0
- package/node_modules/inherits/LICENSE +16 -0
- package/node_modules/inherits/README.md +42 -0
- package/node_modules/inherits/inherits.js +9 -0
- package/node_modules/inherits/inherits_browser.js +27 -0
- package/node_modules/inherits/package.json +29 -0
- package/node_modules/isarray/.npmignore +1 -0
- package/node_modules/isarray/.travis.yml +4 -0
- package/node_modules/isarray/Makefile +6 -0
- package/node_modules/isarray/README.md +60 -0
- package/node_modules/isarray/component.json +19 -0
- package/node_modules/isarray/index.js +5 -0
- package/node_modules/isarray/package.json +45 -0
- package/node_modules/isarray/test.js +20 -0
- package/node_modules/jszip/.codeclimate.yml +16 -0
- package/node_modules/jszip/.editorconfig +8 -0
- package/node_modules/jszip/.eslintrc.js +43 -0
- package/node_modules/jszip/.github/workflows/pr.yaml +58 -0
- package/node_modules/jszip/.jekyll-metadata +0 -0
- package/node_modules/jszip/.travis.yml +17 -0
- package/node_modules/jszip/CHANGES.md +204 -0
- package/node_modules/jszip/LICENSE.markdown +651 -0
- package/node_modules/jszip/README.markdown +33 -0
- package/node_modules/jszip/deps.js +37 -0
- package/node_modules/jszip/dist/jszip.js +11577 -0
- package/node_modules/jszip/dist/jszip.min.js +13 -0
- package/node_modules/jszip/graph.svg +601 -0
- package/node_modules/jszip/index.d.ts +330 -0
- package/node_modules/jszip/lib/base64.js +106 -0
- package/node_modules/jszip/lib/compressedObject.js +74 -0
- package/node_modules/jszip/lib/compressions.js +14 -0
- package/node_modules/jszip/lib/crc32.js +77 -0
- package/node_modules/jszip/lib/defaults.js +11 -0
- package/node_modules/jszip/lib/external.js +18 -0
- package/node_modules/jszip/lib/flate.js +85 -0
- package/node_modules/jszip/lib/generate/ZipFileWorker.js +539 -0
- package/node_modules/jszip/lib/generate/index.js +57 -0
- package/node_modules/jszip/lib/index.js +55 -0
- package/node_modules/jszip/lib/license_header.js +11 -0
- package/node_modules/jszip/lib/load.js +88 -0
- package/node_modules/jszip/lib/nodejs/NodejsStreamInputAdapter.js +74 -0
- package/node_modules/jszip/lib/nodejs/NodejsStreamOutputAdapter.js +42 -0
- package/node_modules/jszip/lib/nodejsUtils.js +57 -0
- package/node_modules/jszip/lib/object.js +384 -0
- package/node_modules/jszip/lib/readable-stream-browser.js +10 -0
- package/node_modules/jszip/lib/reader/ArrayReader.js +57 -0
- package/node_modules/jszip/lib/reader/DataReader.js +116 -0
- package/node_modules/jszip/lib/reader/NodeBufferReader.js +19 -0
- package/node_modules/jszip/lib/reader/StringReader.js +38 -0
- package/node_modules/jszip/lib/reader/Uint8ArrayReader.js +22 -0
- package/node_modules/jszip/lib/reader/readerFor.js +28 -0
- package/node_modules/jszip/lib/signature.js +7 -0
- package/node_modules/jszip/lib/stream/ConvertWorker.js +26 -0
- package/node_modules/jszip/lib/stream/Crc32Probe.js +24 -0
- package/node_modules/jszip/lib/stream/DataLengthProbe.js +29 -0
- package/node_modules/jszip/lib/stream/DataWorker.js +116 -0
- package/node_modules/jszip/lib/stream/GenericWorker.js +263 -0
- package/node_modules/jszip/lib/stream/StreamHelper.js +214 -0
- package/node_modules/jszip/lib/support.js +38 -0
- package/node_modules/jszip/lib/utf8.js +275 -0
- package/node_modules/jszip/lib/utils.js +501 -0
- package/node_modules/jszip/lib/zipEntries.js +261 -0
- package/node_modules/jszip/lib/zipEntry.js +293 -0
- package/node_modules/jszip/lib/zipObject.js +133 -0
- package/node_modules/jszip/package.json +67 -0
- package/node_modules/jszip/sponsors.md +21 -0
- package/node_modules/jszip/tsconfig.json +101 -0
- package/node_modules/jszip/vendor/FileSaver.js +247 -0
- package/node_modules/lie/README.md +62 -0
- package/node_modules/lie/dist/lie.js +350 -0
- package/node_modules/lie/dist/lie.min.js +1 -0
- package/node_modules/lie/dist/lie.polyfill.js +358 -0
- package/node_modules/lie/dist/lie.polyfill.min.js +1 -0
- package/node_modules/lie/lib/browser.js +273 -0
- package/node_modules/lie/lib/index.js +298 -0
- package/node_modules/lie/license.md +7 -0
- package/node_modules/lie/lie.d.ts +244 -0
- package/node_modules/lie/package.json +69 -0
- package/node_modules/lie/polyfill.js +4 -0
- package/node_modules/lop/LICENSE +22 -0
- package/node_modules/lop/README.md +248 -0
- package/node_modules/lop/index.js +18 -0
- package/node_modules/lop/lib/StringSource.js +53 -0
- package/node_modules/lop/lib/Token.js +7 -0
- package/node_modules/lop/lib/TokenIterator.js +28 -0
- package/node_modules/lop/lib/bottom-up.js +128 -0
- package/node_modules/lop/lib/errors.js +22 -0
- package/node_modules/lop/lib/lazy-iterators.js +81 -0
- package/node_modules/lop/lib/parser.js +11 -0
- package/node_modules/lop/lib/parsing-results.js +103 -0
- package/node_modules/lop/lib/regex-tokeniser.js +70 -0
- package/node_modules/lop/lib/rules.js +313 -0
- package/node_modules/lop/lib/testing.js +69 -0
- package/node_modules/lop/makefile +4 -0
- package/node_modules/lop/package.json +24 -0
- package/node_modules/lop/test/StringSource.test.js +21 -0
- package/node_modules/lop/test/TokenIterator.test.js +17 -0
- package/node_modules/lop/test/Tokeniser.js +50 -0
- package/node_modules/lop/test/Tokeniser.test.js +38 -0
- package/node_modules/lop/test/bottom-up.test.js +187 -0
- package/node_modules/lop/test/errors.test.js +36 -0
- package/node_modules/lop/test/lazy-iterators.test.js +53 -0
- package/node_modules/lop/test/lop.test.js +27 -0
- package/node_modules/lop/test/regex-tokeniser.test.js +114 -0
- package/node_modules/lop/test/results.test.js +8 -0
- package/node_modules/lop/test/rules.test.js +617 -0
- package/node_modules/mammoth/LICENSE +22 -0
- package/node_modules/mammoth/SOURCE.json +57 -0
- package/node_modules/mammoth/browser/docx/files.js +14 -0
- package/node_modules/mammoth/browser/unzip.js +12 -0
- package/node_modules/mammoth/lib/document-to-html.js +469 -0
- package/node_modules/mammoth/lib/documents.js +254 -0
- package/node_modules/mammoth/lib/docx/body-reader.js +798 -0
- package/node_modules/mammoth/lib/docx/comments-reader.js +31 -0
- package/node_modules/mammoth/lib/docx/content-types-reader.js +58 -0
- package/node_modules/mammoth/lib/docx/document-xml-reader.js +30 -0
- package/node_modules/mammoth/lib/docx/docx-reader.js +226 -0
- package/node_modules/mammoth/lib/docx/files.js +80 -0
- package/node_modules/mammoth/lib/docx/notes-reader.js +28 -0
- package/node_modules/mammoth/lib/docx/numbering-xml.js +111 -0
- package/node_modules/mammoth/lib/docx/office-xml-reader.js +73 -0
- package/node_modules/mammoth/lib/docx/relationships-reader.js +43 -0
- package/node_modules/mammoth/lib/docx/style-map.js +75 -0
- package/node_modules/mammoth/lib/docx/styles-reader.js +90 -0
- package/node_modules/mammoth/lib/docx/uris.js +21 -0
- package/node_modules/mammoth/lib/html/ast.js +51 -0
- package/node_modules/mammoth/lib/html/index.js +41 -0
- package/node_modules/mammoth/lib/html/simplify.js +88 -0
- package/node_modules/mammoth/lib/images.js +31 -0
- package/node_modules/mammoth/lib/index.d.ts +86 -0
- package/node_modules/mammoth/lib/index.js +111 -0
- package/node_modules/mammoth/lib/options-reader.js +107 -0
- package/node_modules/mammoth/lib/promises.js +42 -0
- package/node_modules/mammoth/lib/raw-text.js +14 -0
- package/node_modules/mammoth/lib/results.js +72 -0
- package/node_modules/mammoth/lib/style-reader.js +365 -0
- package/node_modules/mammoth/lib/styles/document-matchers.js +100 -0
- package/node_modules/mammoth/lib/styles/html-paths.js +75 -0
- package/node_modules/mammoth/lib/styles/parser/tokeniser.js +30 -0
- package/node_modules/mammoth/lib/transforms.js +62 -0
- package/node_modules/mammoth/lib/underline.js +11 -0
- package/node_modules/mammoth/lib/unzip.js +20 -0
- package/node_modules/mammoth/lib/writers/html-writer.js +159 -0
- package/node_modules/mammoth/lib/writers/index.js +14 -0
- package/node_modules/mammoth/lib/writers/markdown-writer.js +163 -0
- package/node_modules/mammoth/lib/xml/index.js +8 -0
- package/node_modules/mammoth/lib/xml/nodes.js +70 -0
- package/node_modules/mammoth/lib/xml/reader.js +69 -0
- package/node_modules/mammoth/lib/xml/writer.js +61 -0
- package/node_modules/mammoth/lib/xml/xmldom.js +23 -0
- package/node_modules/mammoth/lib/zipfile.js +72 -0
- package/node_modules/mammoth/package.json +39 -0
- package/node_modules/mammoth/upstream-package.json +64 -0
- package/node_modules/option/.npmignore +1 -0
- package/node_modules/option/LICENSE +22 -0
- package/node_modules/option/README.md +101 -0
- package/node_modules/option/index.js +88 -0
- package/node_modules/option/package.json +23 -0
- package/node_modules/option/test/options.test.js +174 -0
- package/node_modules/pako/CHANGELOG.md +164 -0
- package/node_modules/pako/LICENSE +21 -0
- package/node_modules/pako/README.md +191 -0
- package/node_modules/pako/dist/pako.js +6818 -0
- package/node_modules/pako/dist/pako.min.js +1 -0
- package/node_modules/pako/dist/pako_deflate.js +3997 -0
- package/node_modules/pako/dist/pako_deflate.min.js +1 -0
- package/node_modules/pako/dist/pako_inflate.js +3300 -0
- package/node_modules/pako/dist/pako_inflate.min.js +1 -0
- package/node_modules/pako/index.js +14 -0
- package/node_modules/pako/lib/deflate.js +400 -0
- package/node_modules/pako/lib/inflate.js +423 -0
- package/node_modules/pako/lib/utils/common.js +105 -0
- package/node_modules/pako/lib/utils/strings.js +187 -0
- package/node_modules/pako/lib/zlib/README +59 -0
- package/node_modules/pako/lib/zlib/adler32.js +51 -0
- package/node_modules/pako/lib/zlib/constants.js +68 -0
- package/node_modules/pako/lib/zlib/crc32.js +59 -0
- package/node_modules/pako/lib/zlib/deflate.js +1874 -0
- package/node_modules/pako/lib/zlib/gzheader.js +58 -0
- package/node_modules/pako/lib/zlib/inffast.js +345 -0
- package/node_modules/pako/lib/zlib/inflate.js +1556 -0
- package/node_modules/pako/lib/zlib/inftrees.js +343 -0
- package/node_modules/pako/lib/zlib/messages.js +32 -0
- package/node_modules/pako/lib/zlib/trees.js +1222 -0
- package/node_modules/pako/lib/zlib/zstream.js +47 -0
- package/node_modules/pako/package.json +44 -0
- package/node_modules/path-is-absolute/index.js +20 -0
- package/node_modules/path-is-absolute/license +21 -0
- package/node_modules/path-is-absolute/package.json +43 -0
- package/node_modules/path-is-absolute/readme.md +59 -0
- package/node_modules/process-nextick-args/index.js +45 -0
- package/node_modules/process-nextick-args/license.md +19 -0
- package/node_modules/process-nextick-args/package.json +25 -0
- package/node_modules/process-nextick-args/readme.md +18 -0
- package/node_modules/readable-stream/.travis.yml +34 -0
- package/node_modules/readable-stream/CONTRIBUTING.md +38 -0
- package/node_modules/readable-stream/GOVERNANCE.md +136 -0
- package/node_modules/readable-stream/LICENSE +47 -0
- package/node_modules/readable-stream/README.md +58 -0
- package/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +60 -0
- package/node_modules/readable-stream/duplex-browser.js +1 -0
- package/node_modules/readable-stream/duplex.js +1 -0
- package/node_modules/readable-stream/lib/_stream_duplex.js +131 -0
- package/node_modules/readable-stream/lib/_stream_passthrough.js +47 -0
- package/node_modules/readable-stream/lib/_stream_readable.js +1019 -0
- package/node_modules/readable-stream/lib/_stream_transform.js +214 -0
- package/node_modules/readable-stream/lib/_stream_writable.js +685 -0
- package/node_modules/readable-stream/lib/internal/streams/BufferList.js +78 -0
- package/node_modules/readable-stream/lib/internal/streams/destroy.js +84 -0
- package/node_modules/readable-stream/lib/internal/streams/stream-browser.js +1 -0
- package/node_modules/readable-stream/lib/internal/streams/stream.js +1 -0
- package/node_modules/readable-stream/package.json +52 -0
- package/node_modules/readable-stream/passthrough.js +1 -0
- package/node_modules/readable-stream/readable-browser.js +7 -0
- package/node_modules/readable-stream/readable.js +19 -0
- package/node_modules/readable-stream/transform.js +1 -0
- package/node_modules/readable-stream/writable-browser.js +1 -0
- package/node_modules/readable-stream/writable.js +8 -0
- package/node_modules/safe-buffer/LICENSE +21 -0
- package/node_modules/safe-buffer/README.md +584 -0
- package/node_modules/safe-buffer/index.d.ts +187 -0
- package/node_modules/safe-buffer/index.js +62 -0
- package/node_modules/safe-buffer/package.json +37 -0
- package/node_modules/setimmediate/LICENSE.txt +20 -0
- package/node_modules/setimmediate/package.json +30 -0
- package/node_modules/setimmediate/setImmediate.js +186 -0
- package/node_modules/string_decoder/.travis.yml +50 -0
- package/node_modules/string_decoder/LICENSE +48 -0
- package/node_modules/string_decoder/README.md +47 -0
- package/node_modules/string_decoder/lib/string_decoder.js +296 -0
- package/node_modules/string_decoder/package.json +31 -0
- package/node_modules/underscore/LICENSE +22 -0
- package/node_modules/underscore/README.md +34 -0
- package/node_modules/underscore/amd/_baseCreate.js +21 -0
- package/node_modules/underscore/amd/_baseIteratee.js +15 -0
- package/node_modules/underscore/amd/_cb.js +12 -0
- package/node_modules/underscore/amd/_chainResult.js +10 -0
- package/node_modules/underscore/amd/_collectNonEnumProps.js +42 -0
- package/node_modules/underscore/amd/_createAssigner.js +24 -0
- package/node_modules/underscore/amd/_createEscaper.js +21 -0
- package/node_modules/underscore/amd/_createIndexFinder.js +30 -0
- package/node_modules/underscore/amd/_createPredicateIndexFinder.js +18 -0
- package/node_modules/underscore/amd/_createReduce.js +30 -0
- package/node_modules/underscore/amd/_createSizePropertyCheck.js +13 -0
- package/node_modules/underscore/amd/_deepGet.js +15 -0
- package/node_modules/underscore/amd/_escapeMap.js +15 -0
- package/node_modules/underscore/amd/_executeBound.js +16 -0
- package/node_modules/underscore/amd/_flatten.js +32 -0
- package/node_modules/underscore/amd/_getByteLength.js +8 -0
- package/node_modules/underscore/amd/_getLength.js +8 -0
- package/node_modules/underscore/amd/_group.js +18 -0
- package/node_modules/underscore/amd/_has.js +10 -0
- package/node_modules/underscore/amd/_hasObjectTag.js +7 -0
- package/node_modules/underscore/amd/_isArrayLike.js +11 -0
- package/node_modules/underscore/amd/_isBufferLike.js +9 -0
- package/node_modules/underscore/amd/_keyInObj.js +11 -0
- package/node_modules/underscore/amd/_methodFingerprint.js +44 -0
- package/node_modules/underscore/amd/_optimizeCb.js +27 -0
- package/node_modules/underscore/amd/_setup.js +70 -0
- package/node_modules/underscore/amd/_shallowProperty.js +12 -0
- package/node_modules/underscore/amd/_stringTagBug.js +19 -0
- package/node_modules/underscore/amd/_tagTester.js +13 -0
- package/node_modules/underscore/amd/_toBufferView.js +15 -0
- package/node_modules/underscore/amd/_toPath.js +11 -0
- package/node_modules/underscore/amd/_unescapeMap.js +8 -0
- package/node_modules/underscore/amd/after.js +14 -0
- package/node_modules/underscore/amd/allKeys.js +15 -0
- package/node_modules/underscore/amd/before.js +18 -0
- package/node_modules/underscore/amd/bind.js +15 -0
- package/node_modules/underscore/amd/bindAll.js +19 -0
- package/node_modules/underscore/amd/chain.js +12 -0
- package/node_modules/underscore/amd/chunk.js +17 -0
- package/node_modules/underscore/amd/clone.js +11 -0
- package/node_modules/underscore/amd/compact.js +10 -0
- package/node_modules/underscore/amd/compose.js +18 -0
- package/node_modules/underscore/amd/constant.js +12 -0
- package/node_modules/underscore/amd/contains.js +12 -0
- package/node_modules/underscore/amd/countBy.js +12 -0
- package/node_modules/underscore/amd/create.js +14 -0
- package/node_modules/underscore/amd/debounce.js +43 -0
- package/node_modules/underscore/amd/defaults.js +8 -0
- package/node_modules/underscore/amd/defer.js +9 -0
- package/node_modules/underscore/amd/delay.js +13 -0
- package/node_modules/underscore/amd/difference.js +14 -0
- package/node_modules/underscore/amd/each.js +25 -0
- package/node_modules/underscore/amd/escape.js +8 -0
- package/node_modules/underscore/amd/every.js +17 -0
- package/node_modules/underscore/amd/extend.js +8 -0
- package/node_modules/underscore/amd/extendOwn.js +10 -0
- package/node_modules/underscore/amd/filter.js +15 -0
- package/node_modules/underscore/amd/find.js +12 -0
- package/node_modules/underscore/amd/findIndex.js +8 -0
- package/node_modules/underscore/amd/findKey.js +15 -0
- package/node_modules/underscore/amd/findLastIndex.js +8 -0
- package/node_modules/underscore/amd/findWhere.js +11 -0
- package/node_modules/underscore/amd/first.js +13 -0
- package/node_modules/underscore/amd/flatten.js +11 -0
- package/node_modules/underscore/amd/functions.js +14 -0
- package/node_modules/underscore/amd/get.js +14 -0
- package/node_modules/underscore/amd/groupBy.js +11 -0
- package/node_modules/underscore/amd/has.js +19 -0
- package/node_modules/underscore/amd/identity.js +10 -0
- package/node_modules/underscore/amd/index-default.js +12 -0
- package/node_modules/underscore/amd/index.js +154 -0
- package/node_modules/underscore/amd/indexBy.js +11 -0
- package/node_modules/underscore/amd/indexOf.js +11 -0
- package/node_modules/underscore/amd/initial.js +12 -0
- package/node_modules/underscore/amd/intersection.js +22 -0
- package/node_modules/underscore/amd/invert.js +15 -0
- package/node_modules/underscore/amd/invoke.js +28 -0
- package/node_modules/underscore/amd/isArguments.js +19 -0
- package/node_modules/underscore/amd/isArray.js +9 -0
- package/node_modules/underscore/amd/isArrayBuffer.js +7 -0
- package/node_modules/underscore/amd/isBoolean.js +10 -0
- package/node_modules/underscore/amd/isDataView.js +17 -0
- package/node_modules/underscore/amd/isDate.js +7 -0
- package/node_modules/underscore/amd/isElement.js +10 -0
- package/node_modules/underscore/amd/isEmpty.js +18 -0
- package/node_modules/underscore/amd/isEqual.js +133 -0
- package/node_modules/underscore/amd/isError.js +7 -0
- package/node_modules/underscore/amd/isFinite.js +10 -0
- package/node_modules/underscore/amd/isFunction.js +18 -0
- package/node_modules/underscore/amd/isMap.js +7 -0
- package/node_modules/underscore/amd/isMatch.js +17 -0
- package/node_modules/underscore/amd/isNaN.js +10 -0
- package/node_modules/underscore/amd/isNull.js +10 -0
- package/node_modules/underscore/amd/isNumber.js +7 -0
- package/node_modules/underscore/amd/isObject.js +11 -0
- package/node_modules/underscore/amd/isRegExp.js +7 -0
- package/node_modules/underscore/amd/isSet.js +7 -0
- package/node_modules/underscore/amd/isString.js +7 -0
- package/node_modules/underscore/amd/isSymbol.js +7 -0
- package/node_modules/underscore/amd/isTypedArray.js +16 -0
- package/node_modules/underscore/amd/isUndefined.js +10 -0
- package/node_modules/underscore/amd/isWeakMap.js +7 -0
- package/node_modules/underscore/amd/isWeakSet.js +7 -0
- package/node_modules/underscore/amd/iteratee.js +13 -0
- package/node_modules/underscore/amd/keys.js +17 -0
- package/node_modules/underscore/amd/last.js +13 -0
- package/node_modules/underscore/amd/lastIndexOf.js +9 -0
- package/node_modules/underscore/amd/map.js +18 -0
- package/node_modules/underscore/amd/mapObject.js +19 -0
- package/node_modules/underscore/amd/matcher.js +14 -0
- package/node_modules/underscore/amd/max.js +30 -0
- package/node_modules/underscore/amd/memoize.js +17 -0
- package/node_modules/underscore/amd/min.js +30 -0
- package/node_modules/underscore/amd/mixin.js +18 -0
- package/node_modules/underscore/amd/negate.js +12 -0
- package/node_modules/underscore/amd/noop.js +8 -0
- package/node_modules/underscore/amd/now.js +10 -0
- package/node_modules/underscore/amd/object.js +20 -0
- package/node_modules/underscore/amd/omit.js +20 -0
- package/node_modules/underscore/amd/once.js +9 -0
- package/node_modules/underscore/amd/pairs.js +17 -0
- package/node_modules/underscore/amd/partial.js +25 -0
- package/node_modules/underscore/amd/partition.js +11 -0
- package/node_modules/underscore/amd/pick.js +25 -0
- package/node_modules/underscore/amd/pipe.js +13 -0
- package/node_modules/underscore/amd/pluck.js +10 -0
- package/node_modules/underscore/amd/property.js +14 -0
- package/node_modules/underscore/amd/propertyOf.js +13 -0
- package/node_modules/underscore/amd/random.js +14 -0
- package/node_modules/underscore/amd/range.js +27 -0
- package/node_modules/underscore/amd/reduce.js +9 -0
- package/node_modules/underscore/amd/reduceRight.js +8 -0
- package/node_modules/underscore/amd/reject.js +10 -0
- package/node_modules/underscore/amd/rest.js +12 -0
- package/node_modules/underscore/amd/restArguments.js +33 -0
- package/node_modules/underscore/amd/result.js +25 -0
- package/node_modules/underscore/amd/sample.js +27 -0
- package/node_modules/underscore/amd/shuffle.js +10 -0
- package/node_modules/underscore/amd/size.js +11 -0
- package/node_modules/underscore/amd/some.js +17 -0
- package/node_modules/underscore/amd/sortBy.js +26 -0
- package/node_modules/underscore/amd/sortedIndex.js +18 -0
- package/node_modules/underscore/amd/tap.js +13 -0
- package/node_modules/underscore/amd/template.js +103 -0
- package/node_modules/underscore/amd/templateSettings.js +13 -0
- package/node_modules/underscore/amd/throttle.js +51 -0
- package/node_modules/underscore/amd/times.js +13 -0
- package/node_modules/underscore/amd/toArray.js +18 -0
- package/node_modules/underscore/amd/toPath.js +12 -0
- package/node_modules/underscore/amd/underscore-array-methods.js +30 -0
- package/node_modules/underscore/amd/underscore.js +29 -0
- package/node_modules/underscore/amd/unescape.js +8 -0
- package/node_modules/underscore/amd/union.js +11 -0
- package/node_modules/underscore/amd/uniq.js +37 -0
- package/node_modules/underscore/amd/uniqueId.js +13 -0
- package/node_modules/underscore/amd/unzip.js +17 -0
- package/node_modules/underscore/amd/values.js +16 -0
- package/node_modules/underscore/amd/where.js +11 -0
- package/node_modules/underscore/amd/without.js +10 -0
- package/node_modules/underscore/amd/wrap.js +12 -0
- package/node_modules/underscore/amd/zip.js +9 -0
- package/node_modules/underscore/cjs/_baseCreate.js +20 -0
- package/node_modules/underscore/cjs/_baseIteratee.js +19 -0
- package/node_modules/underscore/cjs/_cb.js +12 -0
- package/node_modules/underscore/cjs/_chainResult.js +8 -0
- package/node_modules/underscore/cjs/_collectNonEnumProps.js +42 -0
- package/node_modules/underscore/cjs/_createAssigner.js +20 -0
- package/node_modules/underscore/cjs/_createEscaper.js +19 -0
- package/node_modules/underscore/cjs/_createIndexFinder.js +30 -0
- package/node_modules/underscore/cjs/_createPredicateIndexFinder.js +17 -0
- package/node_modules/underscore/cjs/_createReduce.js +30 -0
- package/node_modules/underscore/cjs/_createSizePropertyCheck.js +11 -0
- package/node_modules/underscore/cjs/_deepGet.js +11 -0
- package/node_modules/underscore/cjs/_escapeMap.js +11 -0
- package/node_modules/underscore/cjs/_executeBound.js +15 -0
- package/node_modules/underscore/cjs/_flatten.js +33 -0
- package/node_modules/underscore/cjs/_getByteLength.js +6 -0
- package/node_modules/underscore/cjs/_getLength.js +6 -0
- package/node_modules/underscore/cjs/_group.js +17 -0
- package/node_modules/underscore/cjs/_has.js +8 -0
- package/node_modules/underscore/cjs/_hasObjectTag.js +5 -0
- package/node_modules/underscore/cjs/_isArrayLike.js +10 -0
- package/node_modules/underscore/cjs/_isBufferLike.js +8 -0
- package/node_modules/underscore/cjs/_keyInObj.js +7 -0
- package/node_modules/underscore/cjs/_methodFingerprint.js +44 -0
- package/node_modules/underscore/cjs/_optimizeCb.js +23 -0
- package/node_modules/underscore/cjs/_setup.js +66 -0
- package/node_modules/underscore/cjs/_shallowProperty.js +8 -0
- package/node_modules/underscore/cjs/_stringTagBug.js +18 -0
- package/node_modules/underscore/cjs/_tagTester.js +11 -0
- package/node_modules/underscore/cjs/_toBufferView.js +13 -0
- package/node_modules/underscore/cjs/_toPath.js +10 -0
- package/node_modules/underscore/cjs/_unescapeMap.js +7 -0
- package/node_modules/underscore/cjs/after.js +10 -0
- package/node_modules/underscore/cjs/allKeys.js +15 -0
- package/node_modules/underscore/cjs/before.js +14 -0
- package/node_modules/underscore/cjs/bind.js +15 -0
- package/node_modules/underscore/cjs/bindAll.js +19 -0
- package/node_modules/underscore/cjs/chain.js +10 -0
- package/node_modules/underscore/cjs/chunk.js +15 -0
- package/node_modules/underscore/cjs/clone.js +11 -0
- package/node_modules/underscore/cjs/compact.js +8 -0
- package/node_modules/underscore/cjs/compose.js +14 -0
- package/node_modules/underscore/cjs/constant.js +8 -0
- package/node_modules/underscore/cjs/contains.js +12 -0
- package/node_modules/underscore/cjs/countBy.js +11 -0
- package/node_modules/underscore/cjs/create.js +13 -0
- package/node_modules/underscore/cjs/debounce.js +42 -0
- package/node_modules/underscore/cjs/defaults.js +7 -0
- package/node_modules/underscore/cjs/defer.js +9 -0
- package/node_modules/underscore/cjs/delay.js +11 -0
- package/node_modules/underscore/cjs/difference.js +15 -0
- package/node_modules/underscore/cjs/each.js +25 -0
- package/node_modules/underscore/cjs/escape.js +7 -0
- package/node_modules/underscore/cjs/every.js +17 -0
- package/node_modules/underscore/cjs/extend.js +7 -0
- package/node_modules/underscore/cjs/extendOwn.js +9 -0
- package/node_modules/underscore/cjs/filter.js +14 -0
- package/node_modules/underscore/cjs/find.js +12 -0
- package/node_modules/underscore/cjs/findIndex.js +6 -0
- package/node_modules/underscore/cjs/findKey.js +14 -0
- package/node_modules/underscore/cjs/findLastIndex.js +6 -0
- package/node_modules/underscore/cjs/findWhere.js +10 -0
- package/node_modules/underscore/cjs/first.js +11 -0
- package/node_modules/underscore/cjs/flatten.js +9 -0
- package/node_modules/underscore/cjs/functions.js +12 -0
- package/node_modules/underscore/cjs/get.js +14 -0
- package/node_modules/underscore/cjs/groupBy.js +10 -0
- package/node_modules/underscore/cjs/has.js +18 -0
- package/node_modules/underscore/cjs/identity.js +6 -0
- package/node_modules/underscore/cjs/index-default.js +11 -0
- package/node_modules/underscore/cjs/index.js +278 -0
- package/node_modules/underscore/cjs/indexBy.js +9 -0
- package/node_modules/underscore/cjs/indexOf.js +11 -0
- package/node_modules/underscore/cjs/initial.js +10 -0
- package/node_modules/underscore/cjs/intersection.js +21 -0
- package/node_modules/underscore/cjs/invert.js +13 -0
- package/node_modules/underscore/cjs/invoke.js +30 -0
- package/node_modules/underscore/cjs/isArguments.js +18 -0
- package/node_modules/underscore/cjs/isArray.js +8 -0
- package/node_modules/underscore/cjs/isArrayBuffer.js +5 -0
- package/node_modules/underscore/cjs/isBoolean.js +8 -0
- package/node_modules/underscore/cjs/isDataView.js +18 -0
- package/node_modules/underscore/cjs/isDate.js +5 -0
- package/node_modules/underscore/cjs/isElement.js +6 -0
- package/node_modules/underscore/cjs/isEmpty.js +20 -0
- package/node_modules/underscore/cjs/isEqual.js +140 -0
- package/node_modules/underscore/cjs/isError.js +5 -0
- package/node_modules/underscore/cjs/isFinite.js +9 -0
- package/node_modules/underscore/cjs/isFunction.js +17 -0
- package/node_modules/underscore/cjs/isMap.js +7 -0
- package/node_modules/underscore/cjs/isMatch.js +15 -0
- package/node_modules/underscore/cjs/isNaN.js +9 -0
- package/node_modules/underscore/cjs/isNull.js +6 -0
- package/node_modules/underscore/cjs/isNumber.js +5 -0
- package/node_modules/underscore/cjs/isObject.js +7 -0
- package/node_modules/underscore/cjs/isRegExp.js +5 -0
- package/node_modules/underscore/cjs/isSet.js +7 -0
- package/node_modules/underscore/cjs/isString.js +5 -0
- package/node_modules/underscore/cjs/isSymbol.js +5 -0
- package/node_modules/underscore/cjs/isTypedArray.js +17 -0
- package/node_modules/underscore/cjs/isUndefined.js +6 -0
- package/node_modules/underscore/cjs/isWeakMap.js +7 -0
- package/node_modules/underscore/cjs/isWeakSet.js +5 -0
- package/node_modules/underscore/cjs/iteratee.js +12 -0
- package/node_modules/underscore/cjs/keys.js +18 -0
- package/node_modules/underscore/cjs/last.js +11 -0
- package/node_modules/underscore/cjs/lastIndexOf.js +8 -0
- package/node_modules/underscore/cjs/map.js +18 -0
- package/node_modules/underscore/cjs/mapObject.js +18 -0
- package/node_modules/underscore/cjs/matcher.js +13 -0
- package/node_modules/underscore/cjs/max.js +31 -0
- package/node_modules/underscore/cjs/memoize.js +15 -0
- package/node_modules/underscore/cjs/min.js +31 -0
- package/node_modules/underscore/cjs/mixin.js +20 -0
- package/node_modules/underscore/cjs/negate.js +8 -0
- package/node_modules/underscore/cjs/noop.js +4 -0
- package/node_modules/underscore/cjs/now.js +6 -0
- package/node_modules/underscore/cjs/object.js +18 -0
- package/node_modules/underscore/cjs/omit.js +24 -0
- package/node_modules/underscore/cjs/once.js +8 -0
- package/node_modules/underscore/cjs/pairs.js +15 -0
- package/node_modules/underscore/cjs/partial.js +25 -0
- package/node_modules/underscore/cjs/partition.js +9 -0
- package/node_modules/underscore/cjs/pick.js +28 -0
- package/node_modules/underscore/cjs/pipe.js +12 -0
- package/node_modules/underscore/cjs/pluck.js +9 -0
- package/node_modules/underscore/cjs/property.js +13 -0
- package/node_modules/underscore/cjs/propertyOf.js +12 -0
- package/node_modules/underscore/cjs/random.js +10 -0
- package/node_modules/underscore/cjs/range.js +23 -0
- package/node_modules/underscore/cjs/reduce.js +7 -0
- package/node_modules/underscore/cjs/reduceRight.js +6 -0
- package/node_modules/underscore/cjs/reject.js +10 -0
- package/node_modules/underscore/cjs/rest.js +10 -0
- package/node_modules/underscore/cjs/restArguments.js +29 -0
- package/node_modules/underscore/cjs/result.js +24 -0
- package/node_modules/underscore/cjs/sample.js +29 -0
- package/node_modules/underscore/cjs/shuffle.js +8 -0
- package/node_modules/underscore/cjs/size.js +10 -0
- package/node_modules/underscore/cjs/some.js +17 -0
- package/node_modules/underscore/cjs/sortBy.js +26 -0
- package/node_modules/underscore/cjs/sortedIndex.js +17 -0
- package/node_modules/underscore/cjs/tap.js +9 -0
- package/node_modules/underscore/cjs/template.js +103 -0
- package/node_modules/underscore/cjs/templateSettings.js +11 -0
- package/node_modules/underscore/cjs/throttle.js +49 -0
- package/node_modules/underscore/cjs/times.js +11 -0
- package/node_modules/underscore/cjs/toArray.js +22 -0
- package/node_modules/underscore/cjs/toPath.js +11 -0
- package/node_modules/underscore/cjs/underscore-array-methods.js +31 -0
- package/node_modules/underscore/cjs/underscore.js +27 -0
- package/node_modules/underscore/cjs/unescape.js +7 -0
- package/node_modules/underscore/cjs/union.js +11 -0
- package/node_modules/underscore/cjs/uniq.js +38 -0
- package/node_modules/underscore/cjs/uniqueId.js +9 -0
- package/node_modules/underscore/cjs/unzip.js +17 -0
- package/node_modules/underscore/cjs/values.js +14 -0
- package/node_modules/underscore/cjs/where.js +10 -0
- package/node_modules/underscore/cjs/without.js +9 -0
- package/node_modules/underscore/cjs/wrap.js +10 -0
- package/node_modules/underscore/cjs/zip.js +8 -0
- package/node_modules/underscore/modules/.eslintrc +21 -0
- package/node_modules/underscore/modules/_baseCreate.js +18 -0
- package/node_modules/underscore/modules/_baseIteratee.js +17 -0
- package/node_modules/underscore/modules/_cb.js +10 -0
- package/node_modules/underscore/modules/_chainResult.js +6 -0
- package/node_modules/underscore/modules/_collectNonEnumProps.js +40 -0
- package/node_modules/underscore/modules/_createAssigner.js +18 -0
- package/node_modules/underscore/modules/_createEscaper.js +17 -0
- package/node_modules/underscore/modules/_createIndexFinder.js +28 -0
- package/node_modules/underscore/modules/_createPredicateIndexFinder.js +15 -0
- package/node_modules/underscore/modules/_createReduce.js +28 -0
- package/node_modules/underscore/modules/_createSizePropertyCheck.js +9 -0
- package/node_modules/underscore/modules/_deepGet.js +9 -0
- package/node_modules/underscore/modules/_escapeMap.js +9 -0
- package/node_modules/underscore/modules/_executeBound.js +13 -0
- package/node_modules/underscore/modules/_flatten.js +33 -0
- package/node_modules/underscore/modules/_getByteLength.js +4 -0
- package/node_modules/underscore/modules/_getLength.js +4 -0
- package/node_modules/underscore/modules/_group.js +15 -0
- package/node_modules/underscore/modules/_has.js +6 -0
- package/node_modules/underscore/modules/_hasObjectTag.js +3 -0
- package/node_modules/underscore/modules/_isArrayLike.js +8 -0
- package/node_modules/underscore/modules/_isBufferLike.js +6 -0
- package/node_modules/underscore/modules/_keyInObj.js +5 -0
- package/node_modules/underscore/modules/_methodFingerprint.js +37 -0
- package/node_modules/underscore/modules/_optimizeCb.js +21 -0
- package/node_modules/underscore/modules/_setup.js +43 -0
- package/node_modules/underscore/modules/_shallowProperty.js +6 -0
- package/node_modules/underscore/modules/_stringTagBug.js +13 -0
- package/node_modules/underscore/modules/_tagTester.js +9 -0
- package/node_modules/underscore/modules/_toBufferView.js +11 -0
- package/node_modules/underscore/modules/_toPath.js +8 -0
- package/node_modules/underscore/modules/_unescapeMap.js +5 -0
- package/node_modules/underscore/modules/after.js +8 -0
- package/node_modules/underscore/modules/allKeys.js +13 -0
- package/node_modules/underscore/modules/before.js +12 -0
- package/node_modules/underscore/modules/bind.js +13 -0
- package/node_modules/underscore/modules/bindAll.js +17 -0
- package/node_modules/underscore/modules/chain.js +8 -0
- package/node_modules/underscore/modules/chunk.js +13 -0
- package/node_modules/underscore/modules/clone.js +9 -0
- package/node_modules/underscore/modules/compact.js +6 -0
- package/node_modules/underscore/modules/compose.js +12 -0
- package/node_modules/underscore/modules/constant.js +6 -0
- package/node_modules/underscore/modules/contains.js +10 -0
- package/node_modules/underscore/modules/countBy.js +9 -0
- package/node_modules/underscore/modules/create.js +11 -0
- package/node_modules/underscore/modules/debounce.js +40 -0
- package/node_modules/underscore/modules/defaults.js +5 -0
- package/node_modules/underscore/modules/defer.js +7 -0
- package/node_modules/underscore/modules/delay.js +9 -0
- package/node_modules/underscore/modules/difference.js +13 -0
- package/node_modules/underscore/modules/each.js +23 -0
- package/node_modules/underscore/modules/escape.js +5 -0
- package/node_modules/underscore/modules/every.js +15 -0
- package/node_modules/underscore/modules/extend.js +5 -0
- package/node_modules/underscore/modules/extendOwn.js +7 -0
- package/node_modules/underscore/modules/filter.js +12 -0
- package/node_modules/underscore/modules/find.js +10 -0
- package/node_modules/underscore/modules/findIndex.js +4 -0
- package/node_modules/underscore/modules/findKey.js +12 -0
- package/node_modules/underscore/modules/findLastIndex.js +4 -0
- package/node_modules/underscore/modules/findWhere.js +8 -0
- package/node_modules/underscore/modules/first.js +9 -0
- package/node_modules/underscore/modules/flatten.js +7 -0
- package/node_modules/underscore/modules/functions.js +10 -0
- package/node_modules/underscore/modules/get.js +12 -0
- package/node_modules/underscore/modules/groupBy.js +8 -0
- package/node_modules/underscore/modules/has.js +16 -0
- package/node_modules/underscore/modules/identity.js +4 -0
- package/node_modules/underscore/modules/index-all.js +18 -0
- package/node_modules/underscore/modules/index-default.js +27 -0
- package/node_modules/underscore/modules/index.js +200 -0
- package/node_modules/underscore/modules/indexBy.js +7 -0
- package/node_modules/underscore/modules/indexOf.js +9 -0
- package/node_modules/underscore/modules/initial.js +8 -0
- package/node_modules/underscore/modules/intersection.js +19 -0
- package/node_modules/underscore/modules/invert.js +11 -0
- package/node_modules/underscore/modules/invoke.js +28 -0
- package/node_modules/underscore/modules/isArguments.js +16 -0
- package/node_modules/underscore/modules/isArray.js +6 -0
- package/node_modules/underscore/modules/isArrayBuffer.js +3 -0
- package/node_modules/underscore/modules/isBoolean.js +6 -0
- package/node_modules/underscore/modules/isDataView.js +16 -0
- package/node_modules/underscore/modules/isDate.js +3 -0
- package/node_modules/underscore/modules/isElement.js +4 -0
- package/node_modules/underscore/modules/isEmpty.js +18 -0
- package/node_modules/underscore/modules/isEqual.js +153 -0
- package/node_modules/underscore/modules/isError.js +3 -0
- package/node_modules/underscore/modules/isFinite.js +7 -0
- package/node_modules/underscore/modules/isFunction.js +15 -0
- package/node_modules/underscore/modules/isMap.js +5 -0
- package/node_modules/underscore/modules/isMatch.js +13 -0
- package/node_modules/underscore/modules/isNaN.js +7 -0
- package/node_modules/underscore/modules/isNull.js +4 -0
- package/node_modules/underscore/modules/isNumber.js +3 -0
- package/node_modules/underscore/modules/isObject.js +5 -0
- package/node_modules/underscore/modules/isRegExp.js +3 -0
- package/node_modules/underscore/modules/isSet.js +5 -0
- package/node_modules/underscore/modules/isString.js +3 -0
- package/node_modules/underscore/modules/isSymbol.js +3 -0
- package/node_modules/underscore/modules/isTypedArray.js +15 -0
- package/node_modules/underscore/modules/isUndefined.js +4 -0
- package/node_modules/underscore/modules/isWeakMap.js +5 -0
- package/node_modules/underscore/modules/isWeakSet.js +3 -0
- package/node_modules/underscore/modules/iteratee.js +10 -0
- package/node_modules/underscore/modules/keys.js +16 -0
- package/node_modules/underscore/modules/last.js +9 -0
- package/node_modules/underscore/modules/lastIndexOf.js +6 -0
- package/node_modules/underscore/modules/map.js +16 -0
- package/node_modules/underscore/modules/mapObject.js +16 -0
- package/node_modules/underscore/modules/matcher.js +11 -0
- package/node_modules/underscore/modules/max.js +29 -0
- package/node_modules/underscore/modules/memoize.js +13 -0
- package/node_modules/underscore/modules/min.js +29 -0
- package/node_modules/underscore/modules/mixin.js +18 -0
- package/node_modules/underscore/modules/negate.js +6 -0
- package/node_modules/underscore/modules/noop.js +2 -0
- package/node_modules/underscore/modules/now.js +4 -0
- package/node_modules/underscore/modules/object.js +16 -0
- package/node_modules/underscore/modules/omit.js +22 -0
- package/node_modules/underscore/modules/once.js +6 -0
- package/node_modules/underscore/modules/package.json +1 -0
- package/node_modules/underscore/modules/pairs.js +13 -0
- package/node_modules/underscore/modules/partial.js +24 -0
- package/node_modules/underscore/modules/partition.js +7 -0
- package/node_modules/underscore/modules/pick.js +26 -0
- package/node_modules/underscore/modules/pluck.js +7 -0
- package/node_modules/underscore/modules/property.js +11 -0
- package/node_modules/underscore/modules/propertyOf.js +10 -0
- package/node_modules/underscore/modules/random.js +8 -0
- package/node_modules/underscore/modules/range.js +21 -0
- package/node_modules/underscore/modules/reduce.js +5 -0
- package/node_modules/underscore/modules/reduceRight.js +4 -0
- package/node_modules/underscore/modules/reject.js +8 -0
- package/node_modules/underscore/modules/rest.js +8 -0
- package/node_modules/underscore/modules/restArguments.js +27 -0
- package/node_modules/underscore/modules/result.js +22 -0
- package/node_modules/underscore/modules/sample.js +27 -0
- package/node_modules/underscore/modules/shuffle.js +6 -0
- package/node_modules/underscore/modules/size.js +8 -0
- package/node_modules/underscore/modules/some.js +15 -0
- package/node_modules/underscore/modules/sortBy.js +24 -0
- package/node_modules/underscore/modules/sortedIndex.js +15 -0
- package/node_modules/underscore/modules/tap.js +7 -0
- package/node_modules/underscore/modules/template.js +101 -0
- package/node_modules/underscore/modules/templateSettings.js +9 -0
- package/node_modules/underscore/modules/throttle.js +47 -0
- package/node_modules/underscore/modules/times.js +9 -0
- package/node_modules/underscore/modules/toArray.js +20 -0
- package/node_modules/underscore/modules/toPath.js +9 -0
- package/node_modules/underscore/modules/underscore-array-methods.js +31 -0
- package/node_modules/underscore/modules/underscore.js +25 -0
- package/node_modules/underscore/modules/unescape.js +5 -0
- package/node_modules/underscore/modules/union.js +9 -0
- package/node_modules/underscore/modules/uniq.js +36 -0
- package/node_modules/underscore/modules/uniqueId.js +7 -0
- package/node_modules/underscore/modules/unzip.js +15 -0
- package/node_modules/underscore/modules/values.js +12 -0
- package/node_modules/underscore/modules/where.js +8 -0
- package/node_modules/underscore/modules/without.js +7 -0
- package/node_modules/underscore/modules/wrap.js +8 -0
- package/node_modules/underscore/modules/zip.js +6 -0
- package/node_modules/underscore/package.json +124 -0
- package/node_modules/underscore/underscore-esm-min.js +5 -0
- package/node_modules/underscore/underscore-esm-min.js.map +1 -0
- package/node_modules/underscore/underscore-esm.js +2056 -0
- package/node_modules/underscore/underscore-esm.js.map +1 -0
- package/node_modules/underscore/underscore-min.js +6 -0
- package/node_modules/underscore/underscore-min.js.map +1 -0
- package/node_modules/underscore/underscore-node-f.cjs +2180 -0
- package/node_modules/underscore/underscore-node-f.cjs.map +1 -0
- package/node_modules/underscore/underscore-node.cjs +11 -0
- package/node_modules/underscore/underscore-node.cjs.map +1 -0
- package/node_modules/underscore/underscore-node.mjs +7 -0
- package/node_modules/underscore/underscore-node.mjs.map +1 -0
- package/node_modules/underscore/underscore-umd-min.js +6 -0
- package/node_modules/underscore/underscore-umd-min.js.map +1 -0
- package/node_modules/underscore/underscore-umd.js +2064 -0
- package/node_modules/underscore/underscore-umd.js.map +1 -0
- package/node_modules/underscore/underscore.js +2064 -0
- package/node_modules/util-deprecate/History.md +16 -0
- package/node_modules/util-deprecate/LICENSE +24 -0
- package/node_modules/util-deprecate/README.md +53 -0
- package/node_modules/util-deprecate/browser.js +67 -0
- package/node_modules/util-deprecate/node.js +6 -0
- package/node_modules/util-deprecate/package.json +27 -0
- package/node_modules/xmlbuilder/CHANGELOG.md +438 -0
- package/node_modules/xmlbuilder/LICENSE +21 -0
- package/node_modules/xmlbuilder/README.md +86 -0
- package/node_modules/xmlbuilder/appveyor.yml +20 -0
- package/node_modules/xmlbuilder/lib/Utility.js +83 -0
- package/node_modules/xmlbuilder/lib/XMLAttribute.js +41 -0
- package/node_modules/xmlbuilder/lib/XMLCData.js +32 -0
- package/node_modules/xmlbuilder/lib/XMLComment.js +32 -0
- package/node_modules/xmlbuilder/lib/XMLDTDAttList.js +50 -0
- package/node_modules/xmlbuilder/lib/XMLDTDElement.js +35 -0
- package/node_modules/xmlbuilder/lib/XMLDTDEntity.js +56 -0
- package/node_modules/xmlbuilder/lib/XMLDTDNotation.js +37 -0
- package/node_modules/xmlbuilder/lib/XMLDeclaration.js +40 -0
- package/node_modules/xmlbuilder/lib/XMLDocType.js +108 -0
- package/node_modules/xmlbuilder/lib/XMLDocument.js +49 -0
- package/node_modules/xmlbuilder/lib/XMLDocumentCB.js +414 -0
- package/node_modules/xmlbuilder/lib/XMLDummy.js +29 -0
- package/node_modules/xmlbuilder/lib/XMLElement.js +111 -0
- package/node_modules/xmlbuilder/lib/XMLNode.js +467 -0
- package/node_modules/xmlbuilder/lib/XMLProcessingInstruction.js +35 -0
- package/node_modules/xmlbuilder/lib/XMLRaw.js +32 -0
- package/node_modules/xmlbuilder/lib/XMLStreamWriter.js +287 -0
- package/node_modules/xmlbuilder/lib/XMLStringWriter.js +341 -0
- package/node_modules/xmlbuilder/lib/XMLStringifier.js +163 -0
- package/node_modules/xmlbuilder/lib/XMLText.js +32 -0
- package/node_modules/xmlbuilder/lib/XMLWriterBase.js +90 -0
- package/node_modules/xmlbuilder/lib/index.js +53 -0
- package/node_modules/xmlbuilder/package.json +37 -0
- package/package.json +13 -5
- package/scripts/check-doc-links.mjs +2 -0
- package/scripts/check-image-tags.sh +1 -1
- package/scripts/check-package-artifact.mjs +19 -0
- package/scripts/check-release-consistency.test.mjs +2 -2
- package/scripts/dependency-audit.mjs +49 -96
- package/scripts/dependency-audit.test.mjs +70 -106
- package/scripts/docx-browser-test.mjs +56 -0
- package/scripts/docx-compatibility.test.mjs +39 -0
- package/scripts/docx-fixtures.mjs +19 -0
- package/scripts/export-oss.mjs +3 -0
- package/scripts/generate-third-party-notices.mjs +6 -2
- package/scripts/install.sh +1 -1
- package/scripts/notification-console-test.mjs +172 -0
- package/scripts/oss-boundary-check.mjs +3 -1
- package/scripts/publish-images.sh +1 -1
- package/scripts/release-audit.mjs +5 -1
- package/scripts/vendor-mammoth.mjs +130 -0
- package/scripts/verify-github-repo.mjs +4 -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/approval-continuations.mysql.test.ts +1 -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/kernel-usage-lifecycle.mysql.test.ts +1 -1
- package/src/app/kernel.ts +8 -0
- package/src/app/notification-outbox.test.ts +321 -0
- package/src/app/notification-outbox.ts +123 -0
- package/src/app/operational-metrics.test.ts +15 -0
- package/src/app/operational-metrics.ts +9 -0
- package/src/app/outbound.ts +28 -0
- 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 +8 -0
- package/src/app/tool-approvals.ts +68 -31
- package/src/core/contracts/delivery-replay.ts +1 -0
- package/src/core/contracts/notification-outbox.ts +54 -0
- package/src/core/observability/openmetrics.test.ts +18 -0
- package/src/core/observability/openmetrics.ts +17 -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 +4 -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/configstore.ts +8 -4
- 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 +36 -5
- package/src/routes/admin-notifications.test.ts +75 -0
- package/src/routes/admin-notifications.ts +77 -0
- package/src/routes/admin-runtime.test.ts +25 -0
- package/src/routes/admin-runtime.ts +15 -0
- package/src/routes/admin.ts +1 -0
- package/src/test-support/notification-outbox-journal-crash-child.ts +20 -0
- package/vendor/bailinghub-mammoth-library-1.12.0-bailinghub.1.tgz +0 -0
- package/vendor/mammoth-library/LICENSE +22 -0
- package/vendor/mammoth-library/SOURCE.json +57 -0
- package/vendor/mammoth-library/browser/docx/files.js +14 -0
- package/vendor/mammoth-library/browser/unzip.js +12 -0
- package/vendor/mammoth-library/lib/document-to-html.js +469 -0
- package/vendor/mammoth-library/lib/documents.js +254 -0
- package/vendor/mammoth-library/lib/docx/body-reader.js +798 -0
- package/vendor/mammoth-library/lib/docx/comments-reader.js +31 -0
- package/vendor/mammoth-library/lib/docx/content-types-reader.js +58 -0
- package/vendor/mammoth-library/lib/docx/document-xml-reader.js +30 -0
- package/vendor/mammoth-library/lib/docx/docx-reader.js +226 -0
- package/vendor/mammoth-library/lib/docx/files.js +80 -0
- package/vendor/mammoth-library/lib/docx/notes-reader.js +28 -0
- package/vendor/mammoth-library/lib/docx/numbering-xml.js +111 -0
- package/vendor/mammoth-library/lib/docx/office-xml-reader.js +73 -0
- package/vendor/mammoth-library/lib/docx/relationships-reader.js +43 -0
- package/vendor/mammoth-library/lib/docx/style-map.js +75 -0
- package/vendor/mammoth-library/lib/docx/styles-reader.js +90 -0
- package/vendor/mammoth-library/lib/docx/uris.js +21 -0
- package/vendor/mammoth-library/lib/html/ast.js +51 -0
- package/vendor/mammoth-library/lib/html/index.js +41 -0
- package/vendor/mammoth-library/lib/html/simplify.js +88 -0
- package/vendor/mammoth-library/lib/images.js +31 -0
- package/vendor/mammoth-library/lib/index.d.ts +86 -0
- package/vendor/mammoth-library/lib/index.js +111 -0
- package/vendor/mammoth-library/lib/options-reader.js +107 -0
- package/vendor/mammoth-library/lib/promises.js +42 -0
- package/vendor/mammoth-library/lib/raw-text.js +14 -0
- package/vendor/mammoth-library/lib/results.js +72 -0
- package/vendor/mammoth-library/lib/style-reader.js +365 -0
- package/vendor/mammoth-library/lib/styles/document-matchers.js +100 -0
- package/vendor/mammoth-library/lib/styles/html-paths.js +75 -0
- package/vendor/mammoth-library/lib/styles/parser/tokeniser.js +30 -0
- package/vendor/mammoth-library/lib/transforms.js +62 -0
- package/vendor/mammoth-library/lib/underline.js +11 -0
- package/vendor/mammoth-library/lib/unzip.js +20 -0
- package/vendor/mammoth-library/lib/writers/html-writer.js +159 -0
- package/vendor/mammoth-library/lib/writers/index.js +14 -0
- package/vendor/mammoth-library/lib/writers/markdown-writer.js +163 -0
- package/vendor/mammoth-library/lib/xml/index.js +8 -0
- package/vendor/mammoth-library/lib/xml/nodes.js +70 -0
- package/vendor/mammoth-library/lib/xml/reader.js +69 -0
- package/vendor/mammoth-library/lib/xml/writer.js +61 -0
- package/vendor/mammoth-library/lib/xml/xmldom.js +23 -0
- package/vendor/mammoth-library/lib/zipfile.js +72 -0
- package/vendor/mammoth-library/package.json +39 -0
- package/vendor/mammoth-library/upstream-package.json +64 -0
- package/vendor/mammoth-library-distribution.json +4 -0
- package/web/console/assets/{Accounts-DKhw_QLr.js → Accounts-Dhj6PjXP.js} +1 -1
- package/web/console/assets/{AgentClients-CM4_5HaA.js → AgentClients-CMy8StAH.js} +1 -1
- package/web/console/assets/{AgentTasks-CkQgZTU5.js → AgentTasks-DA1xZdmP.js} +1 -1
- package/web/console/assets/{Approvals-B9O9TkbO.js → Approvals-DIsd7R8N.js} +1 -1
- package/web/console/assets/{Audit-2vDC1SPu.js → Audit-AUDABLTX.js} +1 -1
- package/web/console/assets/{BrandLockup-BgASiRSE.js → BrandLockup-CffORQse.js} +1 -1
- package/web/console/assets/{Channels-A-GvkNBt.js → Channels-B8rjsM0S.js} +1 -1
- package/web/console/assets/{ChatEntries-BLxymI67.js → ChatEntries-iZjJMEUZ.js} +1 -1
- package/web/console/assets/{Clients-DeNlmvS6.js → Clients-CwgpGCSD.js} +1 -1
- package/web/console/assets/{Cost-CBq_L4Kz.js → Cost-B2tNxu71.js} +1 -1
- package/web/console/assets/{Credentials-DmtbctNj.js → Credentials-BuwFB-fV.js} +1 -1
- package/web/console/assets/{Diagnostics-BbcRDiA-.js → Diagnostics-z5glms11.js} +1 -1
- package/web/console/assets/{Executors-gGgmQrDt.js → Executors-Bc4SvjeH.js} +1 -1
- package/web/console/assets/{Kb-lgY6OXUz.js → Kb-BRbRHxLy.js} +1 -1
- package/web/console/assets/{Login-DA6BASZd.js → Login-CGgLGTE1.js} +1 -1
- package/web/console/assets/{Projects-DEbmB_sT.js → Projects-CPWw3con.js} +1 -1
- package/web/console/assets/{Routes-qS6LLoyS.js → Routes-CMIaE0Bx.js} +1 -1
- package/web/console/assets/Runs-B8HuE700.js +3 -0
- package/web/console/assets/Runs-Bv6CV_Hk.css +1 -0
- package/web/console/assets/{Setup-DEpVF5uw.js → Setup-G8RKzliR.js} +1 -1
- package/web/console/assets/{Shell-DgoPgK1E.js → Shell-DimHgraJ.js} +1 -1
- package/web/console/assets/{StorageBuckets-DJtNN769.js → StorageBuckets-CiVYXIE2.js} +1 -1
- package/web/console/assets/{SystemSettings-0DEUgeTR.js → SystemSettings-DF8sZNen.js} +1 -1
- package/web/console/assets/{SystemStatus-CR1phiPE.js → SystemStatus-BlHywK13.js} +1 -1
- package/web/console/assets/{Targets-D65l-IMB.js → Targets-BXaoPoAJ.js} +1 -1
- package/web/console/assets/{Tools-DqtrINrN.js → Tools-B22lNHXq.js} +1 -1
- package/web/console/assets/{Usage-B5njXNjx.js → Usage-C02EzoI2.js} +1 -1
- package/web/console/assets/{UsageAccess-ChnB4pjb.js → UsageAccess-DOb-cyPE.js} +1 -1
- package/web/console/assets/{UsageHelp-BBKIvbQ5.js → UsageHelp-CzS2gI40.js} +1 -1
- package/web/console/assets/{index-sLKrJd_p.js → index-CK0ZCTZv.js} +2 -2
- package/web/console/assets/{request-BpaimqEb.js → request-DKycpD7z.js} +1 -1
- package/web/console/assets/{schema-D0Z4kFCZ.js → schema-SCiNxBlR.js} +1 -1
- package/web/console/index.html +1 -1
- package/web-admin/package-lock.json +5 -23
- package/web-admin/package.json +1 -1
- package/web-admin/src/components/NotificationOutboxPanel.vue +106 -0
- package/web-admin/src/pages/Runs.vue +8 -2
- package/security/dependency-audit-exceptions.json +0 -192
- package/web/console/assets/Runs-CvGTV8I-.css +0 -1
- package/web/console/assets/Runs-DG-VLRSc.js +0 -3
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
var _ = require("underscore");
|
|
2
|
+
var xmlbuilder = require("xmlbuilder");
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
exports.writeString = writeString;
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
function writeString(root, namespaces) {
|
|
9
|
+
var uriToPrefix = _.invert(namespaces);
|
|
10
|
+
|
|
11
|
+
var nodeWriters = {
|
|
12
|
+
element: writeElement,
|
|
13
|
+
text: writeTextNode
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
function writeNode(builder, node) {
|
|
17
|
+
return nodeWriters[node.type](builder, node);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function writeElement(builder, element) {
|
|
21
|
+
var elementBuilder = builder.element(mapElementName(element.name), element.attributes);
|
|
22
|
+
element.children.forEach(function(child) {
|
|
23
|
+
writeNode(elementBuilder, child);
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function mapElementName(name) {
|
|
28
|
+
var longFormMatch = /^\{(.*)\}(.*)$/.exec(name);
|
|
29
|
+
if (longFormMatch) {
|
|
30
|
+
var prefix = uriToPrefix[longFormMatch[1]];
|
|
31
|
+
return prefix + (prefix === "" ? "" : ":") + longFormMatch[2];
|
|
32
|
+
} else {
|
|
33
|
+
return name;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function writeDocument(root) {
|
|
38
|
+
var builder = xmlbuilder
|
|
39
|
+
.create(mapElementName(root.name), {
|
|
40
|
+
version: '1.0',
|
|
41
|
+
encoding: 'UTF-8',
|
|
42
|
+
standalone: true
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
_.forEach(namespaces, function(uri, prefix) {
|
|
46
|
+
var key = "xmlns" + (prefix === "" ? "" : ":" + prefix);
|
|
47
|
+
builder.attribute(key, uri);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
root.children.forEach(function(child) {
|
|
51
|
+
writeNode(builder, child);
|
|
52
|
+
});
|
|
53
|
+
return builder.end();
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return writeDocument(root);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function writeTextNode(builder, node) {
|
|
60
|
+
builder.text(node.value);
|
|
61
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
var xmldom = require("@xmldom/xmldom");
|
|
2
|
+
var dom = require("@xmldom/xmldom/lib/dom");
|
|
3
|
+
|
|
4
|
+
function parseFromString(string) {
|
|
5
|
+
var error = null;
|
|
6
|
+
|
|
7
|
+
var domParser = new xmldom.DOMParser({
|
|
8
|
+
errorHandler: function(level, message) {
|
|
9
|
+
error = {level: level, message: message};
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
var document = domParser.parseFromString(string);
|
|
14
|
+
|
|
15
|
+
if (error === null) {
|
|
16
|
+
return document;
|
|
17
|
+
} else {
|
|
18
|
+
throw new Error(error.level + ": " + error.message);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
exports.parseFromString = parseFromString;
|
|
23
|
+
exports.Node = dom.Node;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
var base64js = require("base64-js");
|
|
2
|
+
var JSZip = require("jszip");
|
|
3
|
+
|
|
4
|
+
exports.openArrayBuffer = openArrayBuffer;
|
|
5
|
+
exports.splitPath = splitPath;
|
|
6
|
+
exports.joinPath = joinPath;
|
|
7
|
+
|
|
8
|
+
function openArrayBuffer(arrayBuffer) {
|
|
9
|
+
return JSZip.loadAsync(arrayBuffer).then(function(zipFile) {
|
|
10
|
+
function exists(name) {
|
|
11
|
+
return zipFile.file(name) !== null;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function read(name, encoding) {
|
|
15
|
+
return zipFile.file(name).async("uint8array").then(function(array) {
|
|
16
|
+
if (encoding === "base64") {
|
|
17
|
+
return base64js.fromByteArray(array);
|
|
18
|
+
} else if (encoding) {
|
|
19
|
+
var decoder = new TextDecoder(encoding);
|
|
20
|
+
return decoder.decode(array);
|
|
21
|
+
} else {
|
|
22
|
+
return array;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function write(name, contents) {
|
|
28
|
+
zipFile.file(name, contents);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function toArrayBuffer() {
|
|
32
|
+
return zipFile.generateAsync({type: "arraybuffer"});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return {
|
|
36
|
+
exists: exists,
|
|
37
|
+
read: read,
|
|
38
|
+
write: write,
|
|
39
|
+
toArrayBuffer: toArrayBuffer
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function splitPath(path) {
|
|
45
|
+
var lastIndex = path.lastIndexOf("/");
|
|
46
|
+
if (lastIndex === -1) {
|
|
47
|
+
return {dirname: "", basename: path};
|
|
48
|
+
} else {
|
|
49
|
+
return {
|
|
50
|
+
dirname: path.substring(0, lastIndex),
|
|
51
|
+
basename: path.substring(lastIndex + 1)
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function joinPath() {
|
|
57
|
+
var nonEmptyPaths = Array.prototype.filter.call(arguments, function(path) {
|
|
58
|
+
return path;
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
var relevantPaths = [];
|
|
62
|
+
|
|
63
|
+
nonEmptyPaths.forEach(function(path) {
|
|
64
|
+
if (/^\//.test(path)) {
|
|
65
|
+
relevantPaths = [path];
|
|
66
|
+
} else {
|
|
67
|
+
relevantPaths.push(path);
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
return relevantPaths.join("/");
|
|
72
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@bailinghub/mammoth-library",
|
|
3
|
+
"version": "1.12.0-bailinghub.1",
|
|
4
|
+
"author": "Michael Williamson <mike@zwobble.org>",
|
|
5
|
+
"description": "BailingHub library-only distribution of Mammoth 1.12.0; no command-line interface",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"docx",
|
|
8
|
+
"html",
|
|
9
|
+
"office",
|
|
10
|
+
"word",
|
|
11
|
+
"markdown",
|
|
12
|
+
"md"
|
|
13
|
+
],
|
|
14
|
+
"main": "./lib/index.js",
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "https://github.com/mwilliamson/mammoth.js.git"
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@xmldom/xmldom": "^0.8.6",
|
|
21
|
+
"base64-js": "^1.5.1",
|
|
22
|
+
"bluebird": "~3.4.0",
|
|
23
|
+
"dingbat-to-unicode": "^1.0.1",
|
|
24
|
+
"jszip": "^3.7.1",
|
|
25
|
+
"lop": "^0.4.2",
|
|
26
|
+
"path-is-absolute": "^1.0.0",
|
|
27
|
+
"underscore": "^1.13.1",
|
|
28
|
+
"xmlbuilder": "^10.0.0"
|
|
29
|
+
},
|
|
30
|
+
"browser": {
|
|
31
|
+
"./lib/unzip.js": "./browser/unzip.js",
|
|
32
|
+
"./lib/docx/files.js": "./browser/docx/files.js"
|
|
33
|
+
},
|
|
34
|
+
"license": "BSD-2-Clause",
|
|
35
|
+
"engines": {
|
|
36
|
+
"node": ">=12.0.0"
|
|
37
|
+
},
|
|
38
|
+
"private": true
|
|
39
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "mammoth",
|
|
3
|
+
"version": "1.12.0",
|
|
4
|
+
"author": "Michael Williamson <mike@zwobble.org>",
|
|
5
|
+
"description": "Convert Word documents from docx to simple HTML and Markdown",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"docx",
|
|
8
|
+
"html",
|
|
9
|
+
"office",
|
|
10
|
+
"word",
|
|
11
|
+
"markdown",
|
|
12
|
+
"md"
|
|
13
|
+
],
|
|
14
|
+
"main": "./lib/index.js",
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "https://github.com/mwilliamson/mammoth.js.git"
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@xmldom/xmldom": "^0.8.6",
|
|
21
|
+
"argparse": "~1.0.3",
|
|
22
|
+
"base64-js": "^1.5.1",
|
|
23
|
+
"bluebird": "~3.4.0",
|
|
24
|
+
"dingbat-to-unicode": "^1.0.1",
|
|
25
|
+
"jszip": "^3.7.1",
|
|
26
|
+
"lop": "^0.4.2",
|
|
27
|
+
"path-is-absolute": "^1.0.0",
|
|
28
|
+
"underscore": "^1.13.1",
|
|
29
|
+
"xmlbuilder": "^10.0.0"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@types/node": "^20.2.5",
|
|
33
|
+
"browserify": "~13.0.1",
|
|
34
|
+
"browserify-prepend-licenses": "~1.0.0",
|
|
35
|
+
"duck": "^0.1.12",
|
|
36
|
+
"eslint": "2.13.1",
|
|
37
|
+
"hamjest": "^4.0.1",
|
|
38
|
+
"mocha": "~2.2.5",
|
|
39
|
+
"temp": "^0.9.4",
|
|
40
|
+
"typescript": "^5.0.4",
|
|
41
|
+
"uglify-js": "~2.4.8"
|
|
42
|
+
},
|
|
43
|
+
"browser": {
|
|
44
|
+
"./lib/unzip.js": "./browser/unzip.js",
|
|
45
|
+
"./lib/docx/files.js": "./browser/docx/files.js"
|
|
46
|
+
},
|
|
47
|
+
"bin": {
|
|
48
|
+
"mammoth": "bin/mammoth"
|
|
49
|
+
},
|
|
50
|
+
"scripts": {
|
|
51
|
+
"pretest": "eslint lib test",
|
|
52
|
+
"test": "mocha 'test/**/*.tests.js'",
|
|
53
|
+
"check-typescript": "tsc --noEmit lib/index.d.ts",
|
|
54
|
+
"prepare": "make mammoth.browser.min.js"
|
|
55
|
+
},
|
|
56
|
+
"license": "BSD-2-Clause",
|
|
57
|
+
"engines": {
|
|
58
|
+
"node": ">=12.0.0"
|
|
59
|
+
},
|
|
60
|
+
"volta": {
|
|
61
|
+
"node": "16.18.1",
|
|
62
|
+
"npm": "8.19.2"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{aj as K,E as V}from"./vendor-element-8cVcdt5T.js";import{a as C}from"./request-
|
|
1
|
+
import{aj as K,E as V}from"./vendor-element-8cVcdt5T.js";import{a as C}from"./request-DKycpD7z.js";import{f as W,c as X}from"./util-DZYfJ5Zo.js";import{u as Y}from"./index-CK0ZCTZv.js";import{H as c}from"./HelpTip-Dtdt2tKR.js";import{d as Z,z as h,c as L,S as a,J as t,R as O,r as _,ai as i,o as b,e as o,Q as r,P as s,u as ee,I as E,O as $,a3 as le,q as te}from"./vendor-vue-Co7x2FW6.js";import{_ as ae}from"./_plugin-vue_export-helper-DlAUqK2U.js";const ne={class:"head"},oe={class:"account-main"},se={class:"account-stack"},de={class:"muted"},ie={class:"account-stack"},ue={class:"muted"},re=Z({__name:"Accounts",setup(me){const y={admin:"全能",kb_editor:"知识库维护",viewer:"只读任务",usage_operator:"用量管理",usage_auditor:"用量只读"},I=Y(),x=_([]),T=_(["admin","kb_editor","viewer"]),u=_(!1),m=_(!1),g=_(!1),d=te({username:"",display_name:"",role:"kb_editor",password:"",enabled:!0});async function w(){var e;const n=await C("/admin/api/admins");x.value=n.list,(e=n.roles)!=null&&e.length&&(T.value=n.roles)}function N(n){return n==="admin"?"admin":n==="kb_editor"?"kb_editor":n==="viewer"?"viewer":n}function S(n){return n?`最近登录 ${W(n)}`:"从未登录"}function A(){m.value=!1,Object.assign(d,{username:"",display_name:"",role:"kb_editor",password:"",enabled:!0}),u.value=!0}function M(n){m.value=!0,Object.assign(d,{username:n.username,display_name:n.display_name||"",role:n.role,password:"",enabled:!!n.enabled}),u.value=!0}async function j(){g.value=!0;try{const n=await C("/admin/api/admins",{method:"POST",body:JSON.stringify(d)});u.value=!1,await w(),n.generated_password?(await K.alert(`账号 ${n.username} 的初始密码(只显示这一次,请立即发给使用人):
|
|
2
2
|
|
|
3
3
|
${n.generated_password}`,"账号已创建",{confirmButtonText:"复制密码"}).catch(()=>{}),await X(n.generated_password,"密码已复制")):V.success("已保存")}catch(n){V.error(n.message)}finally{g.value=!1}}async function q(n){try{await C("/admin/api/admins/"+encodeURIComponent(n),{method:"DELETE"}),await w()}catch(e){V.error(e.message)}}return h(w),(n,e)=>{const p=i("el-button"),v=i("el-table-column"),U=i("el-tag"),D=i("el-popconfirm"),R=i("el-table"),z=i("el-card"),k=i("el-input"),f=i("el-form-item"),H=i("el-option"),J=i("el-select"),P=i("el-switch"),F=i("el-form"),Q=i("el-drawer");return b(),L(O,null,[a(z,{shadow:"never"},{header:t(()=>[o("div",ne,[e[9]||(e[9]=o("b",null,"后台账号",-1)),e[10]||(e[10]=s()),a(c,{title:"后台账号 / 角色"},{default:t(()=>[...e[7]||(e[7]=[o("p",null,"后台账号只用于维护中枢控制台,不等同于业务系统用户,也不参与聊天/工具调用的业务身份。",-1),o("p",null,[s("角色决定可见板块与管理权限:"),o("code",null,"admin"),s(" 管全局配置,"),o("code",null,"kb_editor"),s(" 维护知识库,"),o("code",null,"viewer"),s(" 查看运行记录;"),o("code",null,"usage_operator"),s(" 管理AI额度,"),o("code",null,"usage_auditor"),s(" 只读消费明细。")],-1)])]),_:1}),a(p,{type:"primary",style:{"margin-left":"auto"},onClick:A},{default:t(()=>[...e[8]||(e[8]=[s("新建账号",-1)])]),_:1})])]),default:t(()=>[a(R,{data:x.value},{default:t(()=>[a(v,{label:"账号","min-width":"240","show-overflow-tooltip":""},{default:t(({row:l})=>[o("div",oe,[o("b",null,r(l.display_name||l.username),1),o("code",null,r(l.username),1)])]),_:1}),a(v,{label:"角色权限","min-width":"220"},{default:t(({row:l})=>[o("div",se,[a(U,{type:l.role==="admin"?"warning":"info",effect:"plain"},{default:t(()=>[s(r(N(l.role)),1)]),_:2},1032,["type"]),o("span",de,r(y[l.role]||"自定义角色"),1)])]),_:1}),a(v,{label:"登录状态","min-width":"190"},{default:t(({row:l})=>[o("div",ie,[a(U,{type:l.enabled?"success":"info",effect:"plain"},{default:t(()=>[s(r(l.enabled?"启用":"停用"),1)]),_:2},1032,["type"]),o("span",ue,r(S(l.last_login_at)),1)])]),_:1}),a(v,{"min-width":"80",align:"right"},{default:t(({row:l})=>{var B;return[a(p,{link:"",type:"primary",onClick:G=>M(l)},{default:t(()=>[...e[11]||(e[11]=[s("编辑",-1)])]),_:1},8,["onClick"]),l.username!==((B=ee(I).me)==null?void 0:B.username)?(b(),E(D,{key:0,title:"删除该账号?其登录会话立即失效。",width:"240",onConfirm:G=>q(l.username)},{reference:t(()=>[a(p,{link:"",type:"danger"},{default:t(()=>[...e[12]||(e[12]=[s("删",-1)])]),_:1})]),_:1},8,["onConfirm"])):$("",!0)]}),_:1})]),_:1},8,["data"])]),_:1}),a(Q,{modelValue:u.value,"onUpdate:modelValue":e[6]||(e[6]=l=>u.value=l),title:m.value?"编辑账号":"新建账号",size:"420px"},{footer:t(()=>[a(p,{onClick:e[5]||(e[5]=l=>u.value=!1)},{default:t(()=>[...e[22]||(e[22]=[s("取消",-1)])]),_:1}),a(p,{type:"primary",loading:g.value,onClick:j},{default:t(()=>[...e[23]||(e[23]=[s("保存",-1)])]),_:1},8,["loading"])]),default:t(()=>[a(F,{"label-position":"top"},{default:t(()=>[a(f,null,{label:t(()=>[...e[13]||(e[13]=[s("用户名 ",-1),o("span",{class:"field-required"},"必填",-1)])]),default:t(()=>[a(k,{modelValue:d.username,"onUpdate:modelValue":e[0]||(e[0]=l=>d.username=l),disabled:m.value,placeholder:"如 ops-admin",class:"mono"},null,8,["modelValue","disabled"])]),_:1}),a(f,{label:"显示名(可选)"},{default:t(()=>[a(k,{modelValue:d.display_name,"onUpdate:modelValue":e[1]||(e[1]=l=>d.display_name=l)},null,8,["modelValue"])]),_:1}),a(f,null,{label:t(()=>[e[15]||(e[15]=s("角色 ",-1)),e[16]||(e[16]=o("span",{class:"field-required"},"必填",-1)),e[17]||(e[17]=s()),a(c,{title:"角色"},{default:t(()=>[...e[14]||(e[14]=[o("p",null,[o("b",null,"admin"),s(":管理全局配置与账号;"),o("b",null,"kb_editor"),s(":维护知识库;"),o("b",null,"viewer"),s(":只读查看运行记录;"),o("b",null,"usage_operator"),s(":管理AI额度;"),o("b",null,"usage_auditor"),s(":只读消费明细。用量角色不会获得业务会话正文权限。")],-1)])]),_:1})]),default:t(()=>[a(J,{modelValue:d.role,"onUpdate:modelValue":e[2]||(e[2]=l=>d.role=l),style:{width:"100%"}},{default:t(()=>[(b(!0),L(O,null,le(T.value,l=>(b(),E(H,{key:l,value:l,label:l+(y[l]?"("+y[l]+")":"")},null,8,["value","label"]))),128))]),_:1},8,["modelValue"])]),_:1}),a(f,null,{label:t(()=>[e[19]||(e[19]=s("密码 ",-1)),a(c,{title:"密码"},{default:t(()=>[...e[18]||(e[18]=[o("p",null,"新建时留空会自动生成,并只显示一次。编辑时留空表示不修改;填写后该账号其他登录会话会立即下线。",-1)])]),_:1})]),default:t(()=>[a(k,{modelValue:d.password,"onUpdate:modelValue":e[3]||(e[3]=l=>d.password=l),type:"password","show-password":"",autocomplete:"new-password",placeholder:"至少 8 位"},null,8,["modelValue"])]),_:1}),m.value?(b(),E(f,{key:0},{label:t(()=>[e[21]||(e[21]=s("启用 ",-1)),a(c,{title:"启用状态"},{default:t(()=>[...e[20]||(e[20]=[o("p",null,"停用账号会立即使其登录会话失效。",-1)])]),_:1})]),default:t(()=>[a(P,{modelValue:d.enabled,"onUpdate:modelValue":e[4]||(e[4]=l=>d.enabled=l)},null,8,["modelValue"])]),_:1})):$("",!0)]),_:1})]),_:1},8,["modelValue","title"])],64)}}}),ge=ae(re,[["__scopeId","data-v-3f42f008"]]);export{ge as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as Fe,n as ll,I as g,J as n,ai as _,o as d,K as de,c as w,e as l,Q as r,S as a,P as m,O as U,R as N,a3 as E,L as He,u as T,U as Be,r as C,q as re,m as le,as as Ke,z as tl,aC as al,aB as nl}from"./vendor-vue-Co7x2FW6.js";import{aj as Ze,E as Z}from"./vendor-element-8cVcdt5T.js";import{H as ol}from"./HelpTip-Dtdt2tKR.js";import{u as Qe,k as Je,c as sl}from"./index-sLKrJd_p.js";import{_ as Ge}from"./_plugin-vue_export-helper-DlAUqK2U.js";const il={class:"setup-panel"},ul={class:"setup-header"},dl={class:"setup-steps","aria-label":"接入配置步骤"},rl=["disabled","onClick"],pl={class:"setup-section"},cl={class:"section-footer"},ml={class:"workspace-selector"},vl={key:2},fl={class:"setup-section"},_l={class:"model-preview"},bl={class:"setup-section"},gl={class:"field-note"},yl={class:"source-heading"},wl={key:2,class:"inline-error"},kl={class:"source-top"},Vl={class:"catalog-action"},$l={key:0,class:"inline-error"},Cl={class:"field-note"},Ul={class:"section-footer"},hl={class:"setup-section"},Sl={class:"check-item"},xl={class:"check-item"},zl=Fe({__name:"AgentSetupPanel",props:{modelValue:{type:Boolean},appId:{},workspaces:{},initialWorkspace:{}},emits:["update:modelValue","saved","connect"],setup(xe,{emit:ge}){const A=xe,z=Qe(),M=ge,ye=["授权入口","系统说明","工具与审批","检查连接"],J=C(0),te=C(!1),ie=C(""),k=C(null),F=C(null),we=C(""),P=C(!1),W=C(""),R=C(null),j=C(""),pe=C(!1),X=C(""),V=C(!1),Y=C([]),b=re({enabled:!1,bucket:"",max_bytes:6291456,allowed_mimes:["image/png","image/jpeg","image/webp"]}),L=re({enabled:!1,instructions:"",active_tool_limit:8}),S=re({name:"",summary:"",domains:[],boundaries:[]}),x=re({enabled:!1,write_tools:[],force_approval_tools:[]}),H=C([]),ce=C([]),ae=C("");let f=0,Pe=0;const q=s=>JSON.parse(JSON.stringify(s)),me=()=>{var s;return k.value?{enabled:k.value.enabled,agent_authorize_url:((s=k.value.agent_authorize_url)==null?void 0:s.trim())||null,allowed_routes:k.value.allowed_routes}:null},ve=le(()=>!!k.value&&JSON.stringify(me())!==we.value),ke=le(()=>A.workspaces.filter(s=>{var e,c;return((e=k.value)==null?void 0:e.allowed_routes.includes("*"))||((c=k.value)==null?void 0:c.allowed_routes.includes(s.route))})),ze=le(()=>A.workspaces.filter(s=>{var e,c;return((e=F.value)==null?void 0:e.allowed_routes.includes("*"))||((c=F.value)==null?void 0:c.allowed_routes.includes(s.route))})),Ve=()=>!!(S.name||S.summary||S.domains.length||S.boundaries.length);function be(){var c,p,h,v;const s={...((c=R.value)==null?void 0:c.agent_client)||{},...L};(b.enabled||(h=(p=R.value)==null?void 0:p.agent_client)!=null&&h.artifact_upload)&&(s.artifact_upload={...q(b),bucket:b.bucket||void 0}),Ve()?s.system_info=q(S):delete s.system_info;const e={...((v=R.value)==null?void 0:v.agent_direct)||{},enabled:x.enabled};return delete e.unattended_write_tools,x.write_tools.length?e.write_tools=[...x.write_tools]:delete e.write_tools,x.force_approval_tools.length?e.force_approval_tools=[...x.force_approval_tools]:delete e.force_approval_tools,{agent_client:s,agent_direct:e,tool_sources:H.value.map(G=>q(G.config))}}const ee=le(()=>!!R.value&&JSON.stringify(be())!==j.value),Ne=le(()=>{const s=new Map;for(const e of H.value)for(const c of e._tools)!c.readonly&&(e.config.allow.includes("*")||e.config.allow.includes(c.scope))&&s.set(c.name,c);return[...s.values()]});function je(s){return s.enabled?s.runtime_enabled?s.direct_enabled?s.source_count?`连接与工具通道已配置${s.system_info_configured?"":";建议补充系统说明"}`:"工具调用已开启;尚未关联工具源":"可配置连接;业务工具调用尚未开启":"尚未启用本地智能体":"工作空间已停用"}async function ne(s,e){const c=await Je(s,e),p=await c.json().catch(()=>({}));if(!c.ok)throw c.status===409?new Error("配置已被其他操作更新。请关闭面板后重新打开,核对最新配置再保存。"):c.status===403?new Error("当前账号没有这部分配置的读取或修改权限,请联系中枢管理员。"):p.error==="agent_setup_unsupported"?new Error("当前宿主尚不支持集中保存,请升级配套宿主后再试。"):new Error(p.error||"请求失败,请稍后重试");return p}async function $e(){Se();const s=++f;te.value=!0;try{const e=await ne(`/admin/api/clients/${encodeURIComponent(A.appId)}/agent-setup`);if(s!==f||!A.modelValue)return;k.value=q(e),F.value=q(e),we.value=JSON.stringify(me());const c=A.initialWorkspace&&ke.value.find(p=>p.route===A.initialWorkspace);c&&(J.value=1,await Ue(c.route))}catch(e){s===f&&(ie.value=oe(e))}finally{s===f&&(te.value=!1)}}function oe(s){return s instanceof Error?s.message:"操作失败"}async function Ce(){var p;if(!k.value||P.value||V.value||!z.can("clients:write"))return;const s=f,e=k.value.app_id,c=q({expected_revision:k.value.revision,...me()});P.value=!0;try{const h=await ne(`/admin/api/clients/${encodeURIComponent(e)}/agent-setup`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)});if(s!==f||((p=k.value)==null?void 0:p.app_id)!==e||!A.modelValue)return;k.value=q(h),F.value=q(h),we.value=JSON.stringify(me()),M("saved"),Z.success("授权入口已保存")}catch(h){s===f&&Z.error(oe(h))}finally{s===f&&(P.value=!1)}}async function Ue(s){if(P.value||V.value||ee.value&&!await fe())return;const e=++f;W.value=s,R.value=null,j.value="",X.value="",pe.value=!0;try{const c=await ne(`/admin/api/routes/${encodeURIComponent(s)}/agent-setup`);if(e!==f||!A.modelValue)return;he(c),Oe(e),z.can("storage:read")&&ne("/admin/api/storage-buckets").then(p=>{e===f&&(Y.value=p.map(h=>({name:h.name,kind:h.kind,enabled:h.enabled})))}).catch(()=>{})}catch(c){e===f&&(X.value=oe(c))}finally{e===f&&(pe.value=!1,te.value=!1)}}function he(s){var p,h,v,G,I,D;R.value=s,Object.assign(b,{enabled:!1,bucket:"",max_bytes:6291456,allowed_mimes:["image/png","image/jpeg","image/webp"]},q(((p=s.agent_client)==null?void 0:p.artifact_upload)||{})),Object.assign(L,{enabled:((h=s.agent_client)==null?void 0:h.enabled)??((v=s.agent_direct)==null?void 0:v.enabled)===!0,instructions:((G=s.agent_client)==null?void 0:G.instructions)||"",active_tool_limit:((I=s.agent_client)==null?void 0:I.active_tool_limit)||8}),Object.assign(S,q(((D=s.agent_client)==null?void 0:D.system_info)||{name:"",summary:"",domains:[],boundaries:[]}));const e=s.agent_direct||{},c=e.write_tools||[];Object.assign(x,{enabled:e.enabled===!0,write_tools:[...c],force_approval_tools:[...e.force_approval_tools||(Array.isArray(e.unattended_write_tools)?c.filter(K=>!e.unattended_write_tools.includes(K)):[])]}),H.value=(s.tool_sources||[]).map(K=>Ie(K)),j.value=JSON.stringify(be())}async function Oe(s){ae.value="";try{const e=await ne("/admin/api/tool-providers");s===f&&(ce.value=e)}catch{s===f&&(ae.value="暂时无法读取工具源目录。现有配置保留,也可以手工填写已登记的工具源标识。")}}function Ie(s={}){return{config:{...q(s),provider:s.provider||"",allow:[...s.allow||[]]},_key:++Pe,_tools:[],_loaded:!1,_loading:!1,_error:""}}function u(){H.value.push(Ie())}function t(s){s._tools=[],s._loaded=!1,s._error=""}function y(s){return[...new Set(s._tools.map(e=>e.scope))]}function O(s,e){return!s.config.allow.includes("*")&&!s.config.allow.includes(e.scope)?"范围未包含":e.readonly?"已纳入查询范围":x.write_tools.includes(e.name)?"已列入写操作清单":"未开放写入"}async function We(s){const e=s.config.provider,c=f;s._loading=!0,s._error="";try{const p=await ne(`/admin/api/tool-providers/${encodeURIComponent(e)}/tools`);if(c!==f||s.config.provider!==e||!H.value.includes(s))return;s._tools=p.tools||[];const h=Array.isArray(p.skipped)?p.skipped.length:Number(p.skipped||0),v=[p.note,h?`${h} 个声明未通过编译`:"",Array.isArray(p.warnings)&&p.warnings.length?`${p.warnings.length} 项目录提醒`:""].filter(Boolean);s._loaded=!p.note,s._error=v.join(";")}catch(p){c===f&&s.config.provider===e&&(s._error=`${oe(p)};这不代表该工具源没有能力。`)}finally{s._loading=!1}}async function Q(){if(!R.value||P.value||V.value||!z.can("routes:write"))return;if(Ve()&&(!S.name.trim()||!S.summary.trim())){Z.warning("填写系统说明时,系统名称和一句话介绍都需要提供。");return}if(S.domains.some(p=>!p.trim()||p.length>120)||S.boundaries.some(p=>!p.trim()||p.length>160)){Z.warning("业务方向每项不超过120字,系统边界每项不超过160字。");return}if([...x.write_tools,...x.force_approval_tools].some(p=>!/^[A-Za-z_][A-Za-z0-9_]*$/.test(p))||x.force_approval_tools.some(p=>!x.write_tools.includes(p))){Z.warning("写操作需要精确operationId;额外审批只能选择已允许的写操作。");return}const s=f,e=W.value,c=q({expected_revision:R.value.revision,...be()});V.value=!0;try{const p=await ne(`/admin/api/routes/${encodeURIComponent(e)}/agent-setup`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)});if(s!==f||W.value!==e||!A.modelValue)return;he(p),M("saved"),Z.success("工作空间配置已保存")}catch(p){s===f&&Z.error(oe(p))}finally{s===f&&(V.value=!1)}}async function fe(){try{return await Ze.confirm("有未保存的修改,离开会放弃这些修改。","离开配置",{confirmButtonText:"放弃修改",cancelButtonText:"继续编辑",type:"warning"}),!0}catch{return!1}}async function _e(s){P.value||V.value||(ve.value||ee.value)&&!await fe()||(M("update:modelValue",!1),s())}function Se(){f++,P.value=!1,V.value=!1,J.value=0,k.value=null,F.value=null,R.value=null,W.value="",H.value=[],ie.value="",X.value="",te.value=!1}return ll(()=>[A.modelValue,A.appId],()=>{A.modelValue&&A.appId&&$e()}),(s,e)=>{const c=_("el-button"),p=_("el-alert"),h=_("el-input"),v=_("el-form-item"),G=_("el-switch"),I=_("el-option"),D=_("el-select"),K=_("el-form"),ue=_("el-empty"),Te=_("el-divider"),Ae=_("router-link"),i=_("el-input-number"),B=_("el-table-column"),Re=_("el-table"),Xe=_("el-collapse-item"),Ye=_("el-collapse"),el=_("el-drawer"),qe=Ke("loading");return d(),g(el,{"model-value":xe.modelValue,size:"min(1080px, 96vw)","with-header":!1,"before-close":_e,onClosed:Se},{default:n(()=>{var De,Le,Me;return[de((d(),w("div",il,[l("header",ul,[l("div",null,[e[18]||(e[18]=l("span",{class:"eyebrow"},"本地智能体接入",-1)),l("h2",null,r(((De=k.value)==null?void 0:De.name)||"配置接入"),1),e[19]||(e[19]=l("p",null,"在这里完成授权入口、系统介绍与工具范围配置。",-1))]),a(c,{onClick:e[0]||(e[0]=o=>_e(()=>M("update:modelValue",!1)))},{default:n(()=>[...e[20]||(e[20]=[m("关闭",-1)])]),_:1})]),ie.value?(d(),g(p,{key:0,type:"error",title:ie.value,closable:!1,"show-icon":""},null,8,["title"])):U("",!0),k.value?(d(),w(N,{key:1},[l("nav",dl,[(d(),w(N,null,E(ye,(o,se)=>l("button",{key:o,class:He({active:J.value===se}),disabled:P.value||V.value,onClick:$=>J.value=se},[l("span",null,r(se+1),1),m(r(o),1)],10,rl)),64))]),de(l("section",pl,[e[25]||(e[25]=l("h3",null,"让用户通过业务系统确认身份",-1)),e[26]||(e[26]=l("p",{class:"description"},"复用当前接入方。账号、租户和业务权限仍由业务授权页确认。",-1)),T(z).can("clients:write")?U("",!0):(d(),g(p,{key:0,type:"info",closable:!1,title:"当前账号可查看授权入口,保存需要接入方管理权限。"})),a(K,{"label-position":"top",disabled:P.value||!T(z).can("clients:write")},{default:n(()=>[a(v,{label:"接入方标识"},{default:n(()=>[a(h,{"model-value":k.value.app_id,readonly:""},null,8,["model-value"])]),_:1}),a(v,{label:"允许此接入方连接中枢"},{default:n(()=>[a(G,{modelValue:k.value.enabled,"onUpdate:modelValue":e[1]||(e[1]=o=>k.value.enabled=o)},null,8,["modelValue"]),e[21]||(e[21]=l("span",{class:"inline-note"},"停用会影响此接入方的其他入口。",-1))]),_:1}),a(v,{label:"业务授权入口"},{default:n(()=>[a(h,{modelValue:k.value.agent_authorize_url,"onUpdate:modelValue":e[2]||(e[2]=o=>k.value.agent_authorize_url=o),placeholder:"https://business.example.com/agent/authorize",maxlength:"2048"},null,8,["modelValue"]),e[22]||(e[22]=l("div",{class:"field-note"},"填写业务系统提供的固定 HTTPS 地址。用户将在该页面登录并确认本次授权。",-1))]),_:1}),a(v,{label:"允许连接的工作空间"},{default:n(()=>[a(D,{modelValue:k.value.allowed_routes,"onUpdate:modelValue":e[3]||(e[3]=o=>k.value.allowed_routes=o),multiple:"",filterable:"","allow-create":"","default-first-option":"",style:{width:"100%"},placeholder:"选择已存在的工作空间"},{default:n(()=>[(d(!0),w(N,null,E(xe.workspaces,o=>(d(),g(I,{key:o.route,label:`${o.name} · ${o.route}`,value:o.route},null,8,["label","value"]))),128)),a(I,{value:"*",label:"所有工作空间(包含以后新增的空间)"})]),_:1},8,["modelValue"]),e[23]||(e[23]=l("div",{class:"field-note"},"工作空间对应中枢现有业务路由。这里限定接入范围,不授予业务账号额外权限。",-1))]),_:1})]),_:1},8,["disabled"]),l("div",cl,[l("span",null,r(ve.value?"授权入口有未保存修改":"授权入口配置已同步"),1),a(c,{type:"primary",loading:P.value,disabled:!ve.value||!T(z).can("clients:write"),onClick:Ce},{default:n(()=>[...e[24]||(e[24]=[m("保存授权入口",-1)])]),_:1},8,["loading","disabled"])])],512),[[Be,J.value===0]]),J.value===1||J.value===2?(d(),w(N,{key:0},[l("div",ml,[e[27]||(e[27]=l("div",null,[l("b",null,"配置哪个工作空间"),l("p",null,"以下设置保存在原业务路由中,使用同一路由的接入方会共享这些设置。")],-1)),a(D,{"model-value":W.value,disabled:P.value||V.value,filterable:"",placeholder:"选择一个工作空间",onChange:Ue},{default:n(()=>[(d(!0),w(N,null,E(ke.value,o=>(d(),g(I,{key:o.route,label:`${o.name} · ${o.route}`,value:o.route},null,8,["label","value"]))),128))]),_:1},8,["model-value","disabled"])]),X.value?(d(),g(p,{key:0,type:"error",title:X.value,closable:!1,"show-icon":""},null,8,["title"])):U("",!0),W.value?U("",!0):(d(),g(ue,{key:1,description:ke.value.length?"在上方选择要配置的工作空间。":"还没有可选工作空间,请先在授权入口中关联一个已有空间。"},null,8,["description"])),W.value?de((d(),w("div",vl,[R.value?(d(),w(N,{key:0},[R.value.enabled?U("",!0):(d(),g(p,{key:0,title:"这个工作空间已停用。完成配置后,还需在业务路由中恢复空间运行。",type:"warning",closable:!1,"show-icon":""})),de(l("section",fl,[e[31]||(e[31]=l("h3",null,"让智能体先知道这个系统负责什么",-1)),e[32]||(e[32]=l("p",{class:"description"},"说明会在首次搜索工具前提供给已选中的授权。它描述系统定位,具体可执行动作仍以授权后的工具查询为准。",-1)),a(K,{"label-position":"top",disabled:V.value||!T(z).can("routes:write")},{default:n(()=>[a(v,{label:"启用本地智能体"},{default:n(()=>[a(G,{modelValue:L.enabled,"onUpdate:modelValue":e[4]||(e[4]=o=>L.enabled=o)},null,8,["modelValue"]),e[28]||(e[28]=l("span",{class:"inline-note"},"开启本地会话编排;工具调用在下一步单独设置。",-1))]),_:1}),a(v,{label:"业务系统名称"},{default:n(()=>[a(h,{modelValue:S.name,"onUpdate:modelValue":e[5]||(e[5]=o=>S.name=o),placeholder:"例如:客户服务系统",maxlength:"120","show-word-limit":""},null,8,["modelValue"])]),_:1}),a(v,{label:"一句话介绍"},{default:n(()=>[a(h,{modelValue:S.summary,"onUpdate:modelValue":e[6]||(e[6]=o=>S.summary=o),placeholder:"例如:处理客户咨询、服务工单和售后跟进。",maxlength:"400","show-word-limit":""},null,8,["modelValue"])]),_:1}),a(v,{label:"典型业务方向"},{default:n(()=>[a(D,{modelValue:S.domains,"onUpdate:modelValue":e[7]||(e[7]=o=>S.domains=o),multiple:"",filterable:"","allow-create":"","default-first-option":"","multiple-limit":6,style:{width:"100%"},placeholder:"输入一个方向后按回车,最多6项"},{default:n(()=>[(d(!0),w(N,null,E(S.domains,o=>(d(),g(I,{key:o,label:o,value:o},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),a(v,{label:"系统边界"},{default:n(()=>[a(D,{modelValue:S.boundaries,"onUpdate:modelValue":e[8]||(e[8]=o=>S.boundaries=o),multiple:"",filterable:"","allow-create":"","default-first-option":"","multiple-limit":6,style:{width:"100%"},placeholder:"例如:财务结算由其他系统负责;最多6项"},{default:n(()=>[(d(!0),w(N,null,E(S.boundaries,o=>(d(),g(I,{key:o,label:o,value:o},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["disabled"]),l("div",_l,[e[29]||(e[29]=l("span",null,"智能体看到的系统定位",-1)),l("b",null,r(S.name||"系统定位未提供"),1),l("p",null,r(S.summary||"尚未配置说明,客户端仍可按原流程查询已授权的业务工具。"),1),e[30]||(e[30]=l("small",null,"说明仅供目标选择参考 · 工具可能尚未加载 · 不代表已获得写入权限",-1))])],512),[[Be,J.value===1]]),de(l("section",bl,[e[47]||(e[47]=l("h3",null,"限定智能体可以使用的业务动作",-1)),e[48]||(e[48]=l("p",{class:"description"},"工作空间的工具源与范围继续复用原配置。开启后仍会逐次校验业务身份、权限和审批。",-1)),R.value.permission==="readonly"?(d(),g(p,{key:0,title:"这个工作空间的权限档为只读。即使填写写操作清单,也不会开放写入;如需调整,请在业务路由的权限与治理中核对。",type:"warning",closable:!1,"show-icon":""})):U("",!0),a(K,{"label-position":"top",disabled:V.value||!T(z).can("routes:write")},{default:n(()=>[a(v,{label:"允许本地智能体调用工具"},{default:n(()=>[a(G,{modelValue:x.enabled,"onUpdate:modelValue":e[9]||(e[9]=o=>x.enabled=o)},null,8,["modelValue"])]),_:1}),L.enabled&&!x.enabled?(d(),g(p,{key:0,title:"本地会话已启用,但业务工具调用未开启。用户可以完成授权,暂时无法通过此空间发现或操作业务工具。",type:"warning",closable:!1,"show-icon":""})):U("",!0),a(Te,{"content-position":"left"},{default:n(()=>[...e[33]||(e[33]=[m("生成图片上传",-1)])]),_:1}),a(v,{label:"允许上传生成图片"},{default:n(()=>[a(G,{modelValue:b.enabled,"onUpdate:modelValue":e[10]||(e[10]=o=>b.enabled=o)},null,8,["modelValue"]),e[34]||(e[34]=l("div",{class:"field-note"},"将智能体生成的图片保存到所选媒体存储,返回 URL 供商品等业务使用。上传不等于已修改业务数据。",-1))]),_:1}),b.enabled?(d(),w(N,{key:1},[a(v,{label:"保存到哪个媒体存储"},{default:n(()=>[a(D,{modelValue:b.bucket,"onUpdate:modelValue":e[11]||(e[11]=o=>b.bucket=o),filterable:"","allow-create":"",placeholder:"选择已登记的存储",style:{width:"100%"}},{default:n(()=>[(d(!0),w(N,null,E(Y.value,o=>(d(),g(I,{key:o.name,value:o.name,label:`${o.name} · ${o.kind}${o.enabled?"":"(已停用)"}`,disabled:!o.enabled},null,8,["value","label","disabled"]))),128))]),_:1},8,["modelValue"]),l("div",gl,[a(Ae,{to:"/storage"},{default:n(()=>[...e[35]||(e[35]=[m("前往媒体存储配置 COS/OSS 或本地存储",-1)])]),_:1}),e[36]||(e[36]=m("。此处不填写密钥。文件由部署方管理,不随会话结束清理。",-1))])]),_:1}),a(v,{label:"单张图片大小上限(字节)"},{default:n(()=>[a(i,{modelValue:b.max_bytes,"onUpdate:modelValue":e[12]||(e[12]=o=>b.max_bytes=o),min:1,max:6291456},null,8,["modelValue"]),e[37]||(e[37]=l("span",{class:"inline-note"},"默认 6 MiB",-1))]),_:1}),a(v,{label:"允许的图片类型"},{default:n(()=>[a(D,{modelValue:b.allowed_mimes,"onUpdate:modelValue":e[13]||(e[13]=o=>b.allowed_mimes=o),multiple:""},{default:n(()=>[(d(),w(N,null,E(["image/png","image/jpeg","image/webp"],o=>a(I,{key:o,label:o,value:o},null,8,["label","value"])),64))]),_:1},8,["modelValue"])]),_:1})],64)):U("",!0),a(Te,{"content-position":"left"},{default:n(()=>[...e[38]||(e[38]=[m("业务工具",-1)])]),_:1}),l("div",yl,[e[40]||(e[40]=l("b",null,"使用哪些工具源",-1)),a(c,{size:"small",disabled:V.value||!T(z).can("routes:write"),onClick:u},{default:n(()=>[...e[39]||(e[39]=[m("添加工具源",-1)])]),_:1},8,["disabled"])]),ae.value?(d(),w("p",wl,r(ae.value),1)):U("",!0),H.value.length?U("",!0):(d(),g(ue,{key:3,description:"尚未关联工具源。添加已有业务工具源并选择范围。","image-size":56})),(d(!0),w(N,null,E(H.value,(o,se)=>(d(),w("div",{class:"source-card",key:o._key},[l("div",kl,[l("b",null,"工具源 "+r(se+1),1),a(c,{link:"",type:"danger",disabled:V.value||!T(z).can("routes:write"),onClick:$=>H.value.splice(se,1)},{default:n(()=>[...e[41]||(e[41]=[m("移除",-1)])]),_:1},8,["disabled","onClick"])]),a(v,{label:"已登记的工具源"},{default:n(()=>[a(D,{modelValue:o.config.provider,"onUpdate:modelValue":$=>o.config.provider=$,filterable:"","allow-create":"",style:{width:"100%"},onChange:$=>t(o)},{default:n(()=>[(d(!0),w(N,null,E(ce.value,$=>(d(),g(I,{key:$.name,value:$.name,label:$.description?`${$.name} · ${$.description}`:$.name},null,8,["value","label"]))),128))]),_:1},8,["modelValue","onUpdate:modelValue","onChange"])]),_:2},1024),a(v,{label:"允许的工具范围(scope)"},{default:n(()=>[a(D,{modelValue:o.config.allow,"onUpdate:modelValue":$=>o.config.allow=$,multiple:"",filterable:"","allow-create":"","default-first-option":"",style:{width:"100%"},placeholder:"选择范围或输入精确scope"},{default:n(()=>[(d(!0),w(N,null,E(y(o),$=>(d(),g(I,{key:$,value:$,label:$},null,8,["value","label"]))),128)),a(I,{value:"*",label:"全部scope(包含该工具源以后新增的scope)"})]),_:2},1032,["modelValue","onUpdate:modelValue"]),e[42]||(e[42]=l("div",{class:"field-note"},"只读工具按范围开放;写操作还需要下方的精确清单。",-1))]),_:2},1024),l("div",Vl,[a(c,{size:"small",disabled:!o.config.provider,loading:o._loading,onClick:$=>We(o)},{default:n(()=>[...e[43]||(e[43]=[m("读取工具目录",-1)])]),_:1},8,["disabled","loading","onClick"]),l("span",null,r(o._loaded?`${o._tools.length} 个已声明工具`:"尚未读取目录,可手工填写已知scope和操作标识"),1)]),o._error?(d(),w("p",$l,r(o._error),1)):U("",!0),o._tools.length?(d(),g(Re,{key:1,data:o._tools,size:"small","max-height":"240",style:{"margin-top":"14px"}},{default:n(()=>[a(B,{label:"业务动作","min-width":"200","show-overflow-tooltip":""},{default:n(({row:$})=>[l("span",null,r($.description||$.name),1),l("div",Cl,r($.name),1)]),_:1}),a(B,{label:"类型",width:"70"},{default:n(({row:$})=>[m(r($.readonly?"查询":"写入"),1)]),_:1}),a(B,{label:"当前配置","min-width":"150"},{default:n(({row:$})=>[m(r(O(o,$)),1)]),_:2},1024)]),_:2},1032,["data"])):U("",!0)]))),128)),a(v,{label:"允许的写操作",class:"write-field"},{default:n(()=>[a(D,{modelValue:x.write_tools,"onUpdate:modelValue":e[14]||(e[14]=o=>x.write_tools=o),multiple:"",filterable:"","allow-create":"","default-first-option":"",style:{width:"100%"},placeholder:"留空时不开放写操作;只接受精确operationId"},{default:n(()=>[(d(!0),w(N,null,E(Ne.value,o=>(d(),g(I,{key:o.name,value:o.name,label:`${o.name} · ${o.scope}${o.confirm_required||o.risk==="high"?" · 原规则需审批":""}`},null,8,["value","label"]))),128))]),_:1},8,["modelValue"]),e[44]||(e[44]=l("div",{class:"field-note"},"不能填写 *。选中的操作仍须通过原 scope、主体、风险与审批规则。",-1))]),_:1}),a(v,{label:"额外要求审批的写操作"},{default:n(()=>[a(D,{modelValue:x.force_approval_tools,"onUpdate:modelValue":e[15]||(e[15]=o=>x.force_approval_tools=o),multiple:"",filterable:"",style:{width:"100%"},placeholder:"可进一步收紧审批要求"},{default:n(()=>[(d(!0),w(N,null,E(x.write_tools,o=>(d(),g(I,{key:o,value:o,label:o},null,8,["value","label"]))),128))]),_:1},8,["modelValue"]),e[45]||(e[45]=l("div",{class:"field-note"},"这里只增加审批要求,不会取消工具本身要求的审批。",-1))]),_:1})]),_:1},8,["disabled"]),a(Ye,null,{default:n(()=>[a(Xe,{title:"高级运行设置",name:"advanced"},{default:n(()=>[a(K,{"label-position":"top",disabled:V.value||!T(z).can("routes:write")},{default:n(()=>[a(v,{label:"每轮主动加载的工具上限"},{default:n(()=>[a(i,{modelValue:L.active_tool_limit,"onUpdate:modelValue":e[16]||(e[16]=o=>L.active_tool_limit=o),min:1,max:12},null,8,["modelValue"])]),_:1}),a(v,{label:"本地编排补充规则"},{default:n(()=>[a(h,{modelValue:L.instructions,"onUpdate:modelValue":e[17]||(e[17]=o=>L.instructions=o),type:"textarea",rows:3,maxlength:"20000"},null,8,["modelValue"]),e[46]||(e[46]=l("div",{class:"field-note"},"延续已有运行规则;系统介绍应填写在上一步。",-1))]),_:1})]),_:1},8,["disabled"])]),_:1})]),_:1})],512),[[Be,J.value===2]]),l("div",Ul,[l("span",null,r(T(z).can("routes:write")?ee.value?"工作空间有未保存修改":"工作空间配置已同步":"当前账号没有工作空间修改权限"),1),a(c,{type:"primary",loading:V.value,disabled:!ee.value||!T(z).can("routes:write"),onClick:Q},{default:n(()=>[...e[49]||(e[49]=[m("保存工作空间",-1)])]),_:1},8,["loading","disabled"])])],64)):U("",!0)])),[[qe,pe.value]]):U("",!0)],64)):U("",!0),de(l("section",hl,[e[53]||(e[53]=l("h3",null,"检查已保存的接入配置",-1)),e[54]||(e[54]=l("p",{class:"description"},"连接配置只包含中枢地址、接入方和工作空间。用户登录后,实际可用工具会按原业务授权确定。",-1)),ve.value||ee.value?(d(),g(p,{key:0,title:"还有未保存的修改。下方状态和连接配置仅反映已保存内容。",type:"warning",closable:!1,"show-icon":""})):U("",!0),l("div",Sl,[e[50]||(e[50]=l("span",null,"接入方",-1)),l("b",null,r((Le=F.value)!=null&&Le.enabled?"已启用":"已停用"),1)]),l("div",xl,[e[51]||(e[51]=l("span",null,"业务授权入口",-1)),l("b",null,r((Me=F.value)!=null&&Me.agent_authorize_url?"已配置":"尚未配置"),1)]),(d(!0),w(N,null,E(ze.value,o=>{var se,$;return d(),w("div",{key:o.route,class:"workspace-result"},[l("div",null,[l("b",null,r(o.name),1),l("code",null,r(o.route),1)]),l("p",null,r(je(o)),1),a(c,{type:"primary",plain:"",size:"small",disabled:!((se=F.value)!=null&&se.enabled)||!(($=F.value)!=null&&$.agent_authorize_url)||!o.enabled||!o.runtime_enabled,onClick:ft=>M("connect",{app_id:k.value.app_id,workspace:o.route})},{default:n(()=>[...e[52]||(e[52]=[m("生成连接配置",-1)])]),_:1},8,["disabled","onClick"])])}),128)),ze.value.length?U("",!0):(d(),g(ue,{key:1,description:"尚无可连接的工作空间。请先保存授权入口配置。","image-size":70})),e[55]||(e[55]=l("p",{class:"field-note"},"系统说明缺失不会阻断已有连接;工具范围与服务可用性将在授权后进一步校验。",-1))],512),[[Be,J.value===3]])],64)):U("",!0)])),[[qe,te.value]])]}),_:1},8,["model-value"])}}}),Nl=Ge(zl,[["__scopeId","data-v-4099c86e"]]),jl={class:"agent-clients-page"},Ol={class:"page-navigation"},Il={class:"actions"},Tl={class:"head"},Al={class:"actions"},Rl={class:"overview"},Bl={class:"metric primary"},El={class:"metric"},Jl={class:"metric"},Pl={class:"metric"},Wl={class:"metric"},ql={class:"section-head"},Dl={key:0,class:"muted"},Ll={class:"stack"},Ml={class:"stack"},Fl={class:"muted"},Hl={class:"tags"},Kl={class:"stack right"},Zl={class:"muted"},Ql={class:"section-head"},Gl={class:"actions"},Xl={class:"stack"},Yl={class:"subject-name"},et={class:"muted"},lt={class:"stack"},tt={class:"stack"},at={class:"muted"},nt={class:"stack"},ot={class:"muted"},st={class:"stack"},it={class:"muted"},ut={key:1,class:"muted"},dt={key:2,class:"pagination"},rt={class:"subject-name"},pt={class:"form-grid"},ct={class:"code-block"},mt={class:"code-block"},Ee=50,vt=Fe({__name:"AgentClients",setup(xe){const ge=al(),A=Qe(),z=nl(),M=C("setup"),ye=C(30),J=C(!1),te=C(!1),ie=C(""),k=C([]),F=le(()=>{const u=z.query.workspace;return typeof u=="string"?k.value.filter(t=>t.allowed_routes.includes("*")||t.allowed_routes.includes(u)):k.value}),we=C([]),P=C([]),W=re({open:!1,appId:"",workspace:""}),R=C([]),j=C(null),pe=C(0),X=C(1),V=re({applications:0,agent_auth_enabled:0,sessions:{},runs:0,conversations:0,failed:0,tool_calls:0,total_tokens:0,failure_rate:0,approvals:{}}),Y=re({client_app_id:"",state:"all"}),b=re({open:!1,app_id:"",name:"",workspace:"",workspaces:[]}),L=le(()=>sl()),S=le(()=>Object.values(V.approvals||{}).reduce((u,t)=>u+Number(t||0),0)),x=le(()=>JSON.stringify({hubUrl:L.value,clientAppId:b.app_id,workspace:b.workspace,connectionName:b.name.trim()||"default"},null,2)),H=le(()=>`/bailinghub connections add ${ae(b.name.trim()||"default")} ${ae(L.value)} ${ae(b.app_id)} ${ae(b.workspace)}`);function ce(u){var y;const t=(y=u.subject_display)==null?void 0:y.name;return u.subject_display_status==="provided"&&typeof t=="string"?t:""}function ae(u){return JSON.stringify(u)}function f(u){return new Intl.NumberFormat("zh-CN").format(Number(u||0))}function Pe(u){return`${(Number(u||0)*100).toFixed(1)}%`}function q(u){return u?`${u.slice(0,8)}…${u.slice(-4)}`:"—"}function me(u){return u?new Date(u).toLocaleString("zh-CN",{hour12:!1}):"从未"}function ve(u){return u==="active"?"有效":u==="expired"?"已过期":"已撤销"}function ke(u){return u==="active"?"success":u==="expired"?"warning":"info"}function ze(u){return u.includes("*")?["全部 Workspace"]:u.slice(0,4)}function Ve(u){return P.value.filter(t=>u.allowed_routes.includes("*")||u.allowed_routes.includes(t.route))}function be(u){return Ve(u).filter(t=>t.enabled&&t.runtime_enabled)}function ee(u){return u.enabled&&u.agent_auth_enabled&&be(u).length>0}function Ne(u){if(!u.enabled)return"接入方已停用,需先恢复接入";if(!u.agent_auth_enabled)return"尚未配置业务授权入口";const t=Ve(u);if(!t.length)return"尚未关联现有工作空间";const y=t.filter(O=>O.enabled&&O.runtime_enabled);return y.length?y.some(O=>O.direct_enabled)?y.some(O=>O.direct_enabled&&O.source_count)?y.some(O=>!O.system_info_configured)?"建议补充系统说明,帮助智能体首次选择目标":"连接与工具通道已配置;实际可用动作以业务授权为准":"工具通道已开启;尚需配置业务工具源":"连接入口已准备好;业务工具调用尚未开启":"尚无已启用本地智能体的工作空间"}function je(u,t=""){W.appId=u.app_id,W.workspace=t,W.open=!0}function ne(u){const t=k.value.find(y=>y.app_id===u.app_id);t&&(he(t),b.workspace=u.workspace)}async function $e(){J.value=!0;try{const u=await Je(`/admin/api/agent-clients/overview?days=${ye.value}`);if(!u.ok)throw new Error((await u.json().catch(()=>({}))).error||"加载失败");const t=await u.json();k.value=t.applications||[],we.value=t.workspaces||[],P.value=t.setup_workspaces||[],Object.assign(V,t.summary||{})}catch(u){Z.error(u instanceof Error?u.message:"加载智能体客户端失败")}finally{J.value=!1}}async function oe(){te.value=!0;try{const u=new URLSearchParams({state:Y.state,limit:String(Ee),offset:String((X.value-1)*Ee)});Y.client_app_id&&u.set("client_app_id",Y.client_app_id);const t=await Je(`/admin/api/agent-clients/sessions?${u}`);if(!t.ok)throw new Error((await t.json().catch(()=>({}))).error||"加载失败");const y=await t.json();R.value=y.list||[],pe.value=Number(y.total||0)}catch(u){Z.error(u instanceof Error?u.message:"加载授权设备失败")}finally{te.value=!1}}async function Ce(){await Promise.all([$e(),oe()])}async function Ue(){X.value=1,await oe()}function he(u){var y;const t=be(u);b.app_id=u.app_id,b.name=u.app_id.replace(/[^a-zA-Z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")||"default",b.workspaces=t,b.workspace=((y=t[0])==null?void 0:y.route)||"",b.open=!0}async function Oe(u){await navigator.clipboard.writeText(u),Z.success("已复制")}async function Ie(u){await Ze.confirm(`撤销设备“${u.device_label||q(u.session_id)}”的 Agent Session?撤销后需要重新登录授权。`,"远程撤销",{type:"warning",confirmButtonText:"确认撤销"}),ie.value=u.session_id;try{const t=await Je(`/admin/api/agent-clients/sessions/${u.session_id}/revoke`,{method:"POST"});if(!t.ok)throw new Error((await t.json().catch(()=>({}))).error||"撤销失败");Z.success("Agent Session 已撤销"),await Ce()}catch(t){Z.error(t instanceof Error?t.message:"撤销失败")}finally{ie.value=""}}return tl(async()=>{await Ce();const u=typeof z.query.workspace=="string"?z.query.workspace:"",t=typeof z.query.app=="string"?z.query.app:"",y=k.value.filter(O=>t?O.app_id===t:u&&(O.allowed_routes.includes("*")||O.allowed_routes.includes(u)));y.length===1&&je(y[0],u)}),(u,t)=>{const y=_("el-button"),O=_("el-radio-button"),We=_("el-radio-group"),Q=_("el-option"),fe=_("el-select"),_e=_("el-card"),Se=_("el-empty"),s=_("el-table-column"),e=_("el-tag"),c=_("el-tooltip"),p=_("el-table"),h=_("el-pagination"),v=_("el-descriptions-item"),G=_("el-descriptions"),I=_("el-dialog"),D=_("el-alert"),K=_("el-input"),ue=_("el-form-item"),Te=_("el-form"),Ae=Ke("loading");return d(),w("div",jl,[l("div",Ol,[t[19]||(t[19]=l("div",null,[l("b",null,"本地智能体"),l("span",null,"配置接入与管理授权设备")],-1)),l("div",Il,[T(A).can("clients:read")&&T(A).hasModule("agent-tasks")?(d(),g(y,{key:0,onClick:t[0]||(t[0]=i=>T(ge).push("/agent-tasks"))},{default:n(()=>[...t[16]||(t[16]=[m("任务控制",-1)])]),_:1})):U("",!0),a(We,{modelValue:M.value,"onUpdate:modelValue":t[1]||(t[1]=i=>M.value=i)},{default:n(()=>[a(O,{value:"setup"},{default:n(()=>[...t[17]||(t[17]=[m("接入配置",-1)])]),_:1}),a(O,{value:"activity"},{default:n(()=>[...t[18]||(t[18]=[m("设备与运行",-1)])]),_:1})]),_:1},8,["modelValue"])])]),M.value==="activity"?(d(),g(_e,{key:0,shadow:"never"},{header:n(()=>[l("div",Tl,[l("div",null,[t[21]||(t[21]=l("b",null,"智能体客户端",-1)),a(ol,{title:"和执行器有什么区别"},{default:n(()=>[...t[20]||(t[20]=[l("p",null,[l("b",null,"智能体客户端"),m("在本地理解用户意图、选择能力并完成多步编排;中枢继续负责业务身份、授权、审批、执行与审计。")],-1),l("p",null,[l("b",null,"执行器"),m("是中枢下发 Job、由本地运行时执行本地任务后回报结果。两者是独立概念。")],-1),l("p",null,"在“配置接入”中集中设置授权入口、系统说明和工具范围;设置仍保存在原接入方与业务路由中。",-1),l("p",null,"每个接入方只配置一个不绑定账号、租户或门店的业务授权入口;账号切换与租户选择由业务授权页完成。",-1)])]),_:1})]),l("div",Al,[a(fe,{modelValue:ye.value,"onUpdate:modelValue":t[2]||(t[2]=i=>ye.value=i),size:"small",style:{width:"108px"},onChange:$e},{default:n(()=>[a(Q,{value:7,label:"近 7 天"}),a(Q,{value:30,label:"近 30 天"}),a(Q,{value:90,label:"近 90 天"})]),_:1},8,["modelValue"]),a(y,{size:"small",loading:J.value,onClick:Ce},{default:n(()=>[...t[22]||(t[22]=[m("刷新",-1)])]),_:1},8,["loading"])])])]),default:n(()=>{var i,B;return[de((d(),w("div",Rl,[l("div",Bl,[t[23]||(t[23]=l("span",null,"客户端应用",-1)),l("b",null,r(f(V.agent_auth_enabled)),1),l("em",null,"共 "+r(f(V.applications))+" 个接入方",1)]),l("div",El,[t[24]||(t[24]=l("span",null,"有效授权设备",-1)),l("b",null,r(f((i=V.sessions)==null?void 0:i.active)),1),l("em",null,"总会话 "+r(f((B=V.sessions)==null?void 0:B.total)),1)]),l("div",Jl,[t[25]||(t[25]=l("span",null,"Agent Run",-1)),l("b",null,r(f(V.runs)),1),l("em",null,r(f(V.conversations))+" 个本地会话",1)]),l("div",Pl,[t[26]||(t[26]=l("span",null,"工具调用",-1)),l("b",null,r(f(V.tool_calls)),1),l("em",null,"审批 "+r(f(S.value))+" 次",1)]),l("div",Wl,[t[27]||(t[27]=l("span",null,"累计 Token",-1)),l("b",null,r(f(V.total_tokens)),1),t[28]||(t[28]=l("em",null,"由客户端公开 usage 汇总",-1))]),l("div",{class:He(["metric",{danger:Number(V.failure_rate||0)>.1}])},[t[29]||(t[29]=l("span",null,"失败率",-1)),l("b",null,r(Pe(V.failure_rate)),1),l("em",null,r(f(V.failed))+" 个失败或取消",1)],2)])),[[Ae,J.value]])]}),_:1})):U("",!0),M.value==="setup"?(d(),g(_e,{key:1,shadow:"never",class:"setup-intro"},{default:n(()=>[...t[30]||(t[30]=[l("div",null,[l("span",{class:"intro-kicker"},"从接入到业务操作"),l("h2",null,"把一个业务系统接给本地智能体"),l("p",null,"选中下方应用,按顺序完成授权入口、系统说明和工具范围。连接、业务授权与实际执行分别检查。")],-1),l("div",{class:"intro-flow"},[l("span",null,"1 授权入口"),l("i",null,"→"),l("span",null,"2 系统说明"),l("i",null,"→"),l("span",null,"3 工具与审批"),l("i",null,"→"),l("span",null,"4 检查连接")],-1)])]),_:1})):U("",!0),M.value==="setup"?(d(),g(_e,{key:2,shadow:"never"},{header:n(()=>[l("div",ql,[t[32]||(t[32]=l("div",null,[l("b",null,"业务系统接入"),l("span",null,"在一个入口完成本地智能体配置;授权记录与用量请切换到“设备与运行”。")],-1)),a(y,{size:"small",onClick:t[3]||(t[3]=i=>T(ge).push("/clients"))},{default:n(()=>[...t[31]||(t[31]=[m("新建接入方",-1)])]),_:1})])]),default:n(()=>[T(z).query.workspace?(d(),w("p",Dl,[m("以下为允许使用工作空间 "+r(T(z).query.workspace)+" 的接入方,请选择要配置的应用。",1),a(y,{link:"",onClick:t[4]||(t[4]=i=>T(ge).replace("/agent-clients"))},{default:n(()=>[...t[33]||(t[33]=[m("显示全部",-1)])]),_:1})])):U("",!0),F.value.length?(d(),g(p,{key:2,data:F.value,size:"small"},{default:n(()=>[a(s,{label:"应用",width:180},{default:n(({row:i})=>[l("div",Ll,[l("b",null,r(i.name||i.app_id),1),l("code",null,r(i.app_id),1)])]),_:1}),a(s,{label:"接入配置状态","min-width":270},{default:n(({row:i})=>[l("div",Ml,[l("div",null,[a(e,{size:"small",effect:"plain",type:ee(i)?"success":"warning"},{default:n(()=>[m(r(ee(i)?"连接条件已配置":"待完成配置"),1)]),_:2},1032,["type"])]),l("span",Fl,r(Ne(i)),1)])]),_:1}),a(s,{label:"工作空间",width:180},{default:n(({row:i})=>[l("div",Hl,[(d(!0),w(N,null,E(ze(i.allowed_routes),B=>(d(),g(e,{key:B,size:"small",effect:"plain",type:"info"},{default:n(()=>[m(r(B),1)]),_:2},1024))),128))])]),_:1}),a(s,{label:"近期开销",width:150,align:"right"},{default:n(({row:i})=>[l("div",Kl,[l("span",null,r(f(i.stats.runs))+" Run / "+r(f(i.stats.tool_calls))+" 调用",1),l("span",Zl,r(f(i.stats.total_tokens))+" Token",1)])]),_:1}),a(s,{width:210,align:"right"},{default:n(({row:i})=>[a(y,{size:"small",type:"primary",plain:"",onClick:B=>je(i)},{default:n(()=>[...t[34]||(t[34]=[m("配置接入",-1)])]),_:1},8,["onClick"]),a(c,{content:ee(i)?"复制公开连接信息,随后在客户端登录授权":Ne(i)},{default:n(()=>[l("span",null,[a(y,{link:"",disabled:!ee(i),onClick:B=>he(i)},{default:n(()=>[...t[35]||(t[35]=[m("连接配置",-1)])]),_:1},8,["disabled","onClick"])])]),_:2},1032,["content"])]),_:1})]),_:1},8,["data"])):(d(),g(Se,{key:1,description:"当前没有匹配的接入方,请先创建接入方并关联工作空间。"}))]),_:1})):U("",!0),M.value==="activity"?(d(),g(_e,{key:3,shadow:"never"},{header:n(()=>[l("div",Ql,[t[36]||(t[36]=l("div",null,[l("b",null,"业务授权与设备"),l("span",null,"授权名称由业务系统同步;设备名称用于区分使用端。远程撤销后需要重新登录授权。")],-1)),l("div",Gl,[a(fe,{modelValue:Y.client_app_id,"onUpdate:modelValue":t[5]||(t[5]=i=>Y.client_app_id=i),clearable:"",filterable:"",size:"small",placeholder:"全部应用",style:{width:"190px"},onChange:Ue},{default:n(()=>[(d(!0),w(N,null,E(k.value,i=>(d(),g(Q,{key:i.app_id,label:i.name||i.app_id,value:i.app_id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),a(fe,{modelValue:Y.state,"onUpdate:modelValue":t[6]||(t[6]=i=>Y.state=i),size:"small",style:{width:"112px"},onChange:Ue},{default:n(()=>[a(Q,{value:"all",label:"全部状态"}),a(Q,{value:"active",label:"有效"}),a(Q,{value:"expired",label:"已过期"}),a(Q,{value:"revoked",label:"已撤销"})]),_:1},8,["modelValue"])])])]),default:n(()=>[R.value.length?de((d(),g(p,{key:1,data:R.value,size:"small","row-key":"session_id"},{default:n(()=>[a(s,{label:"授权名称","min-width":180},{default:n(({row:i})=>[l("div",Xl,[l("b",Yl,r(ce(i)||"待同步"),1),l("span",et,r(ce(i)?"业务系统提供":"业务系统尚未提供名称"),1)])]),_:1}),a(s,{label:"设备",width:170},{default:n(({row:i})=>[l("div",lt,[l("b",null,r(i.device_label||"未命名设备"),1),l("code",null,r(q(i.session_id)),1)])]),_:1}),a(s,{label:"业务主体",width:150},{default:n(({row:i})=>{var B,Re;return[l("div",tt,[l("span",null,r(((B=i.principal)==null?void 0:B.id)||i.on_behalf_of),1),l("span",at,r(((Re=i.principal)==null?void 0:Re.tenant)||"未声明租户"),1)])]}),_:1}),a(s,{label:"应用 / Workspace","min-width":190},{default:n(({row:i})=>[l("div",nt,[l("code",null,r(i.client_app_id),1),l("span",ot,r((i.allowed_routes||[]).join("、")||"无可用路由"),1)])]),_:1}),a(s,{label:"活跃与有效期",width:185},{default:n(({row:i})=>[l("div",st,[l("span",null,"活跃 "+r(me(i.last_seen_at)),1),l("span",it,"到期 "+r(me(i.refresh_expires_at)),1)])]),_:1}),a(s,{label:"状态",width:80},{default:n(({row:i})=>[a(e,{size:"small",effect:"plain",type:ke(i.state)},{default:n(()=>[m(r(ve(i.state)),1)]),_:2},1032,["type"])]),_:1}),a(s,{width:130,align:"right"},{default:n(({row:i})=>[a(y,{link:"",onClick:B=>j.value=i},{default:n(()=>[...t[37]||(t[37]=[m("详情",-1)])]),_:1},8,["onClick"]),i.state!=="revoked"?(d(),g(y,{key:0,link:"",type:"danger",loading:ie.value===i.session_id,onClick:B=>Ie(i)},{default:n(()=>[...t[38]||(t[38]=[m("远程撤销",-1)])]),_:1},8,["loading","onClick"])):(d(),w("span",ut,"已处理"))]),_:1})]),_:1},8,["data"])),[[Ae,te.value]]):(d(),g(Se,{key:0,description:"当前筛选下没有 Agent Session"})),pe.value>Ee?(d(),w("div",dt,[a(h,{"current-page":X.value,"onUpdate:currentPage":t[7]||(t[7]=i=>X.value=i),"page-size":Ee,total:pe.value,layout:"prev, pager, next, total",onCurrentChange:oe},null,8,["current-page","total"])])):U("",!0)]),_:1})):U("",!0),a(I,{"model-value":!!j.value,title:"业务授权详情",width:"min(640px, 94vw)","onUpdate:modelValue":t[8]||(t[8]=i=>{i||(j.value=null)})},{default:n(()=>[j.value?(d(),w(N,{key:0},[a(G,{column:1,border:""},{default:n(()=>[a(v,{label:"授权名称"},{default:n(()=>[l("span",rt,r(ce(j.value)||"待同步"),1)]),_:1}),a(v,{label:"名称来源"},{default:n(()=>[m(r(ce(j.value)?"业务系统提供":"业务系统尚未提供;旧授权可由原业务系统同步名称"),1)]),_:1}),a(v,{label:"设备名称"},{default:n(()=>[m(r(j.value.device_label||"未命名设备"),1)]),_:1}),a(v,{label:"接入应用"},{default:n(()=>[l("code",null,r(j.value.client_app_id),1)]),_:1}),a(v,{label:"授权记录"},{default:n(()=>[l("code",null,r(j.value.session_id),1)]),_:1}),a(v,{label:"业务主体"},{default:n(()=>{var i;return[m(r(((i=j.value.principal)==null?void 0:i.id)||j.value.on_behalf_of),1)]}),_:1}),a(v,{label:"租户"},{default:n(()=>{var i;return[m(r(((i=j.value.principal)==null?void 0:i.tenant)||"未声明租户"),1)]}),_:1}),a(v,{label:"工作空间"},{default:n(()=>[m(r(j.value.allowed_routes.join("、")),1)]),_:1}),a(v,{label:"状态"},{default:n(()=>[m(r(ve(j.value.state)),1)]),_:1})]),_:1}),t[39]||(t[39]=l("p",{class:"connection-note"},"名称只帮助识别授权。相同名称可能对应不同授权,权限、会话范围和执行记录仍按原授权绑定。名称更新不修改历史对话中的标签。",-1))],64)):U("",!0)]),_:1},8,["model-value"]),a(Nl,{modelValue:W.open,"onUpdate:modelValue":t[9]||(t[9]=i=>W.open=i),"app-id":W.appId,"initial-workspace":W.workspace,workspaces:P.value,onSaved:$e,onConnect:ne},null,8,["modelValue","app-id","initial-workspace","workspaces"]),a(I,{modelValue:b.open,"onUpdate:modelValue":t[15]||(t[15]=i=>b.open=i),title:"生成智能体客户端连接配置",width:"620px"},{footer:n(()=>[a(y,{onClick:t[12]||(t[12]=i=>b.open=!1)},{default:n(()=>[...t[40]||(t[40]=[m("关闭",-1)])]),_:1}),a(y,{onClick:t[13]||(t[13]=i=>Oe(x.value))},{default:n(()=>[...t[41]||(t[41]=[m("复制 JSON",-1)])]),_:1}),a(y,{type:"primary",onClick:t[14]||(t[14]=i=>Oe(H.value))},{default:n(()=>[...t[42]||(t[42]=[m("复制 DSH 命令",-1)])]),_:1})]),default:n(()=>[a(D,{type:"info",closable:!1,"show-icon":"",title:"这里只生成公开连接元数据,不包含业务 URL、业务身份、Client Token、Agent Token 或模型密钥。"}),t[43]||(t[43]=l("p",{class:"connection-note"},[l("code",null,"connectionName"),m(" 只是本机连接选择器。登录时会统一打开接入方配置的业务授权页,由该页面确认当前账号与租户。")],-1)),a(Te,{"label-position":"top",class:"connection-form"},{default:n(()=>[a(ue,{label:"Hub 地址"},{default:n(()=>[a(K,{"model-value":L.value,readonly:"",class:"mono"},null,8,["model-value"])]),_:1}),l("div",pt,[a(ue,{label:"Client App ID"},{default:n(()=>[a(K,{"model-value":b.app_id,readonly:"",class:"mono"},null,8,["model-value"])]),_:1}),a(ue,{label:"Connection Name"},{default:n(()=>[a(K,{modelValue:b.name,"onUpdate:modelValue":t[10]||(t[10]=i=>b.name=i),maxlength:"128",class:"mono"},null,8,["modelValue"])]),_:1})]),a(ue,{label:"Workspace"},{default:n(()=>[a(fe,{modelValue:b.workspace,"onUpdate:modelValue":t[11]||(t[11]=i=>b.workspace=i),style:{width:"100%"}},{default:n(()=>[(d(!0),w(N,null,E(b.workspaces,i=>(d(),g(Q,{key:i.route,label:i.name+"("+i.route+")",value:i.route},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l("div",ct,[l("pre",null,r(x.value),1)]),l("div",mt,[l("pre",null,r(H.value),1)])]),_:1},8,["modelValue"])])}}}),kt=Ge(vt,[["__scopeId","data-v-dce97866"]]);export{kt as default};
|
|
1
|
+
import{d as Fe,n as ll,I as g,J as n,ai as _,o as d,K as de,c as w,e as l,Q as r,S as a,P as m,O as U,R as N,a3 as E,L as He,u as T,U as Be,r as C,q as re,m as le,as as Ke,z as tl,aC as al,aB as nl}from"./vendor-vue-Co7x2FW6.js";import{aj as Ze,E as Z}from"./vendor-element-8cVcdt5T.js";import{H as ol}from"./HelpTip-Dtdt2tKR.js";import{u as Qe,k as Je,c as sl}from"./index-CK0ZCTZv.js";import{_ as Ge}from"./_plugin-vue_export-helper-DlAUqK2U.js";const il={class:"setup-panel"},ul={class:"setup-header"},dl={class:"setup-steps","aria-label":"接入配置步骤"},rl=["disabled","onClick"],pl={class:"setup-section"},cl={class:"section-footer"},ml={class:"workspace-selector"},vl={key:2},fl={class:"setup-section"},_l={class:"model-preview"},bl={class:"setup-section"},gl={class:"field-note"},yl={class:"source-heading"},wl={key:2,class:"inline-error"},kl={class:"source-top"},Vl={class:"catalog-action"},$l={key:0,class:"inline-error"},Cl={class:"field-note"},Ul={class:"section-footer"},hl={class:"setup-section"},Sl={class:"check-item"},xl={class:"check-item"},zl=Fe({__name:"AgentSetupPanel",props:{modelValue:{type:Boolean},appId:{},workspaces:{},initialWorkspace:{}},emits:["update:modelValue","saved","connect"],setup(xe,{emit:ge}){const A=xe,z=Qe(),M=ge,ye=["授权入口","系统说明","工具与审批","检查连接"],J=C(0),te=C(!1),ie=C(""),k=C(null),F=C(null),we=C(""),P=C(!1),W=C(""),R=C(null),j=C(""),pe=C(!1),X=C(""),V=C(!1),Y=C([]),b=re({enabled:!1,bucket:"",max_bytes:6291456,allowed_mimes:["image/png","image/jpeg","image/webp"]}),L=re({enabled:!1,instructions:"",active_tool_limit:8}),S=re({name:"",summary:"",domains:[],boundaries:[]}),x=re({enabled:!1,write_tools:[],force_approval_tools:[]}),H=C([]),ce=C([]),ae=C("");let f=0,Pe=0;const q=s=>JSON.parse(JSON.stringify(s)),me=()=>{var s;return k.value?{enabled:k.value.enabled,agent_authorize_url:((s=k.value.agent_authorize_url)==null?void 0:s.trim())||null,allowed_routes:k.value.allowed_routes}:null},ve=le(()=>!!k.value&&JSON.stringify(me())!==we.value),ke=le(()=>A.workspaces.filter(s=>{var e,c;return((e=k.value)==null?void 0:e.allowed_routes.includes("*"))||((c=k.value)==null?void 0:c.allowed_routes.includes(s.route))})),ze=le(()=>A.workspaces.filter(s=>{var e,c;return((e=F.value)==null?void 0:e.allowed_routes.includes("*"))||((c=F.value)==null?void 0:c.allowed_routes.includes(s.route))})),Ve=()=>!!(S.name||S.summary||S.domains.length||S.boundaries.length);function be(){var c,p,h,v;const s={...((c=R.value)==null?void 0:c.agent_client)||{},...L};(b.enabled||(h=(p=R.value)==null?void 0:p.agent_client)!=null&&h.artifact_upload)&&(s.artifact_upload={...q(b),bucket:b.bucket||void 0}),Ve()?s.system_info=q(S):delete s.system_info;const e={...((v=R.value)==null?void 0:v.agent_direct)||{},enabled:x.enabled};return delete e.unattended_write_tools,x.write_tools.length?e.write_tools=[...x.write_tools]:delete e.write_tools,x.force_approval_tools.length?e.force_approval_tools=[...x.force_approval_tools]:delete e.force_approval_tools,{agent_client:s,agent_direct:e,tool_sources:H.value.map(G=>q(G.config))}}const ee=le(()=>!!R.value&&JSON.stringify(be())!==j.value),Ne=le(()=>{const s=new Map;for(const e of H.value)for(const c of e._tools)!c.readonly&&(e.config.allow.includes("*")||e.config.allow.includes(c.scope))&&s.set(c.name,c);return[...s.values()]});function je(s){return s.enabled?s.runtime_enabled?s.direct_enabled?s.source_count?`连接与工具通道已配置${s.system_info_configured?"":";建议补充系统说明"}`:"工具调用已开启;尚未关联工具源":"可配置连接;业务工具调用尚未开启":"尚未启用本地智能体":"工作空间已停用"}async function ne(s,e){const c=await Je(s,e),p=await c.json().catch(()=>({}));if(!c.ok)throw c.status===409?new Error("配置已被其他操作更新。请关闭面板后重新打开,核对最新配置再保存。"):c.status===403?new Error("当前账号没有这部分配置的读取或修改权限,请联系中枢管理员。"):p.error==="agent_setup_unsupported"?new Error("当前宿主尚不支持集中保存,请升级配套宿主后再试。"):new Error(p.error||"请求失败,请稍后重试");return p}async function $e(){Se();const s=++f;te.value=!0;try{const e=await ne(`/admin/api/clients/${encodeURIComponent(A.appId)}/agent-setup`);if(s!==f||!A.modelValue)return;k.value=q(e),F.value=q(e),we.value=JSON.stringify(me());const c=A.initialWorkspace&&ke.value.find(p=>p.route===A.initialWorkspace);c&&(J.value=1,await Ue(c.route))}catch(e){s===f&&(ie.value=oe(e))}finally{s===f&&(te.value=!1)}}function oe(s){return s instanceof Error?s.message:"操作失败"}async function Ce(){var p;if(!k.value||P.value||V.value||!z.can("clients:write"))return;const s=f,e=k.value.app_id,c=q({expected_revision:k.value.revision,...me()});P.value=!0;try{const h=await ne(`/admin/api/clients/${encodeURIComponent(e)}/agent-setup`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)});if(s!==f||((p=k.value)==null?void 0:p.app_id)!==e||!A.modelValue)return;k.value=q(h),F.value=q(h),we.value=JSON.stringify(me()),M("saved"),Z.success("授权入口已保存")}catch(h){s===f&&Z.error(oe(h))}finally{s===f&&(P.value=!1)}}async function Ue(s){if(P.value||V.value||ee.value&&!await fe())return;const e=++f;W.value=s,R.value=null,j.value="",X.value="",pe.value=!0;try{const c=await ne(`/admin/api/routes/${encodeURIComponent(s)}/agent-setup`);if(e!==f||!A.modelValue)return;he(c),Oe(e),z.can("storage:read")&&ne("/admin/api/storage-buckets").then(p=>{e===f&&(Y.value=p.map(h=>({name:h.name,kind:h.kind,enabled:h.enabled})))}).catch(()=>{})}catch(c){e===f&&(X.value=oe(c))}finally{e===f&&(pe.value=!1,te.value=!1)}}function he(s){var p,h,v,G,I,D;R.value=s,Object.assign(b,{enabled:!1,bucket:"",max_bytes:6291456,allowed_mimes:["image/png","image/jpeg","image/webp"]},q(((p=s.agent_client)==null?void 0:p.artifact_upload)||{})),Object.assign(L,{enabled:((h=s.agent_client)==null?void 0:h.enabled)??((v=s.agent_direct)==null?void 0:v.enabled)===!0,instructions:((G=s.agent_client)==null?void 0:G.instructions)||"",active_tool_limit:((I=s.agent_client)==null?void 0:I.active_tool_limit)||8}),Object.assign(S,q(((D=s.agent_client)==null?void 0:D.system_info)||{name:"",summary:"",domains:[],boundaries:[]}));const e=s.agent_direct||{},c=e.write_tools||[];Object.assign(x,{enabled:e.enabled===!0,write_tools:[...c],force_approval_tools:[...e.force_approval_tools||(Array.isArray(e.unattended_write_tools)?c.filter(K=>!e.unattended_write_tools.includes(K)):[])]}),H.value=(s.tool_sources||[]).map(K=>Ie(K)),j.value=JSON.stringify(be())}async function Oe(s){ae.value="";try{const e=await ne("/admin/api/tool-providers");s===f&&(ce.value=e)}catch{s===f&&(ae.value="暂时无法读取工具源目录。现有配置保留,也可以手工填写已登记的工具源标识。")}}function Ie(s={}){return{config:{...q(s),provider:s.provider||"",allow:[...s.allow||[]]},_key:++Pe,_tools:[],_loaded:!1,_loading:!1,_error:""}}function u(){H.value.push(Ie())}function t(s){s._tools=[],s._loaded=!1,s._error=""}function y(s){return[...new Set(s._tools.map(e=>e.scope))]}function O(s,e){return!s.config.allow.includes("*")&&!s.config.allow.includes(e.scope)?"范围未包含":e.readonly?"已纳入查询范围":x.write_tools.includes(e.name)?"已列入写操作清单":"未开放写入"}async function We(s){const e=s.config.provider,c=f;s._loading=!0,s._error="";try{const p=await ne(`/admin/api/tool-providers/${encodeURIComponent(e)}/tools`);if(c!==f||s.config.provider!==e||!H.value.includes(s))return;s._tools=p.tools||[];const h=Array.isArray(p.skipped)?p.skipped.length:Number(p.skipped||0),v=[p.note,h?`${h} 个声明未通过编译`:"",Array.isArray(p.warnings)&&p.warnings.length?`${p.warnings.length} 项目录提醒`:""].filter(Boolean);s._loaded=!p.note,s._error=v.join(";")}catch(p){c===f&&s.config.provider===e&&(s._error=`${oe(p)};这不代表该工具源没有能力。`)}finally{s._loading=!1}}async function Q(){if(!R.value||P.value||V.value||!z.can("routes:write"))return;if(Ve()&&(!S.name.trim()||!S.summary.trim())){Z.warning("填写系统说明时,系统名称和一句话介绍都需要提供。");return}if(S.domains.some(p=>!p.trim()||p.length>120)||S.boundaries.some(p=>!p.trim()||p.length>160)){Z.warning("业务方向每项不超过120字,系统边界每项不超过160字。");return}if([...x.write_tools,...x.force_approval_tools].some(p=>!/^[A-Za-z_][A-Za-z0-9_]*$/.test(p))||x.force_approval_tools.some(p=>!x.write_tools.includes(p))){Z.warning("写操作需要精确operationId;额外审批只能选择已允许的写操作。");return}const s=f,e=W.value,c=q({expected_revision:R.value.revision,...be()});V.value=!0;try{const p=await ne(`/admin/api/routes/${encodeURIComponent(e)}/agent-setup`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)});if(s!==f||W.value!==e||!A.modelValue)return;he(p),M("saved"),Z.success("工作空间配置已保存")}catch(p){s===f&&Z.error(oe(p))}finally{s===f&&(V.value=!1)}}async function fe(){try{return await Ze.confirm("有未保存的修改,离开会放弃这些修改。","离开配置",{confirmButtonText:"放弃修改",cancelButtonText:"继续编辑",type:"warning"}),!0}catch{return!1}}async function _e(s){P.value||V.value||(ve.value||ee.value)&&!await fe()||(M("update:modelValue",!1),s())}function Se(){f++,P.value=!1,V.value=!1,J.value=0,k.value=null,F.value=null,R.value=null,W.value="",H.value=[],ie.value="",X.value="",te.value=!1}return ll(()=>[A.modelValue,A.appId],()=>{A.modelValue&&A.appId&&$e()}),(s,e)=>{const c=_("el-button"),p=_("el-alert"),h=_("el-input"),v=_("el-form-item"),G=_("el-switch"),I=_("el-option"),D=_("el-select"),K=_("el-form"),ue=_("el-empty"),Te=_("el-divider"),Ae=_("router-link"),i=_("el-input-number"),B=_("el-table-column"),Re=_("el-table"),Xe=_("el-collapse-item"),Ye=_("el-collapse"),el=_("el-drawer"),qe=Ke("loading");return d(),g(el,{"model-value":xe.modelValue,size:"min(1080px, 96vw)","with-header":!1,"before-close":_e,onClosed:Se},{default:n(()=>{var De,Le,Me;return[de((d(),w("div",il,[l("header",ul,[l("div",null,[e[18]||(e[18]=l("span",{class:"eyebrow"},"本地智能体接入",-1)),l("h2",null,r(((De=k.value)==null?void 0:De.name)||"配置接入"),1),e[19]||(e[19]=l("p",null,"在这里完成授权入口、系统介绍与工具范围配置。",-1))]),a(c,{onClick:e[0]||(e[0]=o=>_e(()=>M("update:modelValue",!1)))},{default:n(()=>[...e[20]||(e[20]=[m("关闭",-1)])]),_:1})]),ie.value?(d(),g(p,{key:0,type:"error",title:ie.value,closable:!1,"show-icon":""},null,8,["title"])):U("",!0),k.value?(d(),w(N,{key:1},[l("nav",dl,[(d(),w(N,null,E(ye,(o,se)=>l("button",{key:o,class:He({active:J.value===se}),disabled:P.value||V.value,onClick:$=>J.value=se},[l("span",null,r(se+1),1),m(r(o),1)],10,rl)),64))]),de(l("section",pl,[e[25]||(e[25]=l("h3",null,"让用户通过业务系统确认身份",-1)),e[26]||(e[26]=l("p",{class:"description"},"复用当前接入方。账号、租户和业务权限仍由业务授权页确认。",-1)),T(z).can("clients:write")?U("",!0):(d(),g(p,{key:0,type:"info",closable:!1,title:"当前账号可查看授权入口,保存需要接入方管理权限。"})),a(K,{"label-position":"top",disabled:P.value||!T(z).can("clients:write")},{default:n(()=>[a(v,{label:"接入方标识"},{default:n(()=>[a(h,{"model-value":k.value.app_id,readonly:""},null,8,["model-value"])]),_:1}),a(v,{label:"允许此接入方连接中枢"},{default:n(()=>[a(G,{modelValue:k.value.enabled,"onUpdate:modelValue":e[1]||(e[1]=o=>k.value.enabled=o)},null,8,["modelValue"]),e[21]||(e[21]=l("span",{class:"inline-note"},"停用会影响此接入方的其他入口。",-1))]),_:1}),a(v,{label:"业务授权入口"},{default:n(()=>[a(h,{modelValue:k.value.agent_authorize_url,"onUpdate:modelValue":e[2]||(e[2]=o=>k.value.agent_authorize_url=o),placeholder:"https://business.example.com/agent/authorize",maxlength:"2048"},null,8,["modelValue"]),e[22]||(e[22]=l("div",{class:"field-note"},"填写业务系统提供的固定 HTTPS 地址。用户将在该页面登录并确认本次授权。",-1))]),_:1}),a(v,{label:"允许连接的工作空间"},{default:n(()=>[a(D,{modelValue:k.value.allowed_routes,"onUpdate:modelValue":e[3]||(e[3]=o=>k.value.allowed_routes=o),multiple:"",filterable:"","allow-create":"","default-first-option":"",style:{width:"100%"},placeholder:"选择已存在的工作空间"},{default:n(()=>[(d(!0),w(N,null,E(xe.workspaces,o=>(d(),g(I,{key:o.route,label:`${o.name} · ${o.route}`,value:o.route},null,8,["label","value"]))),128)),a(I,{value:"*",label:"所有工作空间(包含以后新增的空间)"})]),_:1},8,["modelValue"]),e[23]||(e[23]=l("div",{class:"field-note"},"工作空间对应中枢现有业务路由。这里限定接入范围,不授予业务账号额外权限。",-1))]),_:1})]),_:1},8,["disabled"]),l("div",cl,[l("span",null,r(ve.value?"授权入口有未保存修改":"授权入口配置已同步"),1),a(c,{type:"primary",loading:P.value,disabled:!ve.value||!T(z).can("clients:write"),onClick:Ce},{default:n(()=>[...e[24]||(e[24]=[m("保存授权入口",-1)])]),_:1},8,["loading","disabled"])])],512),[[Be,J.value===0]]),J.value===1||J.value===2?(d(),w(N,{key:0},[l("div",ml,[e[27]||(e[27]=l("div",null,[l("b",null,"配置哪个工作空间"),l("p",null,"以下设置保存在原业务路由中,使用同一路由的接入方会共享这些设置。")],-1)),a(D,{"model-value":W.value,disabled:P.value||V.value,filterable:"",placeholder:"选择一个工作空间",onChange:Ue},{default:n(()=>[(d(!0),w(N,null,E(ke.value,o=>(d(),g(I,{key:o.route,label:`${o.name} · ${o.route}`,value:o.route},null,8,["label","value"]))),128))]),_:1},8,["model-value","disabled"])]),X.value?(d(),g(p,{key:0,type:"error",title:X.value,closable:!1,"show-icon":""},null,8,["title"])):U("",!0),W.value?U("",!0):(d(),g(ue,{key:1,description:ke.value.length?"在上方选择要配置的工作空间。":"还没有可选工作空间,请先在授权入口中关联一个已有空间。"},null,8,["description"])),W.value?de((d(),w("div",vl,[R.value?(d(),w(N,{key:0},[R.value.enabled?U("",!0):(d(),g(p,{key:0,title:"这个工作空间已停用。完成配置后,还需在业务路由中恢复空间运行。",type:"warning",closable:!1,"show-icon":""})),de(l("section",fl,[e[31]||(e[31]=l("h3",null,"让智能体先知道这个系统负责什么",-1)),e[32]||(e[32]=l("p",{class:"description"},"说明会在首次搜索工具前提供给已选中的授权。它描述系统定位,具体可执行动作仍以授权后的工具查询为准。",-1)),a(K,{"label-position":"top",disabled:V.value||!T(z).can("routes:write")},{default:n(()=>[a(v,{label:"启用本地智能体"},{default:n(()=>[a(G,{modelValue:L.enabled,"onUpdate:modelValue":e[4]||(e[4]=o=>L.enabled=o)},null,8,["modelValue"]),e[28]||(e[28]=l("span",{class:"inline-note"},"开启本地会话编排;工具调用在下一步单独设置。",-1))]),_:1}),a(v,{label:"业务系统名称"},{default:n(()=>[a(h,{modelValue:S.name,"onUpdate:modelValue":e[5]||(e[5]=o=>S.name=o),placeholder:"例如:客户服务系统",maxlength:"120","show-word-limit":""},null,8,["modelValue"])]),_:1}),a(v,{label:"一句话介绍"},{default:n(()=>[a(h,{modelValue:S.summary,"onUpdate:modelValue":e[6]||(e[6]=o=>S.summary=o),placeholder:"例如:处理客户咨询、服务工单和售后跟进。",maxlength:"400","show-word-limit":""},null,8,["modelValue"])]),_:1}),a(v,{label:"典型业务方向"},{default:n(()=>[a(D,{modelValue:S.domains,"onUpdate:modelValue":e[7]||(e[7]=o=>S.domains=o),multiple:"",filterable:"","allow-create":"","default-first-option":"","multiple-limit":6,style:{width:"100%"},placeholder:"输入一个方向后按回车,最多6项"},{default:n(()=>[(d(!0),w(N,null,E(S.domains,o=>(d(),g(I,{key:o,label:o,value:o},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),a(v,{label:"系统边界"},{default:n(()=>[a(D,{modelValue:S.boundaries,"onUpdate:modelValue":e[8]||(e[8]=o=>S.boundaries=o),multiple:"",filterable:"","allow-create":"","default-first-option":"","multiple-limit":6,style:{width:"100%"},placeholder:"例如:财务结算由其他系统负责;最多6项"},{default:n(()=>[(d(!0),w(N,null,E(S.boundaries,o=>(d(),g(I,{key:o,label:o,value:o},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["disabled"]),l("div",_l,[e[29]||(e[29]=l("span",null,"智能体看到的系统定位",-1)),l("b",null,r(S.name||"系统定位未提供"),1),l("p",null,r(S.summary||"尚未配置说明,客户端仍可按原流程查询已授权的业务工具。"),1),e[30]||(e[30]=l("small",null,"说明仅供目标选择参考 · 工具可能尚未加载 · 不代表已获得写入权限",-1))])],512),[[Be,J.value===1]]),de(l("section",bl,[e[47]||(e[47]=l("h3",null,"限定智能体可以使用的业务动作",-1)),e[48]||(e[48]=l("p",{class:"description"},"工作空间的工具源与范围继续复用原配置。开启后仍会逐次校验业务身份、权限和审批。",-1)),R.value.permission==="readonly"?(d(),g(p,{key:0,title:"这个工作空间的权限档为只读。即使填写写操作清单,也不会开放写入;如需调整,请在业务路由的权限与治理中核对。",type:"warning",closable:!1,"show-icon":""})):U("",!0),a(K,{"label-position":"top",disabled:V.value||!T(z).can("routes:write")},{default:n(()=>[a(v,{label:"允许本地智能体调用工具"},{default:n(()=>[a(G,{modelValue:x.enabled,"onUpdate:modelValue":e[9]||(e[9]=o=>x.enabled=o)},null,8,["modelValue"])]),_:1}),L.enabled&&!x.enabled?(d(),g(p,{key:0,title:"本地会话已启用,但业务工具调用未开启。用户可以完成授权,暂时无法通过此空间发现或操作业务工具。",type:"warning",closable:!1,"show-icon":""})):U("",!0),a(Te,{"content-position":"left"},{default:n(()=>[...e[33]||(e[33]=[m("生成图片上传",-1)])]),_:1}),a(v,{label:"允许上传生成图片"},{default:n(()=>[a(G,{modelValue:b.enabled,"onUpdate:modelValue":e[10]||(e[10]=o=>b.enabled=o)},null,8,["modelValue"]),e[34]||(e[34]=l("div",{class:"field-note"},"将智能体生成的图片保存到所选媒体存储,返回 URL 供商品等业务使用。上传不等于已修改业务数据。",-1))]),_:1}),b.enabled?(d(),w(N,{key:1},[a(v,{label:"保存到哪个媒体存储"},{default:n(()=>[a(D,{modelValue:b.bucket,"onUpdate:modelValue":e[11]||(e[11]=o=>b.bucket=o),filterable:"","allow-create":"",placeholder:"选择已登记的存储",style:{width:"100%"}},{default:n(()=>[(d(!0),w(N,null,E(Y.value,o=>(d(),g(I,{key:o.name,value:o.name,label:`${o.name} · ${o.kind}${o.enabled?"":"(已停用)"}`,disabled:!o.enabled},null,8,["value","label","disabled"]))),128))]),_:1},8,["modelValue"]),l("div",gl,[a(Ae,{to:"/storage"},{default:n(()=>[...e[35]||(e[35]=[m("前往媒体存储配置 COS/OSS 或本地存储",-1)])]),_:1}),e[36]||(e[36]=m("。此处不填写密钥。文件由部署方管理,不随会话结束清理。",-1))])]),_:1}),a(v,{label:"单张图片大小上限(字节)"},{default:n(()=>[a(i,{modelValue:b.max_bytes,"onUpdate:modelValue":e[12]||(e[12]=o=>b.max_bytes=o),min:1,max:6291456},null,8,["modelValue"]),e[37]||(e[37]=l("span",{class:"inline-note"},"默认 6 MiB",-1))]),_:1}),a(v,{label:"允许的图片类型"},{default:n(()=>[a(D,{modelValue:b.allowed_mimes,"onUpdate:modelValue":e[13]||(e[13]=o=>b.allowed_mimes=o),multiple:""},{default:n(()=>[(d(),w(N,null,E(["image/png","image/jpeg","image/webp"],o=>a(I,{key:o,label:o,value:o},null,8,["label","value"])),64))]),_:1},8,["modelValue"])]),_:1})],64)):U("",!0),a(Te,{"content-position":"left"},{default:n(()=>[...e[38]||(e[38]=[m("业务工具",-1)])]),_:1}),l("div",yl,[e[40]||(e[40]=l("b",null,"使用哪些工具源",-1)),a(c,{size:"small",disabled:V.value||!T(z).can("routes:write"),onClick:u},{default:n(()=>[...e[39]||(e[39]=[m("添加工具源",-1)])]),_:1},8,["disabled"])]),ae.value?(d(),w("p",wl,r(ae.value),1)):U("",!0),H.value.length?U("",!0):(d(),g(ue,{key:3,description:"尚未关联工具源。添加已有业务工具源并选择范围。","image-size":56})),(d(!0),w(N,null,E(H.value,(o,se)=>(d(),w("div",{class:"source-card",key:o._key},[l("div",kl,[l("b",null,"工具源 "+r(se+1),1),a(c,{link:"",type:"danger",disabled:V.value||!T(z).can("routes:write"),onClick:$=>H.value.splice(se,1)},{default:n(()=>[...e[41]||(e[41]=[m("移除",-1)])]),_:1},8,["disabled","onClick"])]),a(v,{label:"已登记的工具源"},{default:n(()=>[a(D,{modelValue:o.config.provider,"onUpdate:modelValue":$=>o.config.provider=$,filterable:"","allow-create":"",style:{width:"100%"},onChange:$=>t(o)},{default:n(()=>[(d(!0),w(N,null,E(ce.value,$=>(d(),g(I,{key:$.name,value:$.name,label:$.description?`${$.name} · ${$.description}`:$.name},null,8,["value","label"]))),128))]),_:1},8,["modelValue","onUpdate:modelValue","onChange"])]),_:2},1024),a(v,{label:"允许的工具范围(scope)"},{default:n(()=>[a(D,{modelValue:o.config.allow,"onUpdate:modelValue":$=>o.config.allow=$,multiple:"",filterable:"","allow-create":"","default-first-option":"",style:{width:"100%"},placeholder:"选择范围或输入精确scope"},{default:n(()=>[(d(!0),w(N,null,E(y(o),$=>(d(),g(I,{key:$,value:$,label:$},null,8,["value","label"]))),128)),a(I,{value:"*",label:"全部scope(包含该工具源以后新增的scope)"})]),_:2},1032,["modelValue","onUpdate:modelValue"]),e[42]||(e[42]=l("div",{class:"field-note"},"只读工具按范围开放;写操作还需要下方的精确清单。",-1))]),_:2},1024),l("div",Vl,[a(c,{size:"small",disabled:!o.config.provider,loading:o._loading,onClick:$=>We(o)},{default:n(()=>[...e[43]||(e[43]=[m("读取工具目录",-1)])]),_:1},8,["disabled","loading","onClick"]),l("span",null,r(o._loaded?`${o._tools.length} 个已声明工具`:"尚未读取目录,可手工填写已知scope和操作标识"),1)]),o._error?(d(),w("p",$l,r(o._error),1)):U("",!0),o._tools.length?(d(),g(Re,{key:1,data:o._tools,size:"small","max-height":"240",style:{"margin-top":"14px"}},{default:n(()=>[a(B,{label:"业务动作","min-width":"200","show-overflow-tooltip":""},{default:n(({row:$})=>[l("span",null,r($.description||$.name),1),l("div",Cl,r($.name),1)]),_:1}),a(B,{label:"类型",width:"70"},{default:n(({row:$})=>[m(r($.readonly?"查询":"写入"),1)]),_:1}),a(B,{label:"当前配置","min-width":"150"},{default:n(({row:$})=>[m(r(O(o,$)),1)]),_:2},1024)]),_:2},1032,["data"])):U("",!0)]))),128)),a(v,{label:"允许的写操作",class:"write-field"},{default:n(()=>[a(D,{modelValue:x.write_tools,"onUpdate:modelValue":e[14]||(e[14]=o=>x.write_tools=o),multiple:"",filterable:"","allow-create":"","default-first-option":"",style:{width:"100%"},placeholder:"留空时不开放写操作;只接受精确operationId"},{default:n(()=>[(d(!0),w(N,null,E(Ne.value,o=>(d(),g(I,{key:o.name,value:o.name,label:`${o.name} · ${o.scope}${o.confirm_required||o.risk==="high"?" · 原规则需审批":""}`},null,8,["value","label"]))),128))]),_:1},8,["modelValue"]),e[44]||(e[44]=l("div",{class:"field-note"},"不能填写 *。选中的操作仍须通过原 scope、主体、风险与审批规则。",-1))]),_:1}),a(v,{label:"额外要求审批的写操作"},{default:n(()=>[a(D,{modelValue:x.force_approval_tools,"onUpdate:modelValue":e[15]||(e[15]=o=>x.force_approval_tools=o),multiple:"",filterable:"",style:{width:"100%"},placeholder:"可进一步收紧审批要求"},{default:n(()=>[(d(!0),w(N,null,E(x.write_tools,o=>(d(),g(I,{key:o,value:o,label:o},null,8,["value","label"]))),128))]),_:1},8,["modelValue"]),e[45]||(e[45]=l("div",{class:"field-note"},"这里只增加审批要求,不会取消工具本身要求的审批。",-1))]),_:1})]),_:1},8,["disabled"]),a(Ye,null,{default:n(()=>[a(Xe,{title:"高级运行设置",name:"advanced"},{default:n(()=>[a(K,{"label-position":"top",disabled:V.value||!T(z).can("routes:write")},{default:n(()=>[a(v,{label:"每轮主动加载的工具上限"},{default:n(()=>[a(i,{modelValue:L.active_tool_limit,"onUpdate:modelValue":e[16]||(e[16]=o=>L.active_tool_limit=o),min:1,max:12},null,8,["modelValue"])]),_:1}),a(v,{label:"本地编排补充规则"},{default:n(()=>[a(h,{modelValue:L.instructions,"onUpdate:modelValue":e[17]||(e[17]=o=>L.instructions=o),type:"textarea",rows:3,maxlength:"20000"},null,8,["modelValue"]),e[46]||(e[46]=l("div",{class:"field-note"},"延续已有运行规则;系统介绍应填写在上一步。",-1))]),_:1})]),_:1},8,["disabled"])]),_:1})]),_:1})],512),[[Be,J.value===2]]),l("div",Ul,[l("span",null,r(T(z).can("routes:write")?ee.value?"工作空间有未保存修改":"工作空间配置已同步":"当前账号没有工作空间修改权限"),1),a(c,{type:"primary",loading:V.value,disabled:!ee.value||!T(z).can("routes:write"),onClick:Q},{default:n(()=>[...e[49]||(e[49]=[m("保存工作空间",-1)])]),_:1},8,["loading","disabled"])])],64)):U("",!0)])),[[qe,pe.value]]):U("",!0)],64)):U("",!0),de(l("section",hl,[e[53]||(e[53]=l("h3",null,"检查已保存的接入配置",-1)),e[54]||(e[54]=l("p",{class:"description"},"连接配置只包含中枢地址、接入方和工作空间。用户登录后,实际可用工具会按原业务授权确定。",-1)),ve.value||ee.value?(d(),g(p,{key:0,title:"还有未保存的修改。下方状态和连接配置仅反映已保存内容。",type:"warning",closable:!1,"show-icon":""})):U("",!0),l("div",Sl,[e[50]||(e[50]=l("span",null,"接入方",-1)),l("b",null,r((Le=F.value)!=null&&Le.enabled?"已启用":"已停用"),1)]),l("div",xl,[e[51]||(e[51]=l("span",null,"业务授权入口",-1)),l("b",null,r((Me=F.value)!=null&&Me.agent_authorize_url?"已配置":"尚未配置"),1)]),(d(!0),w(N,null,E(ze.value,o=>{var se,$;return d(),w("div",{key:o.route,class:"workspace-result"},[l("div",null,[l("b",null,r(o.name),1),l("code",null,r(o.route),1)]),l("p",null,r(je(o)),1),a(c,{type:"primary",plain:"",size:"small",disabled:!((se=F.value)!=null&&se.enabled)||!(($=F.value)!=null&&$.agent_authorize_url)||!o.enabled||!o.runtime_enabled,onClick:ft=>M("connect",{app_id:k.value.app_id,workspace:o.route})},{default:n(()=>[...e[52]||(e[52]=[m("生成连接配置",-1)])]),_:1},8,["disabled","onClick"])])}),128)),ze.value.length?U("",!0):(d(),g(ue,{key:1,description:"尚无可连接的工作空间。请先保存授权入口配置。","image-size":70})),e[55]||(e[55]=l("p",{class:"field-note"},"系统说明缺失不会阻断已有连接;工具范围与服务可用性将在授权后进一步校验。",-1))],512),[[Be,J.value===3]])],64)):U("",!0)])),[[qe,te.value]])]}),_:1},8,["model-value"])}}}),Nl=Ge(zl,[["__scopeId","data-v-4099c86e"]]),jl={class:"agent-clients-page"},Ol={class:"page-navigation"},Il={class:"actions"},Tl={class:"head"},Al={class:"actions"},Rl={class:"overview"},Bl={class:"metric primary"},El={class:"metric"},Jl={class:"metric"},Pl={class:"metric"},Wl={class:"metric"},ql={class:"section-head"},Dl={key:0,class:"muted"},Ll={class:"stack"},Ml={class:"stack"},Fl={class:"muted"},Hl={class:"tags"},Kl={class:"stack right"},Zl={class:"muted"},Ql={class:"section-head"},Gl={class:"actions"},Xl={class:"stack"},Yl={class:"subject-name"},et={class:"muted"},lt={class:"stack"},tt={class:"stack"},at={class:"muted"},nt={class:"stack"},ot={class:"muted"},st={class:"stack"},it={class:"muted"},ut={key:1,class:"muted"},dt={key:2,class:"pagination"},rt={class:"subject-name"},pt={class:"form-grid"},ct={class:"code-block"},mt={class:"code-block"},Ee=50,vt=Fe({__name:"AgentClients",setup(xe){const ge=al(),A=Qe(),z=nl(),M=C("setup"),ye=C(30),J=C(!1),te=C(!1),ie=C(""),k=C([]),F=le(()=>{const u=z.query.workspace;return typeof u=="string"?k.value.filter(t=>t.allowed_routes.includes("*")||t.allowed_routes.includes(u)):k.value}),we=C([]),P=C([]),W=re({open:!1,appId:"",workspace:""}),R=C([]),j=C(null),pe=C(0),X=C(1),V=re({applications:0,agent_auth_enabled:0,sessions:{},runs:0,conversations:0,failed:0,tool_calls:0,total_tokens:0,failure_rate:0,approvals:{}}),Y=re({client_app_id:"",state:"all"}),b=re({open:!1,app_id:"",name:"",workspace:"",workspaces:[]}),L=le(()=>sl()),S=le(()=>Object.values(V.approvals||{}).reduce((u,t)=>u+Number(t||0),0)),x=le(()=>JSON.stringify({hubUrl:L.value,clientAppId:b.app_id,workspace:b.workspace,connectionName:b.name.trim()||"default"},null,2)),H=le(()=>`/bailinghub connections add ${ae(b.name.trim()||"default")} ${ae(L.value)} ${ae(b.app_id)} ${ae(b.workspace)}`);function ce(u){var y;const t=(y=u.subject_display)==null?void 0:y.name;return u.subject_display_status==="provided"&&typeof t=="string"?t:""}function ae(u){return JSON.stringify(u)}function f(u){return new Intl.NumberFormat("zh-CN").format(Number(u||0))}function Pe(u){return`${(Number(u||0)*100).toFixed(1)}%`}function q(u){return u?`${u.slice(0,8)}…${u.slice(-4)}`:"—"}function me(u){return u?new Date(u).toLocaleString("zh-CN",{hour12:!1}):"从未"}function ve(u){return u==="active"?"有效":u==="expired"?"已过期":"已撤销"}function ke(u){return u==="active"?"success":u==="expired"?"warning":"info"}function ze(u){return u.includes("*")?["全部 Workspace"]:u.slice(0,4)}function Ve(u){return P.value.filter(t=>u.allowed_routes.includes("*")||u.allowed_routes.includes(t.route))}function be(u){return Ve(u).filter(t=>t.enabled&&t.runtime_enabled)}function ee(u){return u.enabled&&u.agent_auth_enabled&&be(u).length>0}function Ne(u){if(!u.enabled)return"接入方已停用,需先恢复接入";if(!u.agent_auth_enabled)return"尚未配置业务授权入口";const t=Ve(u);if(!t.length)return"尚未关联现有工作空间";const y=t.filter(O=>O.enabled&&O.runtime_enabled);return y.length?y.some(O=>O.direct_enabled)?y.some(O=>O.direct_enabled&&O.source_count)?y.some(O=>!O.system_info_configured)?"建议补充系统说明,帮助智能体首次选择目标":"连接与工具通道已配置;实际可用动作以业务授权为准":"工具通道已开启;尚需配置业务工具源":"连接入口已准备好;业务工具调用尚未开启":"尚无已启用本地智能体的工作空间"}function je(u,t=""){W.appId=u.app_id,W.workspace=t,W.open=!0}function ne(u){const t=k.value.find(y=>y.app_id===u.app_id);t&&(he(t),b.workspace=u.workspace)}async function $e(){J.value=!0;try{const u=await Je(`/admin/api/agent-clients/overview?days=${ye.value}`);if(!u.ok)throw new Error((await u.json().catch(()=>({}))).error||"加载失败");const t=await u.json();k.value=t.applications||[],we.value=t.workspaces||[],P.value=t.setup_workspaces||[],Object.assign(V,t.summary||{})}catch(u){Z.error(u instanceof Error?u.message:"加载智能体客户端失败")}finally{J.value=!1}}async function oe(){te.value=!0;try{const u=new URLSearchParams({state:Y.state,limit:String(Ee),offset:String((X.value-1)*Ee)});Y.client_app_id&&u.set("client_app_id",Y.client_app_id);const t=await Je(`/admin/api/agent-clients/sessions?${u}`);if(!t.ok)throw new Error((await t.json().catch(()=>({}))).error||"加载失败");const y=await t.json();R.value=y.list||[],pe.value=Number(y.total||0)}catch(u){Z.error(u instanceof Error?u.message:"加载授权设备失败")}finally{te.value=!1}}async function Ce(){await Promise.all([$e(),oe()])}async function Ue(){X.value=1,await oe()}function he(u){var y;const t=be(u);b.app_id=u.app_id,b.name=u.app_id.replace(/[^a-zA-Z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")||"default",b.workspaces=t,b.workspace=((y=t[0])==null?void 0:y.route)||"",b.open=!0}async function Oe(u){await navigator.clipboard.writeText(u),Z.success("已复制")}async function Ie(u){await Ze.confirm(`撤销设备“${u.device_label||q(u.session_id)}”的 Agent Session?撤销后需要重新登录授权。`,"远程撤销",{type:"warning",confirmButtonText:"确认撤销"}),ie.value=u.session_id;try{const t=await Je(`/admin/api/agent-clients/sessions/${u.session_id}/revoke`,{method:"POST"});if(!t.ok)throw new Error((await t.json().catch(()=>({}))).error||"撤销失败");Z.success("Agent Session 已撤销"),await Ce()}catch(t){Z.error(t instanceof Error?t.message:"撤销失败")}finally{ie.value=""}}return tl(async()=>{await Ce();const u=typeof z.query.workspace=="string"?z.query.workspace:"",t=typeof z.query.app=="string"?z.query.app:"",y=k.value.filter(O=>t?O.app_id===t:u&&(O.allowed_routes.includes("*")||O.allowed_routes.includes(u)));y.length===1&&je(y[0],u)}),(u,t)=>{const y=_("el-button"),O=_("el-radio-button"),We=_("el-radio-group"),Q=_("el-option"),fe=_("el-select"),_e=_("el-card"),Se=_("el-empty"),s=_("el-table-column"),e=_("el-tag"),c=_("el-tooltip"),p=_("el-table"),h=_("el-pagination"),v=_("el-descriptions-item"),G=_("el-descriptions"),I=_("el-dialog"),D=_("el-alert"),K=_("el-input"),ue=_("el-form-item"),Te=_("el-form"),Ae=Ke("loading");return d(),w("div",jl,[l("div",Ol,[t[19]||(t[19]=l("div",null,[l("b",null,"本地智能体"),l("span",null,"配置接入与管理授权设备")],-1)),l("div",Il,[T(A).can("clients:read")&&T(A).hasModule("agent-tasks")?(d(),g(y,{key:0,onClick:t[0]||(t[0]=i=>T(ge).push("/agent-tasks"))},{default:n(()=>[...t[16]||(t[16]=[m("任务控制",-1)])]),_:1})):U("",!0),a(We,{modelValue:M.value,"onUpdate:modelValue":t[1]||(t[1]=i=>M.value=i)},{default:n(()=>[a(O,{value:"setup"},{default:n(()=>[...t[17]||(t[17]=[m("接入配置",-1)])]),_:1}),a(O,{value:"activity"},{default:n(()=>[...t[18]||(t[18]=[m("设备与运行",-1)])]),_:1})]),_:1},8,["modelValue"])])]),M.value==="activity"?(d(),g(_e,{key:0,shadow:"never"},{header:n(()=>[l("div",Tl,[l("div",null,[t[21]||(t[21]=l("b",null,"智能体客户端",-1)),a(ol,{title:"和执行器有什么区别"},{default:n(()=>[...t[20]||(t[20]=[l("p",null,[l("b",null,"智能体客户端"),m("在本地理解用户意图、选择能力并完成多步编排;中枢继续负责业务身份、授权、审批、执行与审计。")],-1),l("p",null,[l("b",null,"执行器"),m("是中枢下发 Job、由本地运行时执行本地任务后回报结果。两者是独立概念。")],-1),l("p",null,"在“配置接入”中集中设置授权入口、系统说明和工具范围;设置仍保存在原接入方与业务路由中。",-1),l("p",null,"每个接入方只配置一个不绑定账号、租户或门店的业务授权入口;账号切换与租户选择由业务授权页完成。",-1)])]),_:1})]),l("div",Al,[a(fe,{modelValue:ye.value,"onUpdate:modelValue":t[2]||(t[2]=i=>ye.value=i),size:"small",style:{width:"108px"},onChange:$e},{default:n(()=>[a(Q,{value:7,label:"近 7 天"}),a(Q,{value:30,label:"近 30 天"}),a(Q,{value:90,label:"近 90 天"})]),_:1},8,["modelValue"]),a(y,{size:"small",loading:J.value,onClick:Ce},{default:n(()=>[...t[22]||(t[22]=[m("刷新",-1)])]),_:1},8,["loading"])])])]),default:n(()=>{var i,B;return[de((d(),w("div",Rl,[l("div",Bl,[t[23]||(t[23]=l("span",null,"客户端应用",-1)),l("b",null,r(f(V.agent_auth_enabled)),1),l("em",null,"共 "+r(f(V.applications))+" 个接入方",1)]),l("div",El,[t[24]||(t[24]=l("span",null,"有效授权设备",-1)),l("b",null,r(f((i=V.sessions)==null?void 0:i.active)),1),l("em",null,"总会话 "+r(f((B=V.sessions)==null?void 0:B.total)),1)]),l("div",Jl,[t[25]||(t[25]=l("span",null,"Agent Run",-1)),l("b",null,r(f(V.runs)),1),l("em",null,r(f(V.conversations))+" 个本地会话",1)]),l("div",Pl,[t[26]||(t[26]=l("span",null,"工具调用",-1)),l("b",null,r(f(V.tool_calls)),1),l("em",null,"审批 "+r(f(S.value))+" 次",1)]),l("div",Wl,[t[27]||(t[27]=l("span",null,"累计 Token",-1)),l("b",null,r(f(V.total_tokens)),1),t[28]||(t[28]=l("em",null,"由客户端公开 usage 汇总",-1))]),l("div",{class:He(["metric",{danger:Number(V.failure_rate||0)>.1}])},[t[29]||(t[29]=l("span",null,"失败率",-1)),l("b",null,r(Pe(V.failure_rate)),1),l("em",null,r(f(V.failed))+" 个失败或取消",1)],2)])),[[Ae,J.value]])]}),_:1})):U("",!0),M.value==="setup"?(d(),g(_e,{key:1,shadow:"never",class:"setup-intro"},{default:n(()=>[...t[30]||(t[30]=[l("div",null,[l("span",{class:"intro-kicker"},"从接入到业务操作"),l("h2",null,"把一个业务系统接给本地智能体"),l("p",null,"选中下方应用,按顺序完成授权入口、系统说明和工具范围。连接、业务授权与实际执行分别检查。")],-1),l("div",{class:"intro-flow"},[l("span",null,"1 授权入口"),l("i",null,"→"),l("span",null,"2 系统说明"),l("i",null,"→"),l("span",null,"3 工具与审批"),l("i",null,"→"),l("span",null,"4 检查连接")],-1)])]),_:1})):U("",!0),M.value==="setup"?(d(),g(_e,{key:2,shadow:"never"},{header:n(()=>[l("div",ql,[t[32]||(t[32]=l("div",null,[l("b",null,"业务系统接入"),l("span",null,"在一个入口完成本地智能体配置;授权记录与用量请切换到“设备与运行”。")],-1)),a(y,{size:"small",onClick:t[3]||(t[3]=i=>T(ge).push("/clients"))},{default:n(()=>[...t[31]||(t[31]=[m("新建接入方",-1)])]),_:1})])]),default:n(()=>[T(z).query.workspace?(d(),w("p",Dl,[m("以下为允许使用工作空间 "+r(T(z).query.workspace)+" 的接入方,请选择要配置的应用。",1),a(y,{link:"",onClick:t[4]||(t[4]=i=>T(ge).replace("/agent-clients"))},{default:n(()=>[...t[33]||(t[33]=[m("显示全部",-1)])]),_:1})])):U("",!0),F.value.length?(d(),g(p,{key:2,data:F.value,size:"small"},{default:n(()=>[a(s,{label:"应用",width:180},{default:n(({row:i})=>[l("div",Ll,[l("b",null,r(i.name||i.app_id),1),l("code",null,r(i.app_id),1)])]),_:1}),a(s,{label:"接入配置状态","min-width":270},{default:n(({row:i})=>[l("div",Ml,[l("div",null,[a(e,{size:"small",effect:"plain",type:ee(i)?"success":"warning"},{default:n(()=>[m(r(ee(i)?"连接条件已配置":"待完成配置"),1)]),_:2},1032,["type"])]),l("span",Fl,r(Ne(i)),1)])]),_:1}),a(s,{label:"工作空间",width:180},{default:n(({row:i})=>[l("div",Hl,[(d(!0),w(N,null,E(ze(i.allowed_routes),B=>(d(),g(e,{key:B,size:"small",effect:"plain",type:"info"},{default:n(()=>[m(r(B),1)]),_:2},1024))),128))])]),_:1}),a(s,{label:"近期开销",width:150,align:"right"},{default:n(({row:i})=>[l("div",Kl,[l("span",null,r(f(i.stats.runs))+" Run / "+r(f(i.stats.tool_calls))+" 调用",1),l("span",Zl,r(f(i.stats.total_tokens))+" Token",1)])]),_:1}),a(s,{width:210,align:"right"},{default:n(({row:i})=>[a(y,{size:"small",type:"primary",plain:"",onClick:B=>je(i)},{default:n(()=>[...t[34]||(t[34]=[m("配置接入",-1)])]),_:1},8,["onClick"]),a(c,{content:ee(i)?"复制公开连接信息,随后在客户端登录授权":Ne(i)},{default:n(()=>[l("span",null,[a(y,{link:"",disabled:!ee(i),onClick:B=>he(i)},{default:n(()=>[...t[35]||(t[35]=[m("连接配置",-1)])]),_:1},8,["disabled","onClick"])])]),_:2},1032,["content"])]),_:1})]),_:1},8,["data"])):(d(),g(Se,{key:1,description:"当前没有匹配的接入方,请先创建接入方并关联工作空间。"}))]),_:1})):U("",!0),M.value==="activity"?(d(),g(_e,{key:3,shadow:"never"},{header:n(()=>[l("div",Ql,[t[36]||(t[36]=l("div",null,[l("b",null,"业务授权与设备"),l("span",null,"授权名称由业务系统同步;设备名称用于区分使用端。远程撤销后需要重新登录授权。")],-1)),l("div",Gl,[a(fe,{modelValue:Y.client_app_id,"onUpdate:modelValue":t[5]||(t[5]=i=>Y.client_app_id=i),clearable:"",filterable:"",size:"small",placeholder:"全部应用",style:{width:"190px"},onChange:Ue},{default:n(()=>[(d(!0),w(N,null,E(k.value,i=>(d(),g(Q,{key:i.app_id,label:i.name||i.app_id,value:i.app_id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),a(fe,{modelValue:Y.state,"onUpdate:modelValue":t[6]||(t[6]=i=>Y.state=i),size:"small",style:{width:"112px"},onChange:Ue},{default:n(()=>[a(Q,{value:"all",label:"全部状态"}),a(Q,{value:"active",label:"有效"}),a(Q,{value:"expired",label:"已过期"}),a(Q,{value:"revoked",label:"已撤销"})]),_:1},8,["modelValue"])])])]),default:n(()=>[R.value.length?de((d(),g(p,{key:1,data:R.value,size:"small","row-key":"session_id"},{default:n(()=>[a(s,{label:"授权名称","min-width":180},{default:n(({row:i})=>[l("div",Xl,[l("b",Yl,r(ce(i)||"待同步"),1),l("span",et,r(ce(i)?"业务系统提供":"业务系统尚未提供名称"),1)])]),_:1}),a(s,{label:"设备",width:170},{default:n(({row:i})=>[l("div",lt,[l("b",null,r(i.device_label||"未命名设备"),1),l("code",null,r(q(i.session_id)),1)])]),_:1}),a(s,{label:"业务主体",width:150},{default:n(({row:i})=>{var B,Re;return[l("div",tt,[l("span",null,r(((B=i.principal)==null?void 0:B.id)||i.on_behalf_of),1),l("span",at,r(((Re=i.principal)==null?void 0:Re.tenant)||"未声明租户"),1)])]}),_:1}),a(s,{label:"应用 / Workspace","min-width":190},{default:n(({row:i})=>[l("div",nt,[l("code",null,r(i.client_app_id),1),l("span",ot,r((i.allowed_routes||[]).join("、")||"无可用路由"),1)])]),_:1}),a(s,{label:"活跃与有效期",width:185},{default:n(({row:i})=>[l("div",st,[l("span",null,"活跃 "+r(me(i.last_seen_at)),1),l("span",it,"到期 "+r(me(i.refresh_expires_at)),1)])]),_:1}),a(s,{label:"状态",width:80},{default:n(({row:i})=>[a(e,{size:"small",effect:"plain",type:ke(i.state)},{default:n(()=>[m(r(ve(i.state)),1)]),_:2},1032,["type"])]),_:1}),a(s,{width:130,align:"right"},{default:n(({row:i})=>[a(y,{link:"",onClick:B=>j.value=i},{default:n(()=>[...t[37]||(t[37]=[m("详情",-1)])]),_:1},8,["onClick"]),i.state!=="revoked"?(d(),g(y,{key:0,link:"",type:"danger",loading:ie.value===i.session_id,onClick:B=>Ie(i)},{default:n(()=>[...t[38]||(t[38]=[m("远程撤销",-1)])]),_:1},8,["loading","onClick"])):(d(),w("span",ut,"已处理"))]),_:1})]),_:1},8,["data"])),[[Ae,te.value]]):(d(),g(Se,{key:0,description:"当前筛选下没有 Agent Session"})),pe.value>Ee?(d(),w("div",dt,[a(h,{"current-page":X.value,"onUpdate:currentPage":t[7]||(t[7]=i=>X.value=i),"page-size":Ee,total:pe.value,layout:"prev, pager, next, total",onCurrentChange:oe},null,8,["current-page","total"])])):U("",!0)]),_:1})):U("",!0),a(I,{"model-value":!!j.value,title:"业务授权详情",width:"min(640px, 94vw)","onUpdate:modelValue":t[8]||(t[8]=i=>{i||(j.value=null)})},{default:n(()=>[j.value?(d(),w(N,{key:0},[a(G,{column:1,border:""},{default:n(()=>[a(v,{label:"授权名称"},{default:n(()=>[l("span",rt,r(ce(j.value)||"待同步"),1)]),_:1}),a(v,{label:"名称来源"},{default:n(()=>[m(r(ce(j.value)?"业务系统提供":"业务系统尚未提供;旧授权可由原业务系统同步名称"),1)]),_:1}),a(v,{label:"设备名称"},{default:n(()=>[m(r(j.value.device_label||"未命名设备"),1)]),_:1}),a(v,{label:"接入应用"},{default:n(()=>[l("code",null,r(j.value.client_app_id),1)]),_:1}),a(v,{label:"授权记录"},{default:n(()=>[l("code",null,r(j.value.session_id),1)]),_:1}),a(v,{label:"业务主体"},{default:n(()=>{var i;return[m(r(((i=j.value.principal)==null?void 0:i.id)||j.value.on_behalf_of),1)]}),_:1}),a(v,{label:"租户"},{default:n(()=>{var i;return[m(r(((i=j.value.principal)==null?void 0:i.tenant)||"未声明租户"),1)]}),_:1}),a(v,{label:"工作空间"},{default:n(()=>[m(r(j.value.allowed_routes.join("、")),1)]),_:1}),a(v,{label:"状态"},{default:n(()=>[m(r(ve(j.value.state)),1)]),_:1})]),_:1}),t[39]||(t[39]=l("p",{class:"connection-note"},"名称只帮助识别授权。相同名称可能对应不同授权,权限、会话范围和执行记录仍按原授权绑定。名称更新不修改历史对话中的标签。",-1))],64)):U("",!0)]),_:1},8,["model-value"]),a(Nl,{modelValue:W.open,"onUpdate:modelValue":t[9]||(t[9]=i=>W.open=i),"app-id":W.appId,"initial-workspace":W.workspace,workspaces:P.value,onSaved:$e,onConnect:ne},null,8,["modelValue","app-id","initial-workspace","workspaces"]),a(I,{modelValue:b.open,"onUpdate:modelValue":t[15]||(t[15]=i=>b.open=i),title:"生成智能体客户端连接配置",width:"620px"},{footer:n(()=>[a(y,{onClick:t[12]||(t[12]=i=>b.open=!1)},{default:n(()=>[...t[40]||(t[40]=[m("关闭",-1)])]),_:1}),a(y,{onClick:t[13]||(t[13]=i=>Oe(x.value))},{default:n(()=>[...t[41]||(t[41]=[m("复制 JSON",-1)])]),_:1}),a(y,{type:"primary",onClick:t[14]||(t[14]=i=>Oe(H.value))},{default:n(()=>[...t[42]||(t[42]=[m("复制 DSH 命令",-1)])]),_:1})]),default:n(()=>[a(D,{type:"info",closable:!1,"show-icon":"",title:"这里只生成公开连接元数据,不包含业务 URL、业务身份、Client Token、Agent Token 或模型密钥。"}),t[43]||(t[43]=l("p",{class:"connection-note"},[l("code",null,"connectionName"),m(" 只是本机连接选择器。登录时会统一打开接入方配置的业务授权页,由该页面确认当前账号与租户。")],-1)),a(Te,{"label-position":"top",class:"connection-form"},{default:n(()=>[a(ue,{label:"Hub 地址"},{default:n(()=>[a(K,{"model-value":L.value,readonly:"",class:"mono"},null,8,["model-value"])]),_:1}),l("div",pt,[a(ue,{label:"Client App ID"},{default:n(()=>[a(K,{"model-value":b.app_id,readonly:"",class:"mono"},null,8,["model-value"])]),_:1}),a(ue,{label:"Connection Name"},{default:n(()=>[a(K,{modelValue:b.name,"onUpdate:modelValue":t[10]||(t[10]=i=>b.name=i),maxlength:"128",class:"mono"},null,8,["modelValue"])]),_:1})]),a(ue,{label:"Workspace"},{default:n(()=>[a(fe,{modelValue:b.workspace,"onUpdate:modelValue":t[11]||(t[11]=i=>b.workspace=i),style:{width:"100%"}},{default:n(()=>[(d(!0),w(N,null,E(b.workspaces,i=>(d(),g(Q,{key:i.route,label:i.name+"("+i.route+")",value:i.route},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),l("div",ct,[l("pre",null,r(x.value),1)]),l("div",mt,[l("pre",null,r(H.value),1)])]),_:1},8,["modelValue"])])}}}),kt=Ge(vt,[["__scopeId","data-v-dce97866"]]);export{kt as default};
|