@openclaw/mattermost 2026.9.5 → 2026.9.6
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/dist/.setup/{channel-plugin-api-N-mnrhds.mjs → channel-plugin-api-CCmaCFdK.mjs} +2 -2
- package/dist/.setup/{channel-plugin-api-CKz3b0dp.mjs → channel-plugin-api-CzBhdovL.mjs} +2 -2
- package/dist/.setup/{channel-plugin-runtime-Ca4cZHq2.mjs → channel-plugin-runtime-yAOg5GcM.mjs} +33 -25
- package/dist/.setup/{channel.runtime-C074p7wv.mjs → channel.runtime-CihvzY84.mjs} +71 -104
- package/dist/.setup/{client-Cx71KZ1x.mjs → client-BSSVve1x.mjs} +38 -8
- package/dist/.setup/{interactions-BG-CQbVD.mjs → interactions-rBQWCbK8.mjs} +2 -2
- package/dist/.setup/{monitor-auth-DBoM2Bja.mjs → monitor-auth-CCpN0z_f.mjs} +2 -2
- package/dist/.setup/{normalize-BQzx2u8S.mjs → normalize-DM54w7ud.mjs} +1 -1
- package/dist/.setup/{slash-state-CmyIYDIc.mjs → slash-state-DfnmzXMr.mjs} +37 -20
- package/dist/api.js +2 -2
- package/dist/channel-plugin-api.js +2 -2
- package/dist/channel-plugin-runtime.js +1 -1
- package/dist/policy-api.js +1 -1
- package/dist/setup-entry.js +1 -1
- package/dist/slash-route-api.js +1 -1
- package/node_modules/zod/README.md +2 -2
- package/node_modules/zod/compile.cjs +19 -0
- package/node_modules/zod/index.cjs +19 -0
- package/node_modules/zod/locales/index.cjs +19 -0
- package/node_modules/zod/mini/index.cjs +19 -0
- package/node_modules/zod/package.json +8 -7
- package/node_modules/zod/src/v3/helpers/errorUtil.ts +1 -1
- package/node_modules/zod/src/v4/classic/external.ts +2 -0
- package/node_modules/zod/src/v4/classic/from-json-schema.ts +248 -25
- package/node_modules/zod/src/v4/classic/schemas.ts +243 -168
- package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +60 -9
- package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +6 -0
- package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +2 -2
- package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +265 -0
- package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +112 -6
- package/node_modules/zod/src/v4/classic/tests/enum.test.ts +9 -0
- package/node_modules/zod/src/v4/classic/tests/error.test.ts +130 -1
- package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +157 -0
- package/node_modules/zod/src/v4/classic/tests/iban.test.ts +81 -0
- package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +40 -2
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +27 -7
- package/node_modules/zod/src/v4/classic/tests/issue-schema.test.ts +88 -56
- package/node_modules/zod/src/v4/classic/tests/number.test.ts +39 -0
- package/node_modules/zod/src/v4/classic/tests/object.test.ts +56 -0
- package/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +3 -2
- package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +70 -0
- package/node_modules/zod/src/v4/classic/tests/properties.test.ts +141 -0
- package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +46 -1
- package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +19 -0
- package/node_modules/zod/src/v4/classic/tests/string.test.ts +95 -1
- package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +33 -1
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +234 -38
- package/node_modules/zod/src/v4/classic/tests/validate.test.ts +569 -0
- package/node_modules/zod/src/v4/core/api.ts +44 -28
- package/node_modules/zod/src/v4/core/checks.ts +62 -102
- package/node_modules/zod/src/v4/core/compile.ts +218 -93
- package/node_modules/zod/src/v4/core/core.ts +1 -3
- package/node_modules/zod/src/v4/core/doc.ts +6 -2
- package/node_modules/zod/src/v4/core/errors.ts +3 -6
- package/node_modules/zod/src/v4/core/json-schema-generator.ts +2 -2
- package/node_modules/zod/src/v4/core/json-schema-processors.ts +185 -81
- package/node_modules/zod/src/v4/core/memoizer.ts +75 -28
- package/node_modules/zod/src/v4/core/parse.ts +37 -16
- package/node_modules/zod/src/v4/core/regexes.ts +14 -4
- package/node_modules/zod/src/v4/core/schemas.ts +296 -132
- package/node_modules/zod/src/v4/core/tests/cached.test.ts +54 -0
- package/node_modules/zod/src/v4/core/tests/compile-differential.test.ts +35 -0
- package/node_modules/zod/src/v4/core/tests/compile-generative.test.ts +445 -0
- package/node_modules/zod/src/v4/core/tests/compile.test.ts +399 -2
- package/node_modules/zod/src/v4/core/tests/email-regex.test.ts +140 -0
- package/node_modules/zod/src/v4/core/tests/locales/tg.test.ts +85 -0
- package/node_modules/zod/src/v4/core/tests/polyfill-collision.test.ts +46 -0
- package/node_modules/zod/src/v4/core/tests/url-no-canparse.test.ts +118 -16
- package/node_modules/zod/src/v4/core/to-json-schema.ts +9 -7
- package/node_modules/zod/src/v4/core/util.ts +218 -147
- package/node_modules/zod/src/v4/core/versions.ts +2 -2
- package/node_modules/zod/src/v4/locales/ar.ts +2 -0
- package/node_modules/zod/src/v4/locales/az.ts +2 -0
- package/node_modules/zod/src/v4/locales/be.ts +2 -0
- package/node_modules/zod/src/v4/locales/bg.ts +2 -0
- package/node_modules/zod/src/v4/locales/bn.ts +2 -0
- package/node_modules/zod/src/v4/locales/ca.ts +2 -0
- package/node_modules/zod/src/v4/locales/ckb.ts +2 -0
- package/node_modules/zod/src/v4/locales/cs.ts +2 -0
- package/node_modules/zod/src/v4/locales/da.ts +2 -0
- package/node_modules/zod/src/v4/locales/de.ts +2 -0
- package/node_modules/zod/src/v4/locales/el.ts +2 -0
- package/node_modules/zod/src/v4/locales/en.ts +2 -0
- package/node_modules/zod/src/v4/locales/eo.ts +2 -0
- package/node_modules/zod/src/v4/locales/es.ts +2 -0
- package/node_modules/zod/src/v4/locales/fa.ts +2 -0
- package/node_modules/zod/src/v4/locales/fi.ts +2 -0
- package/node_modules/zod/src/v4/locales/fr-CA.ts +2 -0
- package/node_modules/zod/src/v4/locales/fr.ts +2 -0
- package/node_modules/zod/src/v4/locales/gu.ts +2 -0
- package/node_modules/zod/src/v4/locales/he.ts +2 -0
- package/node_modules/zod/src/v4/locales/hi.ts +2 -0
- package/node_modules/zod/src/v4/locales/hr.ts +2 -0
- package/node_modules/zod/src/v4/locales/hu.ts +2 -0
- package/node_modules/zod/src/v4/locales/hy.ts +2 -0
- package/node_modules/zod/src/v4/locales/id.ts +2 -0
- package/node_modules/zod/src/v4/locales/index.ts +1 -0
- package/node_modules/zod/src/v4/locales/is.ts +2 -0
- package/node_modules/zod/src/v4/locales/it.ts +2 -0
- package/node_modules/zod/src/v4/locales/ja.ts +2 -0
- package/node_modules/zod/src/v4/locales/ka.ts +2 -0
- package/node_modules/zod/src/v4/locales/km.ts +2 -0
- package/node_modules/zod/src/v4/locales/kn.ts +2 -0
- package/node_modules/zod/src/v4/locales/ko.ts +2 -0
- package/node_modules/zod/src/v4/locales/lt.ts +2 -0
- package/node_modules/zod/src/v4/locales/mk.ts +2 -0
- package/node_modules/zod/src/v4/locales/ms.ts +2 -0
- package/node_modules/zod/src/v4/locales/ne.ts +2 -0
- package/node_modules/zod/src/v4/locales/nl.ts +2 -0
- package/node_modules/zod/src/v4/locales/nn.ts +2 -0
- package/node_modules/zod/src/v4/locales/no.ts +2 -0
- package/node_modules/zod/src/v4/locales/ota.ts +2 -0
- package/node_modules/zod/src/v4/locales/pl.ts +2 -0
- package/node_modules/zod/src/v4/locales/ps.ts +2 -0
- package/node_modules/zod/src/v4/locales/pt-BR.ts +2 -0
- package/node_modules/zod/src/v4/locales/pt.ts +2 -0
- package/node_modules/zod/src/v4/locales/ro.ts +2 -0
- package/node_modules/zod/src/v4/locales/ru.ts +2 -0
- package/node_modules/zod/src/v4/locales/sk.ts +2 -0
- package/node_modules/zod/src/v4/locales/sl.ts +2 -0
- package/node_modules/zod/src/v4/locales/sv.ts +2 -0
- package/node_modules/zod/src/v4/locales/ta.ts +2 -0
- package/node_modules/zod/src/v4/locales/tg.ts +135 -0
- package/node_modules/zod/src/v4/locales/th.ts +2 -0
- package/node_modules/zod/src/v4/locales/tk.ts +2 -0
- package/node_modules/zod/src/v4/locales/tr.ts +2 -0
- package/node_modules/zod/src/v4/locales/uk.ts +2 -0
- package/node_modules/zod/src/v4/locales/ur.ts +2 -0
- package/node_modules/zod/src/v4/locales/uz.ts +2 -0
- package/node_modules/zod/src/v4/locales/vi.ts +2 -0
- package/node_modules/zod/src/v4/locales/yo.ts +2 -0
- package/node_modules/zod/src/v4/locales/zh-CN.ts +2 -0
- package/node_modules/zod/src/v4/locales/zh-TW.ts +2 -0
- package/node_modules/zod/src/v4/mini/external.ts +2 -0
- package/node_modules/zod/src/v4/mini/schemas.ts +32 -7
- package/node_modules/zod/src/v4/mini/tests/checks.test.ts +1 -1
- package/node_modules/zod/src/v4/mini/tests/computed.test.ts +11 -17
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +86 -0
- package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +16 -0
- package/node_modules/zod/src/v4/mini/tests/string.test.ts +23 -0
- package/node_modules/zod/v3/ZodError.cjs +19 -0
- package/node_modules/zod/v3/errors.cjs +19 -0
- package/node_modules/zod/v3/external.cjs +19 -0
- package/node_modules/zod/v3/helpers/enumUtil.cjs +19 -0
- package/node_modules/zod/v3/helpers/errorUtil.cjs +20 -1
- package/node_modules/zod/v3/helpers/errorUtil.js +1 -1
- package/node_modules/zod/v3/helpers/parseUtil.cjs +19 -0
- package/node_modules/zod/v3/helpers/partialUtil.cjs +19 -0
- package/node_modules/zod/v3/helpers/typeAliases.cjs +19 -0
- package/node_modules/zod/v3/helpers/util.cjs +19 -0
- package/node_modules/zod/v3/index.cjs +19 -0
- package/node_modules/zod/v3/standard-schema.cjs +19 -0
- package/node_modules/zod/v3/types.cjs +19 -0
- package/node_modules/zod/v4/classic/checks.cjs +19 -0
- package/node_modules/zod/v4/classic/coerce.cjs +19 -0
- package/node_modules/zod/v4/classic/compat.cjs +19 -0
- package/node_modules/zod/v4/classic/deep-partial.cjs +19 -0
- package/node_modules/zod/v4/classic/errors.cjs +19 -0
- package/node_modules/zod/v4/classic/external.cjs +22 -1
- package/node_modules/zod/v4/classic/external.d.cts +1 -1
- package/node_modules/zod/v4/classic/external.d.ts +1 -1
- package/node_modules/zod/v4/classic/external.js +1 -1
- package/node_modules/zod/v4/classic/from-json-schema.cjs +264 -24
- package/node_modules/zod/v4/classic/from-json-schema.js +245 -24
- package/node_modules/zod/v4/classic/in-out.cjs +19 -0
- package/node_modules/zod/v4/classic/index.cjs +19 -0
- package/node_modules/zod/v4/classic/iso.cjs +19 -0
- package/node_modules/zod/v4/classic/parse.cjs +19 -0
- package/node_modules/zod/v4/classic/schemas.cjs +100 -35
- package/node_modules/zod/v4/classic/schemas.d.cts +15 -1
- package/node_modules/zod/v4/classic/schemas.d.ts +15 -1
- package/node_modules/zod/v4/classic/schemas.js +77 -33
- package/node_modules/zod/v4/core/api.cjs +45 -22
- package/node_modules/zod/v4/core/api.d.cts +12 -6
- package/node_modules/zod/v4/core/api.d.ts +12 -6
- package/node_modules/zod/v4/core/api.js +25 -22
- package/node_modules/zod/v4/core/checks.cjs +51 -97
- package/node_modules/zod/v4/core/checks.d.cts +17 -1
- package/node_modules/zod/v4/core/checks.d.ts +17 -1
- package/node_modules/zod/v4/core/checks.js +31 -96
- package/node_modules/zod/v4/core/compile.cjs +173 -78
- package/node_modules/zod/v4/core/compile.d.cts +18 -4
- package/node_modules/zod/v4/core/compile.d.ts +18 -4
- package/node_modules/zod/v4/core/compile.js +154 -79
- package/node_modules/zod/v4/core/core.cjs +20 -1
- package/node_modules/zod/v4/core/core.js +1 -1
- package/node_modules/zod/v4/core/doc.cjs +26 -2
- package/node_modules/zod/v4/core/doc.js +7 -2
- package/node_modules/zod/v4/core/errors.cjs +21 -5
- package/node_modules/zod/v4/core/errors.js +2 -5
- package/node_modules/zod/v4/core/index.cjs +19 -0
- package/node_modules/zod/v4/core/json-schema-generator.cjs +20 -1
- package/node_modules/zod/v4/core/json-schema-generator.js +2 -2
- package/node_modules/zod/v4/core/json-schema-processors.cjs +188 -72
- package/node_modules/zod/v4/core/json-schema-processors.d.cts +16 -0
- package/node_modules/zod/v4/core/json-schema-processors.d.ts +16 -0
- package/node_modules/zod/v4/core/json-schema-processors.js +170 -74
- package/node_modules/zod/v4/core/json-schema.cjs +19 -0
- package/node_modules/zod/v4/core/memoizer.cjs +111 -23
- package/node_modules/zod/v4/core/memoizer.js +69 -23
- package/node_modules/zod/v4/core/parse.cjs +56 -16
- package/node_modules/zod/v4/core/parse.js +37 -16
- package/node_modules/zod/v4/core/regexes.cjs +31 -6
- package/node_modules/zod/v4/core/regexes.d.cts +3 -0
- package/node_modules/zod/v4/core/regexes.d.ts +3 -0
- package/node_modules/zod/v4/core/regexes.js +10 -4
- package/node_modules/zod/v4/core/registries.cjs +19 -0
- package/node_modules/zod/v4/core/schemas.cjs +302 -114
- package/node_modules/zod/v4/core/schemas.d.cts +28 -8
- package/node_modules/zod/v4/core/schemas.d.ts +28 -8
- package/node_modules/zod/v4/core/schemas.js +279 -113
- package/node_modules/zod/v4/core/standard-schema.cjs +19 -0
- package/node_modules/zod/v4/core/to-json-schema.cjs +28 -7
- package/node_modules/zod/v4/core/to-json-schema.d.cts +4 -3
- package/node_modules/zod/v4/core/to-json-schema.d.ts +4 -3
- package/node_modules/zod/v4/core/to-json-schema.js +7 -6
- package/node_modules/zod/v4/core/util.cjs +177 -143
- package/node_modules/zod/v4/core/util.d.cts +25 -4
- package/node_modules/zod/v4/core/util.d.ts +25 -4
- package/node_modules/zod/v4/core/util.js +156 -143
- package/node_modules/zod/v4/core/versions.cjs +21 -2
- package/node_modules/zod/v4/core/versions.d.cts +1 -1
- package/node_modules/zod/v4/core/versions.d.ts +1 -1
- package/node_modules/zod/v4/core/versions.js +2 -2
- package/node_modules/zod/v4/core/visit.cjs +19 -0
- package/node_modules/zod/v4/index.cjs +19 -0
- package/node_modules/zod/v4/locales/ar.cjs +2 -0
- package/node_modules/zod/v4/locales/ar.js +2 -0
- package/node_modules/zod/v4/locales/az.cjs +2 -0
- package/node_modules/zod/v4/locales/az.js +2 -0
- package/node_modules/zod/v4/locales/be.cjs +2 -0
- package/node_modules/zod/v4/locales/be.js +2 -0
- package/node_modules/zod/v4/locales/bg.cjs +2 -0
- package/node_modules/zod/v4/locales/bg.js +2 -0
- package/node_modules/zod/v4/locales/bn.cjs +2 -0
- package/node_modules/zod/v4/locales/bn.js +2 -0
- package/node_modules/zod/v4/locales/ca.cjs +2 -0
- package/node_modules/zod/v4/locales/ca.js +2 -0
- package/node_modules/zod/v4/locales/ckb.cjs +2 -0
- package/node_modules/zod/v4/locales/ckb.js +2 -0
- package/node_modules/zod/v4/locales/cs.cjs +2 -0
- package/node_modules/zod/v4/locales/cs.js +2 -0
- package/node_modules/zod/v4/locales/da.cjs +2 -0
- package/node_modules/zod/v4/locales/da.js +2 -0
- package/node_modules/zod/v4/locales/de.cjs +2 -0
- package/node_modules/zod/v4/locales/de.js +2 -0
- package/node_modules/zod/v4/locales/el.cjs +2 -0
- package/node_modules/zod/v4/locales/el.js +2 -0
- package/node_modules/zod/v4/locales/en.cjs +2 -0
- package/node_modules/zod/v4/locales/en.js +2 -0
- package/node_modules/zod/v4/locales/eo.cjs +2 -0
- package/node_modules/zod/v4/locales/eo.js +2 -0
- package/node_modules/zod/v4/locales/es.cjs +2 -0
- package/node_modules/zod/v4/locales/es.js +2 -0
- package/node_modules/zod/v4/locales/fa.cjs +2 -0
- package/node_modules/zod/v4/locales/fa.js +2 -0
- package/node_modules/zod/v4/locales/fi.cjs +2 -0
- package/node_modules/zod/v4/locales/fi.js +2 -0
- package/node_modules/zod/v4/locales/fr-CA.cjs +2 -0
- package/node_modules/zod/v4/locales/fr-CA.js +2 -0
- package/node_modules/zod/v4/locales/fr.cjs +2 -0
- package/node_modules/zod/v4/locales/fr.js +2 -0
- package/node_modules/zod/v4/locales/gu.cjs +2 -0
- package/node_modules/zod/v4/locales/gu.js +2 -0
- package/node_modules/zod/v4/locales/he.cjs +2 -0
- package/node_modules/zod/v4/locales/he.js +2 -0
- package/node_modules/zod/v4/locales/hi.cjs +2 -0
- package/node_modules/zod/v4/locales/hi.js +2 -0
- package/node_modules/zod/v4/locales/hr.cjs +2 -0
- package/node_modules/zod/v4/locales/hr.js +2 -0
- package/node_modules/zod/v4/locales/hu.cjs +2 -0
- package/node_modules/zod/v4/locales/hu.js +2 -0
- package/node_modules/zod/v4/locales/hy.cjs +2 -0
- package/node_modules/zod/v4/locales/hy.js +2 -0
- package/node_modules/zod/v4/locales/id.cjs +2 -0
- package/node_modules/zod/v4/locales/id.js +2 -0
- package/node_modules/zod/v4/locales/index.cjs +22 -1
- package/node_modules/zod/v4/locales/index.d.cts +1 -0
- package/node_modules/zod/v4/locales/index.d.ts +1 -0
- package/node_modules/zod/v4/locales/index.js +1 -0
- package/node_modules/zod/v4/locales/is.cjs +2 -0
- package/node_modules/zod/v4/locales/is.js +2 -0
- package/node_modules/zod/v4/locales/it.cjs +2 -0
- package/node_modules/zod/v4/locales/it.js +2 -0
- package/node_modules/zod/v4/locales/ja.cjs +2 -0
- package/node_modules/zod/v4/locales/ja.js +2 -0
- package/node_modules/zod/v4/locales/ka.cjs +2 -0
- package/node_modules/zod/v4/locales/ka.js +2 -0
- package/node_modules/zod/v4/locales/km.cjs +2 -0
- package/node_modules/zod/v4/locales/km.js +2 -0
- package/node_modules/zod/v4/locales/kn.cjs +2 -0
- package/node_modules/zod/v4/locales/kn.js +2 -0
- package/node_modules/zod/v4/locales/ko.cjs +2 -0
- package/node_modules/zod/v4/locales/ko.js +2 -0
- package/node_modules/zod/v4/locales/lt.cjs +2 -0
- package/node_modules/zod/v4/locales/lt.js +2 -0
- package/node_modules/zod/v4/locales/mk.cjs +2 -0
- package/node_modules/zod/v4/locales/mk.js +2 -0
- package/node_modules/zod/v4/locales/ms.cjs +2 -0
- package/node_modules/zod/v4/locales/ms.js +2 -0
- package/node_modules/zod/v4/locales/ne.cjs +2 -0
- package/node_modules/zod/v4/locales/ne.js +2 -0
- package/node_modules/zod/v4/locales/nl.cjs +2 -0
- package/node_modules/zod/v4/locales/nl.js +2 -0
- package/node_modules/zod/v4/locales/nn.cjs +2 -0
- package/node_modules/zod/v4/locales/nn.js +2 -0
- package/node_modules/zod/v4/locales/no.cjs +2 -0
- package/node_modules/zod/v4/locales/no.js +2 -0
- package/node_modules/zod/v4/locales/ota.cjs +2 -0
- package/node_modules/zod/v4/locales/ota.js +2 -0
- package/node_modules/zod/v4/locales/pl.cjs +2 -0
- package/node_modules/zod/v4/locales/pl.js +2 -0
- package/node_modules/zod/v4/locales/ps.cjs +2 -0
- package/node_modules/zod/v4/locales/ps.js +2 -0
- package/node_modules/zod/v4/locales/pt-BR.cjs +2 -0
- package/node_modules/zod/v4/locales/pt-BR.js +2 -0
- package/node_modules/zod/v4/locales/pt.cjs +2 -0
- package/node_modules/zod/v4/locales/pt.js +2 -0
- package/node_modules/zod/v4/locales/ro.cjs +2 -0
- package/node_modules/zod/v4/locales/ro.js +2 -0
- package/node_modules/zod/v4/locales/ru.cjs +2 -0
- package/node_modules/zod/v4/locales/ru.js +2 -0
- package/node_modules/zod/v4/locales/sk.cjs +2 -0
- package/node_modules/zod/v4/locales/sk.js +2 -0
- package/node_modules/zod/v4/locales/sl.cjs +2 -0
- package/node_modules/zod/v4/locales/sl.js +2 -0
- package/node_modules/zod/v4/locales/sv.cjs +2 -0
- package/node_modules/zod/v4/locales/sv.js +2 -0
- package/node_modules/zod/v4/locales/ta.cjs +2 -0
- package/node_modules/zod/v4/locales/ta.js +2 -0
- package/node_modules/zod/v4/locales/tg.cjs +144 -0
- package/node_modules/zod/v4/locales/tg.d.cts +5 -0
- package/node_modules/zod/v4/locales/tg.d.ts +4 -0
- package/node_modules/zod/v4/locales/tg.js +117 -0
- package/node_modules/zod/v4/locales/th.cjs +2 -0
- package/node_modules/zod/v4/locales/th.js +2 -0
- package/node_modules/zod/v4/locales/tk.cjs +2 -0
- package/node_modules/zod/v4/locales/tk.js +2 -0
- package/node_modules/zod/v4/locales/tr.cjs +2 -0
- package/node_modules/zod/v4/locales/tr.js +2 -0
- package/node_modules/zod/v4/locales/uk.cjs +2 -0
- package/node_modules/zod/v4/locales/uk.js +2 -0
- package/node_modules/zod/v4/locales/ur.cjs +2 -0
- package/node_modules/zod/v4/locales/ur.js +2 -0
- package/node_modules/zod/v4/locales/uz.cjs +2 -0
- package/node_modules/zod/v4/locales/uz.js +2 -0
- package/node_modules/zod/v4/locales/vi.cjs +2 -0
- package/node_modules/zod/v4/locales/vi.js +2 -0
- package/node_modules/zod/v4/locales/yo.cjs +2 -0
- package/node_modules/zod/v4/locales/yo.js +2 -0
- package/node_modules/zod/v4/locales/zh-CN.cjs +2 -0
- package/node_modules/zod/v4/locales/zh-CN.js +2 -0
- package/node_modules/zod/v4/locales/zh-TW.cjs +2 -0
- package/node_modules/zod/v4/locales/zh-TW.js +2 -0
- package/node_modules/zod/v4/mini/checks.cjs +19 -0
- package/node_modules/zod/v4/mini/coerce.cjs +19 -0
- package/node_modules/zod/v4/mini/deep-partial.cjs +19 -0
- package/node_modules/zod/v4/mini/external.cjs +22 -1
- package/node_modules/zod/v4/mini/external.d.cts +1 -1
- package/node_modules/zod/v4/mini/external.d.ts +1 -1
- package/node_modules/zod/v4/mini/external.js +1 -1
- package/node_modules/zod/v4/mini/in-out.cjs +19 -0
- package/node_modules/zod/v4/mini/index.cjs +19 -0
- package/node_modules/zod/v4/mini/iso.cjs +19 -0
- package/node_modules/zod/v4/mini/parse.cjs +19 -0
- package/node_modules/zod/v4/mini/schemas.cjs +44 -8
- package/node_modules/zod/v4/mini/schemas.d.cts +6 -1
- package/node_modules/zod/v4/mini/schemas.d.ts +6 -1
- package/node_modules/zod/v4/mini/schemas.js +21 -6
- package/node_modules/zod/v4-mini/index.cjs +19 -0
- package/package.json +5 -5
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as mattermostPlugin } from "./channel-plugin-runtime-
|
|
2
|
-
import { t as mattermostSetupPlugin } from "./channel-plugin-api-
|
|
1
|
+
import { t as mattermostPlugin } from "./channel-plugin-runtime-yAOg5GcM.mjs";
|
|
2
|
+
import { t as mattermostSetupPlugin } from "./channel-plugin-api-CzBhdovL.mjs";
|
|
3
3
|
export { mattermostPlugin, mattermostSetupPlugin };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { s as isMattermostConfigured } from "./normalize-
|
|
2
|
-
import { a as describeMattermostAccount, i as MattermostChannelConfigSchema, n as mattermostSetupWizard, o as mattermostConfigAdapter, r as mattermostSetupContract, s as mattermostMeta } from "./channel-plugin-runtime-
|
|
1
|
+
import { s as isMattermostConfigured } from "./normalize-DM54w7ud.mjs";
|
|
2
|
+
import { a as describeMattermostAccount, i as MattermostChannelConfigSchema, n as mattermostSetupWizard, o as mattermostConfigAdapter, r as mattermostSetupContract, s as mattermostMeta } from "./channel-plugin-runtime-yAOg5GcM.mjs";
|
|
3
3
|
import { t as resolveMattermostGatewayAuthBypassPaths } from "./gateway-auth-bypass-B93t91oq.mjs";
|
|
4
4
|
//#region extensions/mattermost/src/channel.setup.ts
|
|
5
5
|
const mattermostSetupPlugin = {
|
package/dist/.setup/{channel-plugin-runtime-Ca4cZHq2.mjs → channel-plugin-runtime-yAOg5GcM.mjs}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { h as normalizeMattermostBaseUrl } from "./client-
|
|
1
|
+
import { h as normalizeMattermostBaseUrl } from "./client-BSSVve1x.mjs";
|
|
2
2
|
import { t as mattermostIngressIdentity } from "./ingress-identity-DNl4yQSc.mjs";
|
|
3
|
-
import { a as resolveMattermostPresentation, c as listMattermostAccountIds, d as resolveMattermostReplyToMode, f as buildSecretInputSchema, i as requiresMattermostMediaUpload, l as resolveDefaultMattermostAccountId, n as normalizeMattermostMessagingTarget, o as inspectMattermostAccount, p as hasConfiguredSecretInput, s as isMattermostConfigured$1, t as looksLikeMattermostTargetId, u as resolveMattermostAccount } from "./normalize-
|
|
3
|
+
import { a as resolveMattermostPresentation, c as listMattermostAccountIds, d as resolveMattermostReplyToMode, f as buildSecretInputSchema, i as requiresMattermostMediaUpload, l as resolveDefaultMattermostAccountId, n as normalizeMattermostMessagingTarget, o as inspectMattermostAccount, p as hasConfiguredSecretInput, s as isMattermostConfigured$1, t as looksLikeMattermostTargetId, u as resolveMattermostAccount } from "./normalize-DM54w7ud.mjs";
|
|
4
4
|
import { t as resolveMattermostGatewayAuthBypassPaths } from "./gateway-auth-bypass-B93t91oq.mjs";
|
|
5
5
|
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-mvORF4f6.mjs";
|
|
6
6
|
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-qg3NXRlS.mjs";
|
|
@@ -13,9 +13,9 @@ import { createLoggedPairingApprovalNotifier } from "openclaw/plugin-sdk/channel
|
|
|
13
13
|
import { createAccountStatusSink, createChannelMessageAdapterFromOutbound } from "openclaw/plugin-sdk/channel-outbound";
|
|
14
14
|
import { describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
|
|
15
15
|
import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$1, buildChannelOutboundSessionRoute, buildThreadAwareOutboundSessionRoute, stripChannelTargetPrefix, stripTargetKindPrefix } from "openclaw/plugin-sdk/core";
|
|
16
|
-
import { identityEntryAuthenticationClassifier } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
17
16
|
import { jsonResult, readPositiveIntegerParam, readStringArrayParam, readStringParam, withNormalizedTimestamp } from "openclaw/plugin-sdk/channel-actions";
|
|
18
17
|
import { createChannelConfigUiHints, createChatChannelPlugin } from "openclaw/plugin-sdk/channel-core";
|
|
18
|
+
import { identityEntryAuthenticationClassifier } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
19
19
|
import { buildChannelGroupsScopeTree, buildMutableAllowEntryDetector, collectStandardAllowlistLists, createDangerousNameMatchingMutableAllowlistWarningCollector, createRestrictSendersChannelSecurity, resolveScopeRequireMention } from "openclaw/plugin-sdk/channel-policy";
|
|
20
20
|
import { attachChannelToResult, createAttachedChannelResultAdapter } from "openclaw/plugin-sdk/channel-send-result";
|
|
21
21
|
import { createChannelDirectoryAdapter } from "openclaw/plugin-sdk/directory-runtime";
|
|
@@ -103,6 +103,23 @@ function describeMattermostAccount(account) {
|
|
|
103
103
|
});
|
|
104
104
|
}
|
|
105
105
|
//#endregion
|
|
106
|
+
//#region extensions/mattermost/src/channel-send-result.ts
|
|
107
|
+
function toMattermostOutboundResult(result) {
|
|
108
|
+
const { channelId, ...delivery } = result;
|
|
109
|
+
return {
|
|
110
|
+
...delivery,
|
|
111
|
+
target: {
|
|
112
|
+
kind: "channel",
|
|
113
|
+
id: channelId
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
function createMattermostDeliveryProgressReporter(onDeliveryResult) {
|
|
118
|
+
return onDeliveryResult ? async (result) => {
|
|
119
|
+
await onDeliveryResult(attachChannelToResult("mattermost", toMattermostOutboundResult(result)));
|
|
120
|
+
} : void 0;
|
|
121
|
+
}
|
|
122
|
+
//#endregion
|
|
106
123
|
//#region extensions/mattermost/src/config-schema-core.ts
|
|
107
124
|
const MattermostGroupSchema = buildGroupEntrySchema().omit({
|
|
108
125
|
tools: true,
|
|
@@ -598,7 +615,7 @@ const mattermostSetupWizard = {
|
|
|
598
615
|
};
|
|
599
616
|
//#endregion
|
|
600
617
|
//#region extensions/mattermost/src/channel.ts
|
|
601
|
-
const loadMattermostChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-
|
|
618
|
+
const loadMattermostChannelRuntime = createLazyRuntimeModule(() => import("./channel.runtime-CihvzY84.mjs"));
|
|
602
619
|
const MATTERMOST_PRESENTATION_CAPABILITIES = {
|
|
603
620
|
supported: true,
|
|
604
621
|
buttons: true,
|
|
@@ -868,21 +885,6 @@ function resolveMattermostSendAttachmentMedia(params) {
|
|
|
868
885
|
if (mediaUrls.length > 1) throw new Error("Mattermost send supports one attachment per message; split multiple mediaUrls or attachments[] entries into separate sends.");
|
|
869
886
|
return mediaUrls[0];
|
|
870
887
|
}
|
|
871
|
-
function toMattermostOutboundResult(result) {
|
|
872
|
-
const { channelId, ...delivery } = result;
|
|
873
|
-
return {
|
|
874
|
-
...delivery,
|
|
875
|
-
target: {
|
|
876
|
-
kind: "channel",
|
|
877
|
-
id: channelId
|
|
878
|
-
}
|
|
879
|
-
};
|
|
880
|
-
}
|
|
881
|
-
function createMattermostDeliveryProgressReporter(onDeliveryResult) {
|
|
882
|
-
return onDeliveryResult ? async (result) => {
|
|
883
|
-
await onDeliveryResult(attachChannelToResult("mattermost", toMattermostOutboundResult(result)));
|
|
884
|
-
} : void 0;
|
|
885
|
-
}
|
|
886
888
|
const mattermostOutbound = {
|
|
887
889
|
deliveryMode: "direct",
|
|
888
890
|
chunker: chunkTextForOutbound,
|
|
@@ -938,6 +940,8 @@ const mattermostOutbound = {
|
|
|
938
940
|
replyToId: ctx.replyToId ?? (ctx.threadId != null ? String(ctx.threadId) : void 0),
|
|
939
941
|
buttons: buttons?.length ? buttons : void 0,
|
|
940
942
|
attachmentText,
|
|
943
|
+
assertDirectAdapterHandoff: ctx.assertDirectAdapterHandoff,
|
|
944
|
+
onPlatformSendDispatch: ctx.onPlatformSendDispatch,
|
|
941
945
|
onDeliveryResult: createMattermostDeliveryProgressReporter(ctx.onDeliveryResult)
|
|
942
946
|
});
|
|
943
947
|
return attachChannelToResult("mattermost", toMattermostOutboundResult(result));
|
|
@@ -961,13 +965,15 @@ const mattermostOutbound = {
|
|
|
961
965
|
},
|
|
962
966
|
...createAttachedChannelResultAdapter({
|
|
963
967
|
channel: "mattermost",
|
|
964
|
-
sendText: async (
|
|
965
|
-
cfg,
|
|
966
|
-
accountId: accountId ?? void 0,
|
|
967
|
-
replyToId: replyToId ?? (threadId != null ? String(threadId) : void 0),
|
|
968
|
-
|
|
968
|
+
sendText: async (ctx) => toMattermostOutboundResult(await (await loadMattermostChannelRuntime()).sendMessageMattermost(ctx.to, ctx.text, {
|
|
969
|
+
cfg: ctx.cfg,
|
|
970
|
+
accountId: ctx.accountId ?? void 0,
|
|
971
|
+
replyToId: ctx.replyToId ?? (ctx.threadId != null ? String(ctx.threadId) : void 0),
|
|
972
|
+
assertDirectAdapterHandoff: ctx.assertDirectAdapterHandoff,
|
|
973
|
+
onPlatformSendDispatch: ctx.onPlatformSendDispatch,
|
|
974
|
+
onDeliveryResult: createMattermostDeliveryProgressReporter(ctx.onDeliveryResult)
|
|
969
975
|
})),
|
|
970
|
-
sendMedia: async ({ cfg, to, text, mediaUrl, mediaAccess, mediaLocalRoots, mediaReadFile, accountId, replyToId, threadId, onDeliveryResult }) => toMattermostOutboundResult(await (await loadMattermostChannelRuntime()).sendMessageMattermost(to, text, {
|
|
976
|
+
sendMedia: async ({ cfg, to, text, mediaUrl, mediaAccess, mediaLocalRoots, mediaReadFile, accountId, replyToId, threadId, assertDirectAdapterHandoff, onPlatformSendDispatch, onDeliveryResult }) => toMattermostOutboundResult(await (await loadMattermostChannelRuntime()).sendMessageMattermost(to, text, {
|
|
971
977
|
cfg,
|
|
972
978
|
accountId: accountId ?? void 0,
|
|
973
979
|
mediaUrl,
|
|
@@ -976,6 +982,8 @@ const mattermostOutbound = {
|
|
|
976
982
|
...mediaAccess?.workspaceDir ? { workspaceDir: mediaAccess.workspaceDir } : {},
|
|
977
983
|
requireMediaUpload: requiresMattermostMediaUpload(mediaUrl) ? true : void 0,
|
|
978
984
|
replyToId: replyToId ?? (threadId != null ? String(threadId) : void 0),
|
|
985
|
+
assertDirectAdapterHandoff,
|
|
986
|
+
onPlatformSendDispatch,
|
|
979
987
|
onDeliveryResult: createMattermostDeliveryProgressReporter(onDeliveryResult)
|
|
980
988
|
}))
|
|
981
989
|
})
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { n as getOptionalMattermostRuntime, t as getMattermostRuntime } from "./runtime-CNB4YGqJ.mjs";
|
|
2
|
-
import { a as resolveInteractionCallbackPath, c as setInteractionSecret, i as createMattermostInteractionHandler, n as buildButtonProps, r as computeInteractionCallbackUrl, s as setInteractionCallbackUrl } from "./interactions-
|
|
3
|
-
import { _ as readMattermostError, a as createMattermostPost, d as fetchMattermostUser, h as normalizeMattermostBaseUrl, l as fetchMattermostChannelPosts, m as isRetryableError, n as buildMattermostApiUrl, o as deleteMattermostPost, p as fetchMattermostUserTeams, r as createMattermostClient, s as fetchMattermostChannel, t as MattermostPostSchema, u as fetchMattermostMe, v as sendMattermostTyping, y as updateMattermostPost } from "./client-
|
|
4
|
-
import { C as resolveAllowlistProviderRuntimeGroupPolicy$1, E as resolveDefaultGroupPolicy, O as warnMissingProviderGroupPolicyFallbackOnce, S as registerPluginHttpRoute, _ as listSkillCommandsForAgents, a as resolveMattermostMonitorInboundAccess, b as logTypingFailure, c as DEFAULT_GROUP_HISTORY_LIMIT, d as createChannelMessageReplyPipeline, f as createChannelPairingController, l as buildPreparedModelsProviderData, m as isDangerousNameMatchingEnabled, n as formatMattermostDirectMessageDropLog, o as resolveMattermostTrustedChatKind, s as shouldRetainMattermostSenderHistory, t as authorizeMattermostCommandInvocation, u as createChannelHistoryWindow, w as resolveChannelMediaMaxBytes, y as logInboundDrop } from "./monitor-auth-
|
|
2
|
+
import { a as resolveInteractionCallbackPath, c as setInteractionSecret, i as createMattermostInteractionHandler, n as buildButtonProps, r as computeInteractionCallbackUrl, s as setInteractionCallbackUrl } from "./interactions-rBQWCbK8.mjs";
|
|
3
|
+
import { _ as readMattermostError, a as createMattermostPost, d as fetchMattermostUser, h as normalizeMattermostBaseUrl, l as fetchMattermostChannelPosts, m as isRetryableError, n as buildMattermostApiUrl, o as deleteMattermostPost, p as fetchMattermostUserTeams, r as createMattermostClient, s as fetchMattermostChannel, t as MattermostPostSchema, u as fetchMattermostMe, v as sendMattermostTyping, y as updateMattermostPost } from "./client-BSSVve1x.mjs";
|
|
4
|
+
import { C as resolveAllowlistProviderRuntimeGroupPolicy$1, E as resolveDefaultGroupPolicy, O as warnMissingProviderGroupPolicyFallbackOnce, S as registerPluginHttpRoute, _ as listSkillCommandsForAgents, a as resolveMattermostMonitorInboundAccess, b as logTypingFailure, c as DEFAULT_GROUP_HISTORY_LIMIT, d as createChannelMessageReplyPipeline, f as createChannelPairingController, l as buildPreparedModelsProviderData, m as isDangerousNameMatchingEnabled, n as formatMattermostDirectMessageDropLog, o as resolveMattermostTrustedChatKind, s as shouldRetainMattermostSenderHistory, t as authorizeMattermostCommandInvocation, u as createChannelHistoryWindow, w as resolveChannelMediaMaxBytes, y as logInboundDrop } from "./monitor-auth-CCpN0z_f.mjs";
|
|
5
5
|
import { n as normalizeMattermostAllowEntry } from "./ingress-identity-DNl4yQSc.mjs";
|
|
6
|
-
import { c as listMattermostAccountIds, d as resolveMattermostReplyToMode, n as normalizeMattermostMessagingTarget, o as inspectMattermostAccount, r as parseMattermostQuestionContext, u as resolveMattermostAccount } from "./normalize-
|
|
7
|
-
import { _ as registerSlashCommands, a as sendMessageMattermost, c as joinMattermostVisibleContent, d as renderMattermostModelsPickerView, f as renderMattermostProviderPickerView, g as isSlashCommandsEnabled, h as cleanupSlashCommands, l as buildMattermostAllowedModelRefs, m as DEFAULT_COMMAND_SPECS, n as deactivateSlashCommands, o as resolveMattermostOpaqueTarget, p as resolveMattermostModelPickerCurrentModel, r as getSlashCommandState, s as deliverMattermostReplyPayload, t as activateSlashCommands, u as parseMattermostModelPickerContext, v as resolveCallbackUrl, y as resolveSlashCommandConfig } from "./slash-state-
|
|
6
|
+
import { c as listMattermostAccountIds, d as resolveMattermostReplyToMode, n as normalizeMattermostMessagingTarget, o as inspectMattermostAccount, r as parseMattermostQuestionContext, u as resolveMattermostAccount } from "./normalize-DM54w7ud.mjs";
|
|
7
|
+
import { _ as registerSlashCommands, a as sendMessageMattermost, c as joinMattermostVisibleContent, d as renderMattermostModelsPickerView, f as renderMattermostProviderPickerView, g as isSlashCommandsEnabled, h as cleanupSlashCommands, l as buildMattermostAllowedModelRefs, m as DEFAULT_COMMAND_SPECS, n as deactivateSlashCommands, o as resolveMattermostOpaqueTarget, p as resolveMattermostModelPickerCurrentModel, r as getSlashCommandState, s as deliverMattermostReplyPayload, t as activateSlashCommands, u as parseMattermostModelPickerContext, v as resolveCallbackUrl, y as resolveSlashCommandConfig } from "./slash-state-DfnmzXMr.mjs";
|
|
8
8
|
import { randomUUID } from "node:crypto";
|
|
9
9
|
import { resolveGatewayPort } from "openclaw/plugin-sdk/gateway-config-runtime";
|
|
10
10
|
import { resolvePinnedMainDmOwnerFromAllowlist, sanitizeUntrustedFileName } from "openclaw/plugin-sdk/security-runtime";
|
|
@@ -12,11 +12,11 @@ import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeStri
|
|
|
12
12
|
import { buildChannelInboundMediaPayload, createAcceptedChannelDeliveryResult, createChannelPartialDeliveryError, formatInboundEnvelope, formatInboundFromLabel, formatInboundMediaUnavailableText, formatMediaPlaceholderText, implicitMentionKindWhen, isChannelPartialDeliveryError, resolveInboundMentionDecision, resolveInboundSessionEnvelopeContext, toInboundMediaFactsWithMetadata } from "openclaw/plugin-sdk/channel-inbound";
|
|
13
13
|
import { formatErrorMessage, toErrorObject } from "openclaw/plugin-sdk/error-runtime";
|
|
14
14
|
import { safeParseJsonWithSchema, safeParseWithSchema } from "openclaw/plugin-sdk/extension-shared";
|
|
15
|
-
import { asDateTimestampMs, resolveExpiresAtMsFromDurationMs, resolveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";
|
|
15
|
+
import { asDateTimestampMs, resolveExpiresAtMsFromDurationMs, resolvePromptHistoryLimit, resolveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";
|
|
16
16
|
import { readProviderJsonResponse } from "openclaw/plugin-sdk/provider-http";
|
|
17
17
|
import { fetchWithSsrFGuard, isPrivateNetworkOptInEnabled, ssrfPolicyFromPrivateNetworkOptIn } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
18
18
|
import { z } from "zod";
|
|
19
|
-
import { bindIngressLifecycleToReplyOptions,
|
|
19
|
+
import { bindIngressLifecycleToReplyOptions, createChannelIngressError, createChannelIngressMonitor, createChannelProgressDraftCompositor, createFinalizableDraftLifecycle, createLivePreviewLifecycle, createMessageReceiptFromOutboundResults, createPreviewMessageReceipt, listMessageReceiptPlatformIds, resolveChannelStreamingPreviewToolProgress } from "openclaw/plugin-sdk/channel-outbound";
|
|
20
20
|
import { resolveAllowlistProviderRuntimeGroupPolicy } from "openclaw/plugin-sdk/runtime-group-policy";
|
|
21
21
|
import { rawDataToString } from "openclaw/plugin-sdk/webhook-ingress";
|
|
22
22
|
import { runDetachedWebhookWork } from "openclaw/plugin-sdk/webhook-request-guards";
|
|
@@ -1959,11 +1959,11 @@ function createMattermostDraftStream(params) {
|
|
|
1959
1959
|
}
|
|
1960
1960
|
//#endregion
|
|
1961
1961
|
//#region extensions/mattermost/src/mattermost/monitor-draft-delivery.ts
|
|
1962
|
-
function combineMattermostVisibleDeliveryResults(results) {
|
|
1962
|
+
function combineMattermostVisibleDeliveryResults(results, outcome) {
|
|
1963
1963
|
const visibleResults = results.filter((result) => result?.visibleReplySent === true);
|
|
1964
1964
|
if (visibleResults.length === 0) return;
|
|
1965
1965
|
return {
|
|
1966
|
-
outcome
|
|
1966
|
+
outcome,
|
|
1967
1967
|
...createAcceptedChannelDeliveryResult({
|
|
1968
1968
|
deliveryResults: visibleResults,
|
|
1969
1969
|
content: joinMattermostVisibleContent(visibleResults.map((result) => result.content))
|
|
@@ -1976,35 +1976,30 @@ async function deliverMattermostReplyWithDraftPreview(params) {
|
|
|
1976
1976
|
visibleReplySent: false,
|
|
1977
1977
|
suppression: { reason: "no_visible_result" }
|
|
1978
1978
|
};
|
|
1979
|
-
let
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
let previewFinalTextAlreadyDelivered =
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1979
|
+
let outcome = "text";
|
|
1980
|
+
const ttsSupplement = getReplyPayloadTtsSupplement(params.payload);
|
|
1981
|
+
const previewFinalResolution = params.info.kind === "final" && !params.previewLifecycle.previewFinalized ? params.resolvePreviewFinalText(params.payload.text ?? ttsSupplement?.spokenText) : void 0;
|
|
1982
|
+
const confirmedPreviewDelivery = previewFinalResolution?.confirmedDelivery;
|
|
1983
|
+
const previewFinalDeliveryText = previewFinalResolution?.deliveryText;
|
|
1984
|
+
let previewFinalTextAlreadyDelivered = previewFinalResolution?.alreadyDelivered === true && params.payload.isError !== true;
|
|
1985
|
+
if (previewFinalTextAlreadyDelivered && !resolveSendableOutboundReplyParts(params.payload).hasMedia && !params.payload.presentation && confirmedPreviewDelivery?.visibleReplySent) try {
|
|
1986
|
+
await params.previewLifecycle.observeDelivery(confirmedPreviewDelivery);
|
|
1987
|
+
await params.recordThreadParticipation?.();
|
|
1988
|
+
return confirmedPreviewDelivery;
|
|
1989
|
+
} catch (error) {
|
|
1990
|
+
throw createChannelPartialDeliveryError(error, {
|
|
1991
|
+
...confirmedPreviewDelivery,
|
|
1992
|
+
visibleReplySent: true
|
|
1993
|
+
});
|
|
1994
|
+
}
|
|
1988
1995
|
try {
|
|
1989
|
-
|
|
1996
|
+
return combineMattermostVisibleDeliveryResults([confirmedPreviewDelivery, (await params.previewLifecycle.deliver({
|
|
1990
1997
|
kind: params.info.kind,
|
|
1991
1998
|
payload: params.payload,
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
flush: params.draftStream.flush,
|
|
1995
|
-
clear: params.draftStream.clear,
|
|
1996
|
-
discardPending: params.draftStream.discardPending,
|
|
1997
|
-
seal: params.draftStream.seal,
|
|
1998
|
-
id: params.draftStream.postId
|
|
1999
|
-
} },
|
|
1999
|
+
isError: params.payload.isError,
|
|
2000
|
+
adapter: {
|
|
2000
2001
|
buildFinalEdit: (payload) => {
|
|
2001
2002
|
const hasMedia = Boolean(payload.mediaUrl) || (payload.mediaUrls?.length ?? 0) > 0;
|
|
2002
|
-
const ttsSupplement = getReplyPayloadTtsSupplement(payload);
|
|
2003
|
-
const previewFinalResolution = params.resolvePreviewFinalText(payload.text ?? ttsSupplement?.spokenText);
|
|
2004
|
-
confirmedPreviewDelivery = previewFinalResolution?.confirmedDelivery;
|
|
2005
|
-
previewFinalDeliveryText = previewFinalResolution?.deliveryText;
|
|
2006
|
-
previewFinalTextAlreadyDelivered = previewFinalResolution?.alreadyDelivered === true && payload.isError !== true;
|
|
2007
|
-
useConfirmedPreviewAsWholeFinal = previewFinalTextAlreadyDelivered && !resolveSendableOutboundReplyParts(payload).hasMedia && !payload.presentation;
|
|
2008
2003
|
const previewFinalText = previewFinalResolution?.editText;
|
|
2009
2004
|
if (hasMedia && !ttsSupplement || typeof previewFinalText !== "string" || payload.isError || payload.presentation || !canFinalizeMattermostPreviewInPlace({
|
|
2010
2005
|
kind: params.kind,
|
|
@@ -2012,36 +2007,33 @@ async function deliverMattermostReplyWithDraftPreview(params) {
|
|
|
2012
2007
|
threadRootId: params.effectiveReplyToId,
|
|
2013
2008
|
replyToId: payload.replyToId
|
|
2014
2009
|
})) return;
|
|
2015
|
-
pendingPreviewFinalContent = previewFinalText;
|
|
2016
2010
|
return { message: previewFinalText };
|
|
2017
2011
|
},
|
|
2018
2012
|
editFinal: async (previewPostId, edit) => {
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
params.previewState.finalizedViaPreviewPost = true;
|
|
2024
|
-
previewFinalTextAlreadyDelivered = true;
|
|
2025
|
-
previewDeliveryResult = {
|
|
2026
|
-
outcome: "text",
|
|
2027
|
-
messageIds: listMessageReceiptPlatformIds(receipt),
|
|
2013
|
+
const post = await updateMattermostPost(params.client, previewPostId, edit);
|
|
2014
|
+
const receipt = createPreviewMessageReceipt({ id: post.id ?? previewPostId });
|
|
2015
|
+
return {
|
|
2016
|
+
messageIds: receipt.platformMessageIds,
|
|
2028
2017
|
receipt,
|
|
2029
2018
|
visibleReplySent: true,
|
|
2030
|
-
content:
|
|
2019
|
+
content: post.message ?? edit.message
|
|
2031
2020
|
};
|
|
2021
|
+
},
|
|
2022
|
+
onPreviewFinalized: async () => {
|
|
2023
|
+
previewFinalTextAlreadyDelivered = true;
|
|
2032
2024
|
await params.recordThreadParticipation?.();
|
|
2033
2025
|
},
|
|
2034
2026
|
buildSupplementalPayload: (payload) => getReplyPayloadTtsSupplement(payload) ? buildTtsSupplementMediaPayload(payload) : void 0,
|
|
2035
2027
|
deliverSupplemental: async (payload) => {
|
|
2036
|
-
|
|
2037
|
-
|
|
2028
|
+
const delivered = await params.deliverPayload(payload);
|
|
2029
|
+
if (delivered.outcome === "media") outcome = "media";
|
|
2030
|
+
return delivered.visibleReplySent ? delivered : false;
|
|
2038
2031
|
},
|
|
2039
2032
|
logPreviewEditFailure: (err) => {
|
|
2040
2033
|
params.logVerboseMessage(`mattermost preview final edit failed; falling back to normal send (${String(err)})`);
|
|
2041
2034
|
}
|
|
2042
|
-
}
|
|
2035
|
+
},
|
|
2043
2036
|
deliverNormally: async (payload) => {
|
|
2044
|
-
if (useConfirmedPreviewAsWholeFinal && confirmedPreviewDelivery?.visibleReplySent === true) return true;
|
|
2045
2037
|
const supplement = getReplyPayloadTtsSupplement(payload);
|
|
2046
2038
|
const resolvedDeliveryText = previewFinalDeliveryText ?? (previewFinalTextAlreadyDelivered ? "" : void 0);
|
|
2047
2039
|
const payloadText = payload.text?.trim();
|
|
@@ -2052,38 +2044,22 @@ async function deliverMattermostReplyWithDraftPreview(params) {
|
|
|
2052
2044
|
...payload,
|
|
2053
2045
|
text: resolvedDeliveryText
|
|
2054
2046
|
} : payload;
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2047
|
+
const delivered = await params.deliverPayload(deliveryPayload);
|
|
2048
|
+
if (delivered.outcome === "media") outcome = "media";
|
|
2049
|
+
return delivered;
|
|
2050
|
+
},
|
|
2051
|
+
onNormalDelivered: params.recordThreadParticipation
|
|
2052
|
+
})).deliveryResult], outcome) ?? {
|
|
2059
2053
|
outcome: "empty",
|
|
2060
2054
|
visibleReplySent: false,
|
|
2061
2055
|
suppression: { reason: "no_visible_result" }
|
|
2062
2056
|
};
|
|
2063
|
-
return combineMattermostVisibleDeliveryResults([
|
|
2064
|
-
confirmedPreviewDelivery,
|
|
2065
|
-
previewDeliveryResult,
|
|
2066
|
-
supplementalDeliveryResult,
|
|
2067
|
-
normalDeliveryResult
|
|
2068
|
-
]) ?? previewDeliveryResult;
|
|
2069
2057
|
} catch (error) {
|
|
2070
|
-
|
|
2071
|
-
confirmedPreviewDelivery,
|
|
2072
|
-
previewDeliveryResult,
|
|
2073
|
-
normalDeliveryResult,
|
|
2074
|
-
supplementalDeliveryResult
|
|
2075
|
-
].filter((result) => result?.visibleReplySent === true);
|
|
2076
|
-
if (completedVisibleResults.length === 0) throw error;
|
|
2058
|
+
if (!confirmedPreviewDelivery?.visibleReplySent) throw error;
|
|
2077
2059
|
const failedPartial = isChannelPartialDeliveryError(error) ? error.deliveryResult : void 0;
|
|
2078
2060
|
throw createChannelPartialDeliveryError(error, createAcceptedChannelDeliveryResult({
|
|
2079
|
-
deliveryResults: [
|
|
2080
|
-
content: joinMattermostVisibleContent([
|
|
2081
|
-
confirmedPreviewDelivery?.content,
|
|
2082
|
-
previewDeliveryResult?.content,
|
|
2083
|
-
normalDeliveryResult?.content,
|
|
2084
|
-
supplementalDeliveryResult?.content,
|
|
2085
|
-
failedPartial?.content
|
|
2086
|
-
])
|
|
2061
|
+
deliveryResults: [confirmedPreviewDelivery, ...failedPartial ? [failedPartial] : []],
|
|
2062
|
+
content: joinMattermostVisibleContent([confirmedPreviewDelivery.content, failedPartial?.content])
|
|
2087
2063
|
}));
|
|
2088
2064
|
}
|
|
2089
2065
|
}
|
|
@@ -2178,6 +2154,7 @@ async function dispatchMattermostInboundTurn(monitor, params) {
|
|
|
2178
2154
|
let blockPreviewActivity = "none";
|
|
2179
2155
|
let blockPreviewAssistantMessagePending = false;
|
|
2180
2156
|
const progressDraft = createChannelProgressDraftCompositor({
|
|
2157
|
+
preparedItems: true,
|
|
2181
2158
|
entry: account.config,
|
|
2182
2159
|
mode: account.streamingMode,
|
|
2183
2160
|
active: draftPreviewEnabled,
|
|
@@ -2201,7 +2178,18 @@ async function dispatchMattermostInboundTurn(monitor, params) {
|
|
|
2201
2178
|
if (activity === "tool") lastPartialText = "";
|
|
2202
2179
|
return boundarySettled;
|
|
2203
2180
|
};
|
|
2204
|
-
const
|
|
2181
|
+
const previewLifecycle = createLivePreviewLifecycle({
|
|
2182
|
+
draft: draftPreviewEnabled ? {
|
|
2183
|
+
flush: draftStream.flush,
|
|
2184
|
+
id: draftStream.postId,
|
|
2185
|
+
seal: draftStream.seal,
|
|
2186
|
+
discardPending: draftStream.discardPending,
|
|
2187
|
+
clear: draftStream.clear
|
|
2188
|
+
} : void 0,
|
|
2189
|
+
onFinalStarted: () => progressDraft.markFinalReplyStarted(),
|
|
2190
|
+
onFinalDelivered: () => progressDraft.markFinalReplyDelivered(),
|
|
2191
|
+
onCleanupFailure: (err) => monitor.logVerboseMessage(`mattermost draft preview cleanup failed: ${String(err)}`)
|
|
2192
|
+
});
|
|
2205
2193
|
const resolvePreviewFinalText = (text) => {
|
|
2206
2194
|
const resolution = draftStream.resolveFinalText(typeof text === "string" ? text : "");
|
|
2207
2195
|
const confirmedDelivery = resolution.publishedParts.length > 0 ? (() => {
|
|
@@ -2277,7 +2265,6 @@ async function dispatchMattermostInboundTurn(monitor, params) {
|
|
|
2277
2265
|
if (info.kind === "final") {
|
|
2278
2266
|
await enterBlockPreviewActivity("text");
|
|
2279
2267
|
await draftStream.settleBoundaries();
|
|
2280
|
-
progressDraft.markFinalReplyStarted();
|
|
2281
2268
|
}
|
|
2282
2269
|
let threadParticipationRecorded = false;
|
|
2283
2270
|
const markThreadParticipation = async () => {
|
|
@@ -2291,10 +2278,9 @@ async function dispatchMattermostInboundTurn(monitor, params) {
|
|
|
2291
2278
|
info,
|
|
2292
2279
|
kind,
|
|
2293
2280
|
client,
|
|
2294
|
-
|
|
2281
|
+
previewLifecycle,
|
|
2295
2282
|
effectiveReplyToId,
|
|
2296
2283
|
resolvePreviewFinalText,
|
|
2297
|
-
previewState,
|
|
2298
2284
|
logVerboseMessage: monitor.logVerboseMessage,
|
|
2299
2285
|
recordThreadParticipation: markThreadParticipation,
|
|
2300
2286
|
deliverPayload: async (payloadToDeliver) => {
|
|
@@ -2318,12 +2304,7 @@ async function dispatchMattermostInboundTurn(monitor, params) {
|
|
|
2318
2304
|
textLimit,
|
|
2319
2305
|
tableMode,
|
|
2320
2306
|
sendMessage: sendMessageMattermost
|
|
2321
|
-
}).catch(async (error) => {
|
|
2322
|
-
if (isChannelPartialDeliveryError(error)) await markThreadParticipation();
|
|
2323
|
-
throw error;
|
|
2324
2307
|
});
|
|
2325
|
-
if (deliveryResult.outcome === "text" || deliveryResult.outcome === "media") await markThreadParticipation();
|
|
2326
|
-
else if (deliveryResult.outcome === "empty" && finalTextResolution?.kind === "already-delivered") await markThreadParticipation();
|
|
2327
2308
|
const deliveryLog = formatMattermostFinalDeliveryOutcomeLog({
|
|
2328
2309
|
outcome: deliveryResult.outcome,
|
|
2329
2310
|
payload: resolvedPayload,
|
|
@@ -2335,14 +2316,10 @@ async function dispatchMattermostInboundTurn(monitor, params) {
|
|
|
2335
2316
|
return deliveryResult;
|
|
2336
2317
|
}
|
|
2337
2318
|
}).catch(async (error) => {
|
|
2338
|
-
if (isChannelPartialDeliveryError(error))
|
|
2339
|
-
await markThreadParticipation();
|
|
2340
|
-
if (info.kind === "final") progressDraft.markFinalReplyDelivered();
|
|
2341
|
-
}
|
|
2319
|
+
if (isChannelPartialDeliveryError(error)) await markThreadParticipation();
|
|
2342
2320
|
throw error;
|
|
2343
2321
|
});
|
|
2344
2322
|
if (result.visibleReplySent) await markThreadParticipation();
|
|
2345
|
-
if (info.kind === "final") progressDraft.markFinalReplyDelivered();
|
|
2346
2323
|
return result;
|
|
2347
2324
|
},
|
|
2348
2325
|
onError: (err, info) => {
|
|
@@ -2404,10 +2381,12 @@ async function dispatchMattermostInboundTurn(monitor, params) {
|
|
|
2404
2381
|
dispatcherOptions,
|
|
2405
2382
|
delivery,
|
|
2406
2383
|
replyOptions: {
|
|
2384
|
+
progressPreambleEnabled: draftProgressEnabled,
|
|
2385
|
+
commentaryProgressEnabled: progressDraft.commentaryProgressEnabled,
|
|
2407
2386
|
...turnAdoptionLifecycle ? bindIngressLifecycleToReplyOptions(turnAdoptionLifecycle) : {},
|
|
2408
2387
|
allowProgressCallbacksWhenSourceDeliverySuppressed: draftProgressEnabled ? true : void 0,
|
|
2409
2388
|
preserveProgressCallbackStartOrder: draftPreviewEnabled ? true : void 0,
|
|
2410
|
-
onObservedReplyDelivery:
|
|
2389
|
+
onObservedReplyDelivery: draftPreviewEnabled ? () => previewLifecycle.observeDelivery({ visibleReplySent: true }) : void 0,
|
|
2411
2390
|
disableBlockStreaming: draftPreviewEnabled ? true : replyOptions.disableBlockStreaming,
|
|
2412
2391
|
...suppressDefaultToolProgressMessages ? { suppressDefaultToolProgressMessages: true } : {},
|
|
2413
2392
|
onModelSelected,
|
|
@@ -2447,23 +2426,10 @@ async function dispatchMattermostInboundTurn(monitor, params) {
|
|
|
2447
2426
|
const [, visible] = await Promise.all([boundarySettled, progressSettled]);
|
|
2448
2427
|
return visible;
|
|
2449
2428
|
},
|
|
2450
|
-
onToolStart:
|
|
2451
|
-
if (!draftProgressEnabled) return false;
|
|
2452
|
-
const boundarySettled = enterBlockPreviewActivity("tool");
|
|
2453
|
-
const progressSettled = progressDraft.pushToolProgress(buildChannelProgressDraftLineForEntry(account.config, {
|
|
2454
|
-
event: "tool",
|
|
2455
|
-
itemId: payloadValue.itemId,
|
|
2456
|
-
toolCallId: payloadValue.toolCallId,
|
|
2457
|
-
name: payloadValue.name,
|
|
2458
|
-
phase: payloadValue.phase,
|
|
2459
|
-
args: payloadValue.args
|
|
2460
|
-
}, payloadValue.detailMode ? { detailMode: payloadValue.detailMode } : void 0), { startImmediately: true });
|
|
2461
|
-
previewBoundaryController.noteUpdate();
|
|
2462
|
-
const [, visible] = await Promise.all([boundarySettled, progressSettled]);
|
|
2463
|
-
return visible;
|
|
2464
|
-
},
|
|
2429
|
+
onToolStart: (payload) => progressDraft.pushToolEvent(payload),
|
|
2465
2430
|
onItemEvent: async (payloadLocal) => {
|
|
2466
2431
|
if (!draftProgressEnabled) return false;
|
|
2432
|
+
if (payloadLocal.hideFromChannelProgress || payloadLocal.suppressChannelProgress) return progressDraft.pushItemEvent(payloadLocal);
|
|
2467
2433
|
const boundarySettled = enterBlockPreviewActivity("tool");
|
|
2468
2434
|
const progressSettled = progressDraft.pushItemEvent(payloadLocal);
|
|
2469
2435
|
previewBoundaryController.noteUpdate();
|
|
@@ -2477,6 +2443,7 @@ async function dispatchMattermostInboundTurn(monitor, params) {
|
|
|
2477
2443
|
} finally {
|
|
2478
2444
|
try {
|
|
2479
2445
|
await draftStream.stop();
|
|
2446
|
+
await previewLifecycle.cleanup();
|
|
2480
2447
|
} catch (err) {
|
|
2481
2448
|
monitor.logVerboseMessage(`mattermost draft preview cleanup failed: ${String(err)}`);
|
|
2482
2449
|
}
|
|
@@ -2494,7 +2461,7 @@ function createMattermostPostHandler(monitor) {
|
|
|
2494
2461
|
});
|
|
2495
2462
|
const { resolveMattermostMedia, resolveUserInfo } = resources;
|
|
2496
2463
|
const channelHistories = /* @__PURE__ */ new Map();
|
|
2497
|
-
const historyLimit =
|
|
2464
|
+
const historyLimit = resolvePromptHistoryLimit(account.config.historyLimit ?? cfg.messages?.groupChat?.historyLimit, DEFAULT_GROUP_HISTORY_LIMIT);
|
|
2498
2465
|
const recoverThread = createMattermostThreadBackfill({
|
|
2499
2466
|
monitor,
|
|
2500
2467
|
channelHistories,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
2
2
|
import { bufferToBlobPart } from "openclaw/plugin-sdk/blob-runtime";
|
|
3
3
|
import { createChannelPartialDeliveryError } from "openclaw/plugin-sdk/channel-inbound";
|
|
4
|
-
import { collectErrorGraphCandidates } from "openclaw/plugin-sdk/error-runtime";
|
|
4
|
+
import { PlatformMessageNotDispatchedError, collectErrorGraphCandidates } from "openclaw/plugin-sdk/error-runtime";
|
|
5
5
|
import { buildTimeoutAbortSignal } from "openclaw/plugin-sdk/extension-shared";
|
|
6
6
|
import { captureChannelReadAuthority, responseWithRelease } from "openclaw/plugin-sdk/fetch-runtime";
|
|
7
7
|
import { resolveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";
|
|
@@ -82,17 +82,36 @@ function createMattermostClient(params) {
|
|
|
82
82
|
const apiBaseUrl = `${baseUrl}/api/v4`;
|
|
83
83
|
const token = params.botToken.trim();
|
|
84
84
|
const requestTimeoutMs = resolveTimerTimeoutMs(params.timeoutMs, MATTERMOST_REQUEST_TIMEOUT_MS);
|
|
85
|
+
const assertSenderCurrent = params.assertRequestCurrent;
|
|
86
|
+
let postDispatchStarted = false;
|
|
87
|
+
const assertRequestCurrent = assertSenderCurrent ? () => {
|
|
88
|
+
try {
|
|
89
|
+
assertSenderCurrent();
|
|
90
|
+
} catch (error) {
|
|
91
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
92
|
+
if (postDispatchStarted) throw new AggregateError([error, /* @__PURE__ */ new Error("A Mattermost post request was already dispatched")], message, { cause: error });
|
|
93
|
+
throw new PlatformMessageNotDispatchedError(message, {
|
|
94
|
+
cause: error,
|
|
95
|
+
retryable: false
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
} : void 0;
|
|
85
99
|
const externalFetchImpl = params.fetchImpl;
|
|
86
100
|
const guardedFetchImpl = async (input, init) => {
|
|
87
101
|
const assertReadAuthority = captureChannelReadAuthority();
|
|
88
102
|
assertReadAuthority?.();
|
|
103
|
+
assertRequestCurrent?.();
|
|
89
104
|
const url = typeof input === "string" ? input : input instanceof URL ? input.toString() : input.url;
|
|
90
|
-
const { timeoutMs: initTimeoutMs, ...requestInit } = init ?? {};
|
|
105
|
+
const { timeoutMs: initTimeoutMs, isMessagePost, ...requestInit } = init ?? {};
|
|
91
106
|
const timeoutMs = resolveTimerTimeoutMs(initTimeoutMs, requestTimeoutMs);
|
|
92
107
|
const { response, release } = await fetchWithSsrFGuard({
|
|
93
108
|
url,
|
|
94
109
|
init: requestInit,
|
|
95
|
-
beforeRequest:
|
|
110
|
+
beforeRequest: () => {
|
|
111
|
+
assertReadAuthority?.();
|
|
112
|
+
assertRequestCurrent?.();
|
|
113
|
+
if (isMessagePost) postDispatchStarted = true;
|
|
114
|
+
},
|
|
96
115
|
auditContext: "mattermost-api",
|
|
97
116
|
policy: ssrfPolicyFromPrivateNetworkOptIn(params.allowPrivateNetwork),
|
|
98
117
|
signal: requestInit.signal ?? void 0,
|
|
@@ -103,7 +122,7 @@ function createMattermostClient(params) {
|
|
|
103
122
|
const fetchImpl = (externalFetchImpl ? async (input, init) => {
|
|
104
123
|
captureChannelReadAuthority()?.();
|
|
105
124
|
const url = typeof input === "string" ? input : input instanceof URL ? input.toString() : input.url;
|
|
106
|
-
const { timeoutMs: initTimeoutMs, ...requestInit } = init ?? {};
|
|
125
|
+
const { timeoutMs: initTimeoutMs, isMessagePost, ...requestInit } = init ?? {};
|
|
107
126
|
const timeoutMs = resolveTimerTimeoutMs(initTimeoutMs, requestTimeoutMs);
|
|
108
127
|
const { signal: timeoutSignal, cleanup } = buildTimeoutAbortSignal({
|
|
109
128
|
timeoutMs,
|
|
@@ -113,6 +132,8 @@ function createMattermostClient(params) {
|
|
|
113
132
|
const callerSignal = requestInit.signal ?? void 0;
|
|
114
133
|
const signal = callerSignal && timeoutSignal ? AbortSignal.any([callerSignal, timeoutSignal]) : callerSignal ?? timeoutSignal;
|
|
115
134
|
try {
|
|
135
|
+
assertRequestCurrent?.();
|
|
136
|
+
if (isMessagePost) postDispatchStarted = true;
|
|
116
137
|
const response = await externalFetchImpl(input, {
|
|
117
138
|
...requestInit,
|
|
118
139
|
signal
|
|
@@ -128,9 +149,11 @@ function createMattermostClient(params) {
|
|
|
128
149
|
const headers = new Headers(init?.headers);
|
|
129
150
|
headers.set("Authorization", `Bearer ${token}`);
|
|
130
151
|
if (typeof init?.body === "string" && !headers.has("Content-Type")) headers.set("Content-Type", "application/json");
|
|
152
|
+
const isMessagePost = path === "/posts" && init?.method?.toUpperCase() === "POST";
|
|
131
153
|
const res = await fetchImpl(url, {
|
|
132
154
|
...init,
|
|
133
|
-
headers
|
|
155
|
+
headers,
|
|
156
|
+
isMessagePost
|
|
134
157
|
});
|
|
135
158
|
if (!res.ok) {
|
|
136
159
|
const detail = await readMattermostError(res, headers);
|
|
@@ -147,7 +170,7 @@ function createMattermostClient(params) {
|
|
|
147
170
|
if ((res.headers.get("content-type") ?? "").includes("application/json")) return await readProviderJsonResponse(res, `Mattermost API ${path}`);
|
|
148
171
|
return await readMattermostSuccessText(res, path);
|
|
149
172
|
} catch (error) {
|
|
150
|
-
if (
|
|
173
|
+
if (isMessagePost) throw createChannelPartialDeliveryError(error, {
|
|
151
174
|
messageIds: [],
|
|
152
175
|
visibleReplySent: true
|
|
153
176
|
});
|
|
@@ -159,7 +182,8 @@ function createMattermostClient(params) {
|
|
|
159
182
|
apiBaseUrl,
|
|
160
183
|
token,
|
|
161
184
|
request,
|
|
162
|
-
fetchImpl
|
|
185
|
+
fetchImpl,
|
|
186
|
+
...assertRequestCurrent ? { assertRequestCurrent } : {}
|
|
163
187
|
};
|
|
164
188
|
}
|
|
165
189
|
async function fetchMattermostMe(client) {
|
|
@@ -277,6 +301,7 @@ async function createMattermostDirectChannelWithRetry(client, userIds, options =
|
|
|
277
301
|
});
|
|
278
302
|
}
|
|
279
303
|
function isRetryableError(error) {
|
|
304
|
+
if (error instanceof PlatformMessageNotDispatchedError && !error.retryable) return false;
|
|
280
305
|
const candidates = collectErrorGraphCandidates(error, (current) => [
|
|
281
306
|
current.cause,
|
|
282
307
|
current.reason,
|
|
@@ -354,7 +379,12 @@ async function updateMattermostPost(client, postId, params) {
|
|
|
354
379
|
const payload = { id: postId };
|
|
355
380
|
if (params.message !== void 0) payload.message = params.message;
|
|
356
381
|
if (params.props !== void 0) payload.props = params.props;
|
|
357
|
-
|
|
382
|
+
else if (params.message !== void 0 && /\B@(channel|all|here)\b/i.test(params.message)) {
|
|
383
|
+
const current = MattermostPostSchema.parse(await client.request(`/posts/${postId}`));
|
|
384
|
+
if (current.id !== postId) throw new Error("Mattermost post lookup returned a different post id");
|
|
385
|
+
payload.props = current.props ?? {};
|
|
386
|
+
}
|
|
387
|
+
return await client.request(`/posts/${postId}/patch`, {
|
|
358
388
|
method: "PUT",
|
|
359
389
|
body: JSON.stringify(payload)
|
|
360
390
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as getMattermostRuntime } from "./runtime-CNB4YGqJ.mjs";
|
|
2
|
-
import { y as updateMattermostPost } from "./client-
|
|
3
|
-
import { D as sendHttpRequestRejection, T as resolveClientIp, g as isTrustedProxyAddress, h as isRequestBodyLimitError, x as readRequestBodyWithLimit } from "./monitor-auth-
|
|
2
|
+
import { y as updateMattermostPost } from "./client-BSSVve1x.mjs";
|
|
3
|
+
import { D as sendHttpRequestRejection, T as resolveClientIp, g as isTrustedProxyAddress, h as isRequestBodyLimitError, x as readRequestBodyWithLimit } from "./monitor-auth-CCpN0z_f.mjs";
|
|
4
4
|
import { createHmac } from "node:crypto";
|
|
5
5
|
import { resolveGatewayPort } from "openclaw/plugin-sdk/gateway-config-runtime";
|
|
6
6
|
import { safeEqualSecret } from "openclaw/plugin-sdk/security-runtime";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { t as getMattermostRuntime } from "./runtime-CNB4YGqJ.mjs";
|
|
1
2
|
import { n as normalizeMattermostAllowEntry, t as mattermostIngressIdentity } from "./ingress-identity-DNl4yQSc.mjs";
|
|
2
3
|
import { uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
4
|
import { logInboundDrop } from "openclaw/plugin-sdk/channel-inbound";
|
|
@@ -16,7 +17,6 @@ import { registerPluginHttpRoute } from "openclaw/plugin-sdk/webhook-targets";
|
|
|
16
17
|
import { isRequestBodyLimitError } from "openclaw/plugin-sdk/webhook-ingress";
|
|
17
18
|
import { createWebhookInFlightLimiter, readRequestBodyWithLimit, sendHttpRequestRejection } from "openclaw/plugin-sdk/webhook-request-guards";
|
|
18
19
|
import { isTrustedProxyAddress, resolveClientIp } from "openclaw/plugin-sdk/core";
|
|
19
|
-
import { resolveStableChannelMessageIngress } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
20
20
|
import { resolveChannelContextVisibilityMode, shouldIncludeSupplementalContext } from "openclaw/plugin-sdk/context-visibility-runtime";
|
|
21
21
|
//#region extensions/mattermost/src/mattermost/monitor-auth.ts
|
|
22
22
|
function normalizeMattermostAllowList(entries) {
|
|
@@ -55,7 +55,7 @@ async function resolveMattermostMonitorInboundAccess(params) {
|
|
|
55
55
|
const configAllowFrom = account.config.allowFrom ?? [];
|
|
56
56
|
const configGroupAllowFrom = account.config.groupAllowFrom ?? [];
|
|
57
57
|
const readStoreAllowFrom = params.readStoreAllowFrom ?? (storeAllowFrom != null ? async () => [...storeAllowFrom] : void 0);
|
|
58
|
-
return await
|
|
58
|
+
return await getMattermostRuntime().channel.inbound.ingress.resolveStable({
|
|
59
59
|
channelId: "mattermost",
|
|
60
60
|
accountId: account.accountId,
|
|
61
61
|
identity: mattermostIngressIdentity,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h as normalizeMattermostBaseUrl } from "./client-
|
|
1
|
+
import { h as normalizeMattermostBaseUrl } from "./client-BSSVve1x.mjs";
|
|
2
2
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
import { resolveChannelPreviewStreamMode, resolveChannelStreamingBlockCoalesce, resolveChannelStreamingBlockEnabled, resolveChannelStreamingChunkMode } from "openclaw/plugin-sdk/channel-outbound";
|
|
4
4
|
import { createAccountListHelpers, hasConfiguredAccountValue } from "openclaw/plugin-sdk/account-helpers";
|