@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,449 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @capyclaw/tool-host —— 工具面标准件。
|
|
3
|
+
*
|
|
4
|
+
* 把“能力声明 → 注册表 → 工具 schema/实现 → 契约报告 → MCP 协议壳”收成一套:
|
|
5
|
+
* defineTool / defineCapability / createRegistry / createMcpHandler /
|
|
6
|
+
* createCapabilityReport / buildInstructions
|
|
7
|
+
*
|
|
8
|
+
* 功能插件只写业务能力,不再复制 kernel/registry/dispatch/validate/contract。
|
|
9
|
+
*/
|
|
10
|
+
import { createMcpHandler as createKitMcpHandler } from '@capyclaw/plugin-kit/service/mcp-http'
|
|
11
|
+
import { validateToolArguments } from '@capyclaw/plugin-kit/tools/validate'
|
|
12
|
+
import { normalizeToolResult, resultText } from '@capyclaw/plugin-kit/tools/result'
|
|
13
|
+
import { createServiceApi } from '@capyclaw/plugin-kit/service/api'
|
|
14
|
+
import { createDescriptorRegistry } from './descriptors.mjs'
|
|
15
|
+
import { createModeGate } from './mode-gate.mjs'
|
|
16
|
+
import { runWithCallerSession, currentCallerSession } from './caller-session.mjs'
|
|
17
|
+
import { admitToolResultImages, resolveAttachments } from './admit-images.mjs'
|
|
18
|
+
|
|
19
|
+
export { admitToolResultImages, resolveAttachments } from './admit-images.mjs'
|
|
20
|
+
export { createDescriptorRegistry } from './descriptors.mjs'
|
|
21
|
+
export { createModeGate } from './mode-gate.mjs'
|
|
22
|
+
export { runWithCallerSession, currentCallerSession } from './caller-session.mjs'
|
|
23
|
+
|
|
24
|
+
const KINDS = new Set(['read', 'write', 'control'])
|
|
25
|
+
|
|
26
|
+
export function defineTool({
|
|
27
|
+
name,
|
|
28
|
+
description = '',
|
|
29
|
+
inputSchema = { type: 'object', properties: {}, additionalProperties: false },
|
|
30
|
+
kind = 'write',
|
|
31
|
+
since = '1.0.0',
|
|
32
|
+
domain = '',
|
|
33
|
+
handler,
|
|
34
|
+
} = {}) {
|
|
35
|
+
if (!name || typeof name !== 'string') throw new Error('defineTool 需要 name')
|
|
36
|
+
if (typeof handler !== 'function') throw new Error(`工具 ${name} 需要 handler`)
|
|
37
|
+
if (!KINDS.has(kind)) throw new Error(`工具 ${name} 的 kind 非法: ${kind}`)
|
|
38
|
+
return Object.freeze({ name, description, inputSchema, kind, since, domain: String(domain || ''), handler })
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function defineCapability({
|
|
42
|
+
id,
|
|
43
|
+
title,
|
|
44
|
+
description = '',
|
|
45
|
+
tags = [],
|
|
46
|
+
requires = [],
|
|
47
|
+
dependsOn = [],
|
|
48
|
+
provides = {},
|
|
49
|
+
features = [],
|
|
50
|
+
domain = '',
|
|
51
|
+
tools = [],
|
|
52
|
+
} = {}) {
|
|
53
|
+
if (!id || typeof id !== 'string') throw new Error('defineCapability 需要 id')
|
|
54
|
+
if (!Array.isArray(tools) || !tools.length) throw new Error(`能力 ${id} 至少需要一个工具`)
|
|
55
|
+
return Object.freeze({
|
|
56
|
+
id,
|
|
57
|
+
title: title || id,
|
|
58
|
+
description,
|
|
59
|
+
tags: Object.freeze([...tags]),
|
|
60
|
+
requires: Object.freeze([...requires]),
|
|
61
|
+
dependsOn: Object.freeze([...dependsOn]),
|
|
62
|
+
provides: Object.freeze({ ...provides }),
|
|
63
|
+
features: Object.freeze([...features]),
|
|
64
|
+
domain: String(domain || ''),
|
|
65
|
+
tools: Object.freeze([...tools]),
|
|
66
|
+
})
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function validateCapabilities(capabilities) {
|
|
70
|
+
const ids = new Set()
|
|
71
|
+
const toolNames = new Set()
|
|
72
|
+
for (const cap of capabilities) {
|
|
73
|
+
if (ids.has(cap.id)) throw new Error(`重复的 capability id: ${cap.id}`)
|
|
74
|
+
ids.add(cap.id)
|
|
75
|
+
for (const tool of cap.tools) {
|
|
76
|
+
if (toolNames.has(tool.name)) throw new Error(`重复的工具名: ${tool.name}`)
|
|
77
|
+
toolNames.add(tool.name)
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
for (const cap of capabilities) {
|
|
81
|
+
for (const dep of cap.dependsOn) {
|
|
82
|
+
if (!ids.has(dep)) throw new Error(`能力 ${cap.id} 依赖不存在的能力: ${dep}`)
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function selectCapabilities(capabilities, enabled) {
|
|
88
|
+
if (!enabled || !enabled.length) return capabilities
|
|
89
|
+
const byId = new Map(capabilities.map((cap) => [cap.id, cap]))
|
|
90
|
+
for (const id of enabled) {
|
|
91
|
+
if (!byId.has(id)) throw new Error(`enabled 里有未知能力: ${id}`)
|
|
92
|
+
}
|
|
93
|
+
const ids = new Set(enabled)
|
|
94
|
+
let changed = true
|
|
95
|
+
while (changed) {
|
|
96
|
+
changed = false
|
|
97
|
+
for (const cap of capabilities) {
|
|
98
|
+
if (!ids.has(cap.id)) continue
|
|
99
|
+
for (const dep of cap.dependsOn) {
|
|
100
|
+
if (!ids.has(dep)) { ids.add(dep); changed = true }
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return capabilities.filter((cap) => ids.has(cap.id))
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* @param {Array} capabilities
|
|
109
|
+
* @param {{ enabled?: string[], ports?: object, report?: Function, reserved?: string[] }} options
|
|
110
|
+
*/
|
|
111
|
+
export function createRegistry(capabilities, { enabled = null, ports = null, report = null, reserved = [], domain = '' } = {}) {
|
|
112
|
+
validateCapabilities(capabilities)
|
|
113
|
+
const selected = selectCapabilities(capabilities, enabled)
|
|
114
|
+
|
|
115
|
+
const kernelPorts = { ...(ports || {}) }
|
|
116
|
+
const reservedNames = new Set([...(reserved || []), 'contract'])
|
|
117
|
+
const providers = new Map()
|
|
118
|
+
for (const cap of selected) {
|
|
119
|
+
for (const [ns, api] of Object.entries(cap.provides || {})) {
|
|
120
|
+
if (reservedNames.has(ns)) throw new Error(`能力 ${cap.id} 不能覆盖内核端口: ${ns}`)
|
|
121
|
+
if (providers.has(ns)) throw new Error(`服务命名空间重复: ${ns}(${providers.get(ns).cap.id} / ${cap.id})`)
|
|
122
|
+
providers.set(ns, { cap, api })
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const available = new Set([...Object.keys(kernelPorts), ...reservedNames, ...providers.keys()])
|
|
127
|
+
for (const cap of selected) {
|
|
128
|
+
for (const req of cap.requires) {
|
|
129
|
+
if (!available.has(req)) throw new Error(`能力 ${cap.id} 需要未提供的端口/服务: ${req}`)
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
const ctx = { ...kernelPorts }
|
|
134
|
+
for (const [ns, { api }] of providers) {
|
|
135
|
+
ctx[ns] = {}
|
|
136
|
+
for (const [method, fn] of Object.entries(api)) {
|
|
137
|
+
if (typeof fn !== 'function') throw new Error(`服务 ${ns}.${method} 必须是函数`)
|
|
138
|
+
ctx[ns][method] = (...args) => fn(ctx, ...args)
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
const TOOLS = []
|
|
143
|
+
const TOOL_IMPL = {}
|
|
144
|
+
const TOOL_META = {}
|
|
145
|
+
const FEATURES = []
|
|
146
|
+
const CAPABILITIES = []
|
|
147
|
+
|
|
148
|
+
for (const cap of selected) {
|
|
149
|
+
for (const feature of cap.features) {
|
|
150
|
+
if (!FEATURES.includes(feature)) FEATURES.push(feature)
|
|
151
|
+
}
|
|
152
|
+
CAPABILITIES.push({
|
|
153
|
+
id: cap.id,
|
|
154
|
+
title: cap.title,
|
|
155
|
+
description: cap.description,
|
|
156
|
+
tags: [...cap.tags],
|
|
157
|
+
domain: cap.domain || domain || '',
|
|
158
|
+
tools: cap.tools.map((tool) => tool.name),
|
|
159
|
+
})
|
|
160
|
+
for (const tool of cap.tools) {
|
|
161
|
+
TOOLS.push({ name: tool.name, description: tool.description, inputSchema: tool.inputSchema })
|
|
162
|
+
TOOL_META[tool.name] = { kind: tool.kind, since: tool.since, capability: cap.id, domain: tool.domain || cap.domain || domain || '' }
|
|
163
|
+
TOOL_IMPL[tool.name] = (args) => tool.handler(args || {}, ctx)
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
const reportFn = report || createCapabilityReport
|
|
168
|
+
ctx.contract = {
|
|
169
|
+
report: (editorUrl = '', runtime = {}) => reportFn({
|
|
170
|
+
tools: TOOLS,
|
|
171
|
+
toolMeta: TOOL_META,
|
|
172
|
+
features: FEATURES,
|
|
173
|
+
capabilities: CAPABILITIES,
|
|
174
|
+
editorUrl,
|
|
175
|
+
runtime,
|
|
176
|
+
}),
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/* 动态增删工具:配合 MCP 活引用(tools/list 读 registry.TOOLS),注册/注销后
|
|
180
|
+
* 客户端重新 list 即见最新工具集,无需重建 handler。旧 registry 是纯静态,
|
|
181
|
+
* 套件热重载/能力开关无法反映到工具面。 */
|
|
182
|
+
function registerTool(tool, capabilityId = '') {
|
|
183
|
+
if (!tool || typeof tool.name !== 'string' || !tool.name) throw new Error('registerTool 需要 tool.name')
|
|
184
|
+
if (typeof tool.handler !== 'function') throw new Error(`工具 ${tool.name} 需要 handler`)
|
|
185
|
+
if (TOOL_IMPL[tool.name]) throw new Error(`工具已存在: ${tool.name}`)
|
|
186
|
+
TOOLS.push({ name: tool.name, description: tool.description || '', inputSchema: tool.inputSchema || { type: 'object', properties: {} } })
|
|
187
|
+
TOOL_META[tool.name] = { kind: tool.kind || 'write', since: tool.since || '1.0.0', capability: capabilityId, domain: tool.domain || domain || '' }
|
|
188
|
+
TOOL_IMPL[tool.name] = (args) => tool.handler(args || {}, ctx)
|
|
189
|
+
return true
|
|
190
|
+
}
|
|
191
|
+
function unregisterTool(name) {
|
|
192
|
+
const index = TOOLS.findIndex((tool) => tool.name === name)
|
|
193
|
+
if (index < 0) return false
|
|
194
|
+
TOOLS.splice(index, 1)
|
|
195
|
+
delete TOOL_IMPL[name]
|
|
196
|
+
delete TOOL_META[name]
|
|
197
|
+
return true
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
return { TOOLS, TOOL_IMPL, TOOL_META, FEATURES, CAPABILITIES, ctx, registerTool, unregisterTool }
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/** 与 MCP 工具面解耦:调用前统一校验。 */
|
|
204
|
+
export function createToolDispatcher({ tools, callTool }) {
|
|
205
|
+
const toolMap = new Map((tools || []).map((tool) => [tool.name, tool]))
|
|
206
|
+
return {
|
|
207
|
+
listTools() {
|
|
208
|
+
return { tools }
|
|
209
|
+
},
|
|
210
|
+
async callTool(name, args = {}) {
|
|
211
|
+
const tool = toolMap.get(name)
|
|
212
|
+
if (!tool) {
|
|
213
|
+
return { content: [{ type: 'text', text: `未知工具: ${String(name)}` }], isError: true }
|
|
214
|
+
}
|
|
215
|
+
const check = validateToolArguments(tool, args)
|
|
216
|
+
if (!check.ok) {
|
|
217
|
+
return { content: [{ type: 'text', text: '参数不合法:' + check.errors.join(';') }], isError: true }
|
|
218
|
+
}
|
|
219
|
+
const out = await callTool(name, args)
|
|
220
|
+
/* 与 MCP 面同一归一化:保留纯字符串/空 text/对象,不丢成 'ok'(B 轴 P0-5)。 */
|
|
221
|
+
return normalizeToolResult(out)
|
|
222
|
+
},
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* MCP Streamable HTTP 处理器。registry 可直接传 createRegistry 的返回值。
|
|
228
|
+
* 兼容两种调用:
|
|
229
|
+
* { registry } 或 { tools, toolImpl }
|
|
230
|
+
* { tools, callTool }(旧 relay 形态)
|
|
231
|
+
* @param {{ registry?: object, tools?: Array, toolImpl?: object, callTool?: Function, serverInfo?: object, instructions?: string }} options
|
|
232
|
+
*/
|
|
233
|
+
export function createMcpHandler({ registry, tools, toolImpl, callTool, serverInfo, instructions, listChanged } = {}) {
|
|
234
|
+
/* registry 形态走活引用:tools/list 每次读 registry.TOOLS,callTool 读 registry.TOOL_IMPL,
|
|
235
|
+
* 于是 registerTool/unregisterTool 的动态增删立刻可见,无需重建 handler。 */
|
|
236
|
+
const useRegistry = !tools && !!registry
|
|
237
|
+
const impl = toolImpl || registry?.TOOL_IMPL || null
|
|
238
|
+
const staticList = tools || null
|
|
239
|
+
if (!useRegistry && (!Array.isArray(staticList) || !staticList.length)) throw new Error('createMcpHandler: 没有工具可暴露')
|
|
240
|
+
if (!impl && typeof callTool !== 'function') throw new Error('createMcpHandler: 需要 toolImpl 或 callTool')
|
|
241
|
+
return createKitMcpHandler({
|
|
242
|
+
tools: useRegistry ? () => registry.TOOLS : staticList,
|
|
243
|
+
callTool: (name, args, context) => {
|
|
244
|
+
if (typeof callTool === 'function' && !impl) return callTool(name, args, context)
|
|
245
|
+
const source = useRegistry ? registry.TOOL_IMPL : impl
|
|
246
|
+
const fn = source[name]
|
|
247
|
+
if (!fn) throw new Error(`未知工具: ${name}`)
|
|
248
|
+
return fn(args, context)
|
|
249
|
+
},
|
|
250
|
+
serverInfo: serverInfo || { name: 'dsh-tool-host', version: '0.1.0' },
|
|
251
|
+
instructions,
|
|
252
|
+
listChanged,
|
|
253
|
+
})
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/** 把绝对地址收成同源相对路径:给人看的地址不带端口,端口是宿主的内部细节。 */
|
|
257
|
+
function sameOriginPath(url) {
|
|
258
|
+
const raw = String(url || '').trim()
|
|
259
|
+
if (!raw) return ''
|
|
260
|
+
if (raw.startsWith('/')) return raw
|
|
261
|
+
try {
|
|
262
|
+
const { pathname } = new URL(raw)
|
|
263
|
+
return pathname.endsWith('/') ? pathname : `${pathname}/`
|
|
264
|
+
} catch {
|
|
265
|
+
return ''
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
export function createCapabilityReport({
|
|
270
|
+
tools = [],
|
|
271
|
+
toolMeta = {},
|
|
272
|
+
features = [],
|
|
273
|
+
capabilities = [],
|
|
274
|
+
contractVersion = '1.0.0',
|
|
275
|
+
packageVersion = '0.0.0',
|
|
276
|
+
editorUrl = '',
|
|
277
|
+
runtime = {},
|
|
278
|
+
} = {}) {
|
|
279
|
+
return {
|
|
280
|
+
contractVersion,
|
|
281
|
+
packageVersion,
|
|
282
|
+
editorUrl,
|
|
283
|
+
editorPath: sameOriginPath(editorUrl),
|
|
284
|
+
...runtime,
|
|
285
|
+
toolCount: tools.length,
|
|
286
|
+
tools: tools.map((tool) => ({
|
|
287
|
+
name: tool.name,
|
|
288
|
+
kind: toolMeta[tool.name]?.kind ?? 'write',
|
|
289
|
+
since: toolMeta[tool.name]?.since ?? '1.0.0',
|
|
290
|
+
capability: toolMeta[tool.name]?.capability ?? '',
|
|
291
|
+
})),
|
|
292
|
+
features,
|
|
293
|
+
capabilities: capabilities.map((cap) => ({
|
|
294
|
+
id: cap.id,
|
|
295
|
+
title: cap.title,
|
|
296
|
+
description: cap.description || '',
|
|
297
|
+
tags: cap.tags || [],
|
|
298
|
+
tools: cap.tools || [],
|
|
299
|
+
})),
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* 生成 MCP server instructions(≤32KB)。业务只提供数据,不再手写排版。
|
|
305
|
+
*/
|
|
306
|
+
export function buildInstructions({
|
|
307
|
+
title = '',
|
|
308
|
+
intro = '',
|
|
309
|
+
startup = [],
|
|
310
|
+
capabilities = [],
|
|
311
|
+
tools = [],
|
|
312
|
+
rules = [],
|
|
313
|
+
output = [],
|
|
314
|
+
} = {}) {
|
|
315
|
+
const rows = capabilities.length
|
|
316
|
+
? capabilities.map((cap) => `| ${cap.title} | ${cap.tools.map((name) => `\`${name}\``).join(', ')} | ${cap.description || ''} |`)
|
|
317
|
+
: [{
|
|
318
|
+
title: '工具',
|
|
319
|
+
tools: tools.map((tool) => tool.name),
|
|
320
|
+
description: '',
|
|
321
|
+
}].map((cap) => `| ${cap.title} | ${cap.tools.map((name) => `\`${name}\``).join(', ')} | |`)
|
|
322
|
+
|
|
323
|
+
const lines = []
|
|
324
|
+
if (title) lines.push(`# ${title}`, '')
|
|
325
|
+
if (intro) lines.push(intro, '')
|
|
326
|
+
if (startup.length) {
|
|
327
|
+
lines.push('## 启动检查')
|
|
328
|
+
startup.forEach((line, index) => lines.push(`${index + 1}. ${line}`))
|
|
329
|
+
lines.push('')
|
|
330
|
+
}
|
|
331
|
+
lines.push('## 能力面', '| 能力 | 工具 | 用途 |', '|---|---|---|', ...rows, '')
|
|
332
|
+
if (rules.length) {
|
|
333
|
+
lines.push('## 硬规则')
|
|
334
|
+
rules.forEach((line) => lines.push(`- ${line}`))
|
|
335
|
+
lines.push('')
|
|
336
|
+
}
|
|
337
|
+
if (output.length) {
|
|
338
|
+
lines.push('## 输出')
|
|
339
|
+
output.forEach((line) => lines.push(`- ${line}`))
|
|
340
|
+
}
|
|
341
|
+
return lines.join('\n')
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* 把能力注册表直接注册到 DSH 的 ctx.tools(同进程原生工具面)。
|
|
346
|
+
* 注册后不再需要单独的 loopback /mcp 端口和 @deepseek-ai/dsh-mcp-client row。
|
|
347
|
+
*
|
|
348
|
+
* `execute(args, exec)` 的第二个参数是 DSH 的调用上下文,`exec.agent.session.id`
|
|
349
|
+
* 是「哪个会话调用了这个工具」——多会话工作台要靠它把写入落到调用者的那份文档上。
|
|
350
|
+
* 以前这里写成 `(args) => impl(args)`,把它丢了,于是工具只能退化成"猜用户在看哪个窗口"。
|
|
351
|
+
*
|
|
352
|
+
* @param {object} ctx DSH cordis context
|
|
353
|
+
* @param {object} registry createRegistry() 的返回值
|
|
354
|
+
* @param {{ namespace?: string, domain?: string, modeGate?: object }} options
|
|
355
|
+
* domain:本 registry 的兜底领域(工具/能力未各自声明时用);
|
|
356
|
+
* modeGate:会话模式锁闸(createToolHost 服务级自动注入;独立调用可显式传)。
|
|
357
|
+
* @returns {() => void} 反注册全部工具
|
|
358
|
+
*/
|
|
359
|
+
export function registerWithDsh(ctx, registry, { namespace = '', domain = '', modeGate = null } = {}) {
|
|
360
|
+
if (!ctx?.tools?.register) throw new Error('registerWithDsh: 当前 DSH 没有 ctx.tools.register')
|
|
361
|
+
/* 领域工具一旦注册即声明给模式锁,并挂全局 guard 兜底(幂等)。
|
|
362
|
+
* install 的引用计数 disposer 必须随本次注册一起释放(旧写法丢弃⇒核心工具/guard 泄漏)。 */
|
|
363
|
+
const gateDispose = modeGate ? modeGate.install(ctx.tools) : null
|
|
364
|
+
const disposers = []
|
|
365
|
+
if (typeof gateDispose === 'function') disposers.push(gateDispose)
|
|
366
|
+
try {
|
|
367
|
+
for (const tool of registry?.TOOLS || []) {
|
|
368
|
+
const impl = registry.TOOL_IMPL?.[tool.name]
|
|
369
|
+
if (typeof impl !== 'function') throw new Error(`registerWithDsh: 工具缺少实现 ${tool.name}`)
|
|
370
|
+
const name = namespace ? `${namespace}_${tool.name}` : tool.name
|
|
371
|
+
const toolDomain = registry.TOOL_META?.[tool.name]?.domain || domain || ''
|
|
372
|
+
let when
|
|
373
|
+
if (modeGate && toolDomain) {
|
|
374
|
+
modeGate.declareTools(toolDomain, [name])
|
|
375
|
+
when = modeGate.whenFor(name)
|
|
376
|
+
}
|
|
377
|
+
disposers.push(ctx.tools.register({
|
|
378
|
+
name,
|
|
379
|
+
description: tool.description || '',
|
|
380
|
+
parameters: tool.inputSchema || { type: 'object', properties: {}, additionalProperties: false },
|
|
381
|
+
output: {
|
|
382
|
+
/* execute 恒返回归一化 {content:[...]} object,故此 object schema 恒满足,
|
|
383
|
+
* 不再与 string/{text}/undefined 返回冲突(B 轴 P0-2)。 */
|
|
384
|
+
schema: { type: 'object', additionalProperties: true },
|
|
385
|
+
render: (args, value) => (value && Array.isArray(value.content)
|
|
386
|
+
? value.content
|
|
387
|
+
: normalizeToolResult(value).content),
|
|
388
|
+
},
|
|
389
|
+
execute: async (args, exec) => runWithCallerSession(exec?.agent?.session?.id, async () => {
|
|
390
|
+
const normalized = normalizeToolResult(await impl(args, exec))
|
|
391
|
+
/* DSH 原生面成功恒 isError:false,失败必须 throw 才走错误路径(B 轴 P0-1)。
|
|
392
|
+
* 把工具自报的 isError:true 转成 throw,与 MCP 面的失败语义对齐。 */
|
|
393
|
+
if (normalized.isError === true) {
|
|
394
|
+
throw new Error(resultText(normalized) || `工具 ${name} 执行失败`)
|
|
395
|
+
}
|
|
396
|
+
/* 图像准入:裸 base64 图像块(rsp_screen/browser_screenshot 等)必须先持久化成
|
|
397
|
+
* attachment ref 再入 session 日志,否则下一步序列化读 block.attachment.attachmentId
|
|
398
|
+
* 抛错、永久毒化该会话(2026-11-22 根因)。MCP 面不走这里,保留 wire 形态。 */
|
|
399
|
+
const content = await admitToolResultImages(normalized.content, resolveAttachments(exec, ctx), { name })
|
|
400
|
+
return { ...normalized, content }
|
|
401
|
+
}),
|
|
402
|
+
}, when ? { when } : {}))
|
|
403
|
+
}
|
|
404
|
+
} catch (error) {
|
|
405
|
+
/* 全有或全无:任一工具注册失败,逆序释放已注册的,避免部分注册泄漏(B 轴 P0-6)。 */
|
|
406
|
+
for (let i = disposers.length - 1; i >= 0; i--) {
|
|
407
|
+
try { disposers[i]() } catch { /* 忽略释放失败 */ }
|
|
408
|
+
}
|
|
409
|
+
throw error
|
|
410
|
+
}
|
|
411
|
+
return () => {
|
|
412
|
+
for (const dispose of disposers) {
|
|
413
|
+
try { dispose() } catch { /* 忽略重复释放 */ }
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
export function createToolHost(config = {}) {
|
|
419
|
+
// 跨套件能力发现注册表(互联标准 §A.4/§E)。深度校验器可选注入(suite-kit)。
|
|
420
|
+
const descriptors = createDescriptorRegistry({ validate: config.validateDescriptor })
|
|
421
|
+
// 会话模式锁:全服务共享一个闸实例(所有套件的注册都经此)。getWorkStore 惰性解析
|
|
422
|
+
// (driver 注入 () => safeGet(ctx,'workStore'));底座缺席则降级为恒可见、不拒。
|
|
423
|
+
const modeGate = createModeGate({ getWorkStore: config.getWorkStore })
|
|
424
|
+
return {
|
|
425
|
+
api: createServiceApi('toolHost', '1.2.0', ['dsl', 'registry', 'validate', 'contract', 'mcp', 'instructions', 'native-tools', 'descriptors', 'mode-gate']),
|
|
426
|
+
version: '0.3.0',
|
|
427
|
+
defineTool,
|
|
428
|
+
defineCapability,
|
|
429
|
+
createRegistry: (capabilities, options = {}) => createRegistry(capabilities, { ...config, ...options }),
|
|
430
|
+
createMcpHandler,
|
|
431
|
+
createToolDispatcher,
|
|
432
|
+
createCapabilityReport,
|
|
433
|
+
buildInstructions,
|
|
434
|
+
// 服务级注册自动带会话模式锁(when 可见性 + guard 硬拒 + 调用者会话 ALS),套件零接线。
|
|
435
|
+
registerWithDsh: (ctx, registry, options = {}) => registerWithDsh(ctx, registry, { modeGate, ...options }),
|
|
436
|
+
validateToolArguments,
|
|
437
|
+
modeGate,
|
|
438
|
+
// 能力描述符注册/发现(编排器按类型动态发现,套件零互依赖)。
|
|
439
|
+
registerCapabilityDescriptor: (descriptor, options) => descriptors.register(descriptor, options),
|
|
440
|
+
unregisterCapabilityDescriptor: (name) => descriptors.unregister(name),
|
|
441
|
+
// 发现面按调用者会话过滤:原生工具调用里自动从 ALS 取会话(conductor_discover 无需接线);
|
|
442
|
+
// HTTP/墙等管理面无会话 → 不过滤(全局视图)。query.sessionId 可显式覆盖。
|
|
443
|
+
discoverCapabilities: (query = {}) => modeGate.filterEntries(descriptors.discover(query), query.sessionId || currentCallerSession()),
|
|
444
|
+
capabilityCatalog: () => descriptors.catalog(),
|
|
445
|
+
listSurfaces: () => descriptors.listSurfaces(),
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
export { validateToolArguments }
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 会话模式锁 —— 工具面标准框架的强制闸(基础设施能力,非各套件自接)。
|
|
3
|
+
*
|
|
4
|
+
* 设计目标(用户诉求):锁定一种工作模式(如 rsp)后,本会话只看得见、调得动
|
|
5
|
+
* 该领域的工具;其余已注册能力(browser_* 等)从工具声明里消失,且即便被强行
|
|
6
|
+
* 调用也在分发层硬拒。所有经 tool-host 注册的能力自动受此约束。
|
|
7
|
+
*
|
|
8
|
+
* 三道原生闸里的两道在此落地:
|
|
9
|
+
* · when(可见性):registerWithDsh / bridge host 给每个领域工具挂 whenFor(name),
|
|
10
|
+
* DSH 每步 resolve() 求值,false 同时从声明与分发中排除该工具。
|
|
11
|
+
* · guard(分发硬拒,兜底):install(tools) 挂一个全局 ToolGuard,异领域调用返回
|
|
12
|
+
* denial。单调不可翻回,兜住任何绕过 when 的路径。
|
|
13
|
+
*
|
|
14
|
+
* 领域来源:TOOL_META.domain(defineTool/defineCapability/createRegistry 声明)。
|
|
15
|
+
* 存储真源:work-store.getSessionMode(sid)(终生固化,无 unlock)。
|
|
16
|
+
* 降级:无 workStore / 无 sid / 未锁定 → 恒可见、不拒(与既有“底座缺席不启用”一致)。
|
|
17
|
+
* 无 domain 的工具(conductor/capyclaw/框架核心 mode_*)恒可见,不受锁限制。
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @param {{ getWorkStore?: () => object|null }} deps
|
|
22
|
+
*/
|
|
23
|
+
export function createModeGate({ getWorkStore } = {}) {
|
|
24
|
+
const domainByTool = new Map() // 原生工具名 → domain
|
|
25
|
+
const domainBySuite = new Map() // 套件名 → domain(描述符发现面按 suite 兜底)
|
|
26
|
+
const lockCache = new Map() // sid → kind(锁终生固化,一旦落定永不变更,可缓存)
|
|
27
|
+
let guardInstalled = false
|
|
28
|
+
const guardDisposers = []
|
|
29
|
+
let coreToolsRegistered = false
|
|
30
|
+
const coreDisposers = []
|
|
31
|
+
let installRefs = 0 // 安装方引用计数(见 install 注释)
|
|
32
|
+
|
|
33
|
+
function store() {
|
|
34
|
+
try { return typeof getWorkStore === 'function' ? getWorkStore() : null } catch { return null }
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** 当前会话锁定的工作模式 kind;未锁定/底座缺席/无 sid → null。 */
|
|
38
|
+
function modeOf(sessionId) {
|
|
39
|
+
const sid = String(sessionId || '').trim()
|
|
40
|
+
if (!sid) return null
|
|
41
|
+
if (lockCache.has(sid)) return lockCache.get(sid)
|
|
42
|
+
const ws = store()
|
|
43
|
+
if (!ws || typeof ws.getSessionMode !== 'function') return null
|
|
44
|
+
let rec = null
|
|
45
|
+
try { rec = ws.getSessionMode(sid) } catch { return null }
|
|
46
|
+
const kind = rec && rec.kind ? String(rec.kind) : null
|
|
47
|
+
if (kind) lockCache.set(sid, kind) // 只缓存已落定的锁;null 不缓存(可能稍后被认领)
|
|
48
|
+
return kind
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** 领域工具在指定会话里是否可见。无 domain / 未锁定 / 同领域 → 可见。 */
|
|
52
|
+
function isVisible(domain, sessionId) {
|
|
53
|
+
if (!domain) return true
|
|
54
|
+
const lock = modeOf(sessionId)
|
|
55
|
+
return !lock || domain === lock
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** 声明一组工具属于某领域(registerWithDsh / bridge host 注册时调用)。 */
|
|
59
|
+
function declareTools(domain, names = [], suite = domain) {
|
|
60
|
+
const d = String(domain || '').trim()
|
|
61
|
+
if (!d) return
|
|
62
|
+
for (const name of names || []) {
|
|
63
|
+
if (name) domainByTool.set(String(name), d)
|
|
64
|
+
}
|
|
65
|
+
if (suite) domainBySuite.set(String(suite), d)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** 某工具的领域;未声明 → ''(恒可见)。 */
|
|
69
|
+
function domainOf(name) {
|
|
70
|
+
return domainByTool.get(String(name)) || ''
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* DSH register 的 when 条件。未声明领域的工具返回 undefined(不挂 when,恒可见,
|
|
75
|
+
* 也避免给内置/核心工具增加每步求值开销)。
|
|
76
|
+
* @returns {((context: object) => boolean)|undefined}
|
|
77
|
+
*/
|
|
78
|
+
function whenFor(name) {
|
|
79
|
+
const domain = domainOf(name)
|
|
80
|
+
if (!domain) return undefined
|
|
81
|
+
return (context) => isVisible(domain, context?.agent?.session?.id)
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* 全局 ToolGuard(分发硬拒兜底)。非领域工具立即放行(不读 store,内置工具零开销);
|
|
86
|
+
* 领域工具在异领域锁定的会话里返回 denial。
|
|
87
|
+
* @returns {{reason: string, info: object}|undefined}
|
|
88
|
+
*/
|
|
89
|
+
function guard(execution) {
|
|
90
|
+
const name = execution?.name
|
|
91
|
+
const domain = domainByTool.get(String(name))
|
|
92
|
+
if (!domain) return undefined
|
|
93
|
+
const lock = modeOf(execution?.agent?.session?.id)
|
|
94
|
+
if (!lock || domain === lock) return undefined
|
|
95
|
+
return {
|
|
96
|
+
reason: `本会话已锁定为「${lock}」工作模式,「${name}」属于「${domain}」领域,已被框架屏蔽。`
|
|
97
|
+
+ `请只用「${lock}」领域的工具完成任务;确需其他领域,请新开一个会话。`,
|
|
98
|
+
info: { name: 'SessionModeLocked', code: 'SESSION_MODE_LOCKED', reason: `locked to ${lock}, tool domain ${domain}` },
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** 框架核心工具 mode_lock / mode_status(无领域,恒可见)——显式锁定入口与状态查询。
|
|
103
|
+
* 存储经 modeGate 的 getWorkStore 解析(不依赖插件 ctx),故可在任何 tools 就绪时机注册。 */
|
|
104
|
+
function coreTools() {
|
|
105
|
+
const textRender = (_args, value) => [{ type: 'text', text: typeof value === 'string' ? value : JSON.stringify(value, null, 2) }]
|
|
106
|
+
const OUTPUT_SCHEMA = { type: 'object', additionalProperties: true }
|
|
107
|
+
const modeLock = {
|
|
108
|
+
name: 'mode_lock',
|
|
109
|
+
description: '把当前会话锁定到一种工作模式(领域),如 rsp/browser/ppt/canvas。锁定后本会话只看得见、调得动该领域的工具,'
|
|
110
|
+
+ '其余领域能力被框架从工具面屏蔽并在分发层硬拒。锁终生固化、不可解锁;确需其他领域请新开一个会话。',
|
|
111
|
+
parameters: {
|
|
112
|
+
type: 'object',
|
|
113
|
+
properties: { kind: { type: 'string', description: '要锁定的工作模式/领域,如 rsp、browser、ppt、canvas' } },
|
|
114
|
+
required: ['kind'],
|
|
115
|
+
additionalProperties: false,
|
|
116
|
+
},
|
|
117
|
+
output: { schema: OUTPUT_SCHEMA, render: textRender },
|
|
118
|
+
execute: async (args, exec) => {
|
|
119
|
+
const kind = String(args?.kind || '').trim()
|
|
120
|
+
if (!kind) return { ok: false, error: '需要 kind(要锁定的工作模式/领域)' }
|
|
121
|
+
const sid = exec?.agent?.session?.id
|
|
122
|
+
if (!sid) return { ok: false, error: '无法识别当前会话,不能锁定' }
|
|
123
|
+
const ws = store()
|
|
124
|
+
if (!ws || typeof ws.claimSessionMode !== 'function') return { ok: false, error: 'work-store 底座缺席,无法锁定' }
|
|
125
|
+
const res = ws.claimSessionMode(sid, kind, 'mode-lock', { explicit: true })
|
|
126
|
+
if (res && res.ok === false) {
|
|
127
|
+
return { ok: false, lockedTo: res.lockedTo, error: `本会话已固化为「${res.lockedTo}」模式,不能改为「${kind}」。确需其他领域请新开一个会话。` }
|
|
128
|
+
}
|
|
129
|
+
return {
|
|
130
|
+
ok: true, kind: res.kind, fresh: !!res.fresh, explicit: true,
|
|
131
|
+
message: res.fresh ? `已锁定为「${res.kind}」工作模式,本会话此后只用该领域工具。` : `本会话已处于「${res.kind}」工作模式。`,
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
}
|
|
135
|
+
const modeStatus = {
|
|
136
|
+
name: 'mode_status',
|
|
137
|
+
description: '查询当前会话的工作模式锁状态:是否锁定、锁定到哪个领域、由谁何时认领。未锁定时所有领域工具可见。',
|
|
138
|
+
parameters: { type: 'object', properties: {}, additionalProperties: false },
|
|
139
|
+
output: { schema: OUTPUT_SCHEMA, render: textRender },
|
|
140
|
+
execute: async (_args, exec) => {
|
|
141
|
+
const sid = exec?.agent?.session?.id
|
|
142
|
+
const ws = store()
|
|
143
|
+
if (!ws || typeof ws.getSessionMode !== 'function') return { locked: false, reason: 'work-store 底座缺席' }
|
|
144
|
+
if (!sid) return { locked: false, reason: '无法识别当前会话' }
|
|
145
|
+
const rec = ws.getSessionMode(sid)
|
|
146
|
+
if (!rec) return { locked: false, kind: null, message: '本会话未锁定工作模式,所有领域工具可见。' }
|
|
147
|
+
return {
|
|
148
|
+
locked: true, kind: rec.kind, claimedBy: rec.claimedBy || '', claimedAt: rec.claimedAt || '', explicit: !!rec.explicit,
|
|
149
|
+
message: `本会话已锁定为「${rec.kind}」工作模式,其余领域工具已被屏蔽。`,
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
}
|
|
153
|
+
return [modeLock, modeStatus]
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/** 把 guard + 核心锁定工具挂到 DSH tools 服务(幂等)。每个套件在 tools 就绪时都会调用,
|
|
157
|
+
* 故核心工具注册不依赖 tool-host driver apply 那一刻 tools 是否已就绪(加载顺序鲁棒)。返回 disposer。
|
|
158
|
+
* 引用计数:多个安装方(driver apply / 各套件 registerWithDsh)共享同一份核心注册,
|
|
159
|
+
* 任一安装方卸载只减引用;最后一个释放才真正摘 guard + 核心工具,避免「丢 disposer」泄漏
|
|
160
|
+
* 与「先卸载者拆掉幸存者底座」两种事故。 */
|
|
161
|
+
function install(tools) {
|
|
162
|
+
if (!tools) return () => {}
|
|
163
|
+
if (!guardInstalled && typeof tools.guard === 'function') {
|
|
164
|
+
try {
|
|
165
|
+
const dispose = tools.guard(guard)
|
|
166
|
+
if (typeof dispose === 'function') guardDisposers.push(dispose)
|
|
167
|
+
guardInstalled = true
|
|
168
|
+
} catch { /* 底座不支持 guard 时降级:仅 when 生效 */ }
|
|
169
|
+
}
|
|
170
|
+
if (!coreToolsRegistered && typeof tools.register === 'function') {
|
|
171
|
+
for (const tool of coreTools()) {
|
|
172
|
+
try {
|
|
173
|
+
const d = tools.register(tool)
|
|
174
|
+
if (typeof d === 'function') coreDisposers.push(d)
|
|
175
|
+
} catch (err) {
|
|
176
|
+
console.warn(`[tool-host] 注册核心工具 ${tool.name} 失败:`, err?.message || err)
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
coreToolsRegistered = true
|
|
180
|
+
}
|
|
181
|
+
installRefs++
|
|
182
|
+
let released = false
|
|
183
|
+
return () => {
|
|
184
|
+
if (released) return
|
|
185
|
+
released = true
|
|
186
|
+
installRefs--
|
|
187
|
+
if (installRefs > 0) return
|
|
188
|
+
for (const dispose of guardDisposers.splice(0)) {
|
|
189
|
+
try { dispose() } catch { /* 忽略重复释放 */ }
|
|
190
|
+
}
|
|
191
|
+
for (const dispose of coreDisposers.splice(0)) {
|
|
192
|
+
try { dispose() } catch { /* 忽略重复释放 */ }
|
|
193
|
+
}
|
|
194
|
+
guardInstalled = false
|
|
195
|
+
coreToolsRegistered = false
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* 能力发现面过滤:锁定会话里剔除异领域描述符(conductor_discover 自动受约束)。
|
|
201
|
+
* 无 domain 的描述符(编排/核心基建)保留。未锁定 → 原样返回。
|
|
202
|
+
*/
|
|
203
|
+
function filterEntries(entries, sessionId) {
|
|
204
|
+
const lock = modeOf(sessionId)
|
|
205
|
+
if (!lock) return entries
|
|
206
|
+
return (entries || []).filter((entry) => {
|
|
207
|
+
const d = entry?.descriptor || {}
|
|
208
|
+
const domain = domainByTool.get(String(d.tool || d.name)) || domainBySuite.get(String(entry?.suite)) || ''
|
|
209
|
+
return !domain || domain === lock
|
|
210
|
+
})
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
return { declareTools, domainOf, modeOf, isVisible, whenFor, guard, install, filterEntries }
|
|
214
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
The ISC License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Isaac Z. Schlueter and Contributors
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
7
|
+
copyright notice and this permission notice appear in all copies.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
10
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
11
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
12
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
13
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
14
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|
15
|
+
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|