@openclaw/mattermost 2026.2.21 → 2026.6.11
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 +13 -0
- package/dist/accounts-DnAHfb5f.js +438 -0
- package/dist/api.js +2 -0
- package/dist/channel-plugin-api.js +31 -0
- package/dist/channel-plugin-runtime-MXClEU4F.js +1160 -0
- package/dist/channel-plugin-runtime.js +2 -0
- package/dist/channel.runtime-W-pjr9zL.js +2671 -0
- package/dist/doctor-contract-api.js +2 -0
- package/dist/doctor-contract-ttH0DCuq.js +7 -0
- package/dist/gateway-auth-api.js +2 -0
- package/dist/gateway-auth-bypass-BHgOAkk8.js +37 -0
- package/dist/index.js +31 -0
- package/dist/monitor-auth-BiDuyvOc.js +183 -0
- package/dist/policy-api.js +2 -0
- package/dist/runtime-CNB4YGqJ.js +8 -0
- package/dist/runtime-api.js +24 -0
- package/dist/secret-contract-Cx0LUNXy.js +44 -0
- package/dist/secret-contract-api.js +2 -0
- package/dist/setup-entry.js +15 -0
- package/dist/slash-route-api.js +2 -0
- package/dist/slash-state-I1qleAHM.js +2251 -0
- package/node_modules/ws/LICENSE +20 -0
- package/node_modules/ws/README.md +548 -0
- package/node_modules/ws/browser.js +8 -0
- package/node_modules/ws/index.js +22 -0
- package/node_modules/ws/lib/buffer-util.js +131 -0
- package/node_modules/ws/lib/constants.js +19 -0
- package/node_modules/ws/lib/event-target.js +292 -0
- package/node_modules/ws/lib/extension.js +203 -0
- package/node_modules/ws/lib/limiter.js +55 -0
- package/node_modules/ws/lib/permessage-deflate.js +528 -0
- package/node_modules/ws/lib/receiver.js +760 -0
- package/node_modules/ws/lib/sender.js +607 -0
- package/node_modules/ws/lib/stream.js +161 -0
- package/node_modules/ws/lib/subprotocol.js +62 -0
- package/node_modules/ws/lib/validation.js +152 -0
- package/node_modules/ws/lib/websocket-server.js +562 -0
- package/node_modules/ws/lib/websocket.js +1407 -0
- package/node_modules/ws/package.json +70 -0
- package/node_modules/ws/wrapper.mjs +21 -0
- package/node_modules/zod/LICENSE +21 -0
- package/node_modules/zod/README.md +191 -0
- package/node_modules/zod/index.cjs +33 -0
- package/node_modules/zod/index.d.cts +4 -0
- package/node_modules/zod/index.d.ts +4 -0
- package/node_modules/zod/index.js +4 -0
- package/node_modules/zod/locales/index.cjs +17 -0
- package/node_modules/zod/locales/index.d.cts +1 -0
- package/node_modules/zod/locales/index.d.ts +1 -0
- package/node_modules/zod/locales/index.js +1 -0
- package/node_modules/zod/locales/package.json +7 -0
- package/node_modules/zod/mini/index.cjs +32 -0
- package/node_modules/zod/mini/index.d.cts +3 -0
- package/node_modules/zod/mini/index.d.ts +3 -0
- package/node_modules/zod/mini/index.js +3 -0
- package/node_modules/zod/mini/package.json +7 -0
- package/node_modules/zod/package.json +135 -0
- package/node_modules/zod/src/index.ts +4 -0
- package/node_modules/zod/src/locales/index.ts +1 -0
- package/node_modules/zod/src/mini/index.ts +3 -0
- package/node_modules/zod/src/v3/ZodError.ts +330 -0
- package/node_modules/zod/src/v3/benchmarks/datetime.ts +58 -0
- package/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +80 -0
- package/node_modules/zod/src/v3/benchmarks/index.ts +59 -0
- package/node_modules/zod/src/v3/benchmarks/ipv4.ts +57 -0
- package/node_modules/zod/src/v3/benchmarks/object.ts +69 -0
- package/node_modules/zod/src/v3/benchmarks/primitives.ts +162 -0
- package/node_modules/zod/src/v3/benchmarks/realworld.ts +63 -0
- package/node_modules/zod/src/v3/benchmarks/string.ts +55 -0
- package/node_modules/zod/src/v3/benchmarks/union.ts +80 -0
- package/node_modules/zod/src/v3/errors.ts +13 -0
- package/node_modules/zod/src/v3/external.ts +6 -0
- package/node_modules/zod/src/v3/helpers/enumUtil.ts +17 -0
- package/node_modules/zod/src/v3/helpers/errorUtil.ts +8 -0
- package/node_modules/zod/src/v3/helpers/parseUtil.ts +176 -0
- package/node_modules/zod/src/v3/helpers/partialUtil.ts +34 -0
- package/node_modules/zod/src/v3/helpers/typeAliases.ts +2 -0
- package/node_modules/zod/src/v3/helpers/util.ts +224 -0
- package/node_modules/zod/src/v3/index.ts +4 -0
- package/node_modules/zod/src/v3/locales/en.ts +124 -0
- package/node_modules/zod/src/v3/standard-schema.ts +113 -0
- package/node_modules/zod/src/v3/tests/Mocker.ts +54 -0
- package/node_modules/zod/src/v3/tests/all-errors.test.ts +157 -0
- package/node_modules/zod/src/v3/tests/anyunknown.test.ts +28 -0
- package/node_modules/zod/src/v3/tests/array.test.ts +71 -0
- package/node_modules/zod/src/v3/tests/async-parsing.test.ts +388 -0
- package/node_modules/zod/src/v3/tests/async-refinements.test.ts +46 -0
- package/node_modules/zod/src/v3/tests/base.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/bigint.test.ts +55 -0
- package/node_modules/zod/src/v3/tests/branded.test.ts +53 -0
- package/node_modules/zod/src/v3/tests/catch.test.ts +220 -0
- package/node_modules/zod/src/v3/tests/coerce.test.ts +133 -0
- package/node_modules/zod/src/v3/tests/complex.test.ts +70 -0
- package/node_modules/zod/src/v3/tests/custom.test.ts +31 -0
- package/node_modules/zod/src/v3/tests/date.test.ts +32 -0
- package/node_modules/zod/src/v3/tests/deepmasking.test.ts +186 -0
- package/node_modules/zod/src/v3/tests/default.test.ts +112 -0
- package/node_modules/zod/src/v3/tests/description.test.ts +33 -0
- package/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +315 -0
- package/node_modules/zod/src/v3/tests/enum.test.ts +80 -0
- package/node_modules/zod/src/v3/tests/error.test.ts +551 -0
- package/node_modules/zod/src/v3/tests/firstparty.test.ts +87 -0
- package/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +21 -0
- package/node_modules/zod/src/v3/tests/function.test.ts +261 -0
- package/node_modules/zod/src/v3/tests/generics.test.ts +48 -0
- package/node_modules/zod/src/v3/tests/instanceof.test.ts +37 -0
- package/node_modules/zod/src/v3/tests/intersection.test.ts +110 -0
- package/node_modules/zod/src/v3/tests/language-server.source.ts +76 -0
- package/node_modules/zod/src/v3/tests/language-server.test.ts +207 -0
- package/node_modules/zod/src/v3/tests/literal.test.ts +36 -0
- package/node_modules/zod/src/v3/tests/map.test.ts +110 -0
- package/node_modules/zod/src/v3/tests/masking.test.ts +4 -0
- package/node_modules/zod/src/v3/tests/mocker.test.ts +19 -0
- package/node_modules/zod/src/v3/tests/nan.test.ts +24 -0
- package/node_modules/zod/src/v3/tests/nativeEnum.test.ts +87 -0
- package/node_modules/zod/src/v3/tests/nullable.test.ts +42 -0
- package/node_modules/zod/src/v3/tests/number.test.ts +176 -0
- package/node_modules/zod/src/v3/tests/object-augmentation.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/object.test.ts +434 -0
- package/node_modules/zod/src/v3/tests/optional.test.ts +42 -0
- package/node_modules/zod/src/v3/tests/parseUtil.test.ts +23 -0
- package/node_modules/zod/src/v3/tests/parser.test.ts +41 -0
- package/node_modules/zod/src/v3/tests/partials.test.ts +243 -0
- package/node_modules/zod/src/v3/tests/pickomit.test.ts +111 -0
- package/node_modules/zod/src/v3/tests/pipeline.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/preprocess.test.ts +186 -0
- package/node_modules/zod/src/v3/tests/primitive.test.ts +440 -0
- package/node_modules/zod/src/v3/tests/promise.test.ts +90 -0
- package/node_modules/zod/src/v3/tests/readonly.test.ts +194 -0
- package/node_modules/zod/src/v3/tests/record.test.ts +171 -0
- package/node_modules/zod/src/v3/tests/recursive.test.ts +197 -0
- package/node_modules/zod/src/v3/tests/refine.test.ts +313 -0
- package/node_modules/zod/src/v3/tests/safeparse.test.ts +27 -0
- package/node_modules/zod/src/v3/tests/set.test.ts +142 -0
- package/node_modules/zod/src/v3/tests/standard-schema.test.ts +83 -0
- package/node_modules/zod/src/v3/tests/string.test.ts +916 -0
- package/node_modules/zod/src/v3/tests/transformer.test.ts +233 -0
- package/node_modules/zod/src/v3/tests/tuple.test.ts +90 -0
- package/node_modules/zod/src/v3/tests/unions.test.ts +57 -0
- package/node_modules/zod/src/v3/tests/validations.test.ts +133 -0
- package/node_modules/zod/src/v3/tests/void.test.ts +15 -0
- package/node_modules/zod/src/v3/types.ts +5138 -0
- package/node_modules/zod/src/v4/classic/checks.ts +32 -0
- package/node_modules/zod/src/v4/classic/coerce.ts +27 -0
- package/node_modules/zod/src/v4/classic/compat.ts +70 -0
- package/node_modules/zod/src/v4/classic/errors.ts +82 -0
- package/node_modules/zod/src/v4/classic/external.ts +52 -0
- package/node_modules/zod/src/v4/classic/from-json-schema.ts +659 -0
- package/node_modules/zod/src/v4/classic/index.ts +5 -0
- package/node_modules/zod/src/v4/classic/iso.ts +90 -0
- package/node_modules/zod/src/v4/classic/parse.ts +82 -0
- package/node_modules/zod/src/v4/classic/schemas.ts +2672 -0
- package/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +26 -0
- package/node_modules/zod/src/v4/classic/tests/apply.test.ts +59 -0
- package/node_modules/zod/src/v4/classic/tests/array.test.ts +264 -0
- package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +216 -0
- package/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +381 -0
- package/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +68 -0
- package/node_modules/zod/src/v4/classic/tests/base.test.ts +7 -0
- package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +54 -0
- package/node_modules/zod/src/v4/classic/tests/brand.test.ts +106 -0
- package/node_modules/zod/src/v4/classic/tests/catch.test.ts +326 -0
- package/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +20 -0
- package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +573 -0
- package/node_modules/zod/src/v4/classic/tests/codec.test.ts +703 -0
- package/node_modules/zod/src/v4/classic/tests/coerce.test.ts +160 -0
- package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +374 -0
- package/node_modules/zod/src/v4/classic/tests/custom.test.ts +40 -0
- package/node_modules/zod/src/v4/classic/tests/date.test.ts +62 -0
- package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +302 -0
- package/node_modules/zod/src/v4/classic/tests/default.test.ts +409 -0
- package/node_modules/zod/src/v4/classic/tests/describe-meta-checks.test.ts +27 -0
- package/node_modules/zod/src/v4/classic/tests/description.test.ts +32 -0
- package/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +197 -0
- package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +694 -0
- package/node_modules/zod/src/v4/classic/tests/enum.test.ts +285 -0
- package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +807 -0
- package/node_modules/zod/src/v4/classic/tests/error.test.ts +711 -0
- package/node_modules/zod/src/v4/classic/tests/file.test.ts +96 -0
- package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +179 -0
- package/node_modules/zod/src/v4/classic/tests/fix-json-issue.test.ts +26 -0
- package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +895 -0
- package/node_modules/zod/src/v4/classic/tests/function.test.ts +360 -0
- package/node_modules/zod/src/v4/classic/tests/generics.test.ts +72 -0
- package/node_modules/zod/src/v4/classic/tests/global-config.test.ts +39 -0
- package/node_modules/zod/src/v4/classic/tests/hash.test.ts +68 -0
- package/node_modules/zod/src/v4/classic/tests/index.test.ts +939 -0
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +60 -0
- package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +198 -0
- package/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +46 -0
- package/node_modules/zod/src/v4/classic/tests/json.test.ts +109 -0
- package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +227 -0
- package/node_modules/zod/src/v4/classic/tests/literal.test.ts +117 -0
- package/node_modules/zod/src/v4/classic/tests/locales_ka.test.ts +29 -0
- package/node_modules/zod/src/v4/classic/tests/locales_ro.test.ts +24 -0
- package/node_modules/zod/src/v4/classic/tests/map.test.ts +330 -0
- package/node_modules/zod/src/v4/classic/tests/nan.test.ts +21 -0
- package/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +168 -0
- package/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +101 -0
- package/node_modules/zod/src/v4/classic/tests/nullable.test.ts +22 -0
- package/node_modules/zod/src/v4/classic/tests/number.test.ts +325 -0
- package/node_modules/zod/src/v4/classic/tests/object.test.ts +717 -0
- package/node_modules/zod/src/v4/classic/tests/optional.test.ts +333 -0
- package/node_modules/zod/src/v4/classic/tests/partial.test.ts +450 -0
- package/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +211 -0
- package/node_modules/zod/src/v4/classic/tests/pipe.test.ts +101 -0
- package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +74 -0
- package/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +26 -0
- package/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +351 -0
- package/node_modules/zod/src/v4/classic/tests/primitive.test.ts +175 -0
- package/node_modules/zod/src/v4/classic/tests/promise.test.ts +81 -0
- package/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +23 -0
- package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +252 -0
- package/node_modules/zod/src/v4/classic/tests/record.test.ts +717 -0
- package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +631 -0
- package/node_modules/zod/src/v4/classic/tests/refine.test.ts +633 -0
- package/node_modules/zod/src/v4/classic/tests/registries.test.ts +243 -0
- package/node_modules/zod/src/v4/classic/tests/set.test.ts +181 -0
- package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +134 -0
- package/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +125 -0
- package/node_modules/zod/src/v4/classic/tests/string.test.ts +1224 -0
- package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +106 -0
- package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +771 -0
- package/node_modules/zod/src/v4/classic/tests/to-json-schema-methods.test.ts +438 -0
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +3125 -0
- package/node_modules/zod/src/v4/classic/tests/transform.test.ts +378 -0
- package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +496 -0
- package/node_modules/zod/src/v4/classic/tests/union.test.ts +273 -0
- package/node_modules/zod/src/v4/classic/tests/url.test.ts +13 -0
- package/node_modules/zod/src/v4/classic/tests/validations.test.ts +283 -0
- package/node_modules/zod/src/v4/classic/tests/void.test.ts +12 -0
- package/node_modules/zod/src/v4/core/api.ts +1823 -0
- package/node_modules/zod/src/v4/core/checks.ts +1293 -0
- package/node_modules/zod/src/v4/core/config.ts +15 -0
- package/node_modules/zod/src/v4/core/core.ts +153 -0
- package/node_modules/zod/src/v4/core/doc.ts +44 -0
- package/node_modules/zod/src/v4/core/errors.ts +455 -0
- package/node_modules/zod/src/v4/core/index.ts +16 -0
- package/node_modules/zod/src/v4/core/json-schema-generator.ts +126 -0
- package/node_modules/zod/src/v4/core/json-schema-processors.ts +666 -0
- package/node_modules/zod/src/v4/core/json-schema.ts +147 -0
- package/node_modules/zod/src/v4/core/parse.ts +195 -0
- package/node_modules/zod/src/v4/core/regexes.ts +190 -0
- package/node_modules/zod/src/v4/core/registries.ts +105 -0
- package/node_modules/zod/src/v4/core/schemas.ts +4730 -0
- package/node_modules/zod/src/v4/core/standard-schema.ts +159 -0
- package/node_modules/zod/src/v4/core/tests/extend.test.ts +59 -0
- package/node_modules/zod/src/v4/core/tests/index.test.ts +46 -0
- package/node_modules/zod/src/v4/core/tests/locales/be.test.ts +124 -0
- package/node_modules/zod/src/v4/core/tests/locales/el.test.ts +215 -0
- package/node_modules/zod/src/v4/core/tests/locales/en.test.ts +22 -0
- package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +181 -0
- package/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +72 -0
- package/node_modules/zod/src/v4/core/tests/locales/he.test.ts +379 -0
- package/node_modules/zod/src/v4/core/tests/locales/hr.test.ts +163 -0
- package/node_modules/zod/src/v4/core/tests/locales/nl.test.ts +46 -0
- package/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +128 -0
- package/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +69 -0
- package/node_modules/zod/src/v4/core/tests/locales/uz.test.ts +105 -0
- package/node_modules/zod/src/v4/core/tests/record-constructor.test.ts +125 -0
- package/node_modules/zod/src/v4/core/tests/recursive-tuples.test.ts +45 -0
- package/node_modules/zod/src/v4/core/to-json-schema.ts +622 -0
- package/node_modules/zod/src/v4/core/util.ts +983 -0
- package/node_modules/zod/src/v4/core/versions.ts +5 -0
- package/node_modules/zod/src/v4/core/zsf.ts +323 -0
- package/node_modules/zod/src/v4/index.ts +4 -0
- package/node_modules/zod/src/v4/locales/ar.ts +115 -0
- package/node_modules/zod/src/v4/locales/az.ts +111 -0
- package/node_modules/zod/src/v4/locales/be.ts +176 -0
- package/node_modules/zod/src/v4/locales/bg.ts +128 -0
- package/node_modules/zod/src/v4/locales/ca.ts +116 -0
- package/node_modules/zod/src/v4/locales/cs.ts +118 -0
- package/node_modules/zod/src/v4/locales/da.ts +123 -0
- package/node_modules/zod/src/v4/locales/de.ts +116 -0
- package/node_modules/zod/src/v4/locales/el.ts +121 -0
- package/node_modules/zod/src/v4/locales/en.ts +123 -0
- package/node_modules/zod/src/v4/locales/eo.ts +118 -0
- package/node_modules/zod/src/v4/locales/es.ts +141 -0
- package/node_modules/zod/src/v4/locales/fa.ts +126 -0
- package/node_modules/zod/src/v4/locales/fi.ts +121 -0
- package/node_modules/zod/src/v4/locales/fr-CA.ts +116 -0
- package/node_modules/zod/src/v4/locales/fr.ts +132 -0
- package/node_modules/zod/src/v4/locales/he.ts +246 -0
- package/node_modules/zod/src/v4/locales/hr.ts +131 -0
- package/node_modules/zod/src/v4/locales/hu.ts +117 -0
- package/node_modules/zod/src/v4/locales/hy.ts +164 -0
- package/node_modules/zod/src/v4/locales/id.ts +115 -0
- package/node_modules/zod/src/v4/locales/index.ts +52 -0
- package/node_modules/zod/src/v4/locales/is.ts +119 -0
- package/node_modules/zod/src/v4/locales/it.ts +116 -0
- package/node_modules/zod/src/v4/locales/ja.ts +114 -0
- package/node_modules/zod/src/v4/locales/ka.ts +123 -0
- package/node_modules/zod/src/v4/locales/kh.ts +7 -0
- package/node_modules/zod/src/v4/locales/km.ts +119 -0
- package/node_modules/zod/src/v4/locales/ko.ts +121 -0
- package/node_modules/zod/src/v4/locales/lt.ts +239 -0
- package/node_modules/zod/src/v4/locales/mk.ts +118 -0
- package/node_modules/zod/src/v4/locales/ms.ts +115 -0
- package/node_modules/zod/src/v4/locales/nl.ts +121 -0
- package/node_modules/zod/src/v4/locales/no.ts +116 -0
- package/node_modules/zod/src/v4/locales/ota.ts +117 -0
- package/node_modules/zod/src/v4/locales/pl.ts +118 -0
- package/node_modules/zod/src/v4/locales/ps.ts +126 -0
- package/node_modules/zod/src/v4/locales/pt.ts +116 -0
- package/node_modules/zod/src/v4/locales/ro.ts +129 -0
- package/node_modules/zod/src/v4/locales/ru.ts +176 -0
- package/node_modules/zod/src/v4/locales/sl.ts +118 -0
- package/node_modules/zod/src/v4/locales/sv.ts +119 -0
- package/node_modules/zod/src/v4/locales/ta.ts +118 -0
- package/node_modules/zod/src/v4/locales/th.ts +119 -0
- package/node_modules/zod/src/v4/locales/tr.ts +111 -0
- package/node_modules/zod/src/v4/locales/ua.ts +7 -0
- package/node_modules/zod/src/v4/locales/uk.ts +117 -0
- package/node_modules/zod/src/v4/locales/ur.ts +119 -0
- package/node_modules/zod/src/v4/locales/uz.ts +117 -0
- package/node_modules/zod/src/v4/locales/vi.ts +117 -0
- package/node_modules/zod/src/v4/locales/yo.ts +124 -0
- package/node_modules/zod/src/v4/locales/zh-CN.ts +116 -0
- package/node_modules/zod/src/v4/locales/zh-TW.ts +115 -0
- package/node_modules/zod/src/v4/mini/checks.ts +32 -0
- package/node_modules/zod/src/v4/mini/coerce.ts +27 -0
- package/node_modules/zod/src/v4/mini/external.ts +41 -0
- package/node_modules/zod/src/v4/mini/index.ts +3 -0
- package/node_modules/zod/src/v4/mini/iso.ts +66 -0
- package/node_modules/zod/src/v4/mini/parse.ts +14 -0
- package/node_modules/zod/src/v4/mini/schemas.ts +1947 -0
- package/node_modules/zod/src/v4/mini/tests/apply.test.ts +24 -0
- package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +129 -0
- package/node_modules/zod/src/v4/mini/tests/brand.test.ts +94 -0
- package/node_modules/zod/src/v4/mini/tests/checks.test.ts +144 -0
- package/node_modules/zod/src/v4/mini/tests/codec.test.ts +548 -0
- package/node_modules/zod/src/v4/mini/tests/computed.test.ts +36 -0
- package/node_modules/zod/src/v4/mini/tests/error.test.ts +22 -0
- package/node_modules/zod/src/v4/mini/tests/functions.test.ts +5 -0
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +993 -0
- package/node_modules/zod/src/v4/mini/tests/number.test.ts +95 -0
- package/node_modules/zod/src/v4/mini/tests/object.test.ts +227 -0
- package/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +43 -0
- package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +325 -0
- package/node_modules/zod/src/v4/mini/tests/standard-schema.test.ts +50 -0
- package/node_modules/zod/src/v4/mini/tests/string.test.ts +352 -0
- package/node_modules/zod/src/v4-mini/index.ts +3 -0
- package/node_modules/zod/v3/ZodError.cjs +138 -0
- package/node_modules/zod/v3/ZodError.d.cts +164 -0
- package/node_modules/zod/v3/ZodError.d.ts +164 -0
- package/node_modules/zod/v3/ZodError.js +133 -0
- package/node_modules/zod/v3/errors.cjs +17 -0
- package/node_modules/zod/v3/errors.d.cts +5 -0
- package/node_modules/zod/v3/errors.d.ts +5 -0
- package/node_modules/zod/v3/errors.js +9 -0
- package/node_modules/zod/v3/external.cjs +22 -0
- package/node_modules/zod/v3/external.d.cts +6 -0
- package/node_modules/zod/v3/external.d.ts +6 -0
- package/node_modules/zod/v3/external.js +6 -0
- package/node_modules/zod/v3/helpers/enumUtil.cjs +2 -0
- package/node_modules/zod/v3/helpers/enumUtil.d.cts +8 -0
- package/node_modules/zod/v3/helpers/enumUtil.d.ts +8 -0
- package/node_modules/zod/v3/helpers/enumUtil.js +1 -0
- package/node_modules/zod/v3/helpers/errorUtil.cjs +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.d.cts +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.d.ts +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.js +6 -0
- package/node_modules/zod/v3/helpers/parseUtil.cjs +124 -0
- package/node_modules/zod/v3/helpers/parseUtil.d.cts +78 -0
- package/node_modules/zod/v3/helpers/parseUtil.d.ts +78 -0
- package/node_modules/zod/v3/helpers/parseUtil.js +109 -0
- package/node_modules/zod/v3/helpers/partialUtil.cjs +2 -0
- package/node_modules/zod/v3/helpers/partialUtil.d.cts +8 -0
- package/node_modules/zod/v3/helpers/partialUtil.d.ts +8 -0
- package/node_modules/zod/v3/helpers/partialUtil.js +1 -0
- package/node_modules/zod/v3/helpers/typeAliases.cjs +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.d.cts +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.d.ts +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.js +1 -0
- package/node_modules/zod/v3/helpers/util.cjs +137 -0
- package/node_modules/zod/v3/helpers/util.d.cts +85 -0
- package/node_modules/zod/v3/helpers/util.d.ts +85 -0
- package/node_modules/zod/v3/helpers/util.js +133 -0
- package/node_modules/zod/v3/index.cjs +33 -0
- package/node_modules/zod/v3/index.d.cts +4 -0
- package/node_modules/zod/v3/index.d.ts +4 -0
- package/node_modules/zod/v3/index.js +4 -0
- package/node_modules/zod/v3/locales/en.cjs +112 -0
- package/node_modules/zod/v3/locales/en.d.cts +3 -0
- package/node_modules/zod/v3/locales/en.d.ts +3 -0
- package/node_modules/zod/v3/locales/en.js +109 -0
- package/node_modules/zod/v3/package.json +7 -0
- package/node_modules/zod/v3/standard-schema.cjs +2 -0
- package/node_modules/zod/v3/standard-schema.d.cts +102 -0
- package/node_modules/zod/v3/standard-schema.d.ts +102 -0
- package/node_modules/zod/v3/standard-schema.js +1 -0
- package/node_modules/zod/v3/types.cjs +3777 -0
- package/node_modules/zod/v3/types.d.cts +1034 -0
- package/node_modules/zod/v3/types.d.ts +1034 -0
- package/node_modules/zod/v3/types.js +3695 -0
- package/node_modules/zod/v4/classic/checks.cjs +33 -0
- package/node_modules/zod/v4/classic/checks.d.cts +1 -0
- package/node_modules/zod/v4/classic/checks.d.ts +1 -0
- package/node_modules/zod/v4/classic/checks.js +1 -0
- package/node_modules/zod/v4/classic/coerce.cjs +47 -0
- package/node_modules/zod/v4/classic/coerce.d.cts +17 -0
- package/node_modules/zod/v4/classic/coerce.d.ts +17 -0
- package/node_modules/zod/v4/classic/coerce.js +17 -0
- package/node_modules/zod/v4/classic/compat.cjs +61 -0
- package/node_modules/zod/v4/classic/compat.d.cts +50 -0
- package/node_modules/zod/v4/classic/compat.d.ts +50 -0
- package/node_modules/zod/v4/classic/compat.js +31 -0
- package/node_modules/zod/v4/classic/errors.cjs +74 -0
- package/node_modules/zod/v4/classic/errors.d.cts +30 -0
- package/node_modules/zod/v4/classic/errors.d.ts +30 -0
- package/node_modules/zod/v4/classic/errors.js +48 -0
- package/node_modules/zod/v4/classic/external.cjs +73 -0
- package/node_modules/zod/v4/classic/external.d.cts +16 -0
- package/node_modules/zod/v4/classic/external.d.ts +16 -0
- package/node_modules/zod/v4/classic/external.js +20 -0
- package/node_modules/zod/v4/classic/from-json-schema.cjs +625 -0
- package/node_modules/zod/v4/classic/from-json-schema.d.cts +12 -0
- package/node_modules/zod/v4/classic/from-json-schema.d.ts +12 -0
- package/node_modules/zod/v4/classic/from-json-schema.js +599 -0
- package/node_modules/zod/v4/classic/index.cjs +33 -0
- package/node_modules/zod/v4/classic/index.d.cts +4 -0
- package/node_modules/zod/v4/classic/index.d.ts +4 -0
- package/node_modules/zod/v4/classic/index.js +4 -0
- package/node_modules/zod/v4/classic/iso.cjs +60 -0
- package/node_modules/zod/v4/classic/iso.d.cts +22 -0
- package/node_modules/zod/v4/classic/iso.d.ts +22 -0
- package/node_modules/zod/v4/classic/iso.js +30 -0
- package/node_modules/zod/v4/classic/package.json +7 -0
- package/node_modules/zod/v4/classic/parse.cjs +41 -0
- package/node_modules/zod/v4/classic/parse.d.cts +31 -0
- package/node_modules/zod/v4/classic/parse.d.ts +31 -0
- package/node_modules/zod/v4/classic/parse.js +15 -0
- package/node_modules/zod/v4/classic/schemas.cjs +1511 -0
- package/node_modules/zod/v4/classic/schemas.d.cts +767 -0
- package/node_modules/zod/v4/classic/schemas.d.ts +767 -0
- package/node_modules/zod/v4/classic/schemas.js +1395 -0
- package/node_modules/zod/v4/core/api.cjs +1227 -0
- package/node_modules/zod/v4/core/api.d.cts +325 -0
- package/node_modules/zod/v4/core/api.d.ts +325 -0
- package/node_modules/zod/v4/core/api.js +1087 -0
- package/node_modules/zod/v4/core/checks.cjs +601 -0
- package/node_modules/zod/v4/core/checks.d.cts +278 -0
- package/node_modules/zod/v4/core/checks.d.ts +278 -0
- package/node_modules/zod/v4/core/checks.js +575 -0
- package/node_modules/zod/v4/core/core.cjs +85 -0
- package/node_modules/zod/v4/core/core.d.cts +70 -0
- package/node_modules/zod/v4/core/core.d.ts +70 -0
- package/node_modules/zod/v4/core/core.js +78 -0
- package/node_modules/zod/v4/core/doc.cjs +39 -0
- package/node_modules/zod/v4/core/doc.d.cts +14 -0
- package/node_modules/zod/v4/core/doc.d.ts +14 -0
- package/node_modules/zod/v4/core/doc.js +35 -0
- package/node_modules/zod/v4/core/errors.cjs +216 -0
- package/node_modules/zod/v4/core/errors.d.cts +221 -0
- package/node_modules/zod/v4/core/errors.d.ts +221 -0
- package/node_modules/zod/v4/core/errors.js +185 -0
- package/node_modules/zod/v4/core/index.cjs +47 -0
- package/node_modules/zod/v4/core/index.d.cts +16 -0
- package/node_modules/zod/v4/core/index.d.ts +16 -0
- package/node_modules/zod/v4/core/index.js +16 -0
- package/node_modules/zod/v4/core/json-schema-generator.cjs +99 -0
- package/node_modules/zod/v4/core/json-schema-generator.d.cts +65 -0
- package/node_modules/zod/v4/core/json-schema-generator.d.ts +65 -0
- package/node_modules/zod/v4/core/json-schema-generator.js +95 -0
- package/node_modules/zod/v4/core/json-schema-processors.cjs +644 -0
- package/node_modules/zod/v4/core/json-schema-processors.d.cts +49 -0
- package/node_modules/zod/v4/core/json-schema-processors.d.ts +49 -0
- package/node_modules/zod/v4/core/json-schema-processors.js +601 -0
- package/node_modules/zod/v4/core/json-schema.cjs +2 -0
- package/node_modules/zod/v4/core/json-schema.d.cts +88 -0
- package/node_modules/zod/v4/core/json-schema.d.ts +88 -0
- package/node_modules/zod/v4/core/json-schema.js +1 -0
- package/node_modules/zod/v4/core/package.json +7 -0
- package/node_modules/zod/v4/core/parse.cjs +131 -0
- package/node_modules/zod/v4/core/parse.d.cts +49 -0
- package/node_modules/zod/v4/core/parse.d.ts +49 -0
- package/node_modules/zod/v4/core/parse.js +93 -0
- package/node_modules/zod/v4/core/regexes.cjs +172 -0
- package/node_modules/zod/v4/core/regexes.d.cts +85 -0
- package/node_modules/zod/v4/core/regexes.d.ts +85 -0
- package/node_modules/zod/v4/core/regexes.js +139 -0
- package/node_modules/zod/v4/core/registries.cjs +56 -0
- package/node_modules/zod/v4/core/registries.d.cts +35 -0
- package/node_modules/zod/v4/core/registries.d.ts +35 -0
- package/node_modules/zod/v4/core/registries.js +51 -0
- package/node_modules/zod/v4/core/schemas.cjs +2270 -0
- package/node_modules/zod/v4/core/schemas.d.cts +1184 -0
- package/node_modules/zod/v4/core/schemas.d.ts +1184 -0
- package/node_modules/zod/v4/core/schemas.js +2239 -0
- package/node_modules/zod/v4/core/standard-schema.cjs +2 -0
- package/node_modules/zod/v4/core/standard-schema.d.cts +126 -0
- package/node_modules/zod/v4/core/standard-schema.d.ts +126 -0
- package/node_modules/zod/v4/core/standard-schema.js +1 -0
- package/node_modules/zod/v4/core/to-json-schema.cjs +457 -0
- package/node_modules/zod/v4/core/to-json-schema.d.cts +114 -0
- package/node_modules/zod/v4/core/to-json-schema.d.ts +114 -0
- package/node_modules/zod/v4/core/to-json-schema.js +448 -0
- package/node_modules/zod/v4/core/util.cjs +734 -0
- package/node_modules/zod/v4/core/util.d.cts +200 -0
- package/node_modules/zod/v4/core/util.d.ts +200 -0
- package/node_modules/zod/v4/core/util.js +674 -0
- package/node_modules/zod/v4/core/versions.cjs +8 -0
- package/node_modules/zod/v4/core/versions.d.cts +5 -0
- package/node_modules/zod/v4/core/versions.d.ts +5 -0
- package/node_modules/zod/v4/core/versions.js +5 -0
- package/node_modules/zod/v4/index.cjs +22 -0
- package/node_modules/zod/v4/index.d.cts +3 -0
- package/node_modules/zod/v4/index.d.ts +3 -0
- package/node_modules/zod/v4/index.js +3 -0
- package/node_modules/zod/v4/locales/ar.cjs +133 -0
- package/node_modules/zod/v4/locales/ar.d.cts +5 -0
- package/node_modules/zod/v4/locales/ar.d.ts +4 -0
- package/node_modules/zod/v4/locales/ar.js +106 -0
- package/node_modules/zod/v4/locales/az.cjs +132 -0
- package/node_modules/zod/v4/locales/az.d.cts +5 -0
- package/node_modules/zod/v4/locales/az.d.ts +4 -0
- package/node_modules/zod/v4/locales/az.js +105 -0
- package/node_modules/zod/v4/locales/be.cjs +183 -0
- package/node_modules/zod/v4/locales/be.d.cts +5 -0
- package/node_modules/zod/v4/locales/be.d.ts +4 -0
- package/node_modules/zod/v4/locales/be.js +156 -0
- package/node_modules/zod/v4/locales/bg.cjs +147 -0
- package/node_modules/zod/v4/locales/bg.d.cts +5 -0
- package/node_modules/zod/v4/locales/bg.d.ts +4 -0
- package/node_modules/zod/v4/locales/bg.js +120 -0
- package/node_modules/zod/v4/locales/ca.cjs +134 -0
- package/node_modules/zod/v4/locales/ca.d.cts +5 -0
- package/node_modules/zod/v4/locales/ca.d.ts +4 -0
- package/node_modules/zod/v4/locales/ca.js +107 -0
- package/node_modules/zod/v4/locales/cs.cjs +138 -0
- package/node_modules/zod/v4/locales/cs.d.cts +5 -0
- package/node_modules/zod/v4/locales/cs.d.ts +4 -0
- package/node_modules/zod/v4/locales/cs.js +111 -0
- package/node_modules/zod/v4/locales/da.cjs +142 -0
- package/node_modules/zod/v4/locales/da.d.cts +5 -0
- package/node_modules/zod/v4/locales/da.d.ts +4 -0
- package/node_modules/zod/v4/locales/da.js +115 -0
- package/node_modules/zod/v4/locales/de.cjs +135 -0
- package/node_modules/zod/v4/locales/de.d.cts +5 -0
- package/node_modules/zod/v4/locales/de.d.ts +4 -0
- package/node_modules/zod/v4/locales/de.js +108 -0
- package/node_modules/zod/v4/locales/el.cjs +136 -0
- package/node_modules/zod/v4/locales/el.d.cts +5 -0
- package/node_modules/zod/v4/locales/el.d.ts +4 -0
- package/node_modules/zod/v4/locales/el.js +109 -0
- package/node_modules/zod/v4/locales/en.cjs +140 -0
- package/node_modules/zod/v4/locales/en.d.cts +5 -0
- package/node_modules/zod/v4/locales/en.d.ts +4 -0
- package/node_modules/zod/v4/locales/en.js +113 -0
- package/node_modules/zod/v4/locales/eo.cjs +136 -0
- package/node_modules/zod/v4/locales/eo.d.cts +5 -0
- package/node_modules/zod/v4/locales/eo.d.ts +4 -0
- package/node_modules/zod/v4/locales/eo.js +109 -0
- package/node_modules/zod/v4/locales/es.cjs +159 -0
- package/node_modules/zod/v4/locales/es.d.cts +5 -0
- package/node_modules/zod/v4/locales/es.d.ts +4 -0
- package/node_modules/zod/v4/locales/es.js +132 -0
- package/node_modules/zod/v4/locales/fa.cjs +141 -0
- package/node_modules/zod/v4/locales/fa.d.cts +5 -0
- package/node_modules/zod/v4/locales/fa.d.ts +4 -0
- package/node_modules/zod/v4/locales/fa.js +114 -0
- package/node_modules/zod/v4/locales/fi.cjs +139 -0
- package/node_modules/zod/v4/locales/fi.d.cts +5 -0
- package/node_modules/zod/v4/locales/fi.d.ts +4 -0
- package/node_modules/zod/v4/locales/fi.js +112 -0
- package/node_modules/zod/v4/locales/fr-CA.cjs +134 -0
- package/node_modules/zod/v4/locales/fr-CA.d.cts +5 -0
- package/node_modules/zod/v4/locales/fr-CA.d.ts +4 -0
- package/node_modules/zod/v4/locales/fr-CA.js +107 -0
- package/node_modules/zod/v4/locales/fr.cjs +152 -0
- package/node_modules/zod/v4/locales/fr.d.cts +5 -0
- package/node_modules/zod/v4/locales/fr.d.ts +4 -0
- package/node_modules/zod/v4/locales/fr.js +125 -0
- package/node_modules/zod/v4/locales/he.cjs +241 -0
- package/node_modules/zod/v4/locales/he.d.cts +5 -0
- package/node_modules/zod/v4/locales/he.d.ts +4 -0
- package/node_modules/zod/v4/locales/he.js +214 -0
- package/node_modules/zod/v4/locales/hr.cjs +149 -0
- package/node_modules/zod/v4/locales/hr.d.cts +5 -0
- package/node_modules/zod/v4/locales/hr.d.ts +4 -0
- package/node_modules/zod/v4/locales/hr.js +122 -0
- package/node_modules/zod/v4/locales/hu.cjs +135 -0
- package/node_modules/zod/v4/locales/hu.d.cts +5 -0
- package/node_modules/zod/v4/locales/hu.d.ts +4 -0
- package/node_modules/zod/v4/locales/hu.js +108 -0
- package/node_modules/zod/v4/locales/hy.cjs +174 -0
- package/node_modules/zod/v4/locales/hy.d.cts +5 -0
- package/node_modules/zod/v4/locales/hy.d.ts +4 -0
- package/node_modules/zod/v4/locales/hy.js +147 -0
- package/node_modules/zod/v4/locales/id.cjs +133 -0
- package/node_modules/zod/v4/locales/id.d.cts +5 -0
- package/node_modules/zod/v4/locales/id.d.ts +4 -0
- package/node_modules/zod/v4/locales/id.js +106 -0
- package/node_modules/zod/v4/locales/index.cjs +111 -0
- package/node_modules/zod/v4/locales/index.d.cts +52 -0
- package/node_modules/zod/v4/locales/index.d.ts +52 -0
- package/node_modules/zod/v4/locales/index.js +52 -0
- package/node_modules/zod/v4/locales/is.cjs +136 -0
- package/node_modules/zod/v4/locales/is.d.cts +5 -0
- package/node_modules/zod/v4/locales/is.d.ts +4 -0
- package/node_modules/zod/v4/locales/is.js +109 -0
- package/node_modules/zod/v4/locales/it.cjs +135 -0
- package/node_modules/zod/v4/locales/it.d.cts +5 -0
- package/node_modules/zod/v4/locales/it.d.ts +4 -0
- package/node_modules/zod/v4/locales/it.js +108 -0
- package/node_modules/zod/v4/locales/ja.cjs +134 -0
- package/node_modules/zod/v4/locales/ja.d.cts +5 -0
- package/node_modules/zod/v4/locales/ja.d.ts +4 -0
- package/node_modules/zod/v4/locales/ja.js +107 -0
- package/node_modules/zod/v4/locales/ka.cjs +139 -0
- package/node_modules/zod/v4/locales/ka.d.cts +5 -0
- package/node_modules/zod/v4/locales/ka.d.ts +4 -0
- package/node_modules/zod/v4/locales/ka.js +112 -0
- package/node_modules/zod/v4/locales/kh.cjs +12 -0
- package/node_modules/zod/v4/locales/kh.d.cts +5 -0
- package/node_modules/zod/v4/locales/kh.d.ts +5 -0
- package/node_modules/zod/v4/locales/kh.js +5 -0
- package/node_modules/zod/v4/locales/km.cjs +137 -0
- package/node_modules/zod/v4/locales/km.d.cts +5 -0
- package/node_modules/zod/v4/locales/km.d.ts +4 -0
- package/node_modules/zod/v4/locales/km.js +110 -0
- package/node_modules/zod/v4/locales/ko.cjs +138 -0
- package/node_modules/zod/v4/locales/ko.d.cts +5 -0
- package/node_modules/zod/v4/locales/ko.d.ts +4 -0
- package/node_modules/zod/v4/locales/ko.js +111 -0
- package/node_modules/zod/v4/locales/lt.cjs +230 -0
- package/node_modules/zod/v4/locales/lt.d.cts +5 -0
- package/node_modules/zod/v4/locales/lt.d.ts +4 -0
- package/node_modules/zod/v4/locales/lt.js +203 -0
- package/node_modules/zod/v4/locales/mk.cjs +136 -0
- package/node_modules/zod/v4/locales/mk.d.cts +5 -0
- package/node_modules/zod/v4/locales/mk.d.ts +4 -0
- package/node_modules/zod/v4/locales/mk.js +109 -0
- package/node_modules/zod/v4/locales/ms.cjs +134 -0
- package/node_modules/zod/v4/locales/ms.d.cts +5 -0
- package/node_modules/zod/v4/locales/ms.d.ts +4 -0
- package/node_modules/zod/v4/locales/ms.js +107 -0
- package/node_modules/zod/v4/locales/nl.cjs +137 -0
- package/node_modules/zod/v4/locales/nl.d.cts +5 -0
- package/node_modules/zod/v4/locales/nl.d.ts +4 -0
- package/node_modules/zod/v4/locales/nl.js +110 -0
- package/node_modules/zod/v4/locales/no.cjs +135 -0
- package/node_modules/zod/v4/locales/no.d.cts +5 -0
- package/node_modules/zod/v4/locales/no.d.ts +4 -0
- package/node_modules/zod/v4/locales/no.js +108 -0
- package/node_modules/zod/v4/locales/ota.cjs +136 -0
- package/node_modules/zod/v4/locales/ota.d.cts +5 -0
- package/node_modules/zod/v4/locales/ota.d.ts +4 -0
- package/node_modules/zod/v4/locales/ota.js +109 -0
- package/node_modules/zod/v4/locales/package.json +7 -0
- package/node_modules/zod/v4/locales/pl.cjs +136 -0
- package/node_modules/zod/v4/locales/pl.d.cts +5 -0
- package/node_modules/zod/v4/locales/pl.d.ts +4 -0
- package/node_modules/zod/v4/locales/pl.js +109 -0
- package/node_modules/zod/v4/locales/ps.cjs +141 -0
- package/node_modules/zod/v4/locales/ps.d.cts +5 -0
- package/node_modules/zod/v4/locales/ps.d.ts +4 -0
- package/node_modules/zod/v4/locales/ps.js +114 -0
- package/node_modules/zod/v4/locales/pt.cjs +135 -0
- package/node_modules/zod/v4/locales/pt.d.cts +5 -0
- package/node_modules/zod/v4/locales/pt.d.ts +4 -0
- package/node_modules/zod/v4/locales/pt.js +108 -0
- package/node_modules/zod/v4/locales/ro.cjs +146 -0
- package/node_modules/zod/v4/locales/ro.d.cts +5 -0
- package/node_modules/zod/v4/locales/ro.d.ts +4 -0
- package/node_modules/zod/v4/locales/ro.js +119 -0
- package/node_modules/zod/v4/locales/ru.cjs +183 -0
- package/node_modules/zod/v4/locales/ru.d.cts +5 -0
- package/node_modules/zod/v4/locales/ru.d.ts +4 -0
- package/node_modules/zod/v4/locales/ru.js +156 -0
- package/node_modules/zod/v4/locales/sl.cjs +136 -0
- package/node_modules/zod/v4/locales/sl.d.cts +5 -0
- package/node_modules/zod/v4/locales/sl.d.ts +4 -0
- package/node_modules/zod/v4/locales/sl.js +109 -0
- package/node_modules/zod/v4/locales/sv.cjs +137 -0
- package/node_modules/zod/v4/locales/sv.d.cts +5 -0
- package/node_modules/zod/v4/locales/sv.d.ts +4 -0
- package/node_modules/zod/v4/locales/sv.js +110 -0
- package/node_modules/zod/v4/locales/ta.cjs +137 -0
- package/node_modules/zod/v4/locales/ta.d.cts +5 -0
- package/node_modules/zod/v4/locales/ta.d.ts +4 -0
- package/node_modules/zod/v4/locales/ta.js +110 -0
- package/node_modules/zod/v4/locales/th.cjs +137 -0
- package/node_modules/zod/v4/locales/th.d.cts +5 -0
- package/node_modules/zod/v4/locales/th.d.ts +4 -0
- package/node_modules/zod/v4/locales/th.js +110 -0
- package/node_modules/zod/v4/locales/tr.cjs +132 -0
- package/node_modules/zod/v4/locales/tr.d.cts +5 -0
- package/node_modules/zod/v4/locales/tr.d.ts +4 -0
- package/node_modules/zod/v4/locales/tr.js +105 -0
- package/node_modules/zod/v4/locales/ua.cjs +12 -0
- package/node_modules/zod/v4/locales/ua.d.cts +5 -0
- package/node_modules/zod/v4/locales/ua.d.ts +5 -0
- package/node_modules/zod/v4/locales/ua.js +5 -0
- package/node_modules/zod/v4/locales/uk.cjs +135 -0
- package/node_modules/zod/v4/locales/uk.d.cts +5 -0
- package/node_modules/zod/v4/locales/uk.d.ts +4 -0
- package/node_modules/zod/v4/locales/uk.js +108 -0
- package/node_modules/zod/v4/locales/ur.cjs +137 -0
- package/node_modules/zod/v4/locales/ur.d.cts +5 -0
- package/node_modules/zod/v4/locales/ur.d.ts +4 -0
- package/node_modules/zod/v4/locales/ur.js +110 -0
- package/node_modules/zod/v4/locales/uz.cjs +137 -0
- package/node_modules/zod/v4/locales/uz.d.cts +5 -0
- package/node_modules/zod/v4/locales/uz.d.ts +4 -0
- package/node_modules/zod/v4/locales/uz.js +110 -0
- package/node_modules/zod/v4/locales/vi.cjs +135 -0
- package/node_modules/zod/v4/locales/vi.d.cts +5 -0
- package/node_modules/zod/v4/locales/vi.d.ts +4 -0
- package/node_modules/zod/v4/locales/vi.js +108 -0
- package/node_modules/zod/v4/locales/yo.cjs +134 -0
- package/node_modules/zod/v4/locales/yo.d.cts +5 -0
- package/node_modules/zod/v4/locales/yo.d.ts +4 -0
- package/node_modules/zod/v4/locales/yo.js +107 -0
- package/node_modules/zod/v4/locales/zh-CN.cjs +136 -0
- package/node_modules/zod/v4/locales/zh-CN.d.cts +5 -0
- package/node_modules/zod/v4/locales/zh-CN.d.ts +4 -0
- package/node_modules/zod/v4/locales/zh-CN.js +109 -0
- package/node_modules/zod/v4/locales/zh-TW.cjs +134 -0
- package/node_modules/zod/v4/locales/zh-TW.d.cts +5 -0
- package/node_modules/zod/v4/locales/zh-TW.d.ts +4 -0
- package/node_modules/zod/v4/locales/zh-TW.js +107 -0
- package/node_modules/zod/v4/mini/checks.cjs +34 -0
- package/node_modules/zod/v4/mini/checks.d.cts +1 -0
- package/node_modules/zod/v4/mini/checks.d.ts +1 -0
- package/node_modules/zod/v4/mini/checks.js +1 -0
- package/node_modules/zod/v4/mini/coerce.cjs +52 -0
- package/node_modules/zod/v4/mini/coerce.d.cts +7 -0
- package/node_modules/zod/v4/mini/coerce.d.ts +7 -0
- package/node_modules/zod/v4/mini/coerce.js +22 -0
- package/node_modules/zod/v4/mini/external.cjs +63 -0
- package/node_modules/zod/v4/mini/external.d.cts +13 -0
- package/node_modules/zod/v4/mini/external.d.ts +13 -0
- package/node_modules/zod/v4/mini/external.js +14 -0
- package/node_modules/zod/v4/mini/index.cjs +32 -0
- package/node_modules/zod/v4/mini/index.d.cts +3 -0
- package/node_modules/zod/v4/mini/index.d.ts +3 -0
- package/node_modules/zod/v4/mini/index.js +3 -0
- package/node_modules/zod/v4/mini/iso.cjs +64 -0
- package/node_modules/zod/v4/mini/iso.d.cts +22 -0
- package/node_modules/zod/v4/mini/iso.d.ts +22 -0
- package/node_modules/zod/v4/mini/iso.js +34 -0
- package/node_modules/zod/v4/mini/package.json +7 -0
- package/node_modules/zod/v4/mini/parse.cjs +16 -0
- package/node_modules/zod/v4/mini/parse.d.cts +1 -0
- package/node_modules/zod/v4/mini/parse.d.ts +1 -0
- package/node_modules/zod/v4/mini/parse.js +1 -0
- package/node_modules/zod/v4/mini/schemas.cjs +1083 -0
- package/node_modules/zod/v4/mini/schemas.d.cts +445 -0
- package/node_modules/zod/v4/mini/schemas.d.ts +445 -0
- package/node_modules/zod/v4/mini/schemas.js +961 -0
- package/node_modules/zod/v4/package.json +7 -0
- package/node_modules/zod/v4-mini/index.cjs +32 -0
- package/node_modules/zod/v4-mini/index.d.cts +3 -0
- package/node_modules/zod/v4-mini/index.d.ts +3 -0
- package/node_modules/zod/v4-mini/index.js +3 -0
- package/node_modules/zod/v4-mini/package.json +7 -0
- package/npm-shrinkwrap.json +54 -0
- package/openclaw.plugin.json +997 -1
- package/package.json +48 -7
- package/index.ts +0 -17
- package/src/channel.test.ts +0 -235
- package/src/channel.ts +0 -433
- package/src/config-schema.ts +0 -61
- package/src/group-mentions.ts +0 -15
- package/src/mattermost/accounts.ts +0 -128
- package/src/mattermost/client.test.ts +0 -19
- package/src/mattermost/client.ts +0 -230
- package/src/mattermost/index.ts +0 -9
- package/src/mattermost/monitor-helpers.ts +0 -93
- package/src/mattermost/monitor-onchar.ts +0 -25
- package/src/mattermost/monitor-websocket.test.ts +0 -232
- package/src/mattermost/monitor-websocket.ts +0 -221
- package/src/mattermost/monitor.ts +0 -1030
- package/src/mattermost/probe.ts +0 -73
- package/src/mattermost/reactions.test-helpers.ts +0 -83
- package/src/mattermost/reactions.test.ts +0 -103
- package/src/mattermost/reactions.ts +0 -124
- package/src/mattermost/reconnect.test.ts +0 -192
- package/src/mattermost/reconnect.ts +0 -103
- package/src/mattermost/send.ts +0 -231
- package/src/normalize.ts +0 -46
- package/src/onboarding-helpers.ts +0 -1
- package/src/onboarding.ts +0 -186
- package/src/runtime.ts +0 -14
- package/src/types.ts +0 -57
|
@@ -0,0 +1,1160 @@
|
|
|
1
|
+
import { C as hasConfiguredSecretInput, S as buildSecretInputSchema, g as normalizeMattermostBaseUrl, i as resolveMattermostReplyToMode, n as resolveDefaultMattermostAccountId, r as resolveMattermostAccount, t as listMattermostAccountIds } from "./accounts-DnAHfb5f.js";
|
|
2
|
+
import { t as resolveMattermostGatewayAuthBypassPaths } from "./gateway-auth-bypass-BHgOAkk8.js";
|
|
3
|
+
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-ttH0DCuq.js";
|
|
4
|
+
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-Cx0LUNXy.js";
|
|
5
|
+
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
|
+
import { formatNormalizedAllowFromEntries } from "openclaw/plugin-sdk/allow-from";
|
|
7
|
+
import { createLoggedPairingApprovalNotifier } from "openclaw/plugin-sdk/channel-pairing";
|
|
8
|
+
import { createAccountStatusSink, createChannelMessageAdapterFromOutbound } from "openclaw/plugin-sdk/channel-outbound";
|
|
9
|
+
import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$1, buildChannelOutboundSessionRoute, buildThreadAwareOutboundSessionRoute, stripChannelTargetPrefix, stripTargetKindPrefix } from "openclaw/plugin-sdk/core";
|
|
10
|
+
import { createChatChannelPlugin } from "openclaw/plugin-sdk/channel-core";
|
|
11
|
+
import { createDangerousNameMatchingMutableAllowlistWarningCollector, createRestrictSendersChannelSecurity, resolveChannelGroupRequireMention } from "openclaw/plugin-sdk/channel-policy";
|
|
12
|
+
import { attachChannelToResult, createAttachedChannelResultAdapter } from "openclaw/plugin-sdk/channel-send-result";
|
|
13
|
+
import { createChannelDirectoryAdapter } from "openclaw/plugin-sdk/directory-runtime";
|
|
14
|
+
import { buildPassiveProbedChannelStatusSummary } from "openclaw/plugin-sdk/extension-shared";
|
|
15
|
+
import { normalizeMessagePresentation, renderMessagePresentationFallbackText, resolveMessagePresentationControlValue } from "openclaw/plugin-sdk/interactive-runtime";
|
|
16
|
+
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
17
|
+
import { resolvePayloadMediaUrls, sendTextMediaPayload } from "openclaw/plugin-sdk/reply-payload";
|
|
18
|
+
import { isPrivateNetworkOptInEnabled } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
19
|
+
import { createComputedAccountStatusAdapter, createDefaultChannelRuntimeState } from "openclaw/plugin-sdk/status-helpers";
|
|
20
|
+
import { createResolvedApproverActionAuthAdapter, resolveApprovalApprovers } from "openclaw/plugin-sdk/approval-auth-runtime";
|
|
21
|
+
import { describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
|
|
22
|
+
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
23
|
+
import { z } from "zod";
|
|
24
|
+
import { chunkTextForOutbound } from "openclaw/plugin-sdk/text-chunking";
|
|
25
|
+
import { adaptScopedAccountAccessor, createScopedChannelConfigAdapter } from "openclaw/plugin-sdk/channel-config-helpers";
|
|
26
|
+
import { BlockStreamingCoalesceSchema, DmPolicySchema, GroupPolicySchema, MarkdownConfigSchema, buildChannelConfigSchema, requireOpenAllowFrom } from "openclaw/plugin-sdk/channel-config-primitives";
|
|
27
|
+
import { applyAccountNameToChannelSection, applySetupAccountConfigPatch, createSetupTranslator, createStandardChannelSetupStatus, formatDocsLink, migrateBaseNameToDefaultAccount } from "openclaw/plugin-sdk/setup";
|
|
28
|
+
import { createSetupInputPresenceValidator } from "openclaw/plugin-sdk/setup-runtime";
|
|
29
|
+
//#region extensions/mattermost/src/approval-auth.ts
|
|
30
|
+
const MATTERMOST_USER_ID_RE = /^[a-z0-9]{26}$/;
|
|
31
|
+
function normalizeMattermostApproverId(value) {
|
|
32
|
+
const lowered = normalizeLowercaseStringOrEmpty(String(value).trim().replace(/^(mattermost|user):/i, "").replace(/^@/, "").trim());
|
|
33
|
+
return MATTERMOST_USER_ID_RE.test(lowered) ? lowered : void 0;
|
|
34
|
+
}
|
|
35
|
+
const mattermostApprovalAuth = createResolvedApproverActionAuthAdapter({
|
|
36
|
+
channelLabel: "Mattermost",
|
|
37
|
+
resolveApprovers: ({ cfg, accountId }) => {
|
|
38
|
+
const account = resolveMattermostAccount({
|
|
39
|
+
cfg,
|
|
40
|
+
accountId
|
|
41
|
+
}).config;
|
|
42
|
+
return resolveApprovalApprovers({
|
|
43
|
+
allowFrom: account.allowFrom,
|
|
44
|
+
normalizeApprover: normalizeMattermostApproverId
|
|
45
|
+
});
|
|
46
|
+
},
|
|
47
|
+
normalizeSenderId: (value) => normalizeMattermostApproverId(value)
|
|
48
|
+
});
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region extensions/mattermost/src/channel-config-shared.ts
|
|
51
|
+
const mattermostMeta = {
|
|
52
|
+
id: "mattermost",
|
|
53
|
+
label: "Mattermost",
|
|
54
|
+
selectionLabel: "Mattermost (plugin)",
|
|
55
|
+
detailLabel: "Mattermost Bot",
|
|
56
|
+
docsPath: "/channels/mattermost",
|
|
57
|
+
docsLabel: "mattermost",
|
|
58
|
+
blurb: "self-hosted Slack-style chat; install the plugin to enable.",
|
|
59
|
+
systemImage: "bubble.left.and.bubble.right",
|
|
60
|
+
order: 65,
|
|
61
|
+
quickstartAllowFrom: true
|
|
62
|
+
};
|
|
63
|
+
function normalizeMattermostAllowEntry(entry) {
|
|
64
|
+
return normalizeLowercaseStringOrEmpty(entry.trim().replace(/^(mattermost|user):/i, "").replace(/^@/, ""));
|
|
65
|
+
}
|
|
66
|
+
function formatMattermostAllowEntry(entry) {
|
|
67
|
+
const trimmed = entry.trim();
|
|
68
|
+
if (!trimmed) return "";
|
|
69
|
+
if (trimmed.startsWith("@")) {
|
|
70
|
+
const username = trimmed.slice(1).trim();
|
|
71
|
+
return username ? `@${normalizeLowercaseStringOrEmpty(username)}` : "";
|
|
72
|
+
}
|
|
73
|
+
return normalizeLowercaseStringOrEmpty(trimmed.replace(/^(mattermost|user):/i, ""));
|
|
74
|
+
}
|
|
75
|
+
const mattermostConfigAdapter = createScopedChannelConfigAdapter({
|
|
76
|
+
sectionKey: "mattermost",
|
|
77
|
+
listAccountIds: listMattermostAccountIds,
|
|
78
|
+
resolveAccount: adaptScopedAccountAccessor(resolveMattermostAccount),
|
|
79
|
+
defaultAccountId: resolveDefaultMattermostAccountId,
|
|
80
|
+
clearBaseFields: [
|
|
81
|
+
"botToken",
|
|
82
|
+
"baseUrl",
|
|
83
|
+
"name"
|
|
84
|
+
],
|
|
85
|
+
resolveAllowFrom: (account) => account.config.allowFrom,
|
|
86
|
+
formatAllowFrom: (allowFrom) => formatNormalizedAllowFromEntries({
|
|
87
|
+
allowFrom,
|
|
88
|
+
normalizeEntry: formatMattermostAllowEntry
|
|
89
|
+
})
|
|
90
|
+
});
|
|
91
|
+
function isMattermostConfigured$1(account) {
|
|
92
|
+
return Boolean(account.botToken && account.baseUrl);
|
|
93
|
+
}
|
|
94
|
+
function describeMattermostAccount(account) {
|
|
95
|
+
return describeAccountSnapshot({
|
|
96
|
+
account,
|
|
97
|
+
configured: isMattermostConfigured$1(account),
|
|
98
|
+
extra: {
|
|
99
|
+
botTokenSource: account.botTokenSource,
|
|
100
|
+
baseUrl: account.baseUrl
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
//#endregion
|
|
105
|
+
//#region extensions/mattermost/src/config-schema-core.ts
|
|
106
|
+
const MattermostGroupSchema = z.object({
|
|
107
|
+
/** Whether mentions are required to trigger the bot in this group. */
|
|
108
|
+
requireMention: z.boolean().optional() }).strict();
|
|
109
|
+
function requireMattermostOpenAllowFrom(params) {
|
|
110
|
+
requireOpenAllowFrom({
|
|
111
|
+
policy: params.policy,
|
|
112
|
+
allowFrom: params.allowFrom,
|
|
113
|
+
ctx: params.ctx,
|
|
114
|
+
path: ["allowFrom"],
|
|
115
|
+
message: "channels.mattermost.dmPolicy=\"open\" requires channels.mattermost.allowFrom to include \"*\""
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
const DmChannelRetrySchema = z.object({
|
|
119
|
+
/** Maximum number of retry attempts for DM channel creation (default: 3) */
|
|
120
|
+
maxRetries: z.number().int().min(0).max(10).optional(),
|
|
121
|
+
/** Initial delay in milliseconds before first retry (default: 1000) */
|
|
122
|
+
initialDelayMs: z.number().int().min(100).max(6e4).optional(),
|
|
123
|
+
/** Maximum delay in milliseconds between retries (default: 10000) */
|
|
124
|
+
maxDelayMs: z.number().int().min(1e3).max(6e4).optional(),
|
|
125
|
+
/** Timeout for each individual DM channel creation request in milliseconds (default: 30000) */
|
|
126
|
+
timeoutMs: z.number().int().min(5e3).max(12e4).optional()
|
|
127
|
+
}).strict().refine((data) => {
|
|
128
|
+
if (data.initialDelayMs !== void 0 && data.maxDelayMs !== void 0) return data.initialDelayMs <= data.maxDelayMs;
|
|
129
|
+
return true;
|
|
130
|
+
}, {
|
|
131
|
+
message: "initialDelayMs must be less than or equal to maxDelayMs",
|
|
132
|
+
path: ["initialDelayMs"]
|
|
133
|
+
}).optional();
|
|
134
|
+
const MattermostSlashCommandsSchema = z.object({
|
|
135
|
+
/** Enable native slash commands. "auto" resolves to false (opt-in). */
|
|
136
|
+
native: z.union([z.boolean(), z.literal("auto")]).optional(),
|
|
137
|
+
/** Also register skill-based commands. */
|
|
138
|
+
nativeSkills: z.union([z.boolean(), z.literal("auto")]).optional(),
|
|
139
|
+
/** Path for the callback endpoint on the gateway HTTP server. */
|
|
140
|
+
callbackPath: z.string().optional(),
|
|
141
|
+
/** Explicit callback URL (e.g. behind reverse proxy). */
|
|
142
|
+
callbackUrl: z.string().optional()
|
|
143
|
+
}).strict().optional();
|
|
144
|
+
const MattermostNetworkSchema = z.object({
|
|
145
|
+
/** Dangerous opt-in for self-hosted Mattermost on trusted private/internal hosts. */
|
|
146
|
+
dangerouslyAllowPrivateNetwork: z.boolean().optional() }).strict().optional();
|
|
147
|
+
const MattermostStreamingModeSchema = z.enum([
|
|
148
|
+
"off",
|
|
149
|
+
"partial",
|
|
150
|
+
"block",
|
|
151
|
+
"progress"
|
|
152
|
+
]);
|
|
153
|
+
const MattermostStreamingProgressSchema = z.object({
|
|
154
|
+
label: z.union([z.string(), z.literal(false)]).optional(),
|
|
155
|
+
labels: z.array(z.string()).optional(),
|
|
156
|
+
maxLines: z.number().int().positive().optional(),
|
|
157
|
+
maxLineChars: z.number().int().positive().optional(),
|
|
158
|
+
toolProgress: z.boolean().optional()
|
|
159
|
+
}).strict();
|
|
160
|
+
const MattermostStreamingPreviewSchema = z.object({ toolProgress: z.boolean().optional() }).strict();
|
|
161
|
+
const MattermostStreamingBlockSchema = z.object({
|
|
162
|
+
enabled: z.boolean().optional(),
|
|
163
|
+
coalesce: BlockStreamingCoalesceSchema.optional()
|
|
164
|
+
}).strict();
|
|
165
|
+
const MattermostStreamingSchema = z.union([
|
|
166
|
+
MattermostStreamingModeSchema,
|
|
167
|
+
z.boolean(),
|
|
168
|
+
z.object({
|
|
169
|
+
mode: MattermostStreamingModeSchema.optional(),
|
|
170
|
+
chunkMode: z.enum(["length", "newline"]).optional(),
|
|
171
|
+
preview: MattermostStreamingPreviewSchema.optional(),
|
|
172
|
+
progress: MattermostStreamingProgressSchema.optional(),
|
|
173
|
+
block: MattermostStreamingBlockSchema.optional()
|
|
174
|
+
}).strict()
|
|
175
|
+
]);
|
|
176
|
+
const MattermostAccountSchemaBase = z.object({
|
|
177
|
+
name: z.string().optional(),
|
|
178
|
+
capabilities: z.array(z.string()).optional(),
|
|
179
|
+
dangerouslyAllowNameMatching: z.boolean().optional(),
|
|
180
|
+
markdown: MarkdownConfigSchema,
|
|
181
|
+
enabled: z.boolean().optional(),
|
|
182
|
+
configWrites: z.boolean().optional(),
|
|
183
|
+
botToken: buildSecretInputSchema().optional(),
|
|
184
|
+
baseUrl: z.string().optional(),
|
|
185
|
+
chatmode: z.enum([
|
|
186
|
+
"oncall",
|
|
187
|
+
"onmessage",
|
|
188
|
+
"onchar"
|
|
189
|
+
]).optional(),
|
|
190
|
+
oncharPrefixes: z.array(z.string()).optional(),
|
|
191
|
+
requireMention: z.boolean().optional(),
|
|
192
|
+
dmPolicy: DmPolicySchema.optional().default("pairing"),
|
|
193
|
+
allowFrom: z.array(z.union([z.string(), z.number()])).optional(),
|
|
194
|
+
groupAllowFrom: z.array(z.union([z.string(), z.number()])).optional(),
|
|
195
|
+
groupPolicy: GroupPolicySchema.optional().default("allowlist"),
|
|
196
|
+
textChunkLimit: z.number().int().positive().optional(),
|
|
197
|
+
chunkMode: z.enum(["length", "newline"]).optional(),
|
|
198
|
+
streaming: MattermostStreamingSchema.optional(),
|
|
199
|
+
blockStreaming: z.boolean().optional(),
|
|
200
|
+
blockStreamingCoalesce: BlockStreamingCoalesceSchema.optional(),
|
|
201
|
+
replyToMode: z.enum([
|
|
202
|
+
"off",
|
|
203
|
+
"first",
|
|
204
|
+
"all",
|
|
205
|
+
"batched"
|
|
206
|
+
]).optional(),
|
|
207
|
+
responsePrefix: z.string().optional(),
|
|
208
|
+
actions: z.object({ reactions: z.boolean().optional() }).optional(),
|
|
209
|
+
commands: MattermostSlashCommandsSchema,
|
|
210
|
+
interactions: z.object({
|
|
211
|
+
callbackBaseUrl: z.string().optional(),
|
|
212
|
+
allowedSourceIps: z.array(z.string()).optional()
|
|
213
|
+
}).optional(),
|
|
214
|
+
/** Per-group configuration (keyed by Mattermost channel ID or "*" for default). */
|
|
215
|
+
groups: z.record(z.string(), MattermostGroupSchema.optional()).optional(),
|
|
216
|
+
/** Network policy overrides for self-hosted Mattermost on trusted private/internal hosts. */
|
|
217
|
+
network: MattermostNetworkSchema,
|
|
218
|
+
/** Retry configuration for DM channel creation */
|
|
219
|
+
dmChannelRetry: DmChannelRetrySchema
|
|
220
|
+
}).strict();
|
|
221
|
+
const MattermostAccountSchema = MattermostAccountSchemaBase.superRefine((value, ctx) => {
|
|
222
|
+
requireMattermostOpenAllowFrom({
|
|
223
|
+
policy: value.dmPolicy,
|
|
224
|
+
allowFrom: value.allowFrom,
|
|
225
|
+
ctx
|
|
226
|
+
});
|
|
227
|
+
});
|
|
228
|
+
//#endregion
|
|
229
|
+
//#region extensions/mattermost/src/config-surface.ts
|
|
230
|
+
const MattermostChannelConfigSchema = buildChannelConfigSchema(MattermostAccountSchemaBase.extend({
|
|
231
|
+
accounts: z.record(z.string(), MattermostAccountSchema.optional()).optional(),
|
|
232
|
+
defaultAccount: z.string().optional()
|
|
233
|
+
}).superRefine((value, ctx) => {
|
|
234
|
+
requireMattermostOpenAllowFrom({
|
|
235
|
+
policy: value.dmPolicy,
|
|
236
|
+
allowFrom: value.allowFrom,
|
|
237
|
+
ctx
|
|
238
|
+
});
|
|
239
|
+
}), { uiHints: {
|
|
240
|
+
"": {
|
|
241
|
+
label: "Mattermost",
|
|
242
|
+
help: "Mattermost channel provider configuration for bot auth, access policy, slash commands, and preview streaming."
|
|
243
|
+
},
|
|
244
|
+
dmPolicy: {
|
|
245
|
+
label: "Mattermost DM Policy",
|
|
246
|
+
help: "Direct message access control (\"pairing\" recommended). \"open\" requires channels.mattermost.allowFrom=[\"*\"]."
|
|
247
|
+
},
|
|
248
|
+
streaming: {
|
|
249
|
+
label: "Mattermost Streaming Mode",
|
|
250
|
+
help: "Unified Mattermost stream preview mode: \"off\" | \"partial\" | \"block\" | \"progress\". \"progress\" keeps a single editable progress draft until final delivery."
|
|
251
|
+
},
|
|
252
|
+
"streaming.mode": {
|
|
253
|
+
label: "Mattermost Streaming Mode",
|
|
254
|
+
help: "Canonical Mattermost preview mode: \"off\" | \"partial\" | \"block\" | \"progress\"."
|
|
255
|
+
},
|
|
256
|
+
"streaming.progress.label": {
|
|
257
|
+
label: "Mattermost Progress Label",
|
|
258
|
+
help: "Initial progress draft title. Use \"auto\" for built-in single-word labels, a custom string, or false to hide the title."
|
|
259
|
+
},
|
|
260
|
+
"streaming.progress.labels": {
|
|
261
|
+
label: "Mattermost Progress Label Pool",
|
|
262
|
+
help: "Candidate labels for streaming.progress.label=\"auto\". Leave unset to use OpenClaw built-in progress labels."
|
|
263
|
+
},
|
|
264
|
+
"streaming.progress.maxLines": {
|
|
265
|
+
label: "Mattermost Progress Max Lines",
|
|
266
|
+
help: "Maximum number of compact progress lines to keep below the draft label (default: 8)."
|
|
267
|
+
},
|
|
268
|
+
"streaming.progress.maxLineChars": {
|
|
269
|
+
label: "Mattermost Progress Max Line Chars",
|
|
270
|
+
help: "Maximum characters per compact progress line before truncation (default: 120). Prose cuts at word boundaries; commands and paths keep useful suffixes."
|
|
271
|
+
},
|
|
272
|
+
"streaming.progress.toolProgress": {
|
|
273
|
+
label: "Mattermost Progress Tool Lines",
|
|
274
|
+
help: "Show compact tool/progress lines in progress draft mode (default: true). Set false to keep only the label until final delivery."
|
|
275
|
+
},
|
|
276
|
+
"streaming.progress.commandText": {
|
|
277
|
+
label: "Mattermost Progress Command Text",
|
|
278
|
+
help: "Command/exec detail in progress draft lines: \"raw\" preserves released behavior; \"status\" shows only the tool label."
|
|
279
|
+
},
|
|
280
|
+
"streaming.preview.toolProgress": {
|
|
281
|
+
label: "Mattermost Draft Tool Progress",
|
|
282
|
+
help: "Show tool/progress activity in the live draft preview post (default: true). Set false to hide interim tool updates while the draft preview stays active."
|
|
283
|
+
},
|
|
284
|
+
"streaming.preview.commandText": {
|
|
285
|
+
label: "Mattermost Draft Command Text",
|
|
286
|
+
help: "Command/exec detail in preview tool-progress lines: \"raw\" preserves released behavior; \"status\" shows only the tool label."
|
|
287
|
+
},
|
|
288
|
+
"streaming.block.enabled": {
|
|
289
|
+
label: "Mattermost Block Streaming Enabled",
|
|
290
|
+
help: "Enable chunked block-style Mattermost preview delivery when channels.mattermost.streaming.mode=\"block\"."
|
|
291
|
+
},
|
|
292
|
+
"streaming.block.coalesce": {
|
|
293
|
+
label: "Mattermost Block Streaming Coalesce",
|
|
294
|
+
help: "Merge streamed Mattermost block replies before final delivery."
|
|
295
|
+
}
|
|
296
|
+
} });
|
|
297
|
+
//#endregion
|
|
298
|
+
//#region extensions/mattermost/src/doctor.ts
|
|
299
|
+
function isMattermostMutableAllowEntry(raw) {
|
|
300
|
+
const text = raw.trim();
|
|
301
|
+
if (!text || text === "*") return false;
|
|
302
|
+
const lowered = normalizeLowercaseStringOrEmpty(text.replace(/^(mattermost|user):/i, "").replace(/^@/, "").trim());
|
|
303
|
+
if (/^[a-z0-9]{26}$/.test(lowered)) return false;
|
|
304
|
+
return true;
|
|
305
|
+
}
|
|
306
|
+
const mattermostDoctor = {
|
|
307
|
+
legacyConfigRules,
|
|
308
|
+
normalizeCompatibilityConfig,
|
|
309
|
+
collectMutableAllowlistWarnings: createDangerousNameMatchingMutableAllowlistWarningCollector({
|
|
310
|
+
channel: "mattermost",
|
|
311
|
+
detector: isMattermostMutableAllowEntry,
|
|
312
|
+
collectLists: (scope) => [{
|
|
313
|
+
pathLabel: `${scope.prefix}.allowFrom`,
|
|
314
|
+
list: scope.account.allowFrom
|
|
315
|
+
}, {
|
|
316
|
+
pathLabel: `${scope.prefix}.groupAllowFrom`,
|
|
317
|
+
list: scope.account.groupAllowFrom
|
|
318
|
+
}]
|
|
319
|
+
})
|
|
320
|
+
};
|
|
321
|
+
//#endregion
|
|
322
|
+
//#region extensions/mattermost/src/group-mentions.ts
|
|
323
|
+
function resolveMattermostGroupRequireMention(params) {
|
|
324
|
+
const account = resolveMattermostAccount({
|
|
325
|
+
cfg: params.cfg,
|
|
326
|
+
accountId: params.accountId
|
|
327
|
+
});
|
|
328
|
+
const requireMentionOverride = typeof params.requireMentionOverride === "boolean" ? params.requireMentionOverride : account.requireMention;
|
|
329
|
+
return resolveChannelGroupRequireMention({
|
|
330
|
+
cfg: params.cfg,
|
|
331
|
+
channel: "mattermost",
|
|
332
|
+
groupId: params.groupId,
|
|
333
|
+
accountId: params.accountId,
|
|
334
|
+
requireMentionOverride
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
//#endregion
|
|
338
|
+
//#region extensions/mattermost/src/normalize.ts
|
|
339
|
+
function normalizeMattermostMessagingTarget(raw) {
|
|
340
|
+
const trimmed = raw.trim();
|
|
341
|
+
if (!trimmed) return;
|
|
342
|
+
const lower = normalizeLowercaseStringOrEmpty(trimmed);
|
|
343
|
+
if (lower.startsWith("channel:")) {
|
|
344
|
+
const id = trimmed.slice(8).trim();
|
|
345
|
+
return id ? `channel:${id}` : void 0;
|
|
346
|
+
}
|
|
347
|
+
if (lower.startsWith("group:")) {
|
|
348
|
+
const id = trimmed.slice(6).trim();
|
|
349
|
+
return id ? `channel:${id}` : void 0;
|
|
350
|
+
}
|
|
351
|
+
if (lower.startsWith("user:")) {
|
|
352
|
+
const id = trimmed.slice(5).trim();
|
|
353
|
+
return id ? `user:${id}` : void 0;
|
|
354
|
+
}
|
|
355
|
+
if (lower.startsWith("mattermost:")) {
|
|
356
|
+
const id = trimmed.slice(11).trim();
|
|
357
|
+
return id ? `user:${id}` : void 0;
|
|
358
|
+
}
|
|
359
|
+
if (trimmed.startsWith("@")) {
|
|
360
|
+
const id = trimmed.slice(1).trim();
|
|
361
|
+
return id ? `@${id}` : void 0;
|
|
362
|
+
}
|
|
363
|
+
if (trimmed.startsWith("#")) return;
|
|
364
|
+
}
|
|
365
|
+
function looksLikeMattermostTargetId(raw, _normalized) {
|
|
366
|
+
const trimmed = raw.trim();
|
|
367
|
+
if (!trimmed) return false;
|
|
368
|
+
if (/^(user|channel|group|mattermost):/i.test(trimmed)) return true;
|
|
369
|
+
if (trimmed.startsWith("@")) return true;
|
|
370
|
+
return /^[a-z0-9]{26}$/i.test(trimmed) || /^[a-z0-9]{26}__[a-z0-9]{26}$/i.test(trimmed);
|
|
371
|
+
}
|
|
372
|
+
//#endregion
|
|
373
|
+
//#region extensions/mattermost/src/session-route.ts
|
|
374
|
+
function resolveMattermostOutboundSessionRoute(params) {
|
|
375
|
+
let trimmed = stripChannelTargetPrefix(params.target, "mattermost");
|
|
376
|
+
if (!trimmed) return null;
|
|
377
|
+
const lower = normalizeLowercaseStringOrEmpty(trimmed);
|
|
378
|
+
const resolvedKind = params.resolvedTarget?.kind;
|
|
379
|
+
const isUser = resolvedKind === "user" || resolvedKind !== "channel" && resolvedKind !== "group" && (lower.startsWith("user:") || trimmed.startsWith("@"));
|
|
380
|
+
if (trimmed.startsWith("@")) trimmed = trimmed.slice(1).trim();
|
|
381
|
+
const rawId = stripTargetKindPrefix(trimmed);
|
|
382
|
+
if (!rawId) return null;
|
|
383
|
+
return buildThreadAwareOutboundSessionRoute({
|
|
384
|
+
route: buildChannelOutboundSessionRoute({
|
|
385
|
+
cfg: params.cfg,
|
|
386
|
+
agentId: params.agentId,
|
|
387
|
+
channel: "mattermost",
|
|
388
|
+
accountId: params.accountId,
|
|
389
|
+
peer: {
|
|
390
|
+
kind: isUser ? "direct" : "channel",
|
|
391
|
+
id: rawId
|
|
392
|
+
},
|
|
393
|
+
chatType: isUser ? "direct" : "channel",
|
|
394
|
+
from: isUser ? `mattermost:${rawId}` : `mattermost:channel:${rawId}`,
|
|
395
|
+
to: isUser ? `user:${rawId}` : `channel:${rawId}`
|
|
396
|
+
}),
|
|
397
|
+
replyToId: params.replyToId,
|
|
398
|
+
threadId: params.threadId,
|
|
399
|
+
currentSessionKey: params.currentSessionKey,
|
|
400
|
+
canRecoverCurrentThread: ({ route }) => route.chatType !== "direct" || (params.cfg.session?.dmScope ?? "main") !== "main"
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
//#endregion
|
|
404
|
+
//#region extensions/mattermost/src/setup-core.ts
|
|
405
|
+
const channel$1 = "mattermost";
|
|
406
|
+
function isMattermostConfigured(account) {
|
|
407
|
+
return (Boolean(account.botToken?.trim()) || hasConfiguredSecretInput(account.config.botToken)) && Boolean(account.baseUrl);
|
|
408
|
+
}
|
|
409
|
+
function resolveMattermostAccountWithSecrets(cfg, accountId) {
|
|
410
|
+
return resolveMattermostAccount({
|
|
411
|
+
cfg,
|
|
412
|
+
accountId,
|
|
413
|
+
allowUnresolvedSecretRef: true
|
|
414
|
+
});
|
|
415
|
+
}
|
|
416
|
+
function applyMattermostSetupConfigPatch(params) {
|
|
417
|
+
const namedConfig = applyAccountNameToChannelSection({
|
|
418
|
+
cfg: params.cfg,
|
|
419
|
+
channelKey: channel$1,
|
|
420
|
+
accountId: params.accountId,
|
|
421
|
+
name: params.name
|
|
422
|
+
});
|
|
423
|
+
return applySetupAccountConfigPatch({
|
|
424
|
+
cfg: params.accountId !== DEFAULT_ACCOUNT_ID ? migrateBaseNameToDefaultAccount({
|
|
425
|
+
cfg: namedConfig,
|
|
426
|
+
channelKey: channel$1
|
|
427
|
+
}) : namedConfig,
|
|
428
|
+
channelKey: channel$1,
|
|
429
|
+
accountId: params.accountId,
|
|
430
|
+
patch: params.patch
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
const mattermostSetupAdapter = {
|
|
434
|
+
resolveAccountId: ({ accountId }) => normalizeAccountId(accountId),
|
|
435
|
+
applyAccountName: ({ cfg, accountId, name }) => applyAccountNameToChannelSection({
|
|
436
|
+
cfg,
|
|
437
|
+
channelKey: channel$1,
|
|
438
|
+
accountId,
|
|
439
|
+
name
|
|
440
|
+
}),
|
|
441
|
+
validateInput: createSetupInputPresenceValidator({
|
|
442
|
+
defaultAccountOnlyEnvError: "Mattermost env vars can only be used for the default account.",
|
|
443
|
+
whenNotUseEnv: [{
|
|
444
|
+
someOf: ["botToken", "token"],
|
|
445
|
+
message: "Mattermost requires --bot-token and --http-url (or --use-env)."
|
|
446
|
+
}, {
|
|
447
|
+
someOf: ["httpUrl"],
|
|
448
|
+
message: "Mattermost requires --bot-token and --http-url (or --use-env)."
|
|
449
|
+
}],
|
|
450
|
+
validate: ({ input }) => {
|
|
451
|
+
const token = input.botToken ?? input.token;
|
|
452
|
+
const baseUrl = normalizeMattermostBaseUrl(input.httpUrl);
|
|
453
|
+
if (!input.useEnv && (!token || !baseUrl)) return "Mattermost requires --bot-token and --http-url (or --use-env).";
|
|
454
|
+
if (input.httpUrl && !baseUrl) return "Mattermost --http-url must include a valid base URL.";
|
|
455
|
+
return null;
|
|
456
|
+
}
|
|
457
|
+
}),
|
|
458
|
+
applyAccountConfig: ({ cfg, accountId, input }) => {
|
|
459
|
+
const token = input.botToken ?? input.token;
|
|
460
|
+
const baseUrl = normalizeMattermostBaseUrl(input.httpUrl);
|
|
461
|
+
return applyMattermostSetupConfigPatch({
|
|
462
|
+
cfg,
|
|
463
|
+
accountId,
|
|
464
|
+
name: input.name,
|
|
465
|
+
patch: input.useEnv ? {} : {
|
|
466
|
+
...token ? { botToken: token } : {},
|
|
467
|
+
...baseUrl ? { baseUrl } : {}
|
|
468
|
+
}
|
|
469
|
+
});
|
|
470
|
+
}
|
|
471
|
+
};
|
|
472
|
+
//#endregion
|
|
473
|
+
//#region extensions/mattermost/src/setup-surface.ts
|
|
474
|
+
const t = createSetupTranslator();
|
|
475
|
+
const channel = "mattermost";
|
|
476
|
+
const mattermostSetupWizard = {
|
|
477
|
+
channel,
|
|
478
|
+
status: createStandardChannelSetupStatus({
|
|
479
|
+
channelLabel: "Mattermost",
|
|
480
|
+
configuredLabel: t("wizard.channels.statusConfigured"),
|
|
481
|
+
unconfiguredLabel: t("wizard.channels.statusNeedsTokenUrl"),
|
|
482
|
+
configuredHint: t("wizard.channels.statusConfigured"),
|
|
483
|
+
unconfiguredHint: t("wizard.channels.statusNeedsSetup"),
|
|
484
|
+
configuredScore: 2,
|
|
485
|
+
unconfiguredScore: 1,
|
|
486
|
+
resolveConfigured: ({ cfg, accountId }) => isMattermostConfigured(resolveMattermostAccountWithSecrets(cfg, accountId ?? DEFAULT_ACCOUNT_ID))
|
|
487
|
+
}),
|
|
488
|
+
introNote: {
|
|
489
|
+
title: t("wizard.mattermost.botTokenTitle"),
|
|
490
|
+
lines: [
|
|
491
|
+
t("wizard.mattermost.helpOpenConsole"),
|
|
492
|
+
t("wizard.mattermost.helpCreateBot"),
|
|
493
|
+
t("wizard.mattermost.helpBaseUrl"),
|
|
494
|
+
t("wizard.mattermost.helpBotMember"),
|
|
495
|
+
t("wizard.channels.docs", { link: formatDocsLink("/mattermost", "mattermost") })
|
|
496
|
+
],
|
|
497
|
+
shouldShow: ({ cfg, accountId }) => !isMattermostConfigured(resolveMattermostAccountWithSecrets(cfg, accountId))
|
|
498
|
+
},
|
|
499
|
+
envShortcut: {
|
|
500
|
+
prompt: t("wizard.mattermost.envPrompt"),
|
|
501
|
+
preferredEnvVar: "MATTERMOST_BOT_TOKEN",
|
|
502
|
+
isAvailable: ({ cfg, accountId }) => {
|
|
503
|
+
if (accountId !== DEFAULT_ACCOUNT_ID) return false;
|
|
504
|
+
const resolvedAccount = resolveMattermostAccountWithSecrets(cfg, accountId);
|
|
505
|
+
const hasConfigValues = hasConfiguredSecretInput(resolvedAccount.config.botToken) || Boolean(resolvedAccount.config.baseUrl?.trim());
|
|
506
|
+
return Boolean(process.env.MATTERMOST_BOT_TOKEN?.trim() && process.env.MATTERMOST_URL?.trim() && !hasConfigValues);
|
|
507
|
+
},
|
|
508
|
+
apply: ({ cfg, accountId }) => applySetupAccountConfigPatch({
|
|
509
|
+
cfg,
|
|
510
|
+
channelKey: channel,
|
|
511
|
+
accountId,
|
|
512
|
+
patch: {}
|
|
513
|
+
})
|
|
514
|
+
},
|
|
515
|
+
credentials: [{
|
|
516
|
+
inputKey: "botToken",
|
|
517
|
+
providerHint: channel,
|
|
518
|
+
credentialLabel: t("wizard.mattermost.botToken"),
|
|
519
|
+
preferredEnvVar: "MATTERMOST_BOT_TOKEN",
|
|
520
|
+
envPrompt: t("wizard.mattermost.envPrompt"),
|
|
521
|
+
keepPrompt: t("wizard.mattermost.botTokenKeep"),
|
|
522
|
+
inputPrompt: t("wizard.mattermost.botTokenInput"),
|
|
523
|
+
inspect: ({ cfg, accountId }) => {
|
|
524
|
+
const resolvedAccount = resolveMattermostAccountWithSecrets(cfg, accountId);
|
|
525
|
+
return {
|
|
526
|
+
accountConfigured: isMattermostConfigured(resolvedAccount),
|
|
527
|
+
hasConfiguredValue: hasConfiguredSecretInput(resolvedAccount.config.botToken)
|
|
528
|
+
};
|
|
529
|
+
},
|
|
530
|
+
applySet: async ({ cfg, accountId, value }) => applyMattermostSetupConfigPatch({
|
|
531
|
+
cfg,
|
|
532
|
+
accountId,
|
|
533
|
+
patch: { botToken: value }
|
|
534
|
+
})
|
|
535
|
+
}],
|
|
536
|
+
textInputs: [{
|
|
537
|
+
inputKey: "httpUrl",
|
|
538
|
+
message: t("wizard.mattermost.baseUrlPrompt"),
|
|
539
|
+
confirmCurrentValue: false,
|
|
540
|
+
currentValue: ({ cfg, accountId }) => resolveMattermostAccountWithSecrets(cfg, accountId).baseUrl ?? process.env.MATTERMOST_URL?.trim(),
|
|
541
|
+
initialValue: ({ cfg, accountId }) => resolveMattermostAccountWithSecrets(cfg, accountId).baseUrl ?? process.env.MATTERMOST_URL?.trim(),
|
|
542
|
+
shouldPrompt: ({ cfg, accountId, credentialValues, currentValue }) => {
|
|
543
|
+
const resolvedAccount = resolveMattermostAccountWithSecrets(cfg, accountId);
|
|
544
|
+
const tokenConfigured = Boolean(resolvedAccount.botToken?.trim()) || hasConfiguredSecretInput(resolvedAccount.config.botToken);
|
|
545
|
+
return Boolean(credentialValues.botToken) || !tokenConfigured || !currentValue;
|
|
546
|
+
},
|
|
547
|
+
validate: ({ value }) => normalizeMattermostBaseUrl(value) ? void 0 : "Mattermost base URL must include a valid base URL.",
|
|
548
|
+
normalizeValue: ({ value }) => normalizeMattermostBaseUrl(value) ?? value.trim(),
|
|
549
|
+
applySet: async ({ cfg, accountId, value }) => applyMattermostSetupConfigPatch({
|
|
550
|
+
cfg,
|
|
551
|
+
accountId,
|
|
552
|
+
patch: { baseUrl: value }
|
|
553
|
+
})
|
|
554
|
+
}],
|
|
555
|
+
disable: (cfg) => ({
|
|
556
|
+
...cfg,
|
|
557
|
+
channels: {
|
|
558
|
+
...cfg.channels,
|
|
559
|
+
mattermost: {
|
|
560
|
+
...cfg.channels?.mattermost,
|
|
561
|
+
enabled: false
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
})
|
|
565
|
+
};
|
|
566
|
+
//#endregion
|
|
567
|
+
//#region extensions/mattermost/src/channel.ts
|
|
568
|
+
const loadMattermostChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-W-pjr9zL.js"));
|
|
569
|
+
function buildMattermostPresentationButtons(presentation) {
|
|
570
|
+
return presentation.blocks.filter((block) => block.type === "buttons").map((block) => block.buttons.flatMap((button) => {
|
|
571
|
+
if (button.action) return [];
|
|
572
|
+
const value = resolveMessagePresentationControlValue(button);
|
|
573
|
+
return value ? [{
|
|
574
|
+
id: value,
|
|
575
|
+
text: button.label,
|
|
576
|
+
callback_data: value,
|
|
577
|
+
context: { callback_data: value },
|
|
578
|
+
style: button.style
|
|
579
|
+
}] : [];
|
|
580
|
+
})).filter((row) => row.length > 0);
|
|
581
|
+
}
|
|
582
|
+
const MATTERMOST_PRESENTATION_CAPABILITIES = {
|
|
583
|
+
supported: true,
|
|
584
|
+
buttons: true,
|
|
585
|
+
selects: false,
|
|
586
|
+
context: true,
|
|
587
|
+
divider: false,
|
|
588
|
+
limits: { text: { markdownDialect: "markdown" } }
|
|
589
|
+
};
|
|
590
|
+
function hasMattermostPresentationButtons(presentation) {
|
|
591
|
+
return buildMattermostPresentationButtons(presentation).some((row) => row.length > 0);
|
|
592
|
+
}
|
|
593
|
+
function readMattermostPresentationButtons(payload) {
|
|
594
|
+
const buttons = (payload.channelData?.mattermost)?.presentationButtons;
|
|
595
|
+
return Array.isArray(buttons) ? buttons : void 0;
|
|
596
|
+
}
|
|
597
|
+
const mattermostSecurityAdapter = createRestrictSendersChannelSecurity({
|
|
598
|
+
channelKey: "mattermost",
|
|
599
|
+
resolveDmPolicy: (account) => account.config.dmPolicy,
|
|
600
|
+
resolveDmAllowFrom: (account) => account.config.allowFrom,
|
|
601
|
+
resolveGroupPolicy: (account) => account.config.groupPolicy,
|
|
602
|
+
surface: "Mattermost channels",
|
|
603
|
+
openScope: "any member",
|
|
604
|
+
groupPolicyPath: "channels.mattermost.groupPolicy",
|
|
605
|
+
groupAllowFromPath: "channels.mattermost.groupAllowFrom",
|
|
606
|
+
policyPathSuffix: "dmPolicy",
|
|
607
|
+
normalizeDmEntry: (raw) => normalizeMattermostAllowEntry(raw)
|
|
608
|
+
});
|
|
609
|
+
function describeMattermostMessageTool({ cfg, accountId }) {
|
|
610
|
+
const enabledAccounts = (accountId ? [resolveMattermostAccount({
|
|
611
|
+
cfg,
|
|
612
|
+
accountId
|
|
613
|
+
})] : listMattermostAccountIds(cfg).map((listedAccountId) => resolveMattermostAccount({
|
|
614
|
+
cfg,
|
|
615
|
+
accountId: listedAccountId
|
|
616
|
+
}))).filter((account) => account.enabled).filter((account) => Boolean(account.botToken?.trim() && account.baseUrl?.trim()));
|
|
617
|
+
const actions = [];
|
|
618
|
+
if (enabledAccounts.length > 0) actions.push("send");
|
|
619
|
+
const baseReactions = (cfg.channels?.mattermost?.actions)?.reactions;
|
|
620
|
+
if (enabledAccounts.some((account) => {
|
|
621
|
+
return account.config.actions?.reactions ?? baseReactions ?? true;
|
|
622
|
+
})) actions.push("react");
|
|
623
|
+
return {
|
|
624
|
+
actions,
|
|
625
|
+
capabilities: enabledAccounts.length > 0 ? ["presentation"] : []
|
|
626
|
+
};
|
|
627
|
+
}
|
|
628
|
+
function hasConfiguredMattermostDirectoryAccount({ cfg, accountId }) {
|
|
629
|
+
return (accountId ? [resolveMattermostAccount({
|
|
630
|
+
cfg,
|
|
631
|
+
accountId
|
|
632
|
+
})] : listMattermostAccountIds(cfg).map((listedAccountId) => resolveMattermostAccount({
|
|
633
|
+
cfg,
|
|
634
|
+
accountId: listedAccountId
|
|
635
|
+
}))).some((account) => Boolean(account.enabled && account.botToken?.trim() && account.baseUrl?.trim()));
|
|
636
|
+
}
|
|
637
|
+
function extractMattermostToolSend(args) {
|
|
638
|
+
if (normalizeOptionalString(args.action) !== "send") return null;
|
|
639
|
+
const to = normalizeOptionalString(args.to) ?? normalizeOptionalString(args.target);
|
|
640
|
+
if (!to) return null;
|
|
641
|
+
const threadId = normalizeOptionalString(args.threadId) ?? normalizeOptionalString(args.replyToId) ?? normalizeOptionalString(args.replyTo);
|
|
642
|
+
const threadSuppressed = args.topLevel === true || args.threadId === null;
|
|
643
|
+
return {
|
|
644
|
+
to,
|
|
645
|
+
accountId: normalizeOptionalString(args.accountId),
|
|
646
|
+
...threadId ? { threadId } : {},
|
|
647
|
+
...!threadId && !threadSuppressed ? { threadImplicit: true } : {},
|
|
648
|
+
...threadSuppressed ? { threadSuppressed: true } : {}
|
|
649
|
+
};
|
|
650
|
+
}
|
|
651
|
+
function extractMattermostToolSendResult(result, send) {
|
|
652
|
+
if (!result || typeof result !== "object") return null;
|
|
653
|
+
const details = result.details;
|
|
654
|
+
if (!details || typeof details !== "object") return null;
|
|
655
|
+
const toolSend = details.toolSend;
|
|
656
|
+
if (!toolSend || typeof toolSend !== "object") return null;
|
|
657
|
+
const record = toolSend;
|
|
658
|
+
const to = normalizeOptionalString(record.to);
|
|
659
|
+
if (!to) return null;
|
|
660
|
+
const threadId = normalizeOptionalString(record.threadId);
|
|
661
|
+
const originalTarget = normalizeOptionalString(send.to);
|
|
662
|
+
return {
|
|
663
|
+
to: originalTarget?.startsWith("user:") === true || originalTarget?.startsWith("@") === true ? originalTarget : to,
|
|
664
|
+
...threadId ? { threadId } : {}
|
|
665
|
+
};
|
|
666
|
+
}
|
|
667
|
+
function resolveMattermostAutoThreadId(params) {
|
|
668
|
+
const replyToId = normalizeOptionalString(params.replyToId);
|
|
669
|
+
const context = params.toolContext;
|
|
670
|
+
const currentThreadId = normalizeOptionalString(context?.currentThreadTs);
|
|
671
|
+
const currentMessageId = typeof context?.currentMessageId === "number" ? String(context.currentMessageId) : normalizeOptionalString(context?.currentMessageId);
|
|
672
|
+
const currentTarget = normalizeMattermostThreadTarget(context?.currentChannelId);
|
|
673
|
+
if (currentThreadId && currentTarget === normalizeMattermostThreadTarget(params.to)) {
|
|
674
|
+
if (replyToId === currentMessageId) return currentThreadId;
|
|
675
|
+
if (!replyToId) {
|
|
676
|
+
const replyToMode = context?.replyToMode;
|
|
677
|
+
return replyToMode === "all" || replyToMode === "first" && context?.hasRepliedRef?.value !== true ? currentThreadId : void 0;
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
return replyToId;
|
|
681
|
+
}
|
|
682
|
+
function normalizeMattermostThreadTarget(raw) {
|
|
683
|
+
const normalized = raw ? normalizeMattermostMessagingTarget(raw) : void 0;
|
|
684
|
+
if (normalized) return normalized;
|
|
685
|
+
const trimmed = normalizeOptionalString(raw);
|
|
686
|
+
return trimmed && /^[a-z0-9]{26}$/i.test(trimmed) ? `channel:${trimmed}` : void 0;
|
|
687
|
+
}
|
|
688
|
+
function matchesMattermostToolContextTarget(params) {
|
|
689
|
+
const target = normalizeMattermostThreadTarget(params.target);
|
|
690
|
+
if (!target) return false;
|
|
691
|
+
return [params.toolContext.currentChannelId, params.toolContext.currentMessagingTarget].some((currentTarget) => normalizeMattermostThreadTarget(currentTarget) === target);
|
|
692
|
+
}
|
|
693
|
+
function normalizeMattermostThreadId(value) {
|
|
694
|
+
return typeof value === "number" ? String(value) : normalizeOptionalString(value);
|
|
695
|
+
}
|
|
696
|
+
function buildMattermostThreadingToolContext(params) {
|
|
697
|
+
const configuredReplyToMode = resolveMattermostReplyToMode(resolveMattermostAccount({
|
|
698
|
+
cfg: params.cfg,
|
|
699
|
+
accountId: params.accountId ?? resolveDefaultMattermostAccountId(params.cfg)
|
|
700
|
+
}), params.context.ChatType === "direct" || params.context.ChatType === "group" || params.context.ChatType === "channel" ? params.context.ChatType : "channel");
|
|
701
|
+
const currentThreadTs = normalizeMattermostThreadId(params.context.MessageThreadId) ?? normalizeMattermostThreadId(params.context.TransportThreadId) ?? normalizeOptionalString(params.context.ReplyToId);
|
|
702
|
+
const currentMessageId = normalizeMattermostThreadId(params.context.CurrentMessageId);
|
|
703
|
+
const hasExistingThread = Boolean(currentThreadTs) && (!currentMessageId || currentThreadTs !== currentMessageId);
|
|
704
|
+
return {
|
|
705
|
+
currentChannelId: params.context.To ? normalizeMattermostMessagingTarget(params.context.To) : void 0,
|
|
706
|
+
currentThreadTs,
|
|
707
|
+
currentMessageId: params.context.CurrentMessageId,
|
|
708
|
+
replyToMode: hasExistingThread ? "all" : configuredReplyToMode,
|
|
709
|
+
hasRepliedRef: params.hasRepliedRef,
|
|
710
|
+
sameChannelThreadRequired: Boolean(currentThreadTs)
|
|
711
|
+
};
|
|
712
|
+
}
|
|
713
|
+
async function listMattermostDirectoryGroups(params) {
|
|
714
|
+
if (!hasConfiguredMattermostDirectoryAccount(params)) return [];
|
|
715
|
+
return (await loadMattermostChannelRuntime()).listMattermostDirectoryGroups(params);
|
|
716
|
+
}
|
|
717
|
+
async function listMattermostDirectoryPeers(params) {
|
|
718
|
+
if (!hasConfiguredMattermostDirectoryAccount(params)) return [];
|
|
719
|
+
return (await loadMattermostChannelRuntime()).listMattermostDirectoryPeers(params);
|
|
720
|
+
}
|
|
721
|
+
const mattermostMessageActions = {
|
|
722
|
+
describeMessageTool: describeMattermostMessageTool,
|
|
723
|
+
extractToolSend: ({ args }) => extractMattermostToolSend(args),
|
|
724
|
+
extractToolSendResult: ({ result, send }) => extractMattermostToolSendResult(result, send),
|
|
725
|
+
supportsAction: ({ action }) => {
|
|
726
|
+
return action === "send" || action === "react";
|
|
727
|
+
},
|
|
728
|
+
handleAction: async ({ action, params, cfg, accountId, mediaAccess, mediaLocalRoots, mediaReadFile }) => {
|
|
729
|
+
if (action === "react") {
|
|
730
|
+
const resolvedAccountId = accountId ?? resolveDefaultMattermostAccountId(cfg);
|
|
731
|
+
const mattermostConfig = cfg.channels?.mattermost;
|
|
732
|
+
if (!(resolveMattermostAccount({
|
|
733
|
+
cfg,
|
|
734
|
+
accountId: resolvedAccountId
|
|
735
|
+
}).config.actions?.reactions ?? mattermostConfig?.actions?.reactions ?? true)) throw new Error("Mattermost reactions are disabled in config");
|
|
736
|
+
const { postId, emojiName, remove } = parseMattermostReactActionParams(params);
|
|
737
|
+
if (remove) {
|
|
738
|
+
const result = await (await loadMattermostChannelRuntime()).removeMattermostReaction({
|
|
739
|
+
cfg,
|
|
740
|
+
postId,
|
|
741
|
+
emojiName,
|
|
742
|
+
accountId: resolvedAccountId
|
|
743
|
+
});
|
|
744
|
+
if (!result.ok) throw new Error(result.error);
|
|
745
|
+
return {
|
|
746
|
+
content: [{
|
|
747
|
+
type: "text",
|
|
748
|
+
text: `Removed reaction :${emojiName}: from ${postId}`
|
|
749
|
+
}],
|
|
750
|
+
details: {}
|
|
751
|
+
};
|
|
752
|
+
}
|
|
753
|
+
const result = await (await loadMattermostChannelRuntime()).addMattermostReaction({
|
|
754
|
+
cfg,
|
|
755
|
+
postId,
|
|
756
|
+
emojiName,
|
|
757
|
+
accountId: resolvedAccountId
|
|
758
|
+
});
|
|
759
|
+
if (!result.ok) throw new Error(result.error);
|
|
760
|
+
return {
|
|
761
|
+
content: [{
|
|
762
|
+
type: "text",
|
|
763
|
+
text: `Reacted with :${emojiName}: on ${postId}`
|
|
764
|
+
}],
|
|
765
|
+
details: {}
|
|
766
|
+
};
|
|
767
|
+
}
|
|
768
|
+
if (action !== "send") throw new Error(`Unsupported Mattermost action: ${action}`);
|
|
769
|
+
const to = typeof params.to === "string" ? params.to.trim() : typeof params.target === "string" ? params.target.trim() : "";
|
|
770
|
+
if (!to) throw new Error("Mattermost send requires a target (to).");
|
|
771
|
+
const presentation = normalizeMessagePresentation(params.presentation);
|
|
772
|
+
const message = presentation ? renderMessagePresentationFallbackText({
|
|
773
|
+
text: typeof params.message === "string" ? params.message : "",
|
|
774
|
+
presentation
|
|
775
|
+
}) : typeof params.message === "string" ? params.message : "";
|
|
776
|
+
const replyToId = normalizeOptionalString(params.replyToId) ?? normalizeOptionalString(params.threadId) ?? normalizeOptionalString(params.replyTo);
|
|
777
|
+
const resolvedAccountId = accountId || void 0;
|
|
778
|
+
const attachmentMedia = collectMattermostAttachmentMedia(params);
|
|
779
|
+
if (attachmentMedia.hasUnsupportedAttachmentPayload) throw new Error("Mattermost send attachments require media, mediaUrl, path, filePath, fileUrl, mediaUrls, or attachments[] with one of those fields; buffer/base64 payloads are not supported.");
|
|
780
|
+
if (attachmentMedia.mediaUrls.length > 1) throw new Error("Mattermost send supports one attachment per message; split multiple mediaUrls or attachments[] entries into separate sends.");
|
|
781
|
+
const buttons = presentation ? buildMattermostPresentationButtons(presentation) : [];
|
|
782
|
+
const result = await (await loadMattermostChannelRuntime()).sendMessageMattermost(to, message, {
|
|
783
|
+
cfg,
|
|
784
|
+
accountId: resolvedAccountId,
|
|
785
|
+
replyToId,
|
|
786
|
+
buttons: buttons.length > 0 ? buttons : void 0,
|
|
787
|
+
attachmentText: typeof params.attachmentText === "string" ? params.attachmentText : void 0,
|
|
788
|
+
mediaUrl: attachmentMedia.mediaUrls[0],
|
|
789
|
+
mediaLocalRoots: mediaLocalRoots ?? mediaAccess?.localRoots,
|
|
790
|
+
mediaReadFile: mediaReadFile ?? mediaAccess?.readFile,
|
|
791
|
+
...mediaAccess?.workspaceDir ? { workspaceDir: mediaAccess.workspaceDir } : {},
|
|
792
|
+
requireMediaUpload: requiresMattermostMediaUpload(attachmentMedia.mediaUrls[0]) ? true : void 0
|
|
793
|
+
});
|
|
794
|
+
return {
|
|
795
|
+
content: [{
|
|
796
|
+
type: "text",
|
|
797
|
+
text: JSON.stringify({
|
|
798
|
+
ok: true,
|
|
799
|
+
channel: "mattermost",
|
|
800
|
+
messageId: result.messageId,
|
|
801
|
+
channelId: result.channelId
|
|
802
|
+
})
|
|
803
|
+
}],
|
|
804
|
+
details: { toolSend: {
|
|
805
|
+
to: `channel:${result.channelId}`,
|
|
806
|
+
...replyToId ? { threadId: replyToId } : {}
|
|
807
|
+
} }
|
|
808
|
+
};
|
|
809
|
+
}
|
|
810
|
+
};
|
|
811
|
+
function parseMattermostReactActionParams(params) {
|
|
812
|
+
const postId = normalizeOptionalString(params.messageId) ?? normalizeOptionalString(params.postId);
|
|
813
|
+
if (!postId) throw new Error("Mattermost react requires messageId (post id)");
|
|
814
|
+
const emojiName = normalizeOptionalString(params.emoji)?.replace(/^:+|:+$/g, "");
|
|
815
|
+
if (!emojiName) throw new Error("Mattermost react requires emoji");
|
|
816
|
+
return {
|
|
817
|
+
postId,
|
|
818
|
+
emojiName,
|
|
819
|
+
remove: params.remove === true
|
|
820
|
+
};
|
|
821
|
+
}
|
|
822
|
+
function collectNonBlankStrings(values) {
|
|
823
|
+
const collected = [];
|
|
824
|
+
const seen = /* @__PURE__ */ new Set();
|
|
825
|
+
for (const value of values) {
|
|
826
|
+
const trimmed = value?.trim();
|
|
827
|
+
if (trimmed && !seen.has(trimmed)) {
|
|
828
|
+
seen.add(trimmed);
|
|
829
|
+
collected.push(trimmed);
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
return collected;
|
|
833
|
+
}
|
|
834
|
+
function toSnakeCaseKey(key) {
|
|
835
|
+
return key.replace(/([A-Z]+)([A-Z][a-z])/g, "$1_$2").replace(/([a-z0-9])([A-Z])/g, "$1_$2").toLowerCase();
|
|
836
|
+
}
|
|
837
|
+
function readMattermostParam(params, key) {
|
|
838
|
+
if (Object.hasOwn(params, key)) return params[key];
|
|
839
|
+
const snakeKey = toSnakeCaseKey(key);
|
|
840
|
+
return snakeKey === key || !Object.hasOwn(params, snakeKey) ? void 0 : params[snakeKey];
|
|
841
|
+
}
|
|
842
|
+
function readMattermostStringParam(params, key) {
|
|
843
|
+
const raw = readMattermostParam(params, key);
|
|
844
|
+
return typeof raw === "string" ? normalizeOptionalString(raw) : void 0;
|
|
845
|
+
}
|
|
846
|
+
function readMattermostStringArrayParam(params, key) {
|
|
847
|
+
const raw = readMattermostParam(params, key);
|
|
848
|
+
if (Array.isArray(raw)) return raw.filter((entry) => typeof entry === "string").flatMap((entry) => {
|
|
849
|
+
const normalized = normalizeOptionalString(entry);
|
|
850
|
+
return normalized ? [normalized] : [];
|
|
851
|
+
});
|
|
852
|
+
if (typeof raw === "string") {
|
|
853
|
+
const normalized = normalizeOptionalString(raw);
|
|
854
|
+
return normalized ? [normalized] : [];
|
|
855
|
+
}
|
|
856
|
+
return [];
|
|
857
|
+
}
|
|
858
|
+
function requiresMattermostMediaUpload(mediaUrl) {
|
|
859
|
+
const normalized = normalizeOptionalString(mediaUrl);
|
|
860
|
+
return Boolean(normalized && !/^https?:\/\//i.test(normalized));
|
|
861
|
+
}
|
|
862
|
+
function collectMattermostAttachmentMedia(params) {
|
|
863
|
+
const mediaUrlCandidates = [
|
|
864
|
+
readMattermostStringParam(params, "media"),
|
|
865
|
+
readMattermostStringParam(params, "mediaUrl"),
|
|
866
|
+
readMattermostStringParam(params, "path"),
|
|
867
|
+
readMattermostStringParam(params, "filePath"),
|
|
868
|
+
readMattermostStringParam(params, "fileUrl")
|
|
869
|
+
];
|
|
870
|
+
mediaUrlCandidates.push(...readMattermostStringArrayParam(params, "mediaUrls"));
|
|
871
|
+
let hasUnsupportedAttachmentPayload = typeof params.buffer === "string" || typeof params.base64 === "string";
|
|
872
|
+
if (Array.isArray(params.attachments)) for (const attachment of params.attachments) {
|
|
873
|
+
if (!attachment || typeof attachment !== "object" || Array.isArray(attachment)) continue;
|
|
874
|
+
const record = attachment;
|
|
875
|
+
mediaUrlCandidates.push(readMattermostStringParam(record, "media"), readMattermostStringParam(record, "mediaUrl"), readMattermostStringParam(record, "path"), readMattermostStringParam(record, "filePath"), readMattermostStringParam(record, "fileUrl"), readMattermostStringParam(record, "url"));
|
|
876
|
+
hasUnsupportedAttachmentPayload ||= typeof record.buffer === "string";
|
|
877
|
+
hasUnsupportedAttachmentPayload ||= typeof record.base64 === "string";
|
|
878
|
+
}
|
|
879
|
+
return {
|
|
880
|
+
mediaUrls: collectNonBlankStrings(mediaUrlCandidates),
|
|
881
|
+
hasUnsupportedAttachmentPayload
|
|
882
|
+
};
|
|
883
|
+
}
|
|
884
|
+
const mattermostOutbound = {
|
|
885
|
+
deliveryMode: "direct",
|
|
886
|
+
chunker: chunkTextForOutbound,
|
|
887
|
+
chunkerMode: "markdown",
|
|
888
|
+
textChunkLimit: 4e3,
|
|
889
|
+
deliveryCapabilities: { durableFinal: {
|
|
890
|
+
text: true,
|
|
891
|
+
media: true,
|
|
892
|
+
payload: true,
|
|
893
|
+
replyTo: true,
|
|
894
|
+
thread: true,
|
|
895
|
+
messageSendingHooks: true
|
|
896
|
+
} },
|
|
897
|
+
presentationCapabilities: MATTERMOST_PRESENTATION_CAPABILITIES,
|
|
898
|
+
renderPresentation: ({ payload, presentation }) => {
|
|
899
|
+
if (payload.mediaUrls && payload.mediaUrls.length > 1) return null;
|
|
900
|
+
const buttons = buildMattermostPresentationButtons(presentation);
|
|
901
|
+
if (!hasMattermostPresentationButtons(presentation)) return null;
|
|
902
|
+
return {
|
|
903
|
+
...payload,
|
|
904
|
+
text: renderMessagePresentationFallbackText({
|
|
905
|
+
text: payload.text,
|
|
906
|
+
presentation
|
|
907
|
+
}),
|
|
908
|
+
channelData: {
|
|
909
|
+
...payload.channelData,
|
|
910
|
+
mattermost: {
|
|
911
|
+
...payload.channelData?.mattermost,
|
|
912
|
+
presentationButtons: buttons
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
};
|
|
916
|
+
},
|
|
917
|
+
sendPayload: async (ctx) => {
|
|
918
|
+
const buttons = readMattermostPresentationButtons(ctx.payload);
|
|
919
|
+
if (buttons?.length) {
|
|
920
|
+
const mediaUrl = resolvePayloadMediaUrls({
|
|
921
|
+
...ctx.payload,
|
|
922
|
+
mediaUrl: ctx.payload.mediaUrl ?? ctx.mediaUrl
|
|
923
|
+
}).map((url) => url.trim()).find(Boolean);
|
|
924
|
+
return attachChannelToResult("mattermost", await (await loadMattermostChannelRuntime()).sendMessageMattermost(ctx.to, ctx.payload.text ?? ctx.text, {
|
|
925
|
+
cfg: ctx.cfg,
|
|
926
|
+
accountId: ctx.accountId ?? void 0,
|
|
927
|
+
mediaUrl,
|
|
928
|
+
mediaLocalRoots: ctx.mediaLocalRoots ?? ctx.mediaAccess?.localRoots,
|
|
929
|
+
mediaReadFile: ctx.mediaReadFile ?? ctx.mediaAccess?.readFile,
|
|
930
|
+
...ctx.mediaAccess?.workspaceDir ? { workspaceDir: ctx.mediaAccess.workspaceDir } : {},
|
|
931
|
+
requireMediaUpload: requiresMattermostMediaUpload(mediaUrl) ? true : void 0,
|
|
932
|
+
replyToId: ctx.replyToId ?? (ctx.threadId != null ? String(ctx.threadId) : void 0),
|
|
933
|
+
buttons
|
|
934
|
+
}));
|
|
935
|
+
}
|
|
936
|
+
return await sendTextMediaPayload({
|
|
937
|
+
channel: "mattermost",
|
|
938
|
+
ctx,
|
|
939
|
+
adapter: mattermostOutbound
|
|
940
|
+
});
|
|
941
|
+
},
|
|
942
|
+
resolveTarget: ({ to }) => {
|
|
943
|
+
const trimmed = to?.trim();
|
|
944
|
+
if (!trimmed) return {
|
|
945
|
+
ok: false,
|
|
946
|
+
error: /* @__PURE__ */ new Error("Delivering to Mattermost requires --to <channelId|@username|user:ID|channel:ID>")
|
|
947
|
+
};
|
|
948
|
+
return {
|
|
949
|
+
ok: true,
|
|
950
|
+
to: trimmed
|
|
951
|
+
};
|
|
952
|
+
},
|
|
953
|
+
...createAttachedChannelResultAdapter({
|
|
954
|
+
channel: "mattermost",
|
|
955
|
+
sendText: async ({ cfg, to, text, accountId, replyToId, threadId }) => await (await loadMattermostChannelRuntime()).sendMessageMattermost(to, text, {
|
|
956
|
+
cfg,
|
|
957
|
+
accountId: accountId ?? void 0,
|
|
958
|
+
replyToId: replyToId ?? (threadId != null ? String(threadId) : void 0)
|
|
959
|
+
}),
|
|
960
|
+
sendMedia: async ({ cfg, to, text, mediaUrl, mediaAccess, mediaLocalRoots, mediaReadFile, accountId, replyToId, threadId }) => await (await loadMattermostChannelRuntime()).sendMessageMattermost(to, text, {
|
|
961
|
+
cfg,
|
|
962
|
+
accountId: accountId ?? void 0,
|
|
963
|
+
mediaUrl,
|
|
964
|
+
mediaLocalRoots: mediaLocalRoots ?? mediaAccess?.localRoots,
|
|
965
|
+
mediaReadFile: mediaReadFile ?? mediaAccess?.readFile,
|
|
966
|
+
...mediaAccess?.workspaceDir ? { workspaceDir: mediaAccess.workspaceDir } : {},
|
|
967
|
+
requireMediaUpload: requiresMattermostMediaUpload(mediaUrl) ? true : void 0,
|
|
968
|
+
replyToId: replyToId ?? (threadId != null ? String(threadId) : void 0)
|
|
969
|
+
})
|
|
970
|
+
})
|
|
971
|
+
};
|
|
972
|
+
const mattermostMessageAdapter = createChannelMessageAdapterFromOutbound({
|
|
973
|
+
id: "mattermost",
|
|
974
|
+
outbound: mattermostOutbound,
|
|
975
|
+
live: {
|
|
976
|
+
capabilities: {
|
|
977
|
+
draftPreview: true,
|
|
978
|
+
previewFinalization: true,
|
|
979
|
+
progressUpdates: true
|
|
980
|
+
},
|
|
981
|
+
finalizer: { capabilities: {
|
|
982
|
+
finalEdit: true,
|
|
983
|
+
normalFallback: true,
|
|
984
|
+
discardPending: true
|
|
985
|
+
} }
|
|
986
|
+
}
|
|
987
|
+
});
|
|
988
|
+
const mattermostPlugin = createChatChannelPlugin({
|
|
989
|
+
base: {
|
|
990
|
+
id: "mattermost",
|
|
991
|
+
meta: { ...mattermostMeta },
|
|
992
|
+
setup: mattermostSetupAdapter,
|
|
993
|
+
setupWizard: mattermostSetupWizard,
|
|
994
|
+
capabilities: {
|
|
995
|
+
chatTypes: [
|
|
996
|
+
"direct",
|
|
997
|
+
"channel",
|
|
998
|
+
"group",
|
|
999
|
+
"thread"
|
|
1000
|
+
],
|
|
1001
|
+
reactions: true,
|
|
1002
|
+
threads: true,
|
|
1003
|
+
media: true,
|
|
1004
|
+
nativeCommands: true
|
|
1005
|
+
},
|
|
1006
|
+
streaming: { blockStreamingCoalesceDefaults: {
|
|
1007
|
+
minChars: 1500,
|
|
1008
|
+
idleMs: 1e3
|
|
1009
|
+
} },
|
|
1010
|
+
reload: { configPrefixes: ["channels.mattermost"] },
|
|
1011
|
+
configSchema: MattermostChannelConfigSchema,
|
|
1012
|
+
config: {
|
|
1013
|
+
...mattermostConfigAdapter,
|
|
1014
|
+
isConfigured: isMattermostConfigured$1,
|
|
1015
|
+
describeAccount: describeMattermostAccount
|
|
1016
|
+
},
|
|
1017
|
+
approvalCapability: mattermostApprovalAuth,
|
|
1018
|
+
doctor: mattermostDoctor,
|
|
1019
|
+
groups: { resolveRequireMention: resolveMattermostGroupRequireMention },
|
|
1020
|
+
actions: mattermostMessageActions,
|
|
1021
|
+
message: mattermostMessageAdapter,
|
|
1022
|
+
secrets: {
|
|
1023
|
+
secretTargetRegistryEntries,
|
|
1024
|
+
collectRuntimeConfigAssignments
|
|
1025
|
+
},
|
|
1026
|
+
directory: createChannelDirectoryAdapter({
|
|
1027
|
+
listGroups: listMattermostDirectoryGroups,
|
|
1028
|
+
listGroupsLive: listMattermostDirectoryGroups,
|
|
1029
|
+
listPeers: listMattermostDirectoryPeers,
|
|
1030
|
+
listPeersLive: listMattermostDirectoryPeers
|
|
1031
|
+
}),
|
|
1032
|
+
messaging: {
|
|
1033
|
+
targetPrefixes: ["mattermost"],
|
|
1034
|
+
defaultMarkdownTableMode: "off",
|
|
1035
|
+
normalizeTarget: normalizeMattermostMessagingTarget,
|
|
1036
|
+
resolveDeliveryTarget: ({ conversationId, parentConversationId }) => {
|
|
1037
|
+
const parent = parentConversationId?.trim();
|
|
1038
|
+
const child = conversationId.trim();
|
|
1039
|
+
return parent && parent !== child ? {
|
|
1040
|
+
to: `channel:${parent}`,
|
|
1041
|
+
threadId: child
|
|
1042
|
+
} : { to: normalizeMattermostMessagingTarget(`channel:${child}`) };
|
|
1043
|
+
},
|
|
1044
|
+
resolveOutboundSessionRoute: (params) => resolveMattermostOutboundSessionRoute(params),
|
|
1045
|
+
targetResolver: {
|
|
1046
|
+
looksLikeId: looksLikeMattermostTargetId,
|
|
1047
|
+
hint: "<channelId|user:ID|channel:ID>",
|
|
1048
|
+
resolveTarget: async ({ cfg, accountId, input }) => {
|
|
1049
|
+
const resolved = await (await loadMattermostChannelRuntime()).resolveMattermostOpaqueTarget({
|
|
1050
|
+
input,
|
|
1051
|
+
cfg,
|
|
1052
|
+
accountId
|
|
1053
|
+
});
|
|
1054
|
+
if (!resolved) return null;
|
|
1055
|
+
return {
|
|
1056
|
+
to: resolved.to,
|
|
1057
|
+
kind: resolved.kind,
|
|
1058
|
+
source: "directory"
|
|
1059
|
+
};
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
},
|
|
1063
|
+
status: createComputedAccountStatusAdapter({
|
|
1064
|
+
defaultRuntime: createDefaultChannelRuntimeState(DEFAULT_ACCOUNT_ID$1, {
|
|
1065
|
+
connected: false,
|
|
1066
|
+
lastConnectedAt: null,
|
|
1067
|
+
lastDisconnect: null
|
|
1068
|
+
}),
|
|
1069
|
+
buildChannelSummary: ({ snapshot }) => buildPassiveProbedChannelStatusSummary(snapshot, {
|
|
1070
|
+
botTokenSource: snapshot.botTokenSource ?? "none",
|
|
1071
|
+
connected: snapshot.connected ?? false,
|
|
1072
|
+
baseUrl: snapshot.baseUrl ?? null
|
|
1073
|
+
}),
|
|
1074
|
+
probeAccount: async ({ account, timeoutMs }) => {
|
|
1075
|
+
const token = account.botToken?.trim();
|
|
1076
|
+
const baseUrl = account.baseUrl?.trim();
|
|
1077
|
+
if (!token || !baseUrl) return {
|
|
1078
|
+
ok: false,
|
|
1079
|
+
error: "bot token or baseUrl missing"
|
|
1080
|
+
};
|
|
1081
|
+
return await (await loadMattermostChannelRuntime()).probeMattermost(baseUrl, token, timeoutMs, isPrivateNetworkOptInEnabled(account.config));
|
|
1082
|
+
},
|
|
1083
|
+
resolveAccountSnapshot: ({ account, runtime }) => ({
|
|
1084
|
+
accountId: account.accountId,
|
|
1085
|
+
name: account.name,
|
|
1086
|
+
enabled: account.enabled,
|
|
1087
|
+
configured: Boolean(account.botToken && account.baseUrl),
|
|
1088
|
+
extra: {
|
|
1089
|
+
botTokenSource: account.botTokenSource,
|
|
1090
|
+
baseUrl: account.baseUrl,
|
|
1091
|
+
dmPolicy: account.config.dmPolicy ?? "pairing",
|
|
1092
|
+
connected: runtime?.connected ?? false,
|
|
1093
|
+
lastConnectedAt: runtime?.lastConnectedAt ?? null,
|
|
1094
|
+
lastDisconnect: runtime?.lastDisconnect ?? null
|
|
1095
|
+
}
|
|
1096
|
+
})
|
|
1097
|
+
}),
|
|
1098
|
+
gateway: {
|
|
1099
|
+
resolveGatewayAuthBypassPaths: ({ cfg }) => resolveMattermostGatewayAuthBypassPaths(cfg),
|
|
1100
|
+
startAccount: async (ctx) => {
|
|
1101
|
+
const account = ctx.account;
|
|
1102
|
+
const statusSink = createAccountStatusSink({
|
|
1103
|
+
accountId: ctx.accountId,
|
|
1104
|
+
setStatus: ctx.setStatus
|
|
1105
|
+
});
|
|
1106
|
+
statusSink({
|
|
1107
|
+
baseUrl: account.baseUrl,
|
|
1108
|
+
botTokenSource: account.botTokenSource
|
|
1109
|
+
});
|
|
1110
|
+
ctx.log?.info(`[${account.accountId}] starting channel`);
|
|
1111
|
+
return (await loadMattermostChannelRuntime()).monitorMattermostProvider({
|
|
1112
|
+
botToken: account.botToken ?? void 0,
|
|
1113
|
+
baseUrl: account.baseUrl ?? void 0,
|
|
1114
|
+
accountId: account.accountId,
|
|
1115
|
+
config: ctx.cfg,
|
|
1116
|
+
runtime: ctx.runtime,
|
|
1117
|
+
abortSignal: ctx.abortSignal,
|
|
1118
|
+
statusSink
|
|
1119
|
+
});
|
|
1120
|
+
}
|
|
1121
|
+
}
|
|
1122
|
+
},
|
|
1123
|
+
pairing: { text: {
|
|
1124
|
+
idLabel: "mattermostUserId",
|
|
1125
|
+
message: "OpenClaw: your access has been approved.",
|
|
1126
|
+
normalizeAllowEntry: (entry) => normalizeMattermostAllowEntry(entry),
|
|
1127
|
+
notify: createLoggedPairingApprovalNotifier(({ id }) => `[mattermost] User ${id} approved for pairing`)
|
|
1128
|
+
} },
|
|
1129
|
+
threading: {
|
|
1130
|
+
buildToolContext: (params) => buildMattermostThreadingToolContext(params),
|
|
1131
|
+
scopedAccountReplyToMode: {
|
|
1132
|
+
resolveAccount: (cfg, accountId) => resolveMattermostAccount({
|
|
1133
|
+
cfg,
|
|
1134
|
+
accountId: accountId ?? resolveDefaultMattermostAccountId(cfg)
|
|
1135
|
+
}),
|
|
1136
|
+
resolveReplyToMode: (account, chatType) => resolveMattermostReplyToMode(account, chatType === "direct" || chatType === "group" || chatType === "channel" ? chatType : "channel")
|
|
1137
|
+
},
|
|
1138
|
+
resolveAutoThreadId: ({ to, replyToId, toolContext }) => resolveMattermostAutoThreadId({
|
|
1139
|
+
to,
|
|
1140
|
+
replyToId,
|
|
1141
|
+
toolContext
|
|
1142
|
+
}),
|
|
1143
|
+
matchesToolContextTarget: ({ target, toolContext }) => matchesMattermostToolContextTarget({
|
|
1144
|
+
target,
|
|
1145
|
+
toolContext
|
|
1146
|
+
}),
|
|
1147
|
+
resolveReplyTransport: ({ threadId, replyToId, replyToIsExplicit, replyDelivery }) => {
|
|
1148
|
+
const ambientThreadId = threadId != null ? String(threadId) : void 0;
|
|
1149
|
+
const resolvedThreadId = replyDelivery?.chatType === "direct" ? void 0 : replyDelivery ? replyToIsExplicit ? replyToId ?? ambientThreadId : ambientThreadId ?? replyToId ?? void 0 : ambientThreadId ?? replyToId;
|
|
1150
|
+
return {
|
|
1151
|
+
replyToId: replyDelivery?.chatType === "direct" ? null : resolvedThreadId,
|
|
1152
|
+
threadId: resolvedThreadId ?? null
|
|
1153
|
+
};
|
|
1154
|
+
}
|
|
1155
|
+
},
|
|
1156
|
+
security: mattermostSecurityAdapter,
|
|
1157
|
+
outbound: mattermostOutbound
|
|
1158
|
+
});
|
|
1159
|
+
//#endregion
|
|
1160
|
+
export { describeMattermostAccount as a, mattermostMeta as c, MattermostChannelConfigSchema as i, mattermostSetupWizard as n, isMattermostConfigured$1 as o, mattermostSetupAdapter as r, mattermostConfigAdapter as s, mattermostPlugin as t };
|