@capyclaw/publisher 0.1.4 → 0.1.5
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/node_modules/@capyclaw/foundation/README.md +51 -0
- package/node_modules/@capyclaw/foundation/abi/bridge.mjs +86 -0
- package/node_modules/@capyclaw/foundation/abi/errors.mjs +63 -0
- package/node_modules/@capyclaw/foundation/abi/index.mjs +35 -0
- package/node_modules/@capyclaw/foundation/abi/kinds.mjs +271 -0
- package/node_modules/@capyclaw/foundation/abi/loader.mjs +352 -0
- package/node_modules/@capyclaw/foundation/abi/schema.mjs +98 -0
- package/node_modules/@capyclaw/foundation/abi/spec.mjs +258 -0
- package/node_modules/@capyclaw/foundation/abi/validate.mjs +24 -0
- package/node_modules/@capyclaw/foundation/abi/version.mjs +140 -0
- package/node_modules/@capyclaw/foundation/cordis.patch.yml +5 -0
- package/node_modules/@capyclaw/foundation/kit/index.mjs +6 -0
- package/node_modules/@capyclaw/foundation/lib/adapters/client-panel.mjs +98 -0
- package/node_modules/@capyclaw/foundation/lib/adapters/host-event.mjs +35 -0
- package/node_modules/@capyclaw/foundation/lib/adapters/http-router.mjs +69 -0
- package/node_modules/@capyclaw/foundation/lib/adapters/lifecycle-hook.mjs +55 -0
- package/node_modules/@capyclaw/foundation/lib/adapters/own-server.mjs +113 -0
- package/node_modules/@capyclaw/foundation/lib/adapters/raw.mjs +69 -0
- package/node_modules/@capyclaw/foundation/lib/adapters/runtime-driver.mjs +120 -0
- package/node_modules/@capyclaw/foundation/lib/adapters/service-provider.mjs +77 -0
- package/node_modules/@capyclaw/foundation/lib/adapters/skill-provider.mjs +56 -0
- package/node_modules/@capyclaw/foundation/lib/adapters/tool-provider.mjs +50 -0
- package/node_modules/@capyclaw/foundation/lib/adapters/ui-panel.mjs +64 -0
- package/node_modules/@capyclaw/foundation/lib/ctx-service.mjs +42 -0
- package/node_modules/@capyclaw/foundation/lib/host/caps.mjs +34 -0
- package/node_modules/@capyclaw/foundation/lib/host/contract.mjs +85 -0
- package/node_modules/@capyclaw/foundation/lib/host/dsh.mjs +50 -0
- package/node_modules/@capyclaw/foundation/lib/host/memory.mjs +187 -0
- package/node_modules/@capyclaw/foundation/lib/host.mjs +23 -0
- package/node_modules/@capyclaw/foundation/lib/kernel.mjs +185 -0
- package/node_modules/@capyclaw/foundation/lib/skill/scan.mjs +115 -0
- package/node_modules/@capyclaw/foundation/lib/subsystems/events.mjs +60 -0
- package/node_modules/@capyclaw/foundation/lib/subsystems/log.mjs +51 -0
- package/node_modules/@capyclaw/foundation/lib/subsystems/net.mjs +198 -0
- package/node_modules/@capyclaw/foundation/package.json +53 -0
- package/node_modules/@capyclaw/foundation/runtime/index.mjs +20 -0
- package/node_modules/@capyclaw/plugin-kit/INTEGRATION.md +100 -0
- package/node_modules/@capyclaw/plugin-kit/README.md +70 -0
- package/node_modules/@capyclaw/plugin-kit/bin/sync.mjs +103 -0
- package/node_modules/@capyclaw/plugin-kit/package.json +69 -0
- package/node_modules/@capyclaw/plugin-kit/src/cli.mjs +56 -0
- package/node_modules/@capyclaw/plugin-kit/src/config.mjs +142 -0
- package/node_modules/@capyclaw/plugin-kit/src/editor/heartbeat-worker.js +129 -0
- package/node_modules/@capyclaw/plugin-kit/src/editor/lease.mjs +60 -0
- package/node_modules/@capyclaw/plugin-kit/src/editor/shadow.mjs +219 -0
- package/node_modules/@capyclaw/plugin-kit/src/editor/transport.js +13 -0
- package/node_modules/@capyclaw/plugin-kit/src/index.mjs +13 -0
- package/node_modules/@capyclaw/plugin-kit/src/pack.mjs +230 -0
- package/node_modules/@capyclaw/plugin-kit/src/runtime/context.mjs +128 -0
- package/node_modules/@capyclaw/plugin-kit/src/self-contained.mjs +307 -0
- package/node_modules/@capyclaw/plugin-kit/src/service/api.mjs +45 -0
- package/node_modules/@capyclaw/plugin-kit/src/service/http.mjs +113 -0
- package/node_modules/@capyclaw/plugin-kit/src/service/mcp-http.mjs +150 -0
- package/node_modules/@capyclaw/plugin-kit/src/service/server.mjs +131 -0
- package/node_modules/@capyclaw/plugin-kit/src/skills/provider.mjs +82 -0
- package/node_modules/@capyclaw/plugin-kit/src/store/blob-store.mjs +109 -0
- package/node_modules/@capyclaw/plugin-kit/src/store/content-store.mjs +17 -0
- package/node_modules/@capyclaw/plugin-kit/src/store/journal-store.mjs +89 -0
- package/node_modules/@capyclaw/plugin-kit/src/tools/result.mjs +57 -0
- package/node_modules/@capyclaw/plugin-kit/src/tools/validate.mjs +150 -0
- package/node_modules/@capyclaw/plugin-kit/src/tuning.mjs +82 -0
- package/node_modules/@capyclaw/plugin-kit/src/util/fs-lock.mjs +132 -0
- package/node_modules/@capyclaw/plugin-kit/src/util/http.mjs +130 -0
- package/node_modules/@capyclaw/plugin-kit/src/workspace/manager.mjs +656 -0
- package/node_modules/@capyclaw/plugin-kit/src/zip.mjs +181 -0
- package/node_modules/@capyclaw/plugin-validator/bin/cli.mjs +49 -0
- package/node_modules/@capyclaw/plugin-validator/lib/index.mjs +303 -0
- package/node_modules/@capyclaw/plugin-validator/package.json +28 -0
- package/node_modules/@capyclaw/tool-host/README.md +56 -0
- package/node_modules/@capyclaw/tool-host/cordis.patch.yml +4 -0
- package/node_modules/@capyclaw/tool-host/dsh-suite.json +30 -0
- package/node_modules/@capyclaw/tool-host/lib/host.mjs +37 -0
- package/node_modules/@capyclaw/tool-host/package.json +59 -0
- package/node_modules/@capyclaw/tool-host/src/admit-images.mjs +80 -0
- package/node_modules/@capyclaw/tool-host/src/caller-session.mjs +25 -0
- package/node_modules/@capyclaw/tool-host/src/descriptors.mjs +166 -0
- package/node_modules/@capyclaw/tool-host/src/index.mjs +449 -0
- package/node_modules/@capyclaw/tool-host/src/mode-gate.mjs +214 -0
- package/node_modules/semver/LICENSE +15 -0
- package/node_modules/semver/README.md +680 -0
- package/node_modules/semver/bin/semver.js +195 -0
- package/node_modules/semver/classes/comparator.js +143 -0
- package/node_modules/semver/classes/index.js +7 -0
- package/node_modules/semver/classes/range.js +577 -0
- package/node_modules/semver/classes/semver.js +350 -0
- package/node_modules/semver/functions/clean.js +8 -0
- package/node_modules/semver/functions/cmp.js +54 -0
- package/node_modules/semver/functions/coerce.js +62 -0
- package/node_modules/semver/functions/compare-build.js +9 -0
- package/node_modules/semver/functions/compare-loose.js +5 -0
- package/node_modules/semver/functions/compare.js +7 -0
- package/node_modules/semver/functions/diff.js +60 -0
- package/node_modules/semver/functions/eq.js +5 -0
- package/node_modules/semver/functions/gt.js +5 -0
- package/node_modules/semver/functions/gte.js +5 -0
- package/node_modules/semver/functions/inc.js +21 -0
- package/node_modules/semver/functions/lt.js +5 -0
- package/node_modules/semver/functions/lte.js +5 -0
- package/node_modules/semver/functions/major.js +5 -0
- package/node_modules/semver/functions/minor.js +5 -0
- package/node_modules/semver/functions/neq.js +5 -0
- package/node_modules/semver/functions/parse.js +18 -0
- package/node_modules/semver/functions/patch.js +5 -0
- package/node_modules/semver/functions/prerelease.js +8 -0
- package/node_modules/semver/functions/rcompare.js +5 -0
- package/node_modules/semver/functions/rsort.js +5 -0
- package/node_modules/semver/functions/satisfies.js +12 -0
- package/node_modules/semver/functions/sort.js +5 -0
- package/node_modules/semver/functions/truncate.js +48 -0
- package/node_modules/semver/functions/valid.js +8 -0
- package/node_modules/semver/index.js +93 -0
- package/node_modules/semver/internal/constants.js +67 -0
- package/node_modules/semver/internal/debug.js +11 -0
- package/node_modules/semver/internal/identifiers.js +29 -0
- package/node_modules/semver/internal/lrucache.js +42 -0
- package/node_modules/semver/internal/parse-options.js +17 -0
- package/node_modules/semver/internal/re.js +223 -0
- package/node_modules/semver/internal/trim-comparator-whitespace.js +438 -0
- package/node_modules/semver/package.json +78 -0
- package/node_modules/semver/preload.js +4 -0
- package/node_modules/semver/range.bnf +17 -0
- package/node_modules/semver/ranges/gtr.js +6 -0
- package/node_modules/semver/ranges/intersects.js +9 -0
- package/node_modules/semver/ranges/ltr.js +6 -0
- package/node_modules/semver/ranges/max-satisfying.js +27 -0
- package/node_modules/semver/ranges/min-satisfying.js +26 -0
- package/node_modules/semver/ranges/min-version.js +63 -0
- package/node_modules/semver/ranges/outside.js +82 -0
- package/node_modules/semver/ranges/simplify.js +49 -0
- package/node_modules/semver/ranges/subset.js +249 -0
- package/node_modules/semver/ranges/to-comparators.js +10 -0
- package/node_modules/semver/ranges/valid.js +13 -0
- package/node_modules/yaml/LICENSE +13 -0
- package/node_modules/yaml/README.md +172 -0
- package/node_modules/yaml/bin.mjs +11 -0
- package/node_modules/yaml/browser/dist/compose/compose-collection.js +88 -0
- package/node_modules/yaml/browser/dist/compose/compose-doc.js +43 -0
- package/node_modules/yaml/browser/dist/compose/compose-node.js +109 -0
- package/node_modules/yaml/browser/dist/compose/compose-scalar.js +86 -0
- package/node_modules/yaml/browser/dist/compose/composer.js +219 -0
- package/node_modules/yaml/browser/dist/compose/resolve-block-map.js +115 -0
- package/node_modules/yaml/browser/dist/compose/resolve-block-scalar.js +198 -0
- package/node_modules/yaml/browser/dist/compose/resolve-block-seq.js +49 -0
- package/node_modules/yaml/browser/dist/compose/resolve-end.js +37 -0
- package/node_modules/yaml/browser/dist/compose/resolve-flow-collection.js +207 -0
- package/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js +226 -0
- package/node_modules/yaml/browser/dist/compose/resolve-props.js +146 -0
- package/node_modules/yaml/browser/dist/compose/util-contains-newline.js +34 -0
- package/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js +26 -0
- package/node_modules/yaml/browser/dist/compose/util-flow-indent-check.js +15 -0
- package/node_modules/yaml/browser/dist/compose/util-map-includes.js +13 -0
- package/node_modules/yaml/browser/dist/doc/Document.js +335 -0
- package/node_modules/yaml/browser/dist/doc/anchors.js +71 -0
- package/node_modules/yaml/browser/dist/doc/applyReviver.js +55 -0
- package/node_modules/yaml/browser/dist/doc/createNode.js +88 -0
- package/node_modules/yaml/browser/dist/doc/directives.js +176 -0
- package/node_modules/yaml/browser/dist/errors.js +57 -0
- package/node_modules/yaml/browser/dist/index.js +17 -0
- package/node_modules/yaml/browser/dist/log.js +11 -0
- package/node_modules/yaml/browser/dist/nodes/Alias.js +118 -0
- package/node_modules/yaml/browser/dist/nodes/Collection.js +147 -0
- package/node_modules/yaml/browser/dist/nodes/Node.js +38 -0
- package/node_modules/yaml/browser/dist/nodes/Pair.js +36 -0
- package/node_modules/yaml/browser/dist/nodes/Scalar.js +24 -0
- package/node_modules/yaml/browser/dist/nodes/YAMLMap.js +144 -0
- package/node_modules/yaml/browser/dist/nodes/YAMLSeq.js +113 -0
- package/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js +63 -0
- package/node_modules/yaml/browser/dist/nodes/identity.js +36 -0
- package/node_modules/yaml/browser/dist/nodes/toJS.js +37 -0
- package/node_modules/yaml/browser/dist/parse/cst-scalar.js +214 -0
- package/node_modules/yaml/browser/dist/parse/cst-stringify.js +61 -0
- package/node_modules/yaml/browser/dist/parse/cst-visit.js +97 -0
- package/node_modules/yaml/browser/dist/parse/cst.js +98 -0
- package/node_modules/yaml/browser/dist/parse/lexer.js +721 -0
- package/node_modules/yaml/browser/dist/parse/line-counter.js +39 -0
- package/node_modules/yaml/browser/dist/parse/parser.js +975 -0
- package/node_modules/yaml/browser/dist/public-api.js +102 -0
- package/node_modules/yaml/browser/dist/schema/Schema.js +37 -0
- package/node_modules/yaml/browser/dist/schema/common/map.js +17 -0
- package/node_modules/yaml/browser/dist/schema/common/null.js +15 -0
- package/node_modules/yaml/browser/dist/schema/common/seq.js +17 -0
- package/node_modules/yaml/browser/dist/schema/common/string.js +14 -0
- package/node_modules/yaml/browser/dist/schema/core/bool.js +19 -0
- package/node_modules/yaml/browser/dist/schema/core/float.js +43 -0
- package/node_modules/yaml/browser/dist/schema/core/int.js +38 -0
- package/node_modules/yaml/browser/dist/schema/core/schema.js +23 -0
- package/node_modules/yaml/browser/dist/schema/json/schema.js +62 -0
- package/node_modules/yaml/browser/dist/schema/tags.js +96 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js +58 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js +26 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/float.js +46 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/int.js +71 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/merge.js +67 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js +74 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js +78 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js +39 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/set.js +93 -0
- package/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js +101 -0
- package/node_modules/yaml/browser/dist/stringify/foldFlowLines.js +146 -0
- package/node_modules/yaml/browser/dist/stringify/stringify.js +129 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyCollection.js +153 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyComment.js +20 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyDocument.js +85 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyNumber.js +25 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyPair.js +150 -0
- package/node_modules/yaml/browser/dist/stringify/stringifyString.js +336 -0
- package/node_modules/yaml/browser/dist/util.js +11 -0
- package/node_modules/yaml/browser/dist/visit.js +233 -0
- package/node_modules/yaml/browser/index.js +5 -0
- package/node_modules/yaml/browser/package.json +3 -0
- package/node_modules/yaml/dist/cli.d.ts +8 -0
- package/node_modules/yaml/dist/cli.mjs +201 -0
- package/node_modules/yaml/dist/compose/compose-collection.d.ts +11 -0
- package/node_modules/yaml/dist/compose/compose-collection.js +90 -0
- package/node_modules/yaml/dist/compose/compose-doc.d.ts +7 -0
- package/node_modules/yaml/dist/compose/compose-doc.js +45 -0
- package/node_modules/yaml/dist/compose/compose-node.d.ts +29 -0
- package/node_modules/yaml/dist/compose/compose-node.js +112 -0
- package/node_modules/yaml/dist/compose/compose-scalar.d.ts +5 -0
- package/node_modules/yaml/dist/compose/compose-scalar.js +88 -0
- package/node_modules/yaml/dist/compose/composer.d.ts +63 -0
- package/node_modules/yaml/dist/compose/composer.js +224 -0
- package/node_modules/yaml/dist/compose/resolve-block-map.d.ts +6 -0
- package/node_modules/yaml/dist/compose/resolve-block-map.js +117 -0
- package/node_modules/yaml/dist/compose/resolve-block-scalar.d.ts +11 -0
- package/node_modules/yaml/dist/compose/resolve-block-scalar.js +200 -0
- package/node_modules/yaml/dist/compose/resolve-block-seq.d.ts +6 -0
- package/node_modules/yaml/dist/compose/resolve-block-seq.js +51 -0
- package/node_modules/yaml/dist/compose/resolve-end.d.ts +6 -0
- package/node_modules/yaml/dist/compose/resolve-end.js +39 -0
- package/node_modules/yaml/dist/compose/resolve-flow-collection.d.ts +7 -0
- package/node_modules/yaml/dist/compose/resolve-flow-collection.js +209 -0
- package/node_modules/yaml/dist/compose/resolve-flow-scalar.d.ts +10 -0
- package/node_modules/yaml/dist/compose/resolve-flow-scalar.js +228 -0
- package/node_modules/yaml/dist/compose/resolve-props.d.ts +23 -0
- package/node_modules/yaml/dist/compose/resolve-props.js +148 -0
- package/node_modules/yaml/dist/compose/util-contains-newline.d.ts +2 -0
- package/node_modules/yaml/dist/compose/util-contains-newline.js +36 -0
- package/node_modules/yaml/dist/compose/util-empty-scalar-position.d.ts +2 -0
- package/node_modules/yaml/dist/compose/util-empty-scalar-position.js +28 -0
- package/node_modules/yaml/dist/compose/util-flow-indent-check.d.ts +3 -0
- package/node_modules/yaml/dist/compose/util-flow-indent-check.js +17 -0
- package/node_modules/yaml/dist/compose/util-map-includes.d.ts +4 -0
- package/node_modules/yaml/dist/compose/util-map-includes.js +15 -0
- package/node_modules/yaml/dist/doc/Document.d.ts +141 -0
- package/node_modules/yaml/dist/doc/Document.js +337 -0
- package/node_modules/yaml/dist/doc/anchors.d.ts +24 -0
- package/node_modules/yaml/dist/doc/anchors.js +76 -0
- package/node_modules/yaml/dist/doc/applyReviver.d.ts +9 -0
- package/node_modules/yaml/dist/doc/applyReviver.js +57 -0
- package/node_modules/yaml/dist/doc/createNode.d.ts +17 -0
- package/node_modules/yaml/dist/doc/createNode.js +90 -0
- package/node_modules/yaml/dist/doc/directives.d.ts +49 -0
- package/node_modules/yaml/dist/doc/directives.js +178 -0
- package/node_modules/yaml/dist/errors.d.ts +21 -0
- package/node_modules/yaml/dist/errors.js +62 -0
- package/node_modules/yaml/dist/index.d.ts +25 -0
- package/node_modules/yaml/dist/index.js +50 -0
- package/node_modules/yaml/dist/log.d.ts +3 -0
- package/node_modules/yaml/dist/log.js +19 -0
- package/node_modules/yaml/dist/nodes/Alias.d.ts +29 -0
- package/node_modules/yaml/dist/nodes/Alias.js +120 -0
- package/node_modules/yaml/dist/nodes/Collection.d.ts +73 -0
- package/node_modules/yaml/dist/nodes/Collection.js +151 -0
- package/node_modules/yaml/dist/nodes/Node.d.ts +53 -0
- package/node_modules/yaml/dist/nodes/Node.js +40 -0
- package/node_modules/yaml/dist/nodes/Pair.d.ts +22 -0
- package/node_modules/yaml/dist/nodes/Pair.js +39 -0
- package/node_modules/yaml/dist/nodes/Scalar.d.ts +47 -0
- package/node_modules/yaml/dist/nodes/Scalar.js +27 -0
- package/node_modules/yaml/dist/nodes/YAMLMap.d.ts +53 -0
- package/node_modules/yaml/dist/nodes/YAMLMap.js +147 -0
- package/node_modules/yaml/dist/nodes/YAMLSeq.d.ts +60 -0
- package/node_modules/yaml/dist/nodes/YAMLSeq.js +115 -0
- package/node_modules/yaml/dist/nodes/addPairToJSMap.d.ts +4 -0
- package/node_modules/yaml/dist/nodes/addPairToJSMap.js +65 -0
- package/node_modules/yaml/dist/nodes/identity.d.ts +23 -0
- package/node_modules/yaml/dist/nodes/identity.js +53 -0
- package/node_modules/yaml/dist/nodes/toJS.d.ts +29 -0
- package/node_modules/yaml/dist/nodes/toJS.js +39 -0
- package/node_modules/yaml/dist/options.d.ts +350 -0
- package/node_modules/yaml/dist/parse/cst-scalar.d.ts +64 -0
- package/node_modules/yaml/dist/parse/cst-scalar.js +218 -0
- package/node_modules/yaml/dist/parse/cst-stringify.d.ts +8 -0
- package/node_modules/yaml/dist/parse/cst-stringify.js +63 -0
- package/node_modules/yaml/dist/parse/cst-visit.d.ts +39 -0
- package/node_modules/yaml/dist/parse/cst-visit.js +99 -0
- package/node_modules/yaml/dist/parse/cst.d.ts +109 -0
- package/node_modules/yaml/dist/parse/cst.js +112 -0
- package/node_modules/yaml/dist/parse/lexer.d.ts +87 -0
- package/node_modules/yaml/dist/parse/lexer.js +723 -0
- package/node_modules/yaml/dist/parse/line-counter.d.ts +22 -0
- package/node_modules/yaml/dist/parse/line-counter.js +41 -0
- package/node_modules/yaml/dist/parse/parser.d.ts +84 -0
- package/node_modules/yaml/dist/parse/parser.js +980 -0
- package/node_modules/yaml/dist/public-api.d.ts +44 -0
- package/node_modules/yaml/dist/public-api.js +107 -0
- package/node_modules/yaml/dist/schema/Schema.d.ts +17 -0
- package/node_modules/yaml/dist/schema/Schema.js +39 -0
- package/node_modules/yaml/dist/schema/common/map.d.ts +2 -0
- package/node_modules/yaml/dist/schema/common/map.js +19 -0
- package/node_modules/yaml/dist/schema/common/null.d.ts +4 -0
- package/node_modules/yaml/dist/schema/common/null.js +17 -0
- package/node_modules/yaml/dist/schema/common/seq.d.ts +2 -0
- package/node_modules/yaml/dist/schema/common/seq.js +19 -0
- package/node_modules/yaml/dist/schema/common/string.d.ts +2 -0
- package/node_modules/yaml/dist/schema/common/string.js +16 -0
- package/node_modules/yaml/dist/schema/core/bool.d.ts +4 -0
- package/node_modules/yaml/dist/schema/core/bool.js +21 -0
- package/node_modules/yaml/dist/schema/core/float.d.ts +4 -0
- package/node_modules/yaml/dist/schema/core/float.js +47 -0
- package/node_modules/yaml/dist/schema/core/int.d.ts +4 -0
- package/node_modules/yaml/dist/schema/core/int.js +42 -0
- package/node_modules/yaml/dist/schema/core/schema.d.ts +1 -0
- package/node_modules/yaml/dist/schema/core/schema.js +25 -0
- package/node_modules/yaml/dist/schema/json/schema.d.ts +2 -0
- package/node_modules/yaml/dist/schema/json/schema.js +64 -0
- package/node_modules/yaml/dist/schema/json-schema.d.ts +69 -0
- package/node_modules/yaml/dist/schema/tags.d.ts +48 -0
- package/node_modules/yaml/dist/schema/tags.js +99 -0
- package/node_modules/yaml/dist/schema/types.d.ts +92 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/binary.d.ts +2 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/binary.js +70 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/bool.d.ts +7 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/bool.js +29 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/float.d.ts +4 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/float.js +50 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/int.d.ts +5 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/int.js +76 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/merge.d.ts +9 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/merge.js +71 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/omap.d.ts +22 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/omap.js +77 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/pairs.d.ts +10 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/pairs.js +82 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/schema.d.ts +1 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/schema.js +41 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/set.d.ts +28 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/set.js +96 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.d.ts +6 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js +105 -0
- package/node_modules/yaml/dist/stringify/foldFlowLines.d.ts +34 -0
- package/node_modules/yaml/dist/stringify/foldFlowLines.js +151 -0
- package/node_modules/yaml/dist/stringify/stringify.d.ts +21 -0
- package/node_modules/yaml/dist/stringify/stringify.js +132 -0
- package/node_modules/yaml/dist/stringify/stringifyCollection.d.ts +17 -0
- package/node_modules/yaml/dist/stringify/stringifyCollection.js +155 -0
- package/node_modules/yaml/dist/stringify/stringifyComment.d.ts +10 -0
- package/node_modules/yaml/dist/stringify/stringifyComment.js +24 -0
- package/node_modules/yaml/dist/stringify/stringifyDocument.d.ts +4 -0
- package/node_modules/yaml/dist/stringify/stringifyDocument.js +87 -0
- package/node_modules/yaml/dist/stringify/stringifyNumber.d.ts +2 -0
- package/node_modules/yaml/dist/stringify/stringifyNumber.js +27 -0
- package/node_modules/yaml/dist/stringify/stringifyPair.d.ts +3 -0
- package/node_modules/yaml/dist/stringify/stringifyPair.js +152 -0
- package/node_modules/yaml/dist/stringify/stringifyString.d.ts +9 -0
- package/node_modules/yaml/dist/stringify/stringifyString.js +338 -0
- package/node_modules/yaml/dist/test-events.d.ts +4 -0
- package/node_modules/yaml/dist/test-events.js +134 -0
- package/node_modules/yaml/dist/util.d.ts +16 -0
- package/node_modules/yaml/dist/util.js +28 -0
- package/node_modules/yaml/dist/visit.d.ts +102 -0
- package/node_modules/yaml/dist/visit.js +236 -0
- package/node_modules/yaml/package.json +97 -0
- package/node_modules/yaml/util.js +2 -0
- package/package.json +10 -2
- package/server/impl.mjs +11 -1
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@capyclaw/tool-host",
|
|
3
|
+
"version": "0.3.1",
|
|
4
|
+
"description": "DSH 公共工具面插件:能力 DSL、工具注册表、参数校验、契约报告、MCP 协议壳与 instructions 模板,向插件提供 ctx.toolHost。",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./lib/host.mjs",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": "./lib/host.mjs",
|
|
9
|
+
"./src": "./src/index.mjs",
|
|
10
|
+
"./package.json": "./package.json"
|
|
11
|
+
},
|
|
12
|
+
"engines": {
|
|
13
|
+
"node": ">=18",
|
|
14
|
+
"dsh": "^0.2.0-rc.2"
|
|
15
|
+
},
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public"
|
|
18
|
+
},
|
|
19
|
+
"dsh": {
|
|
20
|
+
"bundle": {
|
|
21
|
+
"patch": "./cordis.patch.yml"
|
|
22
|
+
},
|
|
23
|
+
"suite": "./dsh-suite.json",
|
|
24
|
+
"apiVersion": "1.1.0",
|
|
25
|
+
"category": "service",
|
|
26
|
+
"platform": "both",
|
|
27
|
+
"driver": {
|
|
28
|
+
"service": "toolHost"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"meta": {
|
|
32
|
+
"title": "公共服务工具面",
|
|
33
|
+
"description": "能力 DSL、工具注册表、参数校验、契约报告与 MCP 协议壳,向插件提供 ctx.toolHost"
|
|
34
|
+
},
|
|
35
|
+
"files": [
|
|
36
|
+
"lib/",
|
|
37
|
+
"src/",
|
|
38
|
+
"cordis.patch.yml",
|
|
39
|
+
"dsh-suite.json",
|
|
40
|
+
"README.md"
|
|
41
|
+
],
|
|
42
|
+
"license": "MIT",
|
|
43
|
+
"scripts": {
|
|
44
|
+
"test": "node --test --test-isolation=none test/*.test.mjs"
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"@capyclaw/plugin-kit": "^0.2.0",
|
|
48
|
+
"@capyclaw/foundation": "^0.1.1"
|
|
49
|
+
},
|
|
50
|
+
"repository": {
|
|
51
|
+
"type": "git",
|
|
52
|
+
"url": "git+https://github.com/Maple496/capyclaw.git",
|
|
53
|
+
"directory": "C/packages/capyclaw-tool-host"
|
|
54
|
+
},
|
|
55
|
+
"bugs": {
|
|
56
|
+
"url": "https://github.com/Maple496/capyclaw/issues"
|
|
57
|
+
},
|
|
58
|
+
"homepage": "https://github.com/Maple496/capyclaw/tree/main/C/packages/capyclaw-tool-host#readme"
|
|
59
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 工具结果图像准入 —— DSH 原生工具面专用。
|
|
3
|
+
*
|
|
4
|
+
* 背景(2026-11-22 会话中断根因):DSH 的 ImageBlock 契约要求
|
|
5
|
+
* `{ type:'image', attachment: ImageAttachmentRef }`(见 @deepseek-ai/dsh-llm
|
|
6
|
+
* types.ts)。但部分工作台工具(rsp_screen / browser_screenshot 等)为了「图片直接
|
|
7
|
+
* 回给模型」返回了 MCP wire 形态的裸 base64 块 `{ type:'image', data, mimeType }`。
|
|
8
|
+
* 原生面 `dsh-tools/batch.ts` 把 result.content 原样写进 session 日志、不做形状校验,
|
|
9
|
+
* 于是坏块永久留在历史里;下一步构建请求时序列化器读 `block.attachment.attachmentId`
|
|
10
|
+
* 抛 TypeError(deepseek 侧包成 TRANSPORT,qwen4 侧冒泡成 UNKNOWN),该会话此后每一轮
|
|
11
|
+
* 都在发出前崩掉。
|
|
12
|
+
*
|
|
13
|
+
* 官方工具(read_image / mcp-client / office)都是自己先 `attachments.saveImage`
|
|
14
|
+
* 再回 attachment ref。这里在注册层补上同一道准入:把裸 base64 图像块持久化成
|
|
15
|
+
* attachment ref 再交给 DSH,一处修复覆盖所有 capyclaw 原生工具。
|
|
16
|
+
*
|
|
17
|
+
* 注意:只用于原生面(registerWithDsh)。MCP 面(createMcpHandler/dispatcher)必须
|
|
18
|
+
* 保留 `{data,mimeType}` wire 形态——那是 MCP 协议本身,由 dsh-mcp-client 负责落盘。
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
/** 是否是一个尚未准入的裸 base64 图像块(缺 attachment、带 string data)。 */
|
|
22
|
+
function isRawImageBlock(block) {
|
|
23
|
+
return !!block && block.type === 'image' && !block.attachment && typeof block.data === 'string'
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* 从执行上下文 / 注册上下文解析 attachments 服务。
|
|
28
|
+
* agent 的会话级 ctx 与 read_image 用的是同一棵上下文树,attachments 必在其上;
|
|
29
|
+
* 注册 ctx 作为兜底。cordis 未 inject 时 get 可能抛错,逐一吞掉换下一个候选。
|
|
30
|
+
* @returns {object|null} 带 saveImage 的 AttachmentStore,或 null。
|
|
31
|
+
*/
|
|
32
|
+
export function resolveAttachments(exec, ctx) {
|
|
33
|
+
for (const candidate of [exec?.agent?.ctx, ctx]) {
|
|
34
|
+
if (!candidate) continue
|
|
35
|
+
try {
|
|
36
|
+
const viaGet = typeof candidate.get === 'function' ? candidate.get('attachments') : undefined
|
|
37
|
+
const service = viaGet ?? candidate.attachments ?? candidate.reflect?.get?.('attachments')
|
|
38
|
+
if (service && typeof service.saveImage === 'function') return service
|
|
39
|
+
} catch { /* 该上下文取不到,换下一个候选 */ }
|
|
40
|
+
}
|
|
41
|
+
return null
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* 把工具结果 content 里的裸 base64 图像块准入为持久 attachment ref。
|
|
46
|
+
* 非图像块、已带 attachment 的图像块原样保留;无图像块时零开销直接返回原数组。
|
|
47
|
+
*
|
|
48
|
+
* 降级原则:宁可丢图也不毒化会话——attachments 缺席或 saveImage 失败时,把该图像块
|
|
49
|
+
* 换成一条说明性 text 块(工具通常另有一条带落盘路径的 text 块,信息不丢)。
|
|
50
|
+
*
|
|
51
|
+
* @param {Array} content 归一化后的 MCP content 块数组。
|
|
52
|
+
* @param {object|null} attachments AttachmentStore(resolveAttachments 的结果)。
|
|
53
|
+
* @param {{ name?: string }} [opts] 可选显示名(写入 ref.name,绝不解释为路径)。
|
|
54
|
+
* @returns {Promise<Array>} 准入后的 content 块数组。
|
|
55
|
+
*/
|
|
56
|
+
export async function admitToolResultImages(content, attachments, { name } = {}) {
|
|
57
|
+
if (!Array.isArray(content)) return content
|
|
58
|
+
if (!content.some(isRawImageBlock)) return content
|
|
59
|
+
|
|
60
|
+
const out = []
|
|
61
|
+
for (const block of content) {
|
|
62
|
+
if (!isRawImageBlock(block)) { out.push(block); continue }
|
|
63
|
+
|
|
64
|
+
const mediaType = block.mediaType || block.mimeType || 'image/png'
|
|
65
|
+
if (!attachments) {
|
|
66
|
+
out.push({ type: 'text', text: `[image omitted: no attachment service mounted; ${mediaType}]` })
|
|
67
|
+
continue
|
|
68
|
+
}
|
|
69
|
+
try {
|
|
70
|
+
const data = Buffer.from(block.data, 'base64')
|
|
71
|
+
const ref = await attachments.saveImage({ data, mediaType, ...(name ? { name } : {}) })
|
|
72
|
+
out.push({ type: 'image', attachment: ref })
|
|
73
|
+
} catch (error) {
|
|
74
|
+
const code = error?.code || error?.name || 'ERROR'
|
|
75
|
+
const message = String(error?.message || error)
|
|
76
|
+
out.push({ type: 'text', text: `[image omitted: attachment save failed (${code}): ${message}]` })
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return out
|
|
80
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 调用者会话上下文(框架级 ALS)。
|
|
3
|
+
*
|
|
4
|
+
* registerWithDsh 把每个原生工具的执行包进 runWithCallerSession(sid, …),
|
|
5
|
+
* 于是工具 handler 执行期间(哪怕 handler 只拿到 (args, ctx)、丢了 exec),
|
|
6
|
+
* 框架内部任何一层都能用 currentCallerSession() 取回“是谁在调我”。
|
|
7
|
+
*
|
|
8
|
+
* 用途:会话模式锁在能力发现面(discoverCapabilities)按调用者会话过滤异领域
|
|
9
|
+
* 描述符——conductor_discover 这类 read 工具无需自己接线 exec 即自动受约束。
|
|
10
|
+
*
|
|
11
|
+
* 无会话(HTTP/MCP 管理面、墙聚合视图)时返回 '',调用方据此降级为不过滤。
|
|
12
|
+
*/
|
|
13
|
+
import { AsyncLocalStorage } from 'node:async_hooks'
|
|
14
|
+
|
|
15
|
+
const als = new AsyncLocalStorage()
|
|
16
|
+
|
|
17
|
+
/** 在指定调用者会话上下文里执行 fn(同步/异步均可,ALS 随 await 传播)。 */
|
|
18
|
+
export function runWithCallerSession(sessionId, fn) {
|
|
19
|
+
return als.run(String(sessionId || ''), fn)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** 当前调用者会话 id;不在工具调用上下文里时返回 ''。 */
|
|
23
|
+
export function currentCallerSession() {
|
|
24
|
+
return als.getStore() || ''
|
|
25
|
+
}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 能力描述符注册表(互联标准 v0.2 §A.4 / §E「broker 注册发现」的公共落点)。
|
|
3
|
+
*
|
|
4
|
+
* 定位:tool-host 已是公共工具面(defineCapability/createRegistry),这里再补一层
|
|
5
|
+
* 「跨套件能力发现」——每个套件把自己的能力描述符 + 调用地址登记进来,编排器
|
|
6
|
+
* (conductor 这类平级作品)按 produces/consumes/controlMode 动态发现,不硬 import 任何套件。
|
|
7
|
+
*
|
|
8
|
+
* 解耦口径(标准 §1):
|
|
9
|
+
* - 注册表只认「描述符 + 地址」,不认套件实现;套件之间零互依赖。
|
|
10
|
+
* - 描述符的深度校验交给注入的 validate(通常是 @capyclaw/suite-kit/capability 的
|
|
11
|
+
* validateCapabilityDescriptor);本模块只做最小结构兜底,保持零依赖、可单测。
|
|
12
|
+
* - baseUrl 是套件的调用入口(service-host 的 app.url,embedded 模式也有值),
|
|
13
|
+
* 编排器据此走 HTTP MCP tools/call,而不是 ctx.tools.execute(后者需要 Agent scope,太重)。
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
const CONTROL_MODES = new Set(['interface', 'browser'])
|
|
17
|
+
const KINDS = new Set(['read', 'write', 'control'])
|
|
18
|
+
|
|
19
|
+
/** 结尾 `/*` 前缀通配:`artifact:image/*` 命中 `artifact:image/png`。 */
|
|
20
|
+
function typeMatches(pattern, type) {
|
|
21
|
+
if (!pattern || !type) return false
|
|
22
|
+
if (pattern === type) return true
|
|
23
|
+
if (pattern.endsWith('/*')) return type.startsWith(pattern.slice(0, -1))
|
|
24
|
+
return false
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function anyTypeMatches(patterns, type) {
|
|
28
|
+
return (patterns || []).some((p) => typeMatches(p, type))
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** 双向通配匹配:声明侧或查询侧任一带 `/*` 通配都要能命中。
|
|
32
|
+
* 旧实现只把声明当 pattern、查询当 type,查询侧通配(conductor 问「谁产出
|
|
33
|
+
* artifact:image/*」)永远不命中具体类型。 */
|
|
34
|
+
function typesOverlap(declPatterns, queryType) {
|
|
35
|
+
return (declPatterns || []).some((p) => typeMatches(p, queryType) || typeMatches(queryType, p))
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** 深冻结:描述符的 produces/consumes/surface/provides 等嵌套结构也要不可变,
|
|
39
|
+
* 否则注册后仍能被外部改写,注册表的「单一真源」失真。 */
|
|
40
|
+
function deepFreeze(value) {
|
|
41
|
+
if (!value || typeof value !== 'object' || Object.isFrozen(value)) return value
|
|
42
|
+
Object.freeze(value)
|
|
43
|
+
for (const key of Object.keys(value)) deepFreeze(value[key])
|
|
44
|
+
return value
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** 最小结构兜底:name/suite/controlMode/kind 必须在场且合法。深度校验走注入的 validate。 */
|
|
48
|
+
function structuralCheck(descriptor) {
|
|
49
|
+
const errors = []
|
|
50
|
+
if (!descriptor || typeof descriptor !== 'object') return ['descriptor 必须是对象']
|
|
51
|
+
if (!descriptor.name || typeof descriptor.name !== 'string') errors.push('缺少 name')
|
|
52
|
+
if (!descriptor.suite || typeof descriptor.suite !== 'string') errors.push('缺少 suite')
|
|
53
|
+
if (!descriptor.capability || typeof descriptor.capability !== 'string') errors.push('缺少 capability(能力语义)')
|
|
54
|
+
if (!CONTROL_MODES.has(descriptor.controlMode)) errors.push(`controlMode 必须是 interface|browser,收到 ${descriptor.controlMode}`)
|
|
55
|
+
if (!KINDS.has(descriptor.kind)) errors.push(`kind 必须是 read|write|control,收到 ${descriptor.kind}`)
|
|
56
|
+
return errors
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* @param {{ validate?: (d:object)=>{ok:boolean,errors?:string[]} }} [options]
|
|
61
|
+
* validate 可选注入(suite-kit 的深度校验器)。缺省只做结构兜底。
|
|
62
|
+
*/
|
|
63
|
+
export function createDescriptorRegistry({ validate } = {}) {
|
|
64
|
+
/** @type {Map<string, {descriptor:object, suite:string, baseUrl:string, registeredAt:number}>} */
|
|
65
|
+
const entries = new Map()
|
|
66
|
+
|
|
67
|
+
function register(descriptor, { suite, baseUrl = '', force = false } = {}) {
|
|
68
|
+
const merged = { ...descriptor, suite: descriptor?.suite || suite }
|
|
69
|
+
const errors = structuralCheck(merged)
|
|
70
|
+
if (errors.length) {
|
|
71
|
+
const err = new Error(`能力描述符不合法: ${errors.join('; ')}`)
|
|
72
|
+
err.code = 'DESCRIPTOR_INVALID'
|
|
73
|
+
throw err
|
|
74
|
+
}
|
|
75
|
+
if (typeof validate === 'function') {
|
|
76
|
+
const verdict = validate(merged)
|
|
77
|
+
if (verdict && verdict.ok === false) {
|
|
78
|
+
const err = new Error(`能力描述符不合法: ${(verdict.errors || []).join('; ')}`)
|
|
79
|
+
err.code = 'DESCRIPTOR_INVALID'
|
|
80
|
+
throw err
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/* owner 校验:同名描述符已属另一套件时拒绝静默覆盖(防跨套件抢占);
|
|
84
|
+
* 同套件热重载刷新放行,确需跨套件替换须显式 force。 */
|
|
85
|
+
const existing = entries.get(merged.name)
|
|
86
|
+
if (existing && existing.suite !== merged.suite && !force) {
|
|
87
|
+
const err = new Error(`能力描述符 ${merged.name} 已属套件 ${existing.suite},套件 ${merged.suite} 不能覆盖(如确需替换请传 force)`)
|
|
88
|
+
err.code = 'DESCRIPTOR_OWNER_CONFLICT'
|
|
89
|
+
throw err
|
|
90
|
+
}
|
|
91
|
+
const entry = Object.freeze({
|
|
92
|
+
descriptor: deepFreeze({ ...merged }),
|
|
93
|
+
suite: merged.suite,
|
|
94
|
+
baseUrl: String(baseUrl || ''),
|
|
95
|
+
registeredAt: Date.now(),
|
|
96
|
+
})
|
|
97
|
+
// 同名幂等覆盖:套件热重载/重新激活时直接刷新,不产生重复。
|
|
98
|
+
entries.set(merged.name, entry)
|
|
99
|
+
return entry
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function unregister(name) {
|
|
103
|
+
return entries.delete(name)
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* 按条件发现。produces/consumes 用类型词表匹配(含 `/*` 通配)。
|
|
108
|
+
* @param {{ name?:string, suite?:string, controlMode?:string, kind?:string,
|
|
109
|
+
* produces?:string, consumes?:string }} [query]
|
|
110
|
+
*/
|
|
111
|
+
function discover(query = {}) {
|
|
112
|
+
const out = []
|
|
113
|
+
for (const entry of entries.values()) {
|
|
114
|
+
const d = entry.descriptor
|
|
115
|
+
if (query.name && d.name !== query.name) continue
|
|
116
|
+
if (query.suite && entry.suite !== query.suite) continue
|
|
117
|
+
if (query.controlMode && d.controlMode !== query.controlMode) continue
|
|
118
|
+
if (query.kind && d.kind !== query.kind) continue
|
|
119
|
+
if (query.produces && !typesOverlap(d.produces, query.produces)) continue
|
|
120
|
+
if (query.consumes && !typesOverlap(d.consumes, query.consumes)) continue
|
|
121
|
+
out.push(entry)
|
|
122
|
+
}
|
|
123
|
+
return out
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function catalog() {
|
|
127
|
+
return [...entries.values()]
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* 表面投影(互联标准 v0.3 §C.7 / 单一真源):把描述符里的 surface 声明聚合成
|
|
132
|
+
* 「工作台候选」,一扇挂载路径一行。portal-hud/展示墙与编排器读的是**同一个**注册表,
|
|
133
|
+
* 因此「注册了一个带 surface 的能力」必然自动上墙,不会出现能力加了表上没有。
|
|
134
|
+
*
|
|
135
|
+
* 只认 surface.embedPath(以 / 开头);同路径去重(一个套件多个工具共享一扇窗)。
|
|
136
|
+
* 返回行形状与 portal-hud 注册行兼容:{id,title,path,suite,lastAt:''}。
|
|
137
|
+
*/
|
|
138
|
+
function listSurfaces() {
|
|
139
|
+
const byPath = new Map()
|
|
140
|
+
for (const entry of entries.values()) {
|
|
141
|
+
const surface = entry.descriptor && entry.descriptor.surface
|
|
142
|
+
const embedPath = surface && typeof surface.embedPath === 'string' ? surface.embedPath : ''
|
|
143
|
+
if (!embedPath || !embedPath.startsWith('/')) continue
|
|
144
|
+
if (surface.embeddable === false && surface.standalone === false) continue
|
|
145
|
+
if (byPath.has(embedPath)) continue
|
|
146
|
+
const suite = entry.suite
|
|
147
|
+
byPath.set(embedPath, {
|
|
148
|
+
id: `${suite}-workbench`,
|
|
149
|
+
title: String(surface.title || '') || `${suite} 工作台`,
|
|
150
|
+
path: embedPath.endsWith('/') ? embedPath : `${embedPath}/`,
|
|
151
|
+
suite,
|
|
152
|
+
lastAt: '',
|
|
153
|
+
})
|
|
154
|
+
}
|
|
155
|
+
return [...byPath.values()]
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
return {
|
|
159
|
+
register,
|
|
160
|
+
unregister,
|
|
161
|
+
discover,
|
|
162
|
+
catalog,
|
|
163
|
+
listSurfaces,
|
|
164
|
+
get size() { return entries.size },
|
|
165
|
+
}
|
|
166
|
+
}
|