@openclaw/clickclack 2026.9.4 → 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/assets/activity.svg +3 -0
- package/assets/icon.png +0 -0
- package/dist/{channel-ByvJKugM.js → .setup/channel-CT4CVd4d.mjs} +235 -128
- package/dist/{runtime-api-vd8TLXz1.js → .setup/runtime-api-A9r1b12d.mjs} +236 -169
- package/dist/.setup/secret-contract-api-C1QwGlzF.mjs +3 -0
- package/dist/{setup-claim-DHkUFaSu.js → .setup/setup-claim-t5SbtvZy.mjs} +2 -2
- package/dist/.setup/setup-plugin-api-B19mjQvl.mjs +2 -0
- package/dist/.setup/setup-plugin-api-BUwBPYpy.mjs +18 -0
- package/dist/{setup-surface-qNPMK71w.js → .setup/setup-surface-BBl3rvVx.mjs} +1 -1
- package/dist/api.js +2 -2
- package/dist/channel-plugin-api.js +1 -1
- package/dist/index.js +1 -1
- package/dist/runtime-api.js +3 -3
- package/dist/secret-contract-api.js +1 -1
- package/dist/setup-entry.js +3 -2
- package/dist/setup-plugin-api.js +1 -17
- package/node_modules/zod/README.md +29 -2
- package/node_modules/zod/compile.cjs +96 -0
- package/node_modules/zod/compile.d.cts +1 -0
- package/node_modules/zod/compile.d.ts +1 -0
- package/node_modules/zod/compile.js +52 -0
- package/node_modules/zod/index.cjs +21 -2
- package/node_modules/zod/index.d.cts +1 -2
- package/node_modules/zod/index.d.ts +1 -2
- package/node_modules/zod/index.js +5 -2
- package/node_modules/zod/locales/index.cjs +19 -0
- package/node_modules/zod/mini/index.cjs +19 -0
- package/node_modules/zod/package.json +20 -8
- package/node_modules/zod/src/compile.ts +56 -0
- package/node_modules/zod/src/index.ts +5 -2
- package/node_modules/zod/src/v3/ZodError.ts +22 -12
- package/node_modules/zod/src/v3/helpers/errorUtil.ts +1 -1
- package/node_modules/zod/src/v3/tests/error.test.ts +35 -0
- package/node_modules/zod/src/v3/tests/intersection.test.ts +18 -0
- package/node_modules/zod/src/v3/tests/language-server.test.ts +1 -2
- package/node_modules/zod/src/v3/tests/object.test.ts +3 -6
- package/node_modules/zod/src/v3/tests/readonly.test.ts +0 -80
- package/node_modules/zod/src/v3/tests/string.test.ts +6 -0
- package/node_modules/zod/src/v3/types.ts +5 -5
- package/node_modules/zod/src/v4/classic/checks.ts +1 -0
- package/node_modules/zod/src/v4/classic/compat.ts +26 -18
- package/node_modules/zod/src/v4/classic/deep-partial.ts +76 -0
- package/node_modules/zod/src/v4/classic/errors.ts +59 -44
- package/node_modules/zod/src/v4/classic/external.ts +14 -9
- package/node_modules/zod/src/v4/classic/from-json-schema.ts +363 -78
- package/node_modules/zod/src/v4/classic/in-out.ts +45 -0
- package/node_modules/zod/src/v4/classic/index.ts +2 -2
- package/node_modules/zod/src/v4/classic/iso.ts +2 -72
- package/node_modules/zod/src/v4/classic/parse.ts +10 -4
- package/node_modules/zod/src/v4/classic/schemas.ts +640 -375
- package/node_modules/zod/src/v4/classic/tests/apply.test.ts +27 -0
- package/node_modules/zod/src/v4/classic/tests/array.test.ts +2 -2
- package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +186 -0
- package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +36 -1
- package/node_modules/zod/src/v4/classic/tests/catch.test.ts +278 -0
- package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +1 -2
- package/node_modules/zod/src/v4/classic/tests/codec.test.ts +2 -1
- package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +3 -3
- package/node_modules/zod/src/v4/classic/tests/credit-card.test.ts +76 -0
- package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +985 -0
- package/node_modules/zod/src/v4/classic/tests/date.test.ts +30 -0
- package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +32 -18
- package/node_modules/zod/src/v4/classic/tests/deep-partial.test.ts +380 -0
- package/node_modules/zod/src/v4/classic/tests/default-locale.test.ts +32 -0
- package/node_modules/zod/src/v4/classic/tests/default.test.ts +46 -0
- package/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +31 -7
- package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +261 -13
- package/node_modules/zod/src/v4/classic/tests/enum.test.ts +20 -0
- package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +112 -2
- package/node_modules/zod/src/v4/classic/tests/error.test.ts +403 -6
- package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +582 -10
- package/node_modules/zod/src/v4/classic/tests/function.test.ts +31 -0
- package/node_modules/zod/src/v4/classic/tests/global-config.test.ts +2 -9
- package/node_modules/zod/src/v4/classic/tests/hash.test.ts +1 -2
- package/node_modules/zod/src/v4/classic/tests/iban.test.ts +81 -0
- package/node_modules/zod/src/v4/classic/tests/in-out.test.ts +159 -0
- package/node_modules/zod/src/v4/classic/tests/index.test.ts +21 -2
- package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +319 -0
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +67 -0
- package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +136 -0
- package/node_modules/zod/src/v4/classic/tests/issue-schema.test.ts +215 -0
- package/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +3 -10
- package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +36 -1
- package/node_modules/zod/src/v4/classic/tests/literal.test.ts +12 -1
- package/node_modules/zod/src/v4/classic/tests/map.test.ts +12 -0
- package/node_modules/zod/src/v4/classic/tests/number.test.ts +85 -9
- package/node_modules/zod/src/v4/classic/tests/object.test.ts +301 -12
- package/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +235 -0
- package/node_modules/zod/src/v4/classic/tests/optional.test.ts +49 -16
- package/node_modules/zod/src/v4/classic/tests/partial.test.ts +51 -4
- package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +70 -0
- package/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +20 -2
- package/node_modules/zod/src/v4/classic/tests/properties.test.ts +141 -0
- package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +0 -68
- package/node_modules/zod/src/v4/classic/tests/record.test.ts +186 -18
- package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +79 -3
- package/node_modules/zod/src/v4/classic/tests/redos.test.ts +68 -0
- package/node_modules/zod/src/v4/classic/tests/refine.test.ts +60 -0
- package/node_modules/zod/src/v4/classic/tests/set.test.ts +9 -0
- 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 +222 -6
- package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +18 -0
- package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +44 -3
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +1812 -204
- package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +45 -30
- package/node_modules/zod/src/v4/classic/tests/union.test.ts +39 -2
- package/node_modules/zod/src/v4/classic/tests/validate.test.ts +645 -0
- package/node_modules/zod/src/v4/classic/tests/validations.test.ts +2 -2
- package/node_modules/zod/src/v4/core/api.ts +87 -35
- package/node_modules/zod/src/v4/core/checks.ts +119 -146
- package/node_modules/zod/src/v4/core/compile.ts +2313 -0
- package/node_modules/zod/src/v4/core/core.ts +99 -22
- package/node_modules/zod/src/v4/core/doc.ts +17 -9
- package/node_modules/zod/src/v4/core/errors.ts +113 -25
- package/node_modules/zod/src/v4/core/index.ts +3 -0
- package/node_modules/zod/src/v4/core/json-schema-generator.ts +8 -3
- package/node_modules/zod/src/v4/core/json-schema-processors.ts +424 -156
- package/node_modules/zod/src/v4/core/json-schema.ts +2 -1
- package/node_modules/zod/src/v4/core/memoizer.ts +331 -0
- package/node_modules/zod/src/v4/core/parse.ts +164 -50
- package/node_modules/zod/src/v4/core/regexes.ts +42 -15
- package/node_modules/zod/src/v4/core/registries.ts +2 -2
- package/node_modules/zod/src/v4/core/schemas.ts +1000 -538
- 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 +1004 -0
- package/node_modules/zod/src/v4/core/tests/compile-generative.test.ts +445 -0
- package/node_modules/zod/src/v4/core/tests/compile-global.test.ts +89 -0
- package/node_modules/zod/src/v4/core/tests/compile-off-by-default.test.ts +26 -0
- package/node_modules/zod/src/v4/core/tests/compile-stats.test.ts +34 -0
- package/node_modules/zod/src/v4/core/tests/compile.test.ts +2036 -0
- package/node_modules/zod/src/v4/core/tests/email-regex.test.ts +140 -0
- package/node_modules/zod/src/v4/core/tests/locales/el.test.ts +1 -2
- package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +1 -2
- package/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +3 -3
- package/node_modules/zod/src/v4/core/tests/locales/parity.test.ts +42 -0
- package/node_modules/zod/src/v4/core/tests/locales/tg.test.ts +85 -0
- package/node_modules/zod/src/v4/core/tests/locales/tk.test.ts +69 -0
- package/node_modules/zod/src/v4/core/tests/polyfill-collision.test.ts +46 -0
- package/node_modules/zod/src/v4/core/tests/treeshake.test.ts +51 -0
- package/node_modules/zod/src/v4/core/tests/url-no-canparse.test.ts +133 -0
- package/node_modules/zod/src/v4/core/to-json-schema.ts +283 -48
- package/node_modules/zod/src/v4/core/util.ts +454 -157
- package/node_modules/zod/src/v4/core/versions.ts +2 -2
- package/node_modules/zod/src/v4/core/visit.ts +193 -0
- package/node_modules/zod/src/v4/index.ts +3 -3
- package/node_modules/zod/src/v4/locales/ar.ts +5 -0
- package/node_modules/zod/src/v4/locales/az.ts +5 -0
- package/node_modules/zod/src/v4/locales/be.ts +12 -0
- package/node_modules/zod/src/v4/locales/bg.ts +5 -0
- package/node_modules/zod/src/v4/locales/bn.ts +123 -0
- package/node_modules/zod/src/v4/locales/ca.ts +5 -0
- package/node_modules/zod/src/v4/locales/ckb.ts +140 -0
- package/node_modules/zod/src/v4/locales/cs.ts +5 -0
- package/node_modules/zod/src/v4/locales/da.ts +7 -2
- package/node_modules/zod/src/v4/locales/de.ts +5 -0
- package/node_modules/zod/src/v4/locales/el.ts +3 -0
- package/node_modules/zod/src/v4/locales/en.ts +17 -4
- package/node_modules/zod/src/v4/locales/eo.ts +5 -0
- package/node_modules/zod/src/v4/locales/es.ts +4 -0
- package/node_modules/zod/src/v4/locales/fa.ts +5 -0
- package/node_modules/zod/src/v4/locales/fi.ts +5 -0
- package/node_modules/zod/src/v4/locales/fr-CA.ts +5 -0
- package/node_modules/zod/src/v4/locales/fr.ts +21 -14
- package/node_modules/zod/src/v4/locales/gu.ts +123 -0
- package/node_modules/zod/src/v4/locales/he.ts +8 -1
- package/node_modules/zod/src/v4/locales/hi.ts +126 -0
- package/node_modules/zod/src/v4/locales/hr.ts +4 -0
- package/node_modules/zod/src/v4/locales/hu.ts +5 -0
- package/node_modules/zod/src/v4/locales/hy.ts +11 -0
- package/node_modules/zod/src/v4/locales/id.ts +5 -0
- package/node_modules/zod/src/v4/locales/index.ts +11 -0
- package/node_modules/zod/src/v4/locales/is.ts +5 -0
- package/node_modules/zod/src/v4/locales/it.ts +5 -0
- package/node_modules/zod/src/v4/locales/ja.ts +5 -0
- package/node_modules/zod/src/v4/locales/ka.ts +5 -0
- package/node_modules/zod/src/v4/locales/km.ts +5 -0
- package/node_modules/zod/src/v4/locales/kn.ts +126 -0
- package/node_modules/zod/src/v4/locales/ko.ts +5 -0
- package/node_modules/zod/src/v4/locales/lt.ts +4 -0
- package/node_modules/zod/src/v4/locales/mk.ts +5 -0
- package/node_modules/zod/src/v4/locales/ms.ts +5 -0
- package/node_modules/zod/src/v4/locales/ne.ts +128 -0
- package/node_modules/zod/src/v4/locales/nl.ts +5 -0
- package/node_modules/zod/src/v4/locales/nn.ts +121 -0
- package/node_modules/zod/src/v4/locales/no.ts +7 -2
- package/node_modules/zod/src/v4/locales/ota.ts +5 -0
- package/node_modules/zod/src/v4/locales/pl.ts +5 -0
- package/node_modules/zod/src/v4/locales/ps.ts +5 -0
- package/node_modules/zod/src/v4/locales/pt-BR.ts +161 -0
- package/node_modules/zod/src/v4/locales/pt.ts +101 -58
- package/node_modules/zod/src/v4/locales/ro.ts +3 -0
- package/node_modules/zod/src/v4/locales/ru.ts +12 -0
- package/node_modules/zod/src/v4/locales/sk.ts +123 -0
- package/node_modules/zod/src/v4/locales/sl.ts +5 -0
- package/node_modules/zod/src/v4/locales/sv.ts +7 -2
- package/node_modules/zod/src/v4/locales/ta.ts +5 -0
- package/node_modules/zod/src/v4/locales/tg.ts +135 -0
- package/node_modules/zod/src/v4/locales/th.ts +5 -0
- package/node_modules/zod/src/v4/locales/tk.ts +113 -0
- package/node_modules/zod/src/v4/locales/tr.ts +5 -0
- package/node_modules/zod/src/v4/locales/uk.ts +5 -0
- package/node_modules/zod/src/v4/locales/ur.ts +5 -0
- package/node_modules/zod/src/v4/locales/uz.ts +3 -0
- package/node_modules/zod/src/v4/locales/vi.ts +5 -0
- package/node_modules/zod/src/v4/locales/yo.ts +5 -0
- package/node_modules/zod/src/v4/locales/zh-CN.ts +5 -0
- package/node_modules/zod/src/v4/locales/zh-TW.ts +5 -0
- package/node_modules/zod/src/v4/mini/checks.ts +1 -0
- package/node_modules/zod/src/v4/mini/deep-partial.ts +73 -0
- package/node_modules/zod/src/v4/mini/external.ts +12 -1
- package/node_modules/zod/src/v4/mini/in-out.ts +45 -0
- package/node_modules/zod/src/v4/mini/parse.ts +2 -0
- package/node_modules/zod/src/v4/mini/schemas.ts +167 -63
- package/node_modules/zod/src/v4/mini/tests/apply.test.ts +33 -0
- package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +62 -1
- package/node_modules/zod/src/v4/mini/tests/checks.test.ts +14 -0
- package/node_modules/zod/src/v4/mini/tests/codec.test.ts +35 -1
- package/node_modules/zod/src/v4/mini/tests/computed.test.ts +11 -17
- package/node_modules/zod/src/v4/mini/tests/cyclic-data.test.ts +84 -0
- package/node_modules/zod/src/v4/mini/tests/deep-partial.test.ts +54 -0
- package/node_modules/zod/src/v4/mini/tests/error.test.ts +23 -4
- package/node_modules/zod/src/v4/mini/tests/functions.test.ts +9 -0
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +158 -5
- package/node_modules/zod/src/v4/mini/tests/number.test.ts +14 -0
- package/node_modules/zod/src/v4/mini/tests/object.test.ts +65 -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 +44 -0
- package/node_modules/zod/v3/ZodError.cjs +41 -12
- package/node_modules/zod/v3/ZodError.d.cts +1 -1
- package/node_modules/zod/v3/ZodError.d.ts +1 -1
- package/node_modules/zod/v3/ZodError.js +22 -12
- 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 +26 -5
- package/node_modules/zod/v3/types.js +7 -5
- package/node_modules/zod/v4/classic/checks.cjs +21 -1
- package/node_modules/zod/v4/classic/checks.d.cts +1 -1
- package/node_modules/zod/v4/classic/checks.d.ts +1 -1
- package/node_modules/zod/v4/classic/checks.js +1 -1
- 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/compat.d.cts +9 -11
- package/node_modules/zod/v4/classic/compat.d.ts +9 -11
- package/node_modules/zod/v4/classic/deep-partial.cjs +58 -0
- package/node_modules/zod/v4/classic/deep-partial.d.cts +14 -0
- package/node_modules/zod/v4/classic/deep-partial.d.ts +14 -0
- package/node_modules/zod/v4/classic/deep-partial.js +13 -0
- package/node_modules/zod/v4/classic/errors.cjs +62 -34
- package/node_modules/zod/v4/classic/errors.d.cts +3 -4
- package/node_modules/zod/v4/classic/errors.d.ts +3 -4
- package/node_modules/zod/v4/classic/errors.js +43 -34
- package/node_modules/zod/v4/classic/external.cjs +51 -27
- package/node_modules/zod/v4/classic/external.d.cts +5 -2
- package/node_modules/zod/v4/classic/external.d.ts +5 -2
- package/node_modules/zod/v4/classic/external.js +5 -8
- package/node_modules/zod/v4/classic/from-json-schema.cjs +376 -75
- package/node_modules/zod/v4/classic/from-json-schema.js +357 -75
- package/node_modules/zod/v4/classic/in-out.cjs +82 -0
- package/node_modules/zod/v4/classic/in-out.d.cts +8 -0
- package/node_modules/zod/v4/classic/in-out.d.ts +8 -0
- package/node_modules/zod/v4/classic/in-out.js +36 -0
- package/node_modules/zod/v4/classic/index.cjs +21 -2
- package/node_modules/zod/v4/classic/index.d.cts +1 -2
- package/node_modules/zod/v4/classic/index.d.ts +1 -2
- package/node_modules/zod/v4/classic/index.js +2 -2
- package/node_modules/zod/v4/classic/iso.cjs +30 -22
- package/node_modules/zod/v4/classic/iso.d.cts +2 -17
- package/node_modules/zod/v4/classic/iso.d.ts +2 -17
- package/node_modules/zod/v4/classic/iso.js +2 -17
- package/node_modules/zod/v4/classic/parse.cjs +23 -1
- package/node_modules/zod/v4/classic/parse.d.cts +17 -4
- package/node_modules/zod/v4/classic/parse.d.ts +17 -4
- package/node_modules/zod/v4/classic/parse.js +1 -0
- package/node_modules/zod/v4/classic/schemas.cjs +591 -426
- package/node_modules/zod/v4/classic/schemas.d.cts +68 -19
- package/node_modules/zod/v4/classic/schemas.d.ts +68 -19
- package/node_modules/zod/v4/classic/schemas.js +564 -424
- package/node_modules/zod/v4/core/api.cjs +66 -24
- package/node_modules/zod/v4/core/api.d.cts +22 -12
- package/node_modules/zod/v4/core/api.d.ts +22 -12
- package/node_modules/zod/v4/core/api.js +44 -24
- package/node_modules/zod/v4/core/checks.cjs +88 -128
- package/node_modules/zod/v4/core/checks.d.cts +29 -13
- package/node_modules/zod/v4/core/checks.d.ts +29 -13
- package/node_modules/zod/v4/core/checks.js +68 -127
- package/node_modules/zod/v4/core/compile.cjs +1908 -0
- package/node_modules/zod/v4/core/compile.d.cts +65 -0
- package/node_modules/zod/v4/core/compile.d.ts +65 -0
- package/node_modules/zod/v4/core/compile.js +1858 -0
- package/node_modules/zod/v4/core/core.cjs +101 -19
- package/node_modules/zod/v4/core/core.d.cts +16 -4
- package/node_modules/zod/v4/core/core.d.ts +16 -4
- package/node_modules/zod/v4/core/core.js +83 -20
- package/node_modules/zod/v4/core/doc.cjs +31 -9
- package/node_modules/zod/v4/core/doc.d.cts +3 -1
- package/node_modules/zod/v4/core/doc.d.ts +3 -1
- package/node_modules/zod/v4/core/doc.js +12 -9
- package/node_modules/zod/v4/core/errors.cjs +126 -25
- package/node_modules/zod/v4/core/errors.d.cts +4 -0
- package/node_modules/zod/v4/core/errors.d.ts +4 -0
- package/node_modules/zod/v4/core/errors.js +107 -25
- package/node_modules/zod/v4/core/index.cjs +24 -1
- package/node_modules/zod/v4/core/index.d.cts +3 -0
- package/node_modules/zod/v4/core/index.d.ts +3 -0
- package/node_modules/zod/v4/core/index.js +3 -0
- package/node_modules/zod/v4/core/json-schema-generator.cjs +24 -1
- package/node_modules/zod/v4/core/json-schema-generator.d.cts +2 -2
- package/node_modules/zod/v4/core/json-schema-generator.d.ts +2 -2
- package/node_modules/zod/v4/core/json-schema-generator.js +6 -2
- package/node_modules/zod/v4/core/json-schema-processors.cjs +441 -156
- 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 +400 -158
- package/node_modules/zod/v4/core/json-schema.cjs +19 -0
- package/node_modules/zod/v4/core/json-schema.d.cts +2 -1
- package/node_modules/zod/v4/core/json-schema.d.ts +2 -1
- package/node_modules/zod/v4/core/memoizer.cjs +360 -0
- package/node_modules/zod/v4/core/memoizer.d.cts +15 -0
- package/node_modules/zod/v4/core/memoizer.d.ts +15 -0
- package/node_modules/zod/v4/core/memoizer.js +311 -0
- package/node_modules/zod/v4/core/parse.cjs +148 -46
- package/node_modules/zod/v4/core/parse.d.cts +14 -11
- package/node_modules/zod/v4/core/parse.d.ts +14 -11
- package/node_modules/zod/v4/core/parse.js +127 -45
- package/node_modules/zod/v4/core/regexes.cjs +54 -17
- package/node_modules/zod/v4/core/regexes.d.cts +5 -0
- package/node_modules/zod/v4/core/regexes.d.ts +5 -0
- package/node_modules/zod/v4/core/regexes.js +32 -15
- package/node_modules/zod/v4/core/registries.cjs +19 -0
- package/node_modules/zod/v4/core/registries.js +2 -2
- package/node_modules/zod/v4/core/schemas.cjs +785 -386
- package/node_modules/zod/v4/core/schemas.d.cts +123 -34
- package/node_modules/zod/v4/core/schemas.d.ts +123 -34
- package/node_modules/zod/v4/core/schemas.js +753 -386
- package/node_modules/zod/v4/core/standard-schema.cjs +19 -0
- package/node_modules/zod/v4/core/to-json-schema.cjs +269 -45
- package/node_modules/zod/v4/core/to-json-schema.d.cts +45 -5
- package/node_modules/zod/v4/core/to-json-schema.d.ts +45 -5
- package/node_modules/zod/v4/core/to-json-schema.js +247 -44
- package/node_modules/zod/v4/core/util.cjs +372 -157
- package/node_modules/zod/v4/core/util.d.cts +79 -1
- package/node_modules/zod/v4/core/util.d.ts +79 -1
- package/node_modules/zod/v4/core/util.js +341 -156
- 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 +214 -0
- package/node_modules/zod/v4/core/visit.d.cts +30 -0
- package/node_modules/zod/v4/core/visit.d.ts +30 -0
- package/node_modules/zod/v4/core/visit.js +169 -0
- package/node_modules/zod/v4/index.cjs +34 -5
- package/node_modules/zod/v4/index.d.cts +2 -2
- package/node_modules/zod/v4/index.d.ts +2 -2
- package/node_modules/zod/v4/index.js +3 -2
- package/node_modules/zod/v4/locales/ar.cjs +5 -0
- package/node_modules/zod/v4/locales/ar.js +5 -0
- package/node_modules/zod/v4/locales/az.cjs +5 -0
- package/node_modules/zod/v4/locales/az.js +5 -0
- package/node_modules/zod/v4/locales/be.cjs +12 -0
- package/node_modules/zod/v4/locales/be.js +12 -0
- package/node_modules/zod/v4/locales/bg.cjs +5 -0
- package/node_modules/zod/v4/locales/bg.js +5 -0
- package/node_modules/zod/v4/locales/bn.cjs +140 -0
- package/node_modules/zod/v4/locales/bn.d.cts +5 -0
- package/node_modules/zod/v4/locales/bn.d.ts +4 -0
- package/node_modules/zod/v4/locales/bn.js +113 -0
- package/node_modules/zod/v4/locales/ca.cjs +5 -0
- package/node_modules/zod/v4/locales/ca.js +5 -0
- package/node_modules/zod/v4/locales/ckb.cjs +160 -0
- package/node_modules/zod/v4/locales/ckb.d.cts +5 -0
- package/node_modules/zod/v4/locales/ckb.d.ts +4 -0
- package/node_modules/zod/v4/locales/ckb.js +133 -0
- package/node_modules/zod/v4/locales/cs.cjs +5 -0
- package/node_modules/zod/v4/locales/cs.js +5 -0
- package/node_modules/zod/v4/locales/da.cjs +7 -2
- package/node_modules/zod/v4/locales/da.js +7 -2
- package/node_modules/zod/v4/locales/de.cjs +5 -0
- package/node_modules/zod/v4/locales/de.js +5 -0
- package/node_modules/zod/v4/locales/el.cjs +3 -0
- package/node_modules/zod/v4/locales/el.js +3 -0
- package/node_modules/zod/v4/locales/en.cjs +16 -4
- package/node_modules/zod/v4/locales/en.js +16 -4
- package/node_modules/zod/v4/locales/eo.cjs +5 -0
- package/node_modules/zod/v4/locales/eo.js +5 -0
- package/node_modules/zod/v4/locales/es.cjs +4 -0
- package/node_modules/zod/v4/locales/es.js +4 -0
- package/node_modules/zod/v4/locales/fa.cjs +5 -0
- package/node_modules/zod/v4/locales/fa.js +5 -0
- package/node_modules/zod/v4/locales/fi.cjs +5 -0
- package/node_modules/zod/v4/locales/fi.js +5 -0
- package/node_modules/zod/v4/locales/fr-CA.cjs +5 -0
- package/node_modules/zod/v4/locales/fr-CA.js +5 -0
- package/node_modules/zod/v4/locales/fr.cjs +18 -14
- package/node_modules/zod/v4/locales/fr.js +18 -14
- package/node_modules/zod/v4/locales/gu.cjs +140 -0
- package/node_modules/zod/v4/locales/gu.d.cts +5 -0
- package/node_modules/zod/v4/locales/gu.d.ts +4 -0
- package/node_modules/zod/v4/locales/gu.js +113 -0
- package/node_modules/zod/v4/locales/he.cjs +7 -0
- package/node_modules/zod/v4/locales/he.js +7 -0
- package/node_modules/zod/v4/locales/hi.cjs +138 -0
- package/node_modules/zod/v4/locales/hi.d.cts +5 -0
- package/node_modules/zod/v4/locales/hi.d.ts +4 -0
- package/node_modules/zod/v4/locales/hi.js +111 -0
- package/node_modules/zod/v4/locales/hr.cjs +4 -0
- package/node_modules/zod/v4/locales/hr.js +4 -0
- package/node_modules/zod/v4/locales/hu.cjs +5 -0
- package/node_modules/zod/v4/locales/hu.js +5 -0
- package/node_modules/zod/v4/locales/hy.cjs +11 -0
- package/node_modules/zod/v4/locales/hy.js +11 -0
- package/node_modules/zod/v4/locales/id.cjs +5 -0
- package/node_modules/zod/v4/locales/id.js +5 -0
- package/node_modules/zod/v4/locales/index.cjs +43 -2
- package/node_modules/zod/v4/locales/index.d.cts +11 -0
- package/node_modules/zod/v4/locales/index.d.ts +11 -0
- package/node_modules/zod/v4/locales/index.js +11 -0
- package/node_modules/zod/v4/locales/is.cjs +5 -0
- package/node_modules/zod/v4/locales/is.js +5 -0
- package/node_modules/zod/v4/locales/it.cjs +5 -0
- package/node_modules/zod/v4/locales/it.js +5 -0
- package/node_modules/zod/v4/locales/ja.cjs +5 -0
- package/node_modules/zod/v4/locales/ja.js +5 -0
- package/node_modules/zod/v4/locales/ka.cjs +5 -0
- package/node_modules/zod/v4/locales/ka.js +5 -0
- package/node_modules/zod/v4/locales/km.cjs +5 -0
- package/node_modules/zod/v4/locales/km.js +5 -0
- package/node_modules/zod/v4/locales/kn.cjs +143 -0
- package/node_modules/zod/v4/locales/kn.d.cts +5 -0
- package/node_modules/zod/v4/locales/kn.d.ts +4 -0
- package/node_modules/zod/v4/locales/kn.js +116 -0
- package/node_modules/zod/v4/locales/ko.cjs +5 -0
- package/node_modules/zod/v4/locales/ko.js +5 -0
- package/node_modules/zod/v4/locales/lt.cjs +4 -0
- package/node_modules/zod/v4/locales/lt.js +4 -0
- package/node_modules/zod/v4/locales/mk.cjs +5 -0
- package/node_modules/zod/v4/locales/mk.js +5 -0
- package/node_modules/zod/v4/locales/ms.cjs +5 -0
- package/node_modules/zod/v4/locales/ms.js +5 -0
- package/node_modules/zod/v4/locales/ne.cjs +138 -0
- package/node_modules/zod/v4/locales/ne.d.cts +5 -0
- package/node_modules/zod/v4/locales/ne.d.ts +4 -0
- package/node_modules/zod/v4/locales/ne.js +111 -0
- package/node_modules/zod/v4/locales/nl.cjs +5 -0
- package/node_modules/zod/v4/locales/nl.js +5 -0
- package/node_modules/zod/v4/locales/nn.cjs +140 -0
- package/node_modules/zod/v4/locales/nn.d.cts +5 -0
- package/node_modules/zod/v4/locales/nn.d.ts +4 -0
- package/node_modules/zod/v4/locales/nn.js +113 -0
- package/node_modules/zod/v4/locales/no.cjs +7 -2
- package/node_modules/zod/v4/locales/no.js +7 -2
- package/node_modules/zod/v4/locales/ota.cjs +5 -0
- package/node_modules/zod/v4/locales/ota.js +5 -0
- package/node_modules/zod/v4/locales/pl.cjs +5 -0
- package/node_modules/zod/v4/locales/pl.js +5 -0
- package/node_modules/zod/v4/locales/ps.cjs +5 -0
- package/node_modules/zod/v4/locales/ps.js +5 -0
- package/node_modules/zod/v4/locales/pt-BR.cjs +170 -0
- package/node_modules/zod/v4/locales/pt-BR.d.cts +5 -0
- package/node_modules/zod/v4/locales/pt-BR.d.ts +4 -0
- package/node_modules/zod/v4/locales/pt-BR.js +143 -0
- package/node_modules/zod/v4/locales/pt.cjs +89 -55
- package/node_modules/zod/v4/locales/pt.js +89 -55
- package/node_modules/zod/v4/locales/ro.cjs +3 -0
- package/node_modules/zod/v4/locales/ro.js +3 -0
- package/node_modules/zod/v4/locales/ru.cjs +12 -0
- package/node_modules/zod/v4/locales/ru.js +12 -0
- package/node_modules/zod/v4/locales/sk.cjs +143 -0
- package/node_modules/zod/v4/locales/sk.d.cts +5 -0
- package/node_modules/zod/v4/locales/sk.d.ts +4 -0
- package/node_modules/zod/v4/locales/sk.js +116 -0
- package/node_modules/zod/v4/locales/sl.cjs +5 -0
- package/node_modules/zod/v4/locales/sl.js +5 -0
- package/node_modules/zod/v4/locales/sv.cjs +7 -2
- package/node_modules/zod/v4/locales/sv.js +7 -2
- package/node_modules/zod/v4/locales/ta.cjs +5 -0
- package/node_modules/zod/v4/locales/ta.js +5 -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 +5 -0
- package/node_modules/zod/v4/locales/th.js +5 -0
- package/node_modules/zod/v4/locales/tk.cjs +134 -0
- package/node_modules/zod/v4/locales/tk.d.cts +5 -0
- package/node_modules/zod/v4/locales/tk.d.ts +4 -0
- package/node_modules/zod/v4/locales/tk.js +107 -0
- package/node_modules/zod/v4/locales/tr.cjs +5 -0
- package/node_modules/zod/v4/locales/tr.js +5 -0
- package/node_modules/zod/v4/locales/uk.cjs +5 -0
- package/node_modules/zod/v4/locales/uk.js +5 -0
- package/node_modules/zod/v4/locales/ur.cjs +5 -0
- package/node_modules/zod/v4/locales/ur.js +5 -0
- package/node_modules/zod/v4/locales/uz.cjs +3 -0
- package/node_modules/zod/v4/locales/uz.js +3 -0
- package/node_modules/zod/v4/locales/vi.cjs +5 -0
- package/node_modules/zod/v4/locales/vi.js +5 -0
- package/node_modules/zod/v4/locales/yo.cjs +5 -0
- package/node_modules/zod/v4/locales/yo.js +5 -0
- package/node_modules/zod/v4/locales/zh-CN.cjs +5 -0
- package/node_modules/zod/v4/locales/zh-CN.js +5 -0
- package/node_modules/zod/v4/locales/zh-TW.cjs +5 -0
- package/node_modules/zod/v4/locales/zh-TW.js +5 -0
- package/node_modules/zod/v4/mini/checks.cjs +21 -1
- package/node_modules/zod/v4/mini/checks.d.cts +1 -1
- package/node_modules/zod/v4/mini/checks.d.ts +1 -1
- package/node_modules/zod/v4/mini/checks.js +1 -1
- package/node_modules/zod/v4/mini/coerce.cjs +19 -0
- package/node_modules/zod/v4/mini/deep-partial.cjs +58 -0
- package/node_modules/zod/v4/mini/deep-partial.d.cts +14 -0
- package/node_modules/zod/v4/mini/deep-partial.d.ts +14 -0
- package/node_modules/zod/v4/mini/deep-partial.js +13 -0
- package/node_modules/zod/v4/mini/external.cjs +33 -1
- package/node_modules/zod/v4/mini/external.d.cts +5 -2
- package/node_modules/zod/v4/mini/external.d.ts +5 -2
- package/node_modules/zod/v4/mini/external.js +3 -1
- package/node_modules/zod/v4/mini/in-out.cjs +82 -0
- package/node_modules/zod/v4/mini/in-out.d.cts +8 -0
- package/node_modules/zod/v4/mini/in-out.d.ts +8 -0
- package/node_modules/zod/v4/mini/in-out.js +36 -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 +22 -1
- package/node_modules/zod/v4/mini/parse.d.cts +1 -1
- package/node_modules/zod/v4/mini/parse.d.ts +1 -1
- package/node_modules/zod/v4/mini/parse.js +1 -1
- package/node_modules/zod/v4/mini/schemas.cjs +117 -53
- package/node_modules/zod/v4/mini/schemas.d.cts +49 -14
- package/node_modules/zod/v4/mini/schemas.d.ts +49 -14
- package/node_modules/zod/v4/mini/schemas.js +92 -51
- package/node_modules/zod/v4-mini/index.cjs +19 -0
- package/openclaw.plugin.json +1 -2
- package/package.json +8 -6
- package/node_modules/zod/src/v4/core/config.ts +0 -15
- /package/dist/{secret-contract-BKkzzjBA.js → .setup/secret-contract-BKkzzjBA.mjs} +0 -0
|
@@ -1,105 +1,156 @@
|
|
|
1
|
-
import { _ as DEFAULT_ACCOUNT_ID, b as resolveClickClackAccount, c as resolveWorkspaceId, f as normalizeClickClackCorrelationId, g as clickClackMeta, h as clickClackConfigAdapter, l as ClickClackHttpError, m as CLICKCLACK_CHANNEL_ID, n as clickClackSetupContract, p as clickClackConfigSchema, s as resolveChannelId, t as clickClackSetupWizard, u as createClickClackClient, y as listEnabledClickClackAccounts } from "./setup-surface-
|
|
2
|
-
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-BKkzzjBA.
|
|
1
|
+
import { _ as DEFAULT_ACCOUNT_ID, b as resolveClickClackAccount, c as resolveWorkspaceId, f as normalizeClickClackCorrelationId, g as clickClackMeta, h as clickClackConfigAdapter, l as ClickClackHttpError, m as CLICKCLACK_CHANNEL_ID, n as clickClackSetupContract, p as clickClackConfigSchema, s as resolveChannelId, t as clickClackSetupWizard, u as createClickClackClient, y as listEnabledClickClackAccounts } from "./setup-surface-BBl3rvVx.mjs";
|
|
2
|
+
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-BKkzzjBA.mjs";
|
|
3
3
|
import { resolveChannelMediaMaxBytes } from "openclaw/plugin-sdk/account-helpers";
|
|
4
4
|
import { parseDateStringTimestampMs } from "openclaw/plugin-sdk/number-runtime";
|
|
5
5
|
import { mergePairLoopGuardConfig } from "openclaw/plugin-sdk/pair-loop-guard-runtime";
|
|
6
6
|
import { readStringField } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
7
|
import { buildChannelOutboundSessionRoute, buildThreadAwareOutboundSessionRoute, createChatChannelPlugin } from "openclaw/plugin-sdk/channel-core";
|
|
8
|
-
import { buildChannelProgressDraftLine, createChannelMessageReplyPipeline, createMessageReceiptFromOutboundResults, defineChannelMessageAdapter, deriveDurableFinalDeliveryRequirements } from "openclaw/plugin-sdk/channel-outbound";
|
|
8
|
+
import { buildChannelProgressDraftLine, createChannelMessageReplyPipeline, createMessageReceiptFromOutboundResults, defineChannelMessageAdapter, deriveDurableFinalDeliveryRequirements, formatChannelProgressDraftLineForEntry, isCompleteAgentPreamble } from "openclaw/plugin-sdk/channel-outbound";
|
|
9
9
|
import { createComputedAccountStatusAdapter, createDefaultChannelRuntimeState } from "openclaw/plugin-sdk/status-helpers";
|
|
10
10
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
11
11
|
import { channelReadyPatch, channelStoppedPatch } from "openclaw/plugin-sdk/gateway-runtime";
|
|
12
12
|
import { sleepWithAbort } from "openclaw/plugin-sdk/runtime-env";
|
|
13
13
|
import { rawDataToString } from "openclaw/plugin-sdk/webhook-ingress";
|
|
14
|
-
import { resolveStableChannelMessageIngress } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
15
14
|
import { normalizeAgentId } from "openclaw/plugin-sdk/routing";
|
|
16
15
|
import { createHash, randomUUID } from "node:crypto";
|
|
16
|
+
import { truncateCodePoints } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
17
17
|
import { buildMentionRegexes, normalizeMentionText } from "openclaw/plugin-sdk/channel-mention-gating";
|
|
18
18
|
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
|
|
19
19
|
import { listNativeCommandSpecsForConfig } from "openclaw/plugin-sdk/native-command-registry";
|
|
20
|
-
import { buildChannelInboundEventContext, createChannelInboundEnvelopeBuilder, recordChannelBotPairLoopAndCheckSuppression } from "openclaw/plugin-sdk/channel-inbound";
|
|
20
|
+
import { buildChannelInboundEventContext, createChannelInboundEnvelopeBuilder, createChannelPartialDeliveryError, recordChannelBotPairLoopAndCheckSuppression } from "openclaw/plugin-sdk/channel-inbound";
|
|
21
21
|
import { extensionForMime } from "openclaw/plugin-sdk/media-mime";
|
|
22
22
|
import { loadOutboundMediaFromUrl } from "openclaw/plugin-sdk/outbound-media";
|
|
23
23
|
import { FormatCapabilityProfile, renderMarkdownWithMarkers, sanitizeAssistantVisibleText } from "openclaw/plugin-sdk/text-chunking";
|
|
24
24
|
//#region extensions/clickclack/src/discussions/binding-generation.ts
|
|
25
|
-
const
|
|
26
|
-
|
|
25
|
+
const GENERATION_STORE_OPTIONS = {
|
|
26
|
+
namespace: "discussion-binding-generations",
|
|
27
|
+
maxEntries: 1e4,
|
|
28
|
+
overflowPolicy: "reject-new"
|
|
29
|
+
};
|
|
27
30
|
const storesByRuntime$2 = /* @__PURE__ */ new WeakMap();
|
|
28
|
-
function
|
|
29
|
-
|
|
30
|
-
if (
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
function withGenerationStore(runtime, run) {
|
|
32
|
+
let owner = storesByRuntime$2.get(runtime);
|
|
33
|
+
if (!owner) {
|
|
34
|
+
const store = runtime.state.openKeyedStore(GENERATION_STORE_OPTIONS);
|
|
35
|
+
owner = {
|
|
36
|
+
store,
|
|
37
|
+
...!store.observe || !store.compareAndApply ? { native: runtime.state.openSyncKeyedStore(GENERATION_STORE_OPTIONS) } : {},
|
|
38
|
+
tail: Promise.resolve()
|
|
39
|
+
};
|
|
40
|
+
storesByRuntime$2.set(runtime, owner);
|
|
41
|
+
}
|
|
42
|
+
const currentOwner = owner;
|
|
43
|
+
const current = owner.tail.then(() => run(currentOwner));
|
|
44
|
+
owner.tail = current.then(() => void 0, () => void 0);
|
|
45
|
+
return current;
|
|
46
|
+
}
|
|
47
|
+
function mutateGeneration(runtime, sessionKey, decide) {
|
|
48
|
+
return withGenerationStore(runtime, async ({ store, native }) => {
|
|
49
|
+
if (native) {
|
|
50
|
+
const current = native.lookup(sessionKey);
|
|
51
|
+
const next = decide(current);
|
|
52
|
+
if (next.value !== current) {
|
|
53
|
+
if (next.value) native.register(sessionKey, next.value);
|
|
54
|
+
else native.delete(sessionKey);
|
|
55
|
+
}
|
|
56
|
+
return next.result;
|
|
57
|
+
}
|
|
58
|
+
const { observe, compareAndApply } = store;
|
|
59
|
+
if (!observe || !compareAndApply) throw new Error("ClickClack generation comparison capabilities changed");
|
|
60
|
+
let observed = await observe(sessionKey);
|
|
61
|
+
for (;;) {
|
|
62
|
+
const next = decide(observed.value);
|
|
63
|
+
const outcome = await compareAndApply(sessionKey, observed.comparison, next.value === observed.value ? {
|
|
64
|
+
operation: "update",
|
|
65
|
+
action: "keep"
|
|
66
|
+
} : next.value ? {
|
|
67
|
+
operation: "update",
|
|
68
|
+
action: "set",
|
|
69
|
+
value: next.value
|
|
70
|
+
} : {
|
|
71
|
+
operation: "delete",
|
|
72
|
+
action: "delete"
|
|
73
|
+
});
|
|
74
|
+
if (outcome.status !== "conflict") return next.result;
|
|
75
|
+
observed = outcome.current;
|
|
76
|
+
}
|
|
35
77
|
});
|
|
36
|
-
storesByRuntime$2.set(runtime, created);
|
|
37
|
-
return created;
|
|
38
78
|
}
|
|
39
79
|
/** Reserves a generation so an interrupted channel create can be adopted on retry. */
|
|
40
80
|
function reserveDiscussionBindingGeneration(params) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
81
|
+
let generation;
|
|
82
|
+
return mutateGeneration(params.runtime, params.sessionKey, (existing) => {
|
|
83
|
+
const existingAccountId = existing?.accountId ?? existing?.pending?.accountId;
|
|
84
|
+
const existingCredentialFingerprint = existing?.credentialFingerprint ?? existing?.pending?.credentialFingerprint;
|
|
85
|
+
if (existing?.destinationIdentity === params.destinationIdentity && existingAccountId === params.accountId && existingCredentialFingerprint === params.credentialFingerprint) return {
|
|
86
|
+
value: existing.accountId && existing.credentialFingerprint ? existing : {
|
|
87
|
+
...existing,
|
|
88
|
+
accountId: params.accountId,
|
|
89
|
+
credentialFingerprint: params.credentialFingerprint
|
|
90
|
+
},
|
|
91
|
+
result: existing.generation
|
|
92
|
+
};
|
|
93
|
+
generation ??= (params.createGeneration ?? randomUUID)();
|
|
94
|
+
return {
|
|
95
|
+
value: {
|
|
96
|
+
accountId: params.accountId,
|
|
97
|
+
credentialFingerprint: params.credentialFingerprint,
|
|
98
|
+
destinationIdentity: params.destinationIdentity,
|
|
99
|
+
generation
|
|
100
|
+
},
|
|
101
|
+
result: generation
|
|
102
|
+
};
|
|
59
103
|
});
|
|
60
|
-
return generation;
|
|
61
104
|
}
|
|
62
105
|
/** Clears only the completed reservation; future opens must mint a new ownership ref. */
|
|
63
106
|
function clearDiscussionBindingGeneration(params) {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
store.delete(params.sessionKey);
|
|
107
|
+
return mutateGeneration(params.runtime, params.sessionKey, (existing) => ({
|
|
108
|
+
value: existing && params.expectedGeneration && existing.generation !== params.expectedGeneration ? existing : void 0,
|
|
109
|
+
result: void 0
|
|
110
|
+
}));
|
|
69
111
|
}
|
|
70
112
|
/** Quarantines a destination before the first fallible channel create. */
|
|
71
113
|
function recordPendingDiscussionOpen(params) {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
114
|
+
return mutateGeneration(params.runtime, params.sessionKey, (existing) => {
|
|
115
|
+
if (!existing || existing.generation !== params.generation) throw new Error("ClickClack discussion generation changed before channel creation");
|
|
116
|
+
if (existing.accountId !== params.pending.accountId || existing.credentialFingerprint !== params.pending.credentialFingerprint) throw new Error("ClickClack discussion ownership changed before channel creation");
|
|
117
|
+
return {
|
|
118
|
+
value: {
|
|
119
|
+
...existing,
|
|
120
|
+
pending: params.pending
|
|
121
|
+
},
|
|
122
|
+
result: void 0
|
|
123
|
+
};
|
|
79
124
|
});
|
|
80
125
|
}
|
|
81
126
|
function listPendingDiscussionOpens(runtime) {
|
|
82
|
-
return
|
|
127
|
+
return withGenerationStore(runtime, async ({ store }) => (await store.entries()).flatMap((entry) => entry.value.pending ? [{
|
|
83
128
|
sessionKey: entry.key,
|
|
84
129
|
generation: entry.value.generation,
|
|
85
130
|
...entry.value.pending
|
|
86
|
-
}] : []);
|
|
131
|
+
}] : []));
|
|
87
132
|
}
|
|
88
133
|
/** Stops destination-wide quarantine after the exact remote channel is known. */
|
|
89
134
|
function clearPendingDiscussionOpen(params) {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
135
|
+
return mutateGeneration(params.runtime, params.sessionKey, (existing) => {
|
|
136
|
+
if (!existing || existing.generation !== params.expectedGeneration || !existing.pending) return {
|
|
137
|
+
value: existing,
|
|
138
|
+
result: void 0
|
|
139
|
+
};
|
|
140
|
+
return {
|
|
141
|
+
value: {
|
|
142
|
+
accountId: existing.accountId ?? existing.pending.accountId,
|
|
143
|
+
credentialFingerprint: existing.credentialFingerprint ?? existing.pending.credentialFingerprint,
|
|
144
|
+
destinationIdentity: existing.destinationIdentity,
|
|
145
|
+
generation: existing.generation
|
|
146
|
+
},
|
|
147
|
+
result: void 0
|
|
148
|
+
};
|
|
98
149
|
});
|
|
99
150
|
}
|
|
100
|
-
function hasPendingDiscussionOpenForDestination(params) {
|
|
151
|
+
async function hasPendingDiscussionOpenForDestination(params) {
|
|
101
152
|
const serverBaseUrl = params.serverBaseUrl.replace(/\/+$/u, "");
|
|
102
|
-
return listPendingDiscussionOpens(params.runtime).some((pending) => pending.serverBaseUrl === serverBaseUrl && pending.workspaceId === params.workspaceId);
|
|
153
|
+
return (await listPendingDiscussionOpens(params.runtime)).some((pending) => pending.serverBaseUrl === serverBaseUrl && pending.workspaceId === params.workspaceId);
|
|
103
154
|
}
|
|
104
155
|
//#endregion
|
|
105
156
|
//#region extensions/clickclack/src/discussions/naming.ts
|
|
@@ -118,7 +169,7 @@ function resolveDiscussionLabel(entry, sessionKey, agentId) {
|
|
|
118
169
|
return entry.label?.trim() || entry.displayName?.trim() || entry.subject?.trim() || fallbackDiscussionLabel(sessionKey, agentId);
|
|
119
170
|
}
|
|
120
171
|
function truncateDiscussionDisplayTitle(label) {
|
|
121
|
-
return
|
|
172
|
+
return truncateCodePoints(label, 200).trim();
|
|
122
173
|
}
|
|
123
174
|
function slugifyDiscussionLabel(label, sessionKey) {
|
|
124
175
|
return slugifyLabel(label) || fallbackDiscussionLabel(sessionKey);
|
|
@@ -217,7 +268,7 @@ var ClickClackDiscussionBindingStore = class {
|
|
|
217
268
|
return this.#store.lookup(sessionKey);
|
|
218
269
|
}
|
|
219
270
|
hasCapacity(sessionKey) {
|
|
220
|
-
return this.get(sessionKey) !== void 0 || this
|
|
271
|
+
return this.get(sessionKey) !== void 0 || this.count() < MAX_DISCUSSION_BINDINGS;
|
|
221
272
|
}
|
|
222
273
|
getByChannel(serverBaseUrl, channelId) {
|
|
223
274
|
const key = channelKey(serverBaseUrl, channelId);
|
|
@@ -260,6 +311,9 @@ var ClickClackDiscussionBindingStore = class {
|
|
|
260
311
|
binding: entry.value
|
|
261
312
|
}));
|
|
262
313
|
}
|
|
314
|
+
count() {
|
|
315
|
+
return this.#store.count?.() ?? this.#store.entries().length;
|
|
316
|
+
}
|
|
263
317
|
detachedCount() {
|
|
264
318
|
return this.#detachedAtBySession.size;
|
|
265
319
|
}
|
|
@@ -398,14 +452,19 @@ function isClickClackDiscussionChannelRevoked(params) {
|
|
|
398
452
|
}
|
|
399
453
|
//#endregion
|
|
400
454
|
//#region extensions/clickclack/src/discussions/routing.ts
|
|
401
|
-
function resolveClickClackDiscussionRoute(params) {
|
|
402
|
-
if (isClickClackDiscussionChannelRevoked(params)) return { state: "revoked" };
|
|
455
|
+
async function resolveClickClackDiscussionRoute(params) {
|
|
403
456
|
const store = getClickClackDiscussionBindingStore(params.runtime);
|
|
404
|
-
|
|
405
|
-
|
|
457
|
+
let matched = store.getByChannel(params.serverBaseUrl, params.channelId);
|
|
458
|
+
let pending = false;
|
|
459
|
+
if (!matched) {
|
|
460
|
+
pending = await hasPendingDiscussionOpenForDestination(params);
|
|
461
|
+
matched = store.getByChannel(params.serverBaseUrl, params.channelId);
|
|
462
|
+
}
|
|
463
|
+
if (isClickClackDiscussionChannelRevoked(params)) return { state: "revoked" };
|
|
464
|
+
if (!matched) return { state: pending ? "revoked" : "unbound" };
|
|
406
465
|
if (matched.binding.accountId !== params.accountId) return { state: "revoked" };
|
|
407
466
|
if (matched.binding.serverBaseUrl !== params.serverBaseUrl.replace(/\/+$/u, "")) return { state: "revoked" };
|
|
408
|
-
if (resolveDiscussionBindingAccount(params.config, matched.binding).state !== "active") return { state: "revoked" };
|
|
467
|
+
if (resolveDiscussionBindingAccount(params.runtime.config.current(), matched.binding).state !== "active") return { state: "revoked" };
|
|
409
468
|
let binding;
|
|
410
469
|
try {
|
|
411
470
|
binding = attachBindingToCurrentActiveSession({
|
|
@@ -618,10 +677,6 @@ function looksLikeClickClackTarget(raw) {
|
|
|
618
677
|
}
|
|
619
678
|
//#endregion
|
|
620
679
|
//#region extensions/clickclack/src/access.ts
|
|
621
|
-
/**
|
|
622
|
-
* Maps ClickClack senders and conversations onto the shared channel ingress
|
|
623
|
-
* allowlist/command authorization contract.
|
|
624
|
-
*/
|
|
625
680
|
const CHANNEL_ID$2 = "clickclack";
|
|
626
681
|
function normalizeClickClackUserId(value) {
|
|
627
682
|
const trimmed = value.trim();
|
|
@@ -680,7 +735,7 @@ function resolveAccountAgentRoute(params) {
|
|
|
680
735
|
lastRoutePolicy: sessionKey === mainSessionKey ? "main" : "session"
|
|
681
736
|
};
|
|
682
737
|
}
|
|
683
|
-
function resolvePreparedInboundRoute(params) {
|
|
738
|
+
async function resolvePreparedInboundRoute(params) {
|
|
684
739
|
const runtime = getClickClackRuntime();
|
|
685
740
|
const isDirect = Boolean(params.message.direct_conversation_id);
|
|
686
741
|
const target = buildClickClackTarget(isDirect ? {
|
|
@@ -698,9 +753,8 @@ function resolvePreparedInboundRoute(params) {
|
|
|
698
753
|
target,
|
|
699
754
|
isDirect
|
|
700
755
|
});
|
|
701
|
-
const discussionResolution = !isDirect && params.message.channel_id ? resolveClickClackDiscussionRoute({
|
|
756
|
+
const discussionResolution = !isDirect && params.message.channel_id ? await resolveClickClackDiscussionRoute({
|
|
702
757
|
runtime,
|
|
703
|
-
config: params.config,
|
|
704
758
|
accountId: params.account.accountId,
|
|
705
759
|
serverBaseUrl: params.account.baseUrl,
|
|
706
760
|
workspaceId: params.message.workspace_id,
|
|
@@ -727,7 +781,7 @@ function resolvePreparedInboundRoute(params) {
|
|
|
727
781
|
async function resolveClickClackInboundAccess(params) {
|
|
728
782
|
const runtime = getClickClackRuntime();
|
|
729
783
|
const cfg = params.config;
|
|
730
|
-
const preparedRoute = resolvePreparedInboundRoute(params);
|
|
784
|
+
const preparedRoute = await resolvePreparedInboundRoute(params);
|
|
731
785
|
const shouldCheckCommand = runtime.channel.commands.shouldComputeCommandAuthorized(params.message.body, cfg);
|
|
732
786
|
const effectiveGroupPolicy = resolveClickClackGroupPolicy({
|
|
733
787
|
account: params.account,
|
|
@@ -782,7 +836,7 @@ async function resolveClickClackInboundAccess(params) {
|
|
|
782
836
|
surface: CHANNEL_ID$2,
|
|
783
837
|
commandSource: "text"
|
|
784
838
|
});
|
|
785
|
-
const resolved = await
|
|
839
|
+
const resolved = await runtime.channel.inbound.ingress.resolveStable({
|
|
786
840
|
channelId: CHANNEL_ID$2,
|
|
787
841
|
accountId: params.account.accountId,
|
|
788
842
|
identity: clickClackIngressIdentity,
|
|
@@ -795,6 +849,7 @@ async function resolveClickClackInboundAccess(params) {
|
|
|
795
849
|
contextBinding: {
|
|
796
850
|
agentId: preparedRoute.route.agentId,
|
|
797
851
|
sessionKey: preparedRoute.route.sessionKey,
|
|
852
|
+
nativeChannelId: params.message.channel_id || params.message.direct_conversation_id,
|
|
798
853
|
messageId: params.message.id,
|
|
799
854
|
inboundEventKind: "user_request"
|
|
800
855
|
},
|
|
@@ -827,9 +882,6 @@ const CLICKCLACK_COMMAND_PATTERN = /^[a-z0-9_-]{1,32}$/u;
|
|
|
827
882
|
const CLICKCLACK_MAX_COMMANDS = 100;
|
|
828
883
|
const CLICKCLACK_MAX_DESCRIPTION_LENGTH = 100;
|
|
829
884
|
const CLICKCLACK_MAX_ARGS_HINT_LENGTH = 100;
|
|
830
|
-
function truncateCodePoints(value, maxLength) {
|
|
831
|
-
return Array.from(value).slice(0, maxLength).join("");
|
|
832
|
-
}
|
|
833
885
|
function commandArgsHint(spec) {
|
|
834
886
|
if (spec.args?.length) return truncateCodePoints(spec.args.map((arg) => arg.required ? `<${arg.name}>` : `[${arg.name}]`).join(" "), CLICKCLACK_MAX_ARGS_HINT_LENGTH);
|
|
835
887
|
return spec.acceptsArgs ? "[args]" : "";
|
|
@@ -937,7 +989,7 @@ function commentaryBody(payload) {
|
|
|
937
989
|
return text;
|
|
938
990
|
}
|
|
939
991
|
function activityBody(payload) {
|
|
940
|
-
const line =
|
|
992
|
+
const line = formatChannelProgressDraftLineForEntry(void 0, {
|
|
941
993
|
event: "item",
|
|
942
994
|
itemId: payload.itemId,
|
|
943
995
|
toolCallId: payload.toolCallId,
|
|
@@ -950,7 +1002,7 @@ function activityBody(payload) {
|
|
|
950
1002
|
progressText: payload.progressText,
|
|
951
1003
|
meta: payload.meta,
|
|
952
1004
|
commandBearing: payload.commandBearing
|
|
953
|
-
})?.
|
|
1005
|
+
})?.trim();
|
|
954
1006
|
if (line) return line;
|
|
955
1007
|
const head = payload.name?.trim() || payload.title?.trim();
|
|
956
1008
|
const text = payload.progressText?.trim() || payload.summary?.trim();
|
|
@@ -1008,9 +1060,19 @@ function createClickClackActivityPublisher(params) {
|
|
|
1008
1060
|
};
|
|
1009
1061
|
const handleCommentary = (payload) => {
|
|
1010
1062
|
const body = commentaryBody(payload);
|
|
1011
|
-
if (!body.trim()) return;
|
|
1012
1063
|
const key = payload.itemId?.trim() || "turn";
|
|
1013
1064
|
let segment = commentaryByItem.get(key);
|
|
1065
|
+
if (!body.trim()) {
|
|
1066
|
+
if (segment) {
|
|
1067
|
+
clearTimeout(segment.timer);
|
|
1068
|
+
commentaryByItem.delete(key);
|
|
1069
|
+
const retracted = segment;
|
|
1070
|
+
enqueue(async () => {
|
|
1071
|
+
if (retracted.messageId) await params.client.updateMessageBody(retracted.messageId, "");
|
|
1072
|
+
});
|
|
1073
|
+
}
|
|
1074
|
+
return;
|
|
1075
|
+
}
|
|
1014
1076
|
if (!segment) {
|
|
1015
1077
|
segment = {
|
|
1016
1078
|
body: "",
|
|
@@ -1018,7 +1080,7 @@ function createClickClackActivityPublisher(params) {
|
|
|
1018
1080
|
};
|
|
1019
1081
|
commentaryByItem.set(key, segment);
|
|
1020
1082
|
}
|
|
1021
|
-
if (body
|
|
1083
|
+
if (body === segment.body) return;
|
|
1022
1084
|
segment.body = body;
|
|
1023
1085
|
segment.dirty = true;
|
|
1024
1086
|
if (!segment.timer) segment.timer = setTimeout(() => {
|
|
@@ -1027,9 +1089,7 @@ function createClickClackActivityPublisher(params) {
|
|
|
1027
1089
|
}, flushMs);
|
|
1028
1090
|
};
|
|
1029
1091
|
const toolRowKey = (payload) => {
|
|
1030
|
-
|
|
1031
|
-
if (toolCallId) return toolCallId;
|
|
1032
|
-
return (payload.itemId?.trim() ?? "").replace(/^(tool|command):/, "");
|
|
1092
|
+
return payload.itemId?.trim() || payload.toolCallId?.trim() || "";
|
|
1033
1093
|
};
|
|
1034
1094
|
const handleDiscreteItem = (payload) => {
|
|
1035
1095
|
const body = activityBody(payload);
|
|
@@ -1048,7 +1108,7 @@ function createClickClackActivityPublisher(params) {
|
|
|
1048
1108
|
});
|
|
1049
1109
|
return;
|
|
1050
1110
|
}
|
|
1051
|
-
if (body
|
|
1111
|
+
if (body === existing.body) return;
|
|
1052
1112
|
existing.body = body;
|
|
1053
1113
|
enqueue(async () => {
|
|
1054
1114
|
if (existing.messageId && existing.body !== existing.sentBody) {
|
|
@@ -1059,6 +1119,18 @@ function createClickClackActivityPublisher(params) {
|
|
|
1059
1119
|
};
|
|
1060
1120
|
return {
|
|
1061
1121
|
onItemEvent: (payload) => {
|
|
1122
|
+
if (payload.hideFromChannelProgress || payload.suppressChannelProgress || payload.suppressDurableProgress) {
|
|
1123
|
+
const key = toolRowKey(payload);
|
|
1124
|
+
const row = key ? toolRows.get(`agent_tool:${key}`) : void 0;
|
|
1125
|
+
if (row) {
|
|
1126
|
+
toolRows.delete(`agent_tool:${key}`);
|
|
1127
|
+
enqueue(async () => {
|
|
1128
|
+
if (row.messageId) await params.client.updateMessageBody(row.messageId, "");
|
|
1129
|
+
});
|
|
1130
|
+
}
|
|
1131
|
+
return false;
|
|
1132
|
+
}
|
|
1133
|
+
if (payload.kind === "preamble" && !isCompleteAgentPreamble(payload)) return false;
|
|
1062
1134
|
const kind = normalizedItemKind(payload);
|
|
1063
1135
|
if (STREAMING_COMMENTARY_ITEM_KINDS.has(kind)) {
|
|
1064
1136
|
handleCommentary(payload);
|
|
@@ -1107,6 +1179,7 @@ async function createTargetMessage(params) {
|
|
|
1107
1179
|
const replyToId = params.replyToId == null ? "" : String(params.replyToId);
|
|
1108
1180
|
if (explicitThreadId || parsed.kind === "thread") {
|
|
1109
1181
|
const rootId = explicitThreadId || parsed.id;
|
|
1182
|
+
params.assertDirectAdapterHandoff?.();
|
|
1110
1183
|
await params.onPlatformSendDispatch?.();
|
|
1111
1184
|
return await params.client.createThreadReply(rootId, params.text, {
|
|
1112
1185
|
provenance: params.provenance,
|
|
@@ -1114,14 +1187,16 @@ async function createTargetMessage(params) {
|
|
|
1114
1187
|
});
|
|
1115
1188
|
}
|
|
1116
1189
|
if (parsed.kind === "dm") {
|
|
1117
|
-
await params.onPlatformSendDispatch?.();
|
|
1118
1190
|
const dm = await params.client.createDirectConversation(params.workspaceId, [parsed.id]);
|
|
1191
|
+
params.assertDirectAdapterHandoff?.();
|
|
1192
|
+
await params.onPlatformSendDispatch?.();
|
|
1119
1193
|
return await params.client.createDirectMessage(dm.id, params.text, {
|
|
1120
1194
|
quotedMessageId: replyToId || void 0,
|
|
1121
1195
|
nonce: params.nonce
|
|
1122
1196
|
});
|
|
1123
1197
|
}
|
|
1124
1198
|
const channelId = await resolveChannelId(params.client, params.workspaceId, parsed.id);
|
|
1199
|
+
params.assertDirectAdapterHandoff?.();
|
|
1125
1200
|
await params.onPlatformSendDispatch?.();
|
|
1126
1201
|
return await params.client.createChannelMessage(channelId, params.text, {
|
|
1127
1202
|
provenance: params.provenance,
|
|
@@ -1146,21 +1221,15 @@ function textDeliveryNonce(params) {
|
|
|
1146
1221
|
const digest = durableDeliveryDigest(params);
|
|
1147
1222
|
return digest ? `openclaw-text:${digest}` : void 0;
|
|
1148
1223
|
}
|
|
1149
|
-
function createDispatchOnce(onPlatformSendDispatch) {
|
|
1150
|
-
let dispatched = false;
|
|
1151
|
-
return async () => {
|
|
1152
|
-
if (dispatched) return;
|
|
1153
|
-
await onPlatformSendDispatch?.();
|
|
1154
|
-
dispatched = true;
|
|
1155
|
-
};
|
|
1156
|
-
}
|
|
1157
1224
|
async function attachUploadRetrySafe(params) {
|
|
1158
1225
|
try {
|
|
1159
1226
|
await params.client.attachUpload(params.messageId, params.uploadId);
|
|
1160
1227
|
} catch (firstError) {
|
|
1228
|
+
params.assertDirectAdapterHandoff?.();
|
|
1161
1229
|
try {
|
|
1162
1230
|
if ((await params.client.message(params.messageId)).attachments?.some((attachment) => attachment.id === params.uploadId)) return;
|
|
1163
1231
|
} catch {}
|
|
1232
|
+
params.assertDirectAdapterHandoff?.();
|
|
1164
1233
|
try {
|
|
1165
1234
|
await params.client.attachUpload(params.messageId, params.uploadId);
|
|
1166
1235
|
} catch {
|
|
@@ -1173,12 +1242,18 @@ function createOutboundContext(params) {
|
|
|
1173
1242
|
cfg: params.cfg,
|
|
1174
1243
|
accountId: params.accountId
|
|
1175
1244
|
});
|
|
1245
|
+
const assertDirectAdapterHandoff = params.assertDirectAdapterHandoff;
|
|
1246
|
+
const fetcher = fetch;
|
|
1176
1247
|
return {
|
|
1177
1248
|
account,
|
|
1178
1249
|
client: createClickClackClient({
|
|
1179
1250
|
baseUrl: account.apiEndpoint,
|
|
1180
1251
|
token: account.token,
|
|
1181
|
-
correlationId: params.correlationId
|
|
1252
|
+
correlationId: params.correlationId,
|
|
1253
|
+
fetch: assertDirectAdapterHandoff ? (input, init) => {
|
|
1254
|
+
assertDirectAdapterHandoff();
|
|
1255
|
+
return fetcher(input, init);
|
|
1256
|
+
} : void 0
|
|
1182
1257
|
})
|
|
1183
1258
|
};
|
|
1184
1259
|
}
|
|
@@ -1190,11 +1265,9 @@ async function sendClickClackText(params) {
|
|
|
1190
1265
|
const text = renderClickClackMarkdown(sanitizeAssistantVisibleText(params.text));
|
|
1191
1266
|
if (!text) return;
|
|
1192
1267
|
const { account, client } = createOutboundContext(params);
|
|
1193
|
-
const workspaceId = await resolveWorkspaceId(client, account.workspace);
|
|
1194
|
-
const dispatch = createDispatchOnce(params.onPlatformSendDispatch);
|
|
1195
1268
|
return (await createTargetMessage({
|
|
1196
1269
|
client,
|
|
1197
|
-
workspaceId,
|
|
1270
|
+
workspaceId: await resolveWorkspaceId(client, account.workspace),
|
|
1198
1271
|
to: params.to,
|
|
1199
1272
|
text,
|
|
1200
1273
|
threadId: params.threadId,
|
|
@@ -1204,7 +1277,8 @@ async function sendClickClackText(params) {
|
|
|
1204
1277
|
deliveryQueueId: params.deliveryQueueId,
|
|
1205
1278
|
deliveryPartIndex: params.deliveryPartIndex
|
|
1206
1279
|
}),
|
|
1207
|
-
onPlatformSendDispatch:
|
|
1280
|
+
onPlatformSendDispatch: params.onPlatformSendDispatch,
|
|
1281
|
+
assertDirectAdapterHandoff: params.assertDirectAdapterHandoff
|
|
1208
1282
|
})).id;
|
|
1209
1283
|
}
|
|
1210
1284
|
/** Resolves, uploads, sends, then attaches one file to a ClickClack message. */
|
|
@@ -1226,12 +1300,10 @@ async function sendClickClackMedia(params) {
|
|
|
1226
1300
|
mediaReadFile: params.mediaReadFile
|
|
1227
1301
|
});
|
|
1228
1302
|
const workspaceId = await resolveWorkspaceId(client, account.workspace);
|
|
1229
|
-
|
|
1303
|
+
let upload = nonces.upload ? await client.findUploadByNonce({
|
|
1230
1304
|
workspaceId,
|
|
1231
1305
|
nonce: nonces.upload
|
|
1232
1306
|
}) : void 0;
|
|
1233
|
-
const dispatch = createDispatchOnce(params.onPlatformSendDispatch);
|
|
1234
|
-
let upload = persistedUpload;
|
|
1235
1307
|
let mediaFilename = preloadedMedia?.fileName?.trim();
|
|
1236
1308
|
if (!upload) {
|
|
1237
1309
|
const media = preloadedMedia ?? await loadOutboundMediaFromUrl(params.mediaUrl, {
|
|
@@ -1243,7 +1315,6 @@ async function sendClickClackMedia(params) {
|
|
|
1243
1315
|
const contentType = media.contentType?.trim() || "application/octet-stream";
|
|
1244
1316
|
const filename = media.fileName?.trim() || `attachment${extensionForMime(contentType) ?? ""}`;
|
|
1245
1317
|
mediaFilename = filename;
|
|
1246
|
-
await dispatch();
|
|
1247
1318
|
upload = await client.createUpload({
|
|
1248
1319
|
workspaceId,
|
|
1249
1320
|
buffer: media.buffer,
|
|
@@ -1261,13 +1332,36 @@ async function sendClickClackMedia(params) {
|
|
|
1261
1332
|
threadId: params.threadId,
|
|
1262
1333
|
replyToId: params.replyToId,
|
|
1263
1334
|
nonce: nonces.message,
|
|
1264
|
-
onPlatformSendDispatch:
|
|
1335
|
+
onPlatformSendDispatch: params.onPlatformSendDispatch,
|
|
1336
|
+
assertDirectAdapterHandoff: params.assertDirectAdapterHandoff
|
|
1265
1337
|
});
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1338
|
+
const receipt = createMessageReceiptFromOutboundResults({
|
|
1339
|
+
results: [{
|
|
1340
|
+
channel: "clickclack",
|
|
1341
|
+
messageId: message.id
|
|
1342
|
+
}],
|
|
1343
|
+
threadId: params.threadId == null ? void 0 : String(params.threadId),
|
|
1344
|
+
replyToId: params.replyToId == null ? void 0 : String(params.replyToId),
|
|
1345
|
+
kind: "text"
|
|
1270
1346
|
});
|
|
1347
|
+
try {
|
|
1348
|
+
await params.onDeliveryResult?.({
|
|
1349
|
+
messageId: message.id,
|
|
1350
|
+
receipt
|
|
1351
|
+
});
|
|
1352
|
+
await attachUploadRetrySafe({
|
|
1353
|
+
client,
|
|
1354
|
+
messageId: message.id,
|
|
1355
|
+
uploadId: upload.id,
|
|
1356
|
+
assertDirectAdapterHandoff: params.assertDirectAdapterHandoff
|
|
1357
|
+
});
|
|
1358
|
+
} catch (error) {
|
|
1359
|
+
throw createChannelPartialDeliveryError(error, {
|
|
1360
|
+
visibleReplySent: true,
|
|
1361
|
+
messageIds: [message.id],
|
|
1362
|
+
receipt
|
|
1363
|
+
});
|
|
1364
|
+
}
|
|
1271
1365
|
return message.id;
|
|
1272
1366
|
}
|
|
1273
1367
|
function collectReconciliationMediaUrls(ctx) {
|
|
@@ -1387,6 +1481,7 @@ function normalizedKind(payload) {
|
|
|
1387
1481
|
return kind;
|
|
1388
1482
|
}
|
|
1389
1483
|
function progressText(payload) {
|
|
1484
|
+
if (payload.kind !== "preamble" && payload.title) return payload.title;
|
|
1390
1485
|
const line = buildChannelProgressDraftLine({
|
|
1391
1486
|
event: "item",
|
|
1392
1487
|
itemId: payload.itemId,
|
|
@@ -1410,21 +1505,11 @@ function isFinal(payload) {
|
|
|
1410
1505
|
return phase === "end" || status === "completed" || status === "failed" || status === "blocked";
|
|
1411
1506
|
}
|
|
1412
1507
|
function createLineIdResolver() {
|
|
1413
|
-
const lineIdsByIdentity = /* @__PURE__ */ new Map();
|
|
1414
1508
|
const anonymousLinesByKind = /* @__PURE__ */ new Map();
|
|
1415
1509
|
let anonymousSequence = 0;
|
|
1416
1510
|
return (payload) => {
|
|
1417
|
-
const
|
|
1418
|
-
|
|
1419
|
-
if (existingId) {
|
|
1420
|
-
for (const identity of identities) lineIdsByIdentity.set(identity, existingId);
|
|
1421
|
-
return existingId;
|
|
1422
|
-
}
|
|
1423
|
-
if (identities.length > 0) {
|
|
1424
|
-
const id = `item:${identities[0]}`;
|
|
1425
|
-
for (const identity of identities) lineIdsByIdentity.set(identity, id);
|
|
1426
|
-
return id;
|
|
1427
|
-
}
|
|
1511
|
+
const identity = payload.itemId?.trim() || payload.toolCallId?.trim();
|
|
1512
|
+
if (identity) return `item:${identity}`;
|
|
1428
1513
|
const kind = normalizedKind(payload);
|
|
1429
1514
|
const anonymousLines = anonymousLinesByKind.get(kind) ?? [];
|
|
1430
1515
|
const line = (payload.phase?.trim().toLowerCase() === "start" ? void 0 : anonymousLines.toReversed().find((line) => line.active)) ?? (() => {
|
|
@@ -1551,7 +1636,19 @@ function createClickClackAgentProgressPublisher(params) {
|
|
|
1551
1636
|
},
|
|
1552
1637
|
onItemEvent(payload) {
|
|
1553
1638
|
if (!started || cleared) return false;
|
|
1639
|
+
if (payload.suppressChannelProgress || payload.kind === "preamble" && !isCompleteAgentPreamble(payload)) return false;
|
|
1554
1640
|
const id = resolveLineId(payload);
|
|
1641
|
+
if (payload.hideFromChannelProgress) {
|
|
1642
|
+
if (seenLines.delete(id)) enqueueLine(id, {
|
|
1643
|
+
op: "update",
|
|
1644
|
+
line: {
|
|
1645
|
+
id,
|
|
1646
|
+
kind: normalizedKind(payload),
|
|
1647
|
+
text: ""
|
|
1648
|
+
}
|
|
1649
|
+
});
|
|
1650
|
+
return false;
|
|
1651
|
+
}
|
|
1555
1652
|
const final = isFinal(payload);
|
|
1556
1653
|
const kind = normalizedKind(payload);
|
|
1557
1654
|
const retractsExistingCommentary = kind === "commentary" && seenLines.has(id) && payload.progressText !== void 0 && payload.progressText.trim() === "";
|
|
@@ -1564,7 +1661,7 @@ function createClickClackAgentProgressPublisher(params) {
|
|
|
1564
1661
|
id,
|
|
1565
1662
|
kind,
|
|
1566
1663
|
text: retractsExistingCommentary ? "" : progressText(payload),
|
|
1567
|
-
status: payload.status?.trim() || (final ? "
|
|
1664
|
+
status: payload.status?.trim() || (final ? "blocked" : "running")
|
|
1568
1665
|
};
|
|
1569
1666
|
if (payload.name?.trim()) line.tool_name = payload.name.trim();
|
|
1570
1667
|
enqueueLine(id, {
|
|
@@ -2122,7 +2219,8 @@ const clickClackMessageAdapter = defineChannelMessageAdapter({
|
|
|
2122
2219
|
replyToId: ctx.replyToId,
|
|
2123
2220
|
deliveryQueueId: ctx.deliveryQueueId,
|
|
2124
2221
|
deliveryPartIndex: ctx.deliveryPartIndex,
|
|
2125
|
-
onPlatformSendDispatch: ctx.onPlatformSendDispatch
|
|
2222
|
+
onPlatformSendDispatch: ctx.onPlatformSendDispatch,
|
|
2223
|
+
assertDirectAdapterHandoff: ctx.assertDirectAdapterHandoff
|
|
2126
2224
|
});
|
|
2127
2225
|
const threadId = ctx.threadId == null ? void 0 : String(ctx.threadId);
|
|
2128
2226
|
const replyToId = ctx.replyToId ?? void 0;
|
|
@@ -2153,7 +2251,9 @@ const clickClackMessageAdapter = defineChannelMessageAdapter({
|
|
|
2153
2251
|
replyToId: ctx.replyToId,
|
|
2154
2252
|
deliveryQueueId: ctx.deliveryQueueId,
|
|
2155
2253
|
deliveryPartIndex: ctx.deliveryPartIndex,
|
|
2156
|
-
onPlatformSendDispatch: ctx.onPlatformSendDispatch
|
|
2254
|
+
onPlatformSendDispatch: ctx.onPlatformSendDispatch,
|
|
2255
|
+
assertDirectAdapterHandoff: ctx.assertDirectAdapterHandoff,
|
|
2256
|
+
onDeliveryResult: ctx.onDeliveryResult
|
|
2157
2257
|
});
|
|
2158
2258
|
const threadId = ctx.threadId == null ? void 0 : String(ctx.threadId);
|
|
2159
2259
|
const replyToId = ctx.replyToId ?? void 0;
|
|
@@ -2264,7 +2364,7 @@ const clickClackPlugin = createChatChannelPlugin({
|
|
|
2264
2364
|
base: { deliveryMode: "direct" },
|
|
2265
2365
|
attachedResults: {
|
|
2266
2366
|
channel: CHANNEL_ID,
|
|
2267
|
-
sendText: async ({ cfg, to, text, accountId, threadId, replyToId, deliveryQueueId, deliveryPartIndex, onPlatformSendDispatch }) => {
|
|
2367
|
+
sendText: async ({ cfg, to, text, accountId, threadId, replyToId, deliveryQueueId, deliveryPartIndex, onPlatformSendDispatch, assertDirectAdapterHandoff }) => {
|
|
2268
2368
|
return { messageId: await sendClickClackText({
|
|
2269
2369
|
cfg,
|
|
2270
2370
|
accountId,
|
|
@@ -2274,10 +2374,11 @@ const clickClackPlugin = createChatChannelPlugin({
|
|
|
2274
2374
|
replyToId,
|
|
2275
2375
|
deliveryQueueId,
|
|
2276
2376
|
deliveryPartIndex,
|
|
2277
|
-
onPlatformSendDispatch
|
|
2377
|
+
onPlatformSendDispatch,
|
|
2378
|
+
assertDirectAdapterHandoff
|
|
2278
2379
|
}) ?? "" };
|
|
2279
2380
|
},
|
|
2280
|
-
sendMedia: async ({ cfg, to, text, mediaUrl, mediaAccess, mediaLocalRoots, mediaReadFile, accountId, threadId, replyToId, deliveryQueueId, deliveryPartIndex, onPlatformSendDispatch }) => {
|
|
2381
|
+
sendMedia: async ({ cfg, to, text, mediaUrl, mediaAccess, mediaLocalRoots, mediaReadFile, accountId, threadId, replyToId, deliveryQueueId, deliveryPartIndex, onPlatformSendDispatch, assertDirectAdapterHandoff, onDeliveryResult }) => {
|
|
2281
2382
|
if (!mediaUrl) throw new Error("ClickClack media send requires mediaUrl");
|
|
2282
2383
|
return { messageId: await sendClickClackMedia({
|
|
2283
2384
|
cfg,
|
|
@@ -2292,7 +2393,13 @@ const clickClackPlugin = createChatChannelPlugin({
|
|
|
2292
2393
|
replyToId,
|
|
2293
2394
|
deliveryQueueId,
|
|
2294
2395
|
deliveryPartIndex,
|
|
2295
|
-
onPlatformSendDispatch
|
|
2396
|
+
onPlatformSendDispatch,
|
|
2397
|
+
assertDirectAdapterHandoff,
|
|
2398
|
+
onDeliveryResult: onDeliveryResult ? ({ messageId: acceptedMessageId, receipt }) => onDeliveryResult({
|
|
2399
|
+
channel: CHANNEL_ID,
|
|
2400
|
+
messageId: acceptedMessageId,
|
|
2401
|
+
receipt
|
|
2402
|
+
}) : void 0
|
|
2296
2403
|
}) };
|
|
2297
2404
|
}
|
|
2298
2405
|
}
|