@capyclaw/publisher 0.0.0-stage → 0.1.3
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/README.md +112 -2
- package/client/client.js +717 -0
- package/cordis.patch.yml +13 -0
- package/icon.svg +6 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- 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 +345 -0
- package/node_modules/@capyclaw/foundation/abi/schema.mjs +98 -0
- package/node_modules/@capyclaw/foundation/abi/spec.mjs +255 -0
- package/node_modules/@capyclaw/foundation/abi/validate.mjs +24 -0
- package/node_modules/@capyclaw/foundation/abi/version.mjs +82 -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 +68 -0
- package/node_modules/@capyclaw/foundation/lib/adapters/runtime-driver.mjs +113 -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 +160 -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 +87 -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 +188 -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 +139 -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 +16 -0
- package/node_modules/@capyclaw/tool-host/package.json +59 -0
- package/node_modules/@capyclaw/tool-host/src/descriptors.mjs +166 -0
- package/node_modules/@capyclaw/tool-host/src/index.mjs +416 -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 +78 -4
- package/plugin.mjs +113 -0
- package/server/archive.mjs +255 -0
- package/server/drop.mjs +498 -0
- package/server/impl.mjs +609 -0
- package/server/routes.mjs +339 -0
- package/server/tools.mjs +111 -0
package/server/impl.mjs
ADDED
|
@@ -0,0 +1,609 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @capyclaw/publisher 业务实现:发布引擎。
|
|
3
|
+
*
|
|
4
|
+
* 逐条移植自插件工程仓库的 scripts/publish-to-npm.mjs(发布主流程/闸门/顺序/漂移/复核)
|
|
5
|
+
* 与 tools/capyclaw-plugin-release 的 publishGateErrors + discoverPlugins(发现集判定),
|
|
6
|
+
* 行为保持对齐:仓库侧脚本删除后,这里是唯一实现。
|
|
7
|
+
*
|
|
8
|
+
* 与原脚本的差异(有意为之):
|
|
9
|
+
* - root(要发布的仓库 checkout)是调用参数,不再是模块常量;
|
|
10
|
+
* - npm view / npm pack 的缓存挂在每次调用的 context 上(服务进程长驻,避免跨调用串味);
|
|
11
|
+
* - 新增轻量 pack 闸(npm pack --dry-run 断言 package.json/main/patch 必在包内),
|
|
12
|
+
* 顶替原 scripts/verify-publishable.mjs 的核心保护。
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { spawnSync } from 'node:child_process'
|
|
16
|
+
import crypto from 'node:crypto'
|
|
17
|
+
import fs from 'node:fs'
|
|
18
|
+
import os from 'node:os'
|
|
19
|
+
import path from 'node:path'
|
|
20
|
+
|
|
21
|
+
import { validatePlugin } from '@capyclaw/plugin-validator'
|
|
22
|
+
import { stagePlugin } from '@capyclaw/plugin-kit/packaging/pack'
|
|
23
|
+
import { makeSelfContained } from '@capyclaw/plugin-kit/packaging/self-contained'
|
|
24
|
+
|
|
25
|
+
/** 支撑库目录(相对仓库根):纯库/独立服务,无 dsh.bundle,插件发现集不收,显式清单维护。
|
|
26
|
+
* 可用 DSH_PUBLISHER_LIBS(JSON 数组,相对 root 的路径)覆盖。 */
|
|
27
|
+
export const DEFAULT_SUPPORT_LIBS = [
|
|
28
|
+
'C/packages/capyclaw-plugin-kit',
|
|
29
|
+
'C/packages/capyclaw-document-workbench',
|
|
30
|
+
'C/packages/capyclaw-host-shell',
|
|
31
|
+
'C/packages/capyclaw-skills-service',
|
|
32
|
+
'C/packages/capyclaw-portal',
|
|
33
|
+
'C/packages/capyclaw-suite-kit',
|
|
34
|
+
]
|
|
35
|
+
|
|
36
|
+
/** 与原脚本一致的失败状态集(其余视为通过或跳过)。 */
|
|
37
|
+
export const FAILURE_STATUSES = [
|
|
38
|
+
'missing-dir', 'gate-failed', 'invalid', 'pack-incomplete',
|
|
39
|
+
'test-failed', 'publish-failed', 'publish-corrupted', 'version-drift', 'order-blocked',
|
|
40
|
+
]
|
|
41
|
+
|
|
42
|
+
/* ────────────────────────── 发现集与闸门(移植) ────────────────────────── */
|
|
43
|
+
|
|
44
|
+
/** 发布闸:验证器不管、但分发必需的项。返回错误串数组。
|
|
45
|
+
* (移植自 tools/capyclaw-plugin-release/lib/index.mjs publishGateErrors) */
|
|
46
|
+
export function publishGateErrors(pkg, srcDir) {
|
|
47
|
+
const errors = []
|
|
48
|
+
if (pkg.private === true) {
|
|
49
|
+
errors.push('package.json 标记了 private: true——不能发布到 npm;确认它是否属于对外分发件')
|
|
50
|
+
}
|
|
51
|
+
if (!pkg.publishConfig?.access) {
|
|
52
|
+
errors.push('缺少 publishConfig.access(作用域包默认 restricted,需显式 public)')
|
|
53
|
+
}
|
|
54
|
+
const enginesDsh = pkg.engines?.dsh
|
|
55
|
+
if (typeof enginesDsh !== 'string' || !enginesDsh.trim()) {
|
|
56
|
+
errors.push('缺少 engines.dsh(消费方无法判断兼容的 dsh 运行时版本)')
|
|
57
|
+
}
|
|
58
|
+
const patch = pkg.dsh?.bundle?.patch
|
|
59
|
+
const patches = Array.isArray(patch) ? patch : patch ? [patch] : []
|
|
60
|
+
/* dsh.member: true —— 只随套件分发的成员包(如各 workbench)。
|
|
61
|
+
* 它们不向 profile 插入任何行,所以没有 bundle.patch 是**正确状态**;反过来,
|
|
62
|
+
* 成员包若声明了补丁就会和套件重复声明同一行,把卸载守卫焊死。
|
|
63
|
+
* 与 C/tools/capyclaw-plugin-release 的判定必须逐字一致(parity 闸会比对)。 */
|
|
64
|
+
if (pkg.dsh?.member === true) {
|
|
65
|
+
if (patches.length) {
|
|
66
|
+
errors.push('dsh.member: true 的成员包不应声明 dsh.bundle.patch(会与套件重复声明同一行)')
|
|
67
|
+
}
|
|
68
|
+
} else if (!patches.length) {
|
|
69
|
+
errors.push('缺少 dsh.bundle.patch(dsh 不会把这个包当作 profile 层加载)')
|
|
70
|
+
}
|
|
71
|
+
for (const rel of patches) {
|
|
72
|
+
if (!fs.existsSync(path.join(srcDir, rel))) errors.push(`dsh.bundle.patch 指向的文件不存在: ${rel}`)
|
|
73
|
+
}
|
|
74
|
+
for (const field of ['dependencies', 'optionalDependencies', 'peerDependencies']) {
|
|
75
|
+
const deps = pkg[field]
|
|
76
|
+
if (!deps || typeof deps !== 'object') continue
|
|
77
|
+
for (const [name, range] of Object.entries(deps)) {
|
|
78
|
+
if (/^(link|file):/.test(String(range))) {
|
|
79
|
+
errors.push(`${field}.${name} 是源码树本地路径(${range})——分发件必须走版本范围`)
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return errors
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** 库发布闸:插件闸管不了的分发必需项。返回错误串数组。(移植自 publish-to-npm.mjs) */
|
|
87
|
+
export function libraryGateErrors(pkg) {
|
|
88
|
+
const errors = []
|
|
89
|
+
if (pkg.private === true) errors.push('package.json 标记了 private: true')
|
|
90
|
+
if (pkg.name.startsWith('@') && !pkg.publishConfig?.access) {
|
|
91
|
+
errors.push('缺少 publishConfig.access(作用域包默认 restricted,需显式 public)')
|
|
92
|
+
}
|
|
93
|
+
if (!pkg.license) errors.push('缺少 license 声明')
|
|
94
|
+
if (!pkg.version) errors.push('缺少 version')
|
|
95
|
+
for (const field of ['dependencies', 'optionalDependencies', 'peerDependencies']) {
|
|
96
|
+
const deps = pkg[field]
|
|
97
|
+
if (!deps || typeof deps !== 'object') continue
|
|
98
|
+
for (const [name, range] of Object.entries(deps)) {
|
|
99
|
+
if (/^(link|file):/.test(String(range))) {
|
|
100
|
+
errors.push(`${field}.${name} 是源码树本地路径(${range})——分发件必须走版本范围`)
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return errors
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/** 插件扫码根目录 + 包名形态。(移植自 plugin-release;发布闸用不到 suite 校验器注入) */
|
|
108
|
+
const PLUGIN_BASES = ['C/packages', 'B/official', 'A/projects']
|
|
109
|
+
const PUBLISHABLE_NAME = /^((@[\w.-]+\/)?dsh-[\w.-]+|@capyclaw\/[\w.-]+)$/
|
|
110
|
+
|
|
111
|
+
/** 找出 root 下所有**可发布**的插件目录(过得了发布闸的才算)。未就绪的落 lastSkipped。 */
|
|
112
|
+
export function discoverPlugins({ root, includeNotReady = false } = {}) {
|
|
113
|
+
const out = []
|
|
114
|
+
const skipped = []
|
|
115
|
+
const seen = new Set()
|
|
116
|
+
const visit = (dir) => {
|
|
117
|
+
const pkgPath = path.join(dir, 'package.json')
|
|
118
|
+
if (fs.existsSync(pkgPath)) {
|
|
119
|
+
try {
|
|
120
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'))
|
|
121
|
+
const publishable = PUBLISHABLE_NAME.test(pkg.name || '')
|
|
122
|
+
&& (pkg.dsh?.bundle || pkg.dsh?.client || pkg.dsh?.suite || pkg.dsh?.member)
|
|
123
|
+
if (publishable && !seen.has(pkg.name)) {
|
|
124
|
+
seen.add(pkg.name)
|
|
125
|
+
const reasons = publishGateErrors(pkg, dir)
|
|
126
|
+
if (reasons.length) skipped.push({ dir, name: pkg.name, reasons })
|
|
127
|
+
else out.push(dir)
|
|
128
|
+
}
|
|
129
|
+
} catch { /* 坏 package.json 由验证器报,不在这里中断扫描 */ }
|
|
130
|
+
}
|
|
131
|
+
let entries = []
|
|
132
|
+
try { entries = fs.readdirSync(dir, { withFileTypes: true }) } catch { return }
|
|
133
|
+
for (const entry of entries) {
|
|
134
|
+
if (!entry.isDirectory()) continue
|
|
135
|
+
if (['node_modules', '.git', 'dist', 'archive', 'test'].includes(entry.name)) continue
|
|
136
|
+
visit(path.join(dir, entry.name))
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
for (const base of PLUGIN_BASES) {
|
|
140
|
+
const dir = path.join(root, base)
|
|
141
|
+
if (fs.existsSync(dir)) visit(dir)
|
|
142
|
+
}
|
|
143
|
+
out.sort()
|
|
144
|
+
discoverPlugins.lastSkipped = skipped.sort((a, b) => a.name.localeCompare(b.name))
|
|
145
|
+
return includeNotReady ? [...out, ...skipped.map((s) => s.dir)].sort() : out
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export function pkgOf(dir) {
|
|
149
|
+
return JSON.parse(fs.readFileSync(path.join(dir, 'package.json'), 'utf8'))
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/* ────────────────────────── npm 调用(每次调用一个 context) ────────────────────────── */
|
|
153
|
+
|
|
154
|
+
/** npm 直调(node npm-cli.js,不走 shell):含空格的临时/用户目录不会被拆词。 */
|
|
155
|
+
const NPM_CLI = path.join(path.dirname(process.execPath), 'node_modules', 'npm', 'bin', 'npm-cli.js')
|
|
156
|
+
function rawNpmRun(args, options = {}) {
|
|
157
|
+
if (fs.existsSync(NPM_CLI)) {
|
|
158
|
+
return spawnSync(process.execPath, [NPM_CLI, ...args], { encoding: 'utf8', stdio: 'pipe', ...options })
|
|
159
|
+
}
|
|
160
|
+
return spawnSync('npm', args, { encoding: 'utf8', stdio: 'pipe', shell: process.platform === 'win32', ...options })
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function createNpmContext() {
|
|
164
|
+
/** npm view 结果缓存:同一次运行里同一 specifier 只查一次。 */
|
|
165
|
+
const viewCache = new Map()
|
|
166
|
+
const npmView = (spec, field) => {
|
|
167
|
+
const key = `${spec}|${field}`
|
|
168
|
+
if (!viewCache.has(key)) viewCache.set(key, rawNpmRun(['view', spec, field]))
|
|
169
|
+
return viewCache.get(key)
|
|
170
|
+
}
|
|
171
|
+
const alreadyPublished = (name, version) => {
|
|
172
|
+
const r = npmView(`${name}@${version}`, 'version')
|
|
173
|
+
if (r.status !== 0) return false
|
|
174
|
+
return String(r.stdout).trim() === version
|
|
175
|
+
}
|
|
176
|
+
/** registry 上已发布 tarball 的 sha1(拿不到返回 null,网络闪断降级为警告)。 */
|
|
177
|
+
const npmShasumOf = (name, version) => {
|
|
178
|
+
const r = npmView(`${name}@${version}`, 'dist.shasum')
|
|
179
|
+
if (r.status !== 0) return null
|
|
180
|
+
return String(r.stdout).trim() || null
|
|
181
|
+
}
|
|
182
|
+
/** 本地 npm pack 产物的 sha1(npm pack 确定性:同内容同哈希)。结果按目录缓存。 */
|
|
183
|
+
const localShasumCache = new Map()
|
|
184
|
+
const localShasumOf = (dir) => {
|
|
185
|
+
if (localShasumCache.has(dir)) return localShasumCache.get(dir)
|
|
186
|
+
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'pub-sha-'))
|
|
187
|
+
try {
|
|
188
|
+
const pack = rawNpmRun(['pack', '--pack-destination', tmp], { cwd: dir })
|
|
189
|
+
if (pack.status !== 0) return null
|
|
190
|
+
const tgz = path.join(tmp, String(pack.stdout).trim().split(/\r?\n/).pop())
|
|
191
|
+
const sha = crypto.createHash('sha1').update(fs.readFileSync(tgz)).digest('hex')
|
|
192
|
+
localShasumCache.set(dir, sha)
|
|
193
|
+
return sha
|
|
194
|
+
} finally {
|
|
195
|
+
fs.rmSync(tmp, { recursive: true, force: true })
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
return { rawNpmRun, npmView, alreadyPublished, npmShasumOf, localShasumOf }
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/** 发布顺序闸:待发包的 @capyclaw 依赖闭包,每一项必须 registry 可解析或在同批发布。
|
|
202
|
+
* 拦截「只发 suite 不发依赖」这类顺序手滑(发布成功 ≠ 用户能装上)。
|
|
203
|
+
*
|
|
204
|
+
* 自包含例外:列在 bundledDependencies 里的依赖**已经实体在 tarball 内**,
|
|
205
|
+
* 安装时 npm/pnpm 用包内副本、根本不会去 registry 解析。这类依赖不该被本闸拦下
|
|
206
|
+
* ——否则「全自包含」的包反而会因为成员尚未上架而发不出去。 */
|
|
207
|
+
export function orderGate(pkg, localMap, batch, npm) {
|
|
208
|
+
const errors = []
|
|
209
|
+
const warnings = []
|
|
210
|
+
const bundled = new Set([
|
|
211
|
+
...(Array.isArray(pkg.bundledDependencies) ? pkg.bundledDependencies : []),
|
|
212
|
+
...(Array.isArray(pkg.bundleDependencies) ? pkg.bundleDependencies : []),
|
|
213
|
+
])
|
|
214
|
+
const seen = new Set([pkg.name])
|
|
215
|
+
const queue = [pkg]
|
|
216
|
+
while (queue.length) {
|
|
217
|
+
const cur = queue.shift()
|
|
218
|
+
const deps = { ...(cur.dependencies || {}), ...(cur.peerDependencies || {}), ...(cur.optionalDependencies || {}) }
|
|
219
|
+
for (const [name, range] of Object.entries(deps)) {
|
|
220
|
+
if (!name.startsWith('@capyclaw/') || seen.has(name)) continue
|
|
221
|
+
seen.add(name)
|
|
222
|
+
const local = localMap.get(name)
|
|
223
|
+
if (local) queue.push(local.pkg) /* 闭包继续沿本仓包展开 */
|
|
224
|
+
/* 已随包携带:安装侧不查 registry,无需顺序约束。 */
|
|
225
|
+
if (bundled.has(name)) continue
|
|
226
|
+
const resolvable = npm.npmView(`${name}@${range}`, 'version')
|
|
227
|
+
if (resolvable.status === 0) continue /* ① registry 已可解析 */
|
|
228
|
+
if (batch.has(name)) {
|
|
229
|
+
warnings.push(`${name}@${range} registry 暂不可解析,依赖同批发布(确认批次包含它)`)
|
|
230
|
+
} else {
|
|
231
|
+
errors.push(`${name}@${range} 在 registry 上不可解析,且不在本次发布批次——先发布 ${name}(或加入批次),否则用户安装本包会 404/ETARGET`)
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
return { errors, warnings }
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/** 密钥/本机信息扫描模式:打包产物里出现任何一种都拒绝发布。
|
|
239
|
+
* (移植自原 scripts/verify-publishable.mjs 的 tarball 逐文件扫描。
|
|
240
|
+
* 认证令牌字段的模式用拼接构造,注释里也不写整串,
|
|
241
|
+
* 否则扫描器会把自己的源码当成泄漏(自噬假阳性)。) */
|
|
242
|
+
const AUTH_TOKEN_RE = new RegExp('_auth' + 'Token', 'i')
|
|
243
|
+
/* ownOnly=true 的模式只查「我们自己的代码」(包根文件 + node_modules/@capyclaw 成员)。
|
|
244
|
+
* 第三方 vendored 依赖(playwright/@types/pptxgenjs 等)的上游源码天然带构建机目录路径,
|
|
245
|
+
* 那不是本机凭据泄漏,不该拦发布;凭据形态(API key / npm 令牌 / npmrc 令牌字段)则对所有文件一律查。
|
|
246
|
+
* 注意:本文件自身也会被扫描,注释里切勿写出任何完整的凭据或路径模式字面量(自噬假阳性)。 */
|
|
247
|
+
const SECRET_PATTERNS = [
|
|
248
|
+
[/sk-[A-Za-z0-9]{20,}/, 'API key 形态(sk-…)', false],
|
|
249
|
+
[/npm_[A-Za-z0-9]{20,}/, 'npm token 形态(npm_…)', false],
|
|
250
|
+
[AUTH_TOKEN_RE, 'npmrc 认证令牌字段', false],
|
|
251
|
+
[/[A-Za-z]:\\Users\\/i, '本机绝对路径(盘符:\\Users\\)', true],
|
|
252
|
+
[/\/(home|Users)\/[A-Za-z0-9._-]+\//, '本机绝对路径(/home/ / /Users/)', true],
|
|
253
|
+
]
|
|
254
|
+
|
|
255
|
+
/** 相对路径是否落在第三方 vendored 依赖里(最后一个 node_modules 段之后非 @capyclaw)。 */
|
|
256
|
+
function isThirdPartyVendored(rel) {
|
|
257
|
+
const parts = rel.split(/[\\/]/)
|
|
258
|
+
const i = parts.lastIndexOf('node_modules')
|
|
259
|
+
if (i === -1) return false
|
|
260
|
+
return parts[i + 1] !== '@capyclaw'
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/** 扫描目录内全部文本文件,返回命中的密钥/本机信息描述串。 */
|
|
264
|
+
export function scanDirForSecrets(root) {
|
|
265
|
+
const hits = []
|
|
266
|
+
const walk = (dir) => {
|
|
267
|
+
let entries = []
|
|
268
|
+
try { entries = fs.readdirSync(dir, { withFileTypes: true }) } catch { return }
|
|
269
|
+
for (const entry of entries) {
|
|
270
|
+
const file = path.join(dir, entry.name)
|
|
271
|
+
if (entry.isDirectory()) { walk(file); continue }
|
|
272
|
+
let text = null
|
|
273
|
+
try { text = fs.readFileSync(file, 'utf8') } catch { continue } /* 二进制/不可读跳过 */
|
|
274
|
+
const rel = path.relative(root, file)
|
|
275
|
+
const thirdParty = isThirdPartyVendored(rel)
|
|
276
|
+
for (const [pattern, label, ownOnly] of SECRET_PATTERNS) {
|
|
277
|
+
if (ownOnly && thirdParty) continue
|
|
278
|
+
if (pattern.test(text)) hits.push(`${rel}: ${label}`)
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
walk(root)
|
|
283
|
+
return [...new Set(hits)]
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/** 轻量 pack 闸:① npm pack --dry-run 断言分发必需文件真的会进包;
|
|
287
|
+
* ② 真实 pack + 解包 + 逐文件扫密钥/本机信息(凭据绝不上 npm)。
|
|
288
|
+
* (顶替原 verify-publishable 的核心断言;干净目录安装级检查不在这里重复。) */
|
|
289
|
+
export function packGateErrors(pkg, dir, npm) {
|
|
290
|
+
const mustHave = ['package.json']
|
|
291
|
+
if (pkg.main) mustHave.push(String(pkg.main).replace(/^\.\//, ''))
|
|
292
|
+
const patch = pkg.dsh?.bundle?.patch
|
|
293
|
+
for (const rel of Array.isArray(patch) ? patch : patch ? [patch] : []) {
|
|
294
|
+
mustHave.push(String(rel).replace(/^\.\//, ''))
|
|
295
|
+
}
|
|
296
|
+
if (pkg.dsh?.client) {
|
|
297
|
+
/* client 入口由包 exports["./client"] 声明(各包不一:client/client.js、根 client.js、lib/client.js),
|
|
298
|
+
* 不能硬编码 client/client.js;无 exports 时回退约定默认值。 */
|
|
299
|
+
const clientEntry = pkg.exports?.['./client'] || 'client/client.js'
|
|
300
|
+
mustHave.push(String(clientEntry).replace(/^\.\//, ''))
|
|
301
|
+
}
|
|
302
|
+
if (pkg.dsh?.suite) mustHave.push(String(pkg.dsh.suite).replace(/^\.\//, ''))
|
|
303
|
+
const r = npm.rawNpmRun(['pack', '--dry-run', '--json'], { cwd: dir })
|
|
304
|
+
if (r.status !== 0) return [`npm pack --dry-run 失败: ${String(r.stderr || r.stdout || '').trim().slice(0, 200)}`]
|
|
305
|
+
let packed = []
|
|
306
|
+
try {
|
|
307
|
+
const parsed = JSON.parse(String(r.stdout))
|
|
308
|
+
packed = (Array.isArray(parsed) ? parsed[0]?.files : parsed?.files)?.map((f) => f.path) || []
|
|
309
|
+
} catch {
|
|
310
|
+
return ['npm pack --dry-run 输出不可解析']
|
|
311
|
+
}
|
|
312
|
+
const errors = mustHave.filter((f) => !packed.includes(f)).map((f) => `分发必需文件未进包: ${f}`)
|
|
313
|
+
|
|
314
|
+
/* 真实 pack + 解包 + 密钥扫描:发布产物里不该有任何凭据/本机信息。 */
|
|
315
|
+
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'pub-scan-'))
|
|
316
|
+
try {
|
|
317
|
+
const pack = npm.rawNpmRun(['pack', '--pack-destination', tmp], { cwd: dir })
|
|
318
|
+
if (pack.status !== 0) return [...errors, 'npm pack 失败(无法做密钥扫描)']
|
|
319
|
+
const tgz = String(pack.stdout).trim().split(/\r?\n/).pop()
|
|
320
|
+
const extract = spawnSync('tar', ['-xzf', tgz, '-C', tmp], { cwd: tmp, encoding: 'utf8' })
|
|
321
|
+
if (extract.status !== 0) return [...errors, 'tarball 解包失败(无法做密钥扫描)']
|
|
322
|
+
const extracted = path.join(tmp, 'package')
|
|
323
|
+
if (fs.existsSync(extracted)) {
|
|
324
|
+
for (const hit of scanDirForSecrets(extracted)) errors.push(`密钥/本机信息进包: ${hit}`)
|
|
325
|
+
}
|
|
326
|
+
} finally {
|
|
327
|
+
fs.rmSync(tmp, { recursive: true, force: true })
|
|
328
|
+
}
|
|
329
|
+
return errors
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
/** 发布预检:npm 凭据状态(ambient:宿主已登录或 NODE_AUTH_TOKEN)。 */
|
|
333
|
+
export function npmWhoami() {
|
|
334
|
+
const r = rawNpmRun(['whoami'])
|
|
335
|
+
if (r.status !== 0) {
|
|
336
|
+
return { ok: false, hint: 'npm whoami 失败——在宿主机 npm login,或设置 NODE_AUTH_TOKEN' }
|
|
337
|
+
}
|
|
338
|
+
return { ok: true, user: String(r.stdout).trim() }
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
/* ────────────────────────── 自包含发布目录 ────────────────────────── */
|
|
342
|
+
|
|
343
|
+
/** 真 suite = dsh.suite 清单里有「成员」(path 不是 '.' 的自条目)。
|
|
344
|
+
* 公共插件也带 dsh-suite.json,但只有自己的自条目,不属于这种情况。 */
|
|
345
|
+
function isRealSuite(dir, pkg) {
|
|
346
|
+
const rel = pkg.dsh?.suite
|
|
347
|
+
if (!rel) return false
|
|
348
|
+
const file = path.join(dir, String(rel))
|
|
349
|
+
if (!fs.existsSync(file)) return false
|
|
350
|
+
try {
|
|
351
|
+
const manifest = JSON.parse(fs.readFileSync(file, 'utf8'))
|
|
352
|
+
return Object.values(manifest.packages || {}).some((entry) => entry?.path && entry.path !== '.' && entry.path !== './')
|
|
353
|
+
} catch {
|
|
354
|
+
return false
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
/** 在 A/artifacts/suites/<bridge>/package(npm run assemble 的产物,首选)
|
|
359
|
+
* 或旧版 dist/suites/<bridge>/package 里找同名同版本的自包含拼装产物。 */
|
|
360
|
+
function findAssembledSuite(root, name, version) {
|
|
361
|
+
const bases = [path.join(root, 'A', 'artifacts', 'suites'), path.join(root, 'dist', 'suites')]
|
|
362
|
+
for (const suitesDir of bases) {
|
|
363
|
+
if (!fs.existsSync(suitesDir)) continue
|
|
364
|
+
let entries = []
|
|
365
|
+
try { entries = fs.readdirSync(suitesDir, { withFileTypes: true }) } catch { continue }
|
|
366
|
+
for (const entry of entries) {
|
|
367
|
+
if (!entry.isDirectory()) continue
|
|
368
|
+
const candidate = path.join(suitesDir, entry.name, 'package')
|
|
369
|
+
const pkgFile = path.join(candidate, 'package.json')
|
|
370
|
+
if (!fs.existsSync(pkgFile)) continue
|
|
371
|
+
try {
|
|
372
|
+
const p = JSON.parse(fs.readFileSync(pkgFile, 'utf8'))
|
|
373
|
+
if (p.name === name && p.version === version) return candidate
|
|
374
|
+
} catch { /* 坏包跳过 */ }
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
return null
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
/**
|
|
381
|
+
* 解析「真正要发布的那份内容」。
|
|
382
|
+
*
|
|
383
|
+
* 为什么不能直接发源码树:`npm publish` 会剥离 node_modules,只有
|
|
384
|
+
* package.json 的 bundledDependencies 列出的依赖才进 tarball。源码树里既没有
|
|
385
|
+
* node_modules,也没有 bundledDependencies,发出去的必然是瘦包——用户安装时
|
|
386
|
+
* 还得回 registry 逐个解析依赖(2.4.x 时代的实际行为)。
|
|
387
|
+
*
|
|
388
|
+
* 两类包分别处理:
|
|
389
|
+
* - 真 suite:改用 C 段拼装产物(dsh-suite.json 已改写成 ./node_modules/…,
|
|
390
|
+
* 成员与闭包都在包内,bundledDependencies 已写好)。找不到就报错,不静默降级。
|
|
391
|
+
* - 其它包:临时 staging(按 files 白名单)+ 实体化依赖闭包 + 写 bundledDependencies。
|
|
392
|
+
*
|
|
393
|
+
* @returns {{publishDir:string, cleanup:()=>void, mode:string, bundled?:string[]}|{error:string}}
|
|
394
|
+
*/
|
|
395
|
+
export function preparePublishDir(dir, root, pkg) {
|
|
396
|
+
if (isRealSuite(dir, pkg)) {
|
|
397
|
+
const assembled = findAssembledSuite(root, pkg.name, pkg.version)
|
|
398
|
+
if (!assembled) {
|
|
399
|
+
return {
|
|
400
|
+
error: `找不到自包含拼装产物:${pkg.name}@${pkg.version} 不在 A/artifacts/suites/*/package(或旧版 dist/suites/*/package)里。`
|
|
401
|
+
+ '先跑 npm run assemble,否则发出去的 suite 里没有成员,安装后要回 registry 拉取。',
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
return { publishDir: assembled, cleanup: () => {}, mode: 'assembled-suite' }
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
const staging = fs.mkdtempSync(path.join(os.tmpdir(), 'pub-selfcontained-'))
|
|
408
|
+
try {
|
|
409
|
+
stagePlugin({ srcDir: dir, destDir: staging, keepNodeModules: false })
|
|
410
|
+
const result = makeSelfContained({ stagingDir: staging, root })
|
|
411
|
+
return {
|
|
412
|
+
publishDir: staging,
|
|
413
|
+
cleanup: () => fs.rmSync(staging, { recursive: true, force: true }),
|
|
414
|
+
mode: 'staged-self-contained',
|
|
415
|
+
bundled: result.bundled,
|
|
416
|
+
}
|
|
417
|
+
} catch (error) {
|
|
418
|
+
fs.rmSync(staging, { recursive: true, force: true })
|
|
419
|
+
return { error: `自包含 staging 失败: ${error.message}` }
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
/* ────────────────────────── 主流程(移植) ────────────────────────── */
|
|
424
|
+
|
|
425
|
+
/** 单包发布流程(插件与库共用)。返回结果记录。 */
|
|
426
|
+
async function publishOne(dir, { kind, localMap, batch, only, tag, skipTests, dryRun, npm, log, root }) {
|
|
427
|
+
const pkg = pkgOf(dir)
|
|
428
|
+
const label = `${pkg.name}@${pkg.version}`
|
|
429
|
+
if (only && pkg.name !== only) return null
|
|
430
|
+
|
|
431
|
+
const gate = kind === 'lib' ? libraryGateErrors(pkg) : publishGateErrors(pkg, dir)
|
|
432
|
+
if (gate.length) {
|
|
433
|
+
log(`✗ ${label} — 发布闸未过`)
|
|
434
|
+
for (const item of gate) log(` - ${item}`)
|
|
435
|
+
return { label, status: 'gate-failed', detail: gate }
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
if (kind === 'plugin') {
|
|
439
|
+
const validation = await validatePlugin(dir)
|
|
440
|
+
if (!validation.valid) {
|
|
441
|
+
log(`✗ ${label} — 插件校验未过`)
|
|
442
|
+
for (const item of validation.errors) log(` - [${item.rule}] ${item.message}`)
|
|
443
|
+
return { label, status: 'invalid', detail: validation.errors.map((e) => e.message) }
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
const exists = npm.alreadyPublished(pkg.name, pkg.version)
|
|
448
|
+
|
|
449
|
+
/* 自包含产物:npm/pnpm 会剥离 node_modules,必须发布「依赖已实体化且写进
|
|
450
|
+
* bundledDependencies」的那一份,否则装出来是瘦包、要回 registry 拉依赖。 */
|
|
451
|
+
const prepared = preparePublishDir(dir, root, pkg)
|
|
452
|
+
if (prepared.error) {
|
|
453
|
+
log(`✗ ${label} — 无法准备自包含产物`)
|
|
454
|
+
log(` - ${prepared.error}`)
|
|
455
|
+
return { label, status: 'pack-incomplete', detail: [prepared.error] }
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
try {
|
|
459
|
+
if (exists) {
|
|
460
|
+
/* 同版本漂移闸:npm pack 确定性 ⇒ 本地 sha1 == registry dist.shasum 当且仅当内容一致。
|
|
461
|
+
* 对比对象是**真正会发布的自包含产物**而非源码树:bundledDependencies 与 vendored
|
|
462
|
+
* 依赖只存在于产物里,直接比源码树会在每次续跑时误报漂移;源码改动若影响产物,
|
|
463
|
+
* 在这里同样会被抓住。 */
|
|
464
|
+
const remoteSha = npm.npmShasumOf(pkg.name, pkg.version)
|
|
465
|
+
const localSha = remoteSha ? npm.localShasumOf(prepared.publishDir) : null
|
|
466
|
+
if (remoteSha && localSha && remoteSha !== localSha) {
|
|
467
|
+
log(`✗ ${label} — 同版本内容漂移:registry ${remoteSha.slice(0, 8)} ≠ 本地 ${localSha.slice(0, 8)}`)
|
|
468
|
+
log(' npm 不允许同版本重发,请 bump 版本后再发布')
|
|
469
|
+
return { label, status: 'version-drift', detail: `shasum ${localSha} != ${remoteSha}` }
|
|
470
|
+
}
|
|
471
|
+
if (!remoteSha) log(`! ${label} — 无法获取 registry shasum(网络?),跳过漂移对比`)
|
|
472
|
+
log(`· ${label} — registry 上已存在,跳过`)
|
|
473
|
+
return { label, status: 'skipped-exists' }
|
|
474
|
+
}
|
|
475
|
+
/* pack 闸只对「真要发布」的包跑(真实 pack + 解包扫描很重,已发布的包由漂移闸把关)。
|
|
476
|
+
* 校验对象是自包含产物——那才是真正上 registry 的内容。 */
|
|
477
|
+
if (kind === 'plugin') {
|
|
478
|
+
const packErrors = packGateErrors(pkg, prepared.publishDir, npm)
|
|
479
|
+
if (packErrors.length) {
|
|
480
|
+
log(`✗ ${label} — pack 闸未过`)
|
|
481
|
+
for (const item of packErrors) log(` - ${item}`)
|
|
482
|
+
return { label, status: 'pack-incomplete', detail: packErrors }
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
/* 发布顺序闸(发布成功 ≠ 用户能装上):依赖闭包须 registry 可解析或同批发布。
|
|
487
|
+
* 用**自包含产物**的清单判定:bundledDependencies 在源码树里没有,
|
|
488
|
+
* 只有 staging/拼装产物里才有,拿错清单会把已随包携带的依赖误判成必须上架。 */
|
|
489
|
+
const order = orderGate(pkgOf(prepared.publishDir), localMap, batch, npm)
|
|
490
|
+
if (order.errors.length) {
|
|
491
|
+
log(`✗ ${label} — 发布顺序闸未过(发布后用户 npm install 会失败)`)
|
|
492
|
+
for (const item of order.errors) log(` - ${item}`)
|
|
493
|
+
return { label, status: 'order-blocked', detail: order.errors }
|
|
494
|
+
}
|
|
495
|
+
for (const w of order.warnings) log(`! ${label} — ${w}`)
|
|
496
|
+
|
|
497
|
+
if (!skipTests && pkg.scripts?.test) {
|
|
498
|
+
const t = npm.rawNpmRun(['test'], { cwd: dir })
|
|
499
|
+
if (t.status !== 0) {
|
|
500
|
+
log(`✗ ${label} — npm test 失败,跳过发布`)
|
|
501
|
+
return { label, status: 'test-failed', detail: (t.stdout || '') + (t.stderr || '') }
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
if (dryRun) {
|
|
506
|
+
log(`→ ${label} — 待发布(dry run,自包含产物=${prepared.mode}${prepared.bundled ? `,内置 ${prepared.bundled.length} 个依赖` : ''}${tag !== 'latest' ? `,dist-tag=${tag}` : ''})`)
|
|
507
|
+
return { label, status: 'would-publish' }
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
const access = pkg.publishConfig?.access || 'public'
|
|
511
|
+
const expectedSha = npm.localShasumOf(prepared.publishDir)
|
|
512
|
+
const pub = npm.rawNpmRun(['publish', '--access', access, '--tag', tag], { cwd: prepared.publishDir })
|
|
513
|
+
if (pub.status !== 0) {
|
|
514
|
+
log(`✗ ${label} — npm publish 失败`)
|
|
515
|
+
log(String(pub.stderr || pub.stdout || '').trim().slice(0, 500))
|
|
516
|
+
return { label, status: 'publish-failed', detail: (pub.stdout || '') + (pub.stderr || '') }
|
|
517
|
+
}
|
|
518
|
+
/* 发布后复核:registry 收到的 tarball 必须与本地 pack 逐字节一致(shasum)。 */
|
|
519
|
+
let remoteSha = null
|
|
520
|
+
for (let i = 0; i < 5 && !remoteSha; i++) {
|
|
521
|
+
if (i) Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, 3000)
|
|
522
|
+
remoteSha = npm.npmShasumOf(pkg.name, pkg.version)
|
|
523
|
+
}
|
|
524
|
+
if (remoteSha && expectedSha && remoteSha !== expectedSha) {
|
|
525
|
+
log(`✗ ${label} — 发布后复核失败:registry ${remoteSha.slice(0, 8)} ≠ 本地 ${expectedSha.slice(0, 8)}(registry 可能收到脏产物,bump 后重发)`)
|
|
526
|
+
return { label, status: 'publish-corrupted', detail: `shasum ${remoteSha} != ${expectedSha}` }
|
|
527
|
+
}
|
|
528
|
+
if (!remoteSha) log(`! ${label} — 发布后复核降级:registry shasum 暂不可见(副本延迟),请稍后人工核对`)
|
|
529
|
+
log(`✓ ${label} — 已发布(自包含产物=${prepared.mode}${tag !== 'latest' ? `,dist-tag=${tag}` : ''})`)
|
|
530
|
+
return { label, status: 'published' }
|
|
531
|
+
} finally {
|
|
532
|
+
prepared.cleanup()
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
/** 解析工作区 root:参数 → DSH_PUBLISHER_ROOT。 */
|
|
537
|
+
export function resolveRoot(root) {
|
|
538
|
+
const resolved = root || process.env.DSH_PUBLISHER_ROOT
|
|
539
|
+
if (!resolved) return { error: '缺少工作区路径:传工具参数 root,或设置 DSH_PUBLISHER_ROOT' }
|
|
540
|
+
const abs = path.resolve(resolved)
|
|
541
|
+
if (!fs.existsSync(path.join(abs, 'package.json'))) return { error: `不是插件工程工作区(缺 package.json): ${abs}` }
|
|
542
|
+
return { root: abs }
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
/** 统一发布主流程:发现集 → 批次 → 先库后插件逐包过闸 →(dryRun ? 预演 : 真发布)。 */
|
|
546
|
+
export async function runPublish(options = {}) {
|
|
547
|
+
const {
|
|
548
|
+
only, tag = 'latest', skipTests = false, dryRun = true, libs, log = console.log,
|
|
549
|
+
} = options
|
|
550
|
+
const rootRes = resolveRoot(options.root)
|
|
551
|
+
if (rootRes.error) return { ok: false, error: rootRes.error }
|
|
552
|
+
const root = rootRes.root
|
|
553
|
+
|
|
554
|
+
const supportLibs = Array.isArray(libs) && libs.length ? libs : DEFAULT_SUPPORT_LIBS
|
|
555
|
+
const npm = createNpmContext()
|
|
556
|
+
|
|
557
|
+
const results = []
|
|
558
|
+
const libDirs = supportLibs.map((rel) => path.join(root, rel))
|
|
559
|
+
for (const dir of libDirs) {
|
|
560
|
+
if (!fs.existsSync(path.join(dir, 'package.json'))) {
|
|
561
|
+
results.push({ label: dir, status: 'missing-dir', detail: [`支撑库目录缺失: ${dir}`] })
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
const pluginDirs = discoverPlugins({ root })
|
|
565
|
+
const usableLibDirs = libDirs.filter((dir) => fs.existsSync(path.join(dir, 'package.json')))
|
|
566
|
+
if (!usableLibDirs.length && !pluginDirs.length) {
|
|
567
|
+
return { ok: false, root, error: '没有可发布的包(全部被发布闸拦下)', results, summary: {} }
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
log(`模式: ${dryRun ? 'DRY RUN(execute 才会真正发布)' : '执行发布'}${tag !== 'latest' ? `,dist-tag=${tag}` : ''}`)
|
|
571
|
+
log(`候选: ${usableLibDirs.length} 个支撑库 + ${pluginDirs.length} 个插件\n`)
|
|
572
|
+
|
|
573
|
+
/* 本次发布批次 = 候选中 registry 上尚不存在同名版本的包(顺序闸据此放行同批依赖)。 */
|
|
574
|
+
const localMap = new Map()
|
|
575
|
+
for (const dir of [...usableLibDirs, ...pluginDirs]) {
|
|
576
|
+
const pkg = pkgOf(dir)
|
|
577
|
+
localMap.set(pkg.name, { pkg, dir })
|
|
578
|
+
}
|
|
579
|
+
const batch = new Set(
|
|
580
|
+
[...usableLibDirs, ...pluginDirs]
|
|
581
|
+
.map((dir) => pkgOf(dir))
|
|
582
|
+
.filter((pkg) => !only || pkg.name === only)
|
|
583
|
+
.filter((pkg) => !npm.alreadyPublished(pkg.name, pkg.version))
|
|
584
|
+
.map((pkg) => pkg.name),
|
|
585
|
+
)
|
|
586
|
+
|
|
587
|
+
const shared = { localMap, batch, only, tag, skipTests, dryRun, npm, log, root }
|
|
588
|
+
// 先库后插件:plugin-kit 等支撑库必须先上 registry,插件发布时依赖才可解析
|
|
589
|
+
for (const dir of usableLibDirs) results.push(await publishOne(dir, { kind: 'lib', ...shared }))
|
|
590
|
+
for (const dir of pluginDirs) results.push(await publishOne(dir, { kind: 'plugin', ...shared }))
|
|
591
|
+
|
|
592
|
+
const done = results.filter(Boolean)
|
|
593
|
+
const summary = done.reduce((acc, item) => {
|
|
594
|
+
acc[item.status] = (acc[item.status] || 0) + 1
|
|
595
|
+
return acc
|
|
596
|
+
}, {})
|
|
597
|
+
log(`\n汇总: ${JSON.stringify(summary)}`)
|
|
598
|
+
|
|
599
|
+
return { ok: !done.some((r) => FAILURE_STATUSES.includes(r.status)), root, results: done, summary }
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
/** 契约探针实现。 */
|
|
603
|
+
export function capabilities() {
|
|
604
|
+
return {
|
|
605
|
+
contractVersion: '1.0.0',
|
|
606
|
+
tools: ['publisher_whoami', 'publisher_preview', 'publisher_execute', 'publisher_capabilities'],
|
|
607
|
+
defaults: { port: 39700, tag: 'latest' },
|
|
608
|
+
}
|
|
609
|
+
}
|