@openclaw/line 2026.9.4 → 2026.9.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/activity.svg +40 -0
- package/assets/icon.png +0 -0
- package/dist/.setup/api-BePkCTWu.mjs +3 -0
- package/dist/.setup/api-W3zy11mj.mjs +11 -0
- package/dist/{card-command-pwvE48Wb.js → .setup/card-command-PSnrhetp.mjs} +2 -2
- package/dist/{channel-C2D8vUmv.js → .setup/channel-CAFu4vuW.mjs} +286 -91
- package/dist/.setup/channel.runtime-CgI6K6p-.mjs +4 -0
- package/dist/{markdown-to-line-DR3sFH6H.js → .setup/markdown-to-line-Dvyr_6HD.mjs} +58 -25
- package/dist/{monitor-2lOtBpg-.js → .setup/monitor-1JaX1WOU.mjs} +393 -135
- package/dist/.setup/monitor.runtime-D2vNVJRD.mjs +2 -0
- package/dist/{outbound.runtime-Cpp7NAmT.js → .setup/outbound.runtime-CyrwiL69.mjs} +2 -2
- package/dist/.setup/probe.runtime-kp-FIW5_.mjs +2 -0
- package/dist/{rich-messages-HS8pNeOa.js → .setup/rich-messages-Cp77q9NY.mjs} +158 -18
- package/dist/{send-CQQxpxPp.js → .setup/send-E6GiL_tr.mjs} +27 -10
- package/dist/{send-retry-ChpfJ-LM.js → .setup/send-retry-DaGwYlBO.mjs} +104 -3
- package/dist/{setup-surface-DiXO4x5f.js → .setup/setup-surface-CcfKJKtr.mjs} +2 -2
- package/dist/api.js +2 -10
- package/dist/channel-plugin-api.js +1 -1
- package/dist/contract-api.js +1 -1
- package/dist/doctor-contract-api.js +1 -1
- package/dist/index.js +1 -1
- package/dist/runtime-api.js +9 -9
- package/dist/setup-api.js +1 -1
- package/dist/setup-entry.js +2 -1
- package/node_modules/typebox/build/compile/validator.d.mts +1 -1
- package/node_modules/typebox/build/compile/validator.mjs +1 -1
- package/node_modules/typebox/build/format/idna/idn-hostname.mjs +7 -5
- package/node_modules/typebox/build/format/iri.mjs +5 -1
- package/node_modules/typebox/build/guard/emit.mjs +2 -4
- package/node_modules/typebox/build/guard/guard.mjs +6 -18
- package/node_modules/typebox/build/guard/string.mjs +16 -24
- package/node_modules/typebox/build/schema/build.mjs +2 -2
- package/node_modules/typebox/build/schema/check.mjs +1 -1
- package/node_modules/typebox/build/schema/compile.d.mts +3 -2
- package/node_modules/typebox/build/schema/compile.mjs +8 -8
- package/node_modules/typebox/build/schema/engine/_context.d.mts +6 -7
- package/node_modules/typebox/build/schema/engine/_context.mjs +23 -15
- package/node_modules/typebox/build/schema/engine/_functions.d.mts +2 -2
- package/node_modules/typebox/build/schema/engine/_functions.mjs +1 -1
- package/node_modules/typebox/build/schema/engine/_reducer.d.mts +3 -3
- package/node_modules/typebox/build/schema/engine/_refine.d.mts +5 -5
- package/node_modules/typebox/build/schema/engine/_refine.mjs +4 -7
- package/node_modules/typebox/build/schema/engine/_stack.d.mts +34 -16
- package/node_modules/typebox/build/schema/engine/_stack.mjs +148 -104
- package/node_modules/typebox/build/schema/engine/additionalItems.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/additionalProperties.d.mts +8 -8
- package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +26 -18
- package/node_modules/typebox/build/schema/engine/allOf.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/allOf.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/anyOf.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/anyOf.mjs +5 -10
- package/node_modules/typebox/build/schema/engine/boolean.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/boolean.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/const.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/const.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/contains.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/contains.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/dependencies.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/dependencies.mjs +3 -6
- package/node_modules/typebox/build/schema/engine/dependentRequired.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/dependentRequired.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/dependentSchemas.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/dynamicRef.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/dynamicRef.mjs +11 -7
- package/node_modules/typebox/build/schema/engine/enum.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/enum.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/exclusiveMaximum.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/exclusiveMaximum.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/exclusiveMinimum.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/exclusiveMinimum.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/format.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/format.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/if.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/if.mjs +7 -15
- package/node_modules/typebox/build/schema/engine/items.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/items.mjs +1 -1
- package/node_modules/typebox/build/schema/engine/maxContains.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/maxContains.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/maxItems.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/maxItems.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/maxLength.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/maxLength.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/maxProperties.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/maxProperties.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/maximum.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/maximum.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/minContains.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/minContains.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/minItems.d.mts +5 -5
- package/node_modules/typebox/build/schema/engine/minItems.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/minLength.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/minLength.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/minProperties.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/minProperties.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/minimum.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/minimum.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/multipleOf.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/multipleOf.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/not.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/not.mjs +4 -8
- package/node_modules/typebox/build/schema/engine/oneOf.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/oneOf.mjs +6 -11
- package/node_modules/typebox/build/schema/engine/pattern.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/pattern.mjs +3 -7
- package/node_modules/typebox/build/schema/engine/patternProperties.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/patternProperties.mjs +1 -1
- package/node_modules/typebox/build/schema/engine/prefixItems.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/prefixItems.mjs +1 -1
- package/node_modules/typebox/build/schema/engine/properties.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/properties.mjs +1 -1
- package/node_modules/typebox/build/schema/engine/propertyNames.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/propertyNames.mjs +4 -10
- package/node_modules/typebox/build/schema/engine/recursiveRef.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/recursiveRef.mjs +11 -7
- package/node_modules/typebox/build/schema/engine/ref.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/ref.mjs +19 -15
- package/node_modules/typebox/build/schema/engine/required.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/required.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/schema.d.mts +7 -7
- package/node_modules/typebox/build/schema/engine/schema.mjs +137 -133
- package/node_modules/typebox/build/schema/engine/type.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/type.mjs +2 -6
- package/node_modules/typebox/build/schema/engine/unevaluatedItems.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/unevaluatedItems.mjs +5 -9
- package/node_modules/typebox/build/schema/engine/unevaluatedProperties.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/unevaluatedProperties.mjs +5 -9
- package/node_modules/typebox/build/schema/engine/uniqueItems.d.mts +4 -4
- package/node_modules/typebox/build/schema/engine/uniqueItems.mjs +2 -6
- package/node_modules/typebox/build/schema/errors.d.mts +2 -2
- package/node_modules/typebox/build/schema/errors.mjs +8 -14
- package/node_modules/typebox/build/schema/intern/index.d.mts +1 -0
- package/node_modules/typebox/build/schema/intern/index.mjs +1 -0
- package/node_modules/typebox/build/schema/intern/intern.d.mts +11 -0
- package/node_modules/typebox/build/schema/intern/intern.mjs +293 -0
- package/node_modules/typebox/build/schema/meta/draft_2019_09.d.mts +2 -0
- package/node_modules/typebox/build/schema/meta/draft_2019_09.mjs +288 -0
- package/node_modules/typebox/build/schema/meta/draft_2020_12.d.mts +2 -0
- package/node_modules/typebox/build/schema/meta/draft_2020_12.mjs +300 -0
- package/node_modules/typebox/build/schema/meta/draft_3.d.mts +2 -0
- package/node_modules/typebox/build/schema/meta/draft_3.mjs +143 -0
- package/node_modules/typebox/build/schema/meta/draft_4.d.mts +2 -0
- package/node_modules/typebox/build/schema/meta/draft_4.mjs +149 -0
- package/node_modules/typebox/build/schema/meta/draft_6.d.mts +2 -0
- package/node_modules/typebox/build/schema/meta/draft_6.mjs +155 -0
- package/node_modules/typebox/build/schema/meta/draft_7.d.mts +2 -0
- package/node_modules/typebox/build/schema/meta/draft_7.mjs +172 -0
- package/node_modules/typebox/build/schema/meta/index.d.mts +2 -0
- package/node_modules/typebox/build/schema/meta/index.mjs +2 -0
- package/node_modules/typebox/build/schema/meta/meta.d.mts +9 -0
- package/node_modules/typebox/build/schema/meta/meta.mjs +15 -0
- package/node_modules/typebox/build/schema/meta/schema.d.mts +6 -0
- package/node_modules/typebox/build/schema/meta/schema.mjs +1 -0
- package/node_modules/typebox/build/schema/parse.d.mts +1 -0
- package/node_modules/typebox/build/schema/parse.mjs +10 -5
- package/node_modules/typebox/build/schema/resolve/resolve.d.mts +8 -3
- package/node_modules/typebox/build/schema/resolve/resolve.mjs +268 -139
- package/node_modules/typebox/build/schema/schema.d.mts +2 -0
- package/node_modules/typebox/build/schema/schema.mjs +2 -0
- package/node_modules/typebox/build/value/errors/errors.d.mts +2 -12
- package/node_modules/typebox/build/value/errors/errors.mjs +2 -7
- package/node_modules/typebox/package.json +1 -1
- package/node_modules/typebox/readme.md +59 -89
- package/node_modules/zod/README.md +27 -0
- package/node_modules/zod/compile.cjs +77 -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 +2 -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/package.json +13 -2
- 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/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 +12 -9
- package/node_modules/zod/src/v4/classic/from-json-schema.ts +140 -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 +452 -262
- 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 +135 -0
- package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +30 -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 +2 -2
- 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 +720 -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 +155 -13
- package/node_modules/zod/src/v4/classic/tests/enum.test.ts +11 -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 +274 -6
- package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +425 -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/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 +281 -0
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +47 -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 +183 -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 +46 -9
- package/node_modules/zod/src/v4/classic/tests/object.test.ts +245 -12
- package/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +234 -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/preprocess-types.test.ts +20 -2
- 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 +33 -2
- 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/string.test.ts +127 -5
- 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 +11 -2
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +1585 -173
- 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 +76 -0
- package/node_modules/zod/src/v4/classic/tests/validations.test.ts +2 -2
- package/node_modules/zod/src/v4/core/api.ts +48 -12
- package/node_modules/zod/src/v4/core/checks.ts +57 -44
- package/node_modules/zod/src/v4/core/compile.ts +2188 -0
- package/node_modules/zod/src/v4/core/core.ts +98 -19
- package/node_modules/zod/src/v4/core/doc.ts +11 -7
- package/node_modules/zod/src/v4/core/errors.ts +115 -24
- package/node_modules/zod/src/v4/core/index.ts +3 -0
- package/node_modules/zod/src/v4/core/json-schema-generator.ts +6 -1
- package/node_modules/zod/src/v4/core/json-schema-processors.ts +257 -93
- package/node_modules/zod/src/v4/core/json-schema.ts +2 -1
- package/node_modules/zod/src/v4/core/memoizer.ts +284 -0
- package/node_modules/zod/src/v4/core/parse.ts +131 -38
- package/node_modules/zod/src/v4/core/regexes.ts +30 -13
- package/node_modules/zod/src/v4/core/registries.ts +2 -2
- package/node_modules/zod/src/v4/core/schemas.ts +759 -461
- package/node_modules/zod/src/v4/core/tests/compile-differential.test.ts +969 -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 +1639 -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/tk.test.ts +69 -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 +31 -0
- package/node_modules/zod/src/v4/core/to-json-schema.ts +275 -42
- package/node_modules/zod/src/v4/core/util.ts +268 -42
- 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 +3 -0
- package/node_modules/zod/src/v4/locales/az.ts +3 -0
- package/node_modules/zod/src/v4/locales/be.ts +10 -0
- package/node_modules/zod/src/v4/locales/bg.ts +3 -0
- package/node_modules/zod/src/v4/locales/bn.ts +121 -0
- package/node_modules/zod/src/v4/locales/ca.ts +3 -0
- package/node_modules/zod/src/v4/locales/ckb.ts +138 -0
- package/node_modules/zod/src/v4/locales/cs.ts +3 -0
- package/node_modules/zod/src/v4/locales/da.ts +5 -2
- package/node_modules/zod/src/v4/locales/de.ts +3 -0
- package/node_modules/zod/src/v4/locales/el.ts +1 -0
- package/node_modules/zod/src/v4/locales/en.ts +15 -4
- package/node_modules/zod/src/v4/locales/eo.ts +3 -0
- package/node_modules/zod/src/v4/locales/es.ts +2 -0
- package/node_modules/zod/src/v4/locales/fa.ts +3 -0
- package/node_modules/zod/src/v4/locales/fi.ts +3 -0
- package/node_modules/zod/src/v4/locales/fr-CA.ts +3 -0
- package/node_modules/zod/src/v4/locales/fr.ts +19 -14
- package/node_modules/zod/src/v4/locales/gu.ts +121 -0
- package/node_modules/zod/src/v4/locales/he.ts +6 -1
- package/node_modules/zod/src/v4/locales/hi.ts +124 -0
- package/node_modules/zod/src/v4/locales/hr.ts +2 -0
- package/node_modules/zod/src/v4/locales/hu.ts +3 -0
- package/node_modules/zod/src/v4/locales/hy.ts +9 -0
- package/node_modules/zod/src/v4/locales/id.ts +3 -0
- package/node_modules/zod/src/v4/locales/index.ts +10 -0
- package/node_modules/zod/src/v4/locales/is.ts +3 -0
- package/node_modules/zod/src/v4/locales/it.ts +3 -0
- package/node_modules/zod/src/v4/locales/ja.ts +3 -0
- package/node_modules/zod/src/v4/locales/ka.ts +3 -0
- package/node_modules/zod/src/v4/locales/km.ts +3 -0
- package/node_modules/zod/src/v4/locales/kn.ts +124 -0
- package/node_modules/zod/src/v4/locales/ko.ts +3 -0
- package/node_modules/zod/src/v4/locales/lt.ts +2 -0
- package/node_modules/zod/src/v4/locales/mk.ts +3 -0
- package/node_modules/zod/src/v4/locales/ms.ts +3 -0
- package/node_modules/zod/src/v4/locales/ne.ts +126 -0
- package/node_modules/zod/src/v4/locales/nl.ts +3 -0
- package/node_modules/zod/src/v4/locales/nn.ts +119 -0
- package/node_modules/zod/src/v4/locales/no.ts +5 -2
- package/node_modules/zod/src/v4/locales/ota.ts +3 -0
- package/node_modules/zod/src/v4/locales/pl.ts +3 -0
- package/node_modules/zod/src/v4/locales/ps.ts +3 -0
- package/node_modules/zod/src/v4/locales/pt-BR.ts +159 -0
- package/node_modules/zod/src/v4/locales/pt.ts +99 -58
- package/node_modules/zod/src/v4/locales/ro.ts +1 -0
- package/node_modules/zod/src/v4/locales/ru.ts +10 -0
- package/node_modules/zod/src/v4/locales/sk.ts +121 -0
- package/node_modules/zod/src/v4/locales/sl.ts +3 -0
- package/node_modules/zod/src/v4/locales/sv.ts +5 -2
- package/node_modules/zod/src/v4/locales/ta.ts +3 -0
- package/node_modules/zod/src/v4/locales/th.ts +3 -0
- package/node_modules/zod/src/v4/locales/tk.ts +111 -0
- package/node_modules/zod/src/v4/locales/tr.ts +3 -0
- package/node_modules/zod/src/v4/locales/uk.ts +3 -0
- package/node_modules/zod/src/v4/locales/ur.ts +3 -0
- package/node_modules/zod/src/v4/locales/uz.ts +1 -0
- package/node_modules/zod/src/v4/locales/vi.ts +3 -0
- package/node_modules/zod/src/v4/locales/yo.ts +3 -0
- package/node_modules/zod/src/v4/locales/zh-CN.ts +3 -0
- package/node_modules/zod/src/v4/locales/zh-TW.ts +3 -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 +10 -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 +135 -56
- 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/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 +72 -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/string.test.ts +21 -0
- package/node_modules/zod/v3/ZodError.cjs +22 -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/types.cjs +7 -5
- package/node_modules/zod/v3/types.js +7 -5
- package/node_modules/zod/v4/classic/checks.cjs +2 -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/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 +39 -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 +43 -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 +30 -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 +136 -75
- package/node_modules/zod/v4/classic/from-json-schema.js +136 -75
- package/node_modules/zod/v4/classic/in-out.cjs +63 -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 +2 -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 +11 -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 +4 -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 +498 -398
- package/node_modules/zod/v4/classic/schemas.d.cts +53 -18
- package/node_modules/zod/v4/classic/schemas.d.ts +53 -18
- package/node_modules/zod/v4/classic/schemas.js +492 -396
- package/node_modules/zod/v4/core/api.cjs +23 -4
- package/node_modules/zod/v4/core/api.d.cts +13 -9
- package/node_modules/zod/v4/core/api.d.ts +13 -9
- package/node_modules/zod/v4/core/api.js +21 -4
- package/node_modules/zod/v4/core/checks.cjs +37 -31
- package/node_modules/zod/v4/core/checks.d.cts +13 -13
- package/node_modules/zod/v4/core/checks.d.ts +13 -13
- package/node_modules/zod/v4/core/checks.js +37 -31
- package/node_modules/zod/v4/core/compile.cjs +1813 -0
- package/node_modules/zod/v4/core/compile.d.cts +51 -0
- package/node_modules/zod/v4/core/compile.d.ts +51 -0
- package/node_modules/zod/v4/core/compile.js +1783 -0
- package/node_modules/zod/v4/core/core.cjs +81 -18
- 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 +82 -19
- package/node_modules/zod/v4/core/doc.cjs +5 -7
- 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 +5 -7
- package/node_modules/zod/v4/core/errors.cjs +110 -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 +110 -25
- package/node_modules/zod/v4/core/index.cjs +5 -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 +4 -0
- 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 +4 -0
- package/node_modules/zod/v4/core/json-schema-processors.cjs +264 -95
- package/node_modules/zod/v4/core/json-schema-processors.js +243 -97
- 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 +272 -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 +265 -0
- package/node_modules/zod/v4/core/parse.cjs +96 -34
- 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 +94 -33
- package/node_modules/zod/v4/core/regexes.cjs +27 -15
- package/node_modules/zod/v4/core/regexes.d.cts +2 -0
- package/node_modules/zod/v4/core/regexes.d.ts +2 -0
- package/node_modules/zod/v4/core/regexes.js +24 -13
- package/node_modules/zod/v4/core/registries.js +2 -2
- package/node_modules/zod/v4/core/schemas.cjs +537 -326
- package/node_modules/zod/v4/core/schemas.d.cts +100 -31
- package/node_modules/zod/v4/core/schemas.d.ts +100 -31
- package/node_modules/zod/v4/core/schemas.js +526 -325
- package/node_modules/zod/v4/core/to-json-schema.cjs +242 -39
- package/node_modules/zod/v4/core/to-json-schema.d.cts +42 -3
- package/node_modules/zod/v4/core/to-json-schema.d.ts +42 -3
- package/node_modules/zod/v4/core/to-json-schema.js +241 -39
- package/node_modules/zod/v4/core/util.cjs +212 -31
- package/node_modules/zod/v4/core/util.d.cts +58 -1
- package/node_modules/zod/v4/core/util.d.ts +58 -1
- package/node_modules/zod/v4/core/util.js +202 -30
- package/node_modules/zod/v4/core/versions.cjs +2 -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 +195 -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 +15 -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 +3 -0
- package/node_modules/zod/v4/locales/ar.js +3 -0
- package/node_modules/zod/v4/locales/az.cjs +3 -0
- package/node_modules/zod/v4/locales/az.js +3 -0
- package/node_modules/zod/v4/locales/be.cjs +10 -0
- package/node_modules/zod/v4/locales/be.js +10 -0
- package/node_modules/zod/v4/locales/bg.cjs +3 -0
- package/node_modules/zod/v4/locales/bg.js +3 -0
- package/node_modules/zod/v4/locales/bn.cjs +138 -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 +111 -0
- package/node_modules/zod/v4/locales/ca.cjs +3 -0
- package/node_modules/zod/v4/locales/ca.js +3 -0
- package/node_modules/zod/v4/locales/ckb.cjs +158 -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 +131 -0
- package/node_modules/zod/v4/locales/cs.cjs +3 -0
- package/node_modules/zod/v4/locales/cs.js +3 -0
- package/node_modules/zod/v4/locales/da.cjs +5 -2
- package/node_modules/zod/v4/locales/da.js +5 -2
- package/node_modules/zod/v4/locales/de.cjs +3 -0
- package/node_modules/zod/v4/locales/de.js +3 -0
- package/node_modules/zod/v4/locales/el.cjs +1 -0
- package/node_modules/zod/v4/locales/el.js +1 -0
- package/node_modules/zod/v4/locales/en.cjs +14 -4
- package/node_modules/zod/v4/locales/en.js +14 -4
- package/node_modules/zod/v4/locales/eo.cjs +3 -0
- package/node_modules/zod/v4/locales/eo.js +3 -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 +3 -0
- package/node_modules/zod/v4/locales/fa.js +3 -0
- package/node_modules/zod/v4/locales/fi.cjs +3 -0
- package/node_modules/zod/v4/locales/fi.js +3 -0
- package/node_modules/zod/v4/locales/fr-CA.cjs +3 -0
- package/node_modules/zod/v4/locales/fr-CA.js +3 -0
- package/node_modules/zod/v4/locales/fr.cjs +16 -14
- package/node_modules/zod/v4/locales/fr.js +16 -14
- package/node_modules/zod/v4/locales/gu.cjs +138 -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 +111 -0
- package/node_modules/zod/v4/locales/he.cjs +5 -0
- package/node_modules/zod/v4/locales/he.js +5 -0
- package/node_modules/zod/v4/locales/hi.cjs +136 -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 +109 -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 +3 -0
- package/node_modules/zod/v4/locales/hu.js +3 -0
- package/node_modules/zod/v4/locales/hy.cjs +9 -0
- package/node_modules/zod/v4/locales/hy.js +9 -0
- package/node_modules/zod/v4/locales/id.cjs +3 -0
- package/node_modules/zod/v4/locales/id.js +3 -0
- package/node_modules/zod/v4/locales/index.cjs +22 -2
- package/node_modules/zod/v4/locales/index.d.cts +10 -0
- package/node_modules/zod/v4/locales/index.d.ts +10 -0
- package/node_modules/zod/v4/locales/index.js +10 -0
- package/node_modules/zod/v4/locales/is.cjs +3 -0
- package/node_modules/zod/v4/locales/is.js +3 -0
- package/node_modules/zod/v4/locales/it.cjs +3 -0
- package/node_modules/zod/v4/locales/it.js +3 -0
- package/node_modules/zod/v4/locales/ja.cjs +3 -0
- package/node_modules/zod/v4/locales/ja.js +3 -0
- package/node_modules/zod/v4/locales/ka.cjs +3 -0
- package/node_modules/zod/v4/locales/ka.js +3 -0
- package/node_modules/zod/v4/locales/km.cjs +3 -0
- package/node_modules/zod/v4/locales/km.js +3 -0
- package/node_modules/zod/v4/locales/kn.cjs +141 -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 +114 -0
- package/node_modules/zod/v4/locales/ko.cjs +3 -0
- package/node_modules/zod/v4/locales/ko.js +3 -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 +3 -0
- package/node_modules/zod/v4/locales/mk.js +3 -0
- package/node_modules/zod/v4/locales/ms.cjs +3 -0
- package/node_modules/zod/v4/locales/ms.js +3 -0
- package/node_modules/zod/v4/locales/ne.cjs +136 -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 +109 -0
- package/node_modules/zod/v4/locales/nl.cjs +3 -0
- package/node_modules/zod/v4/locales/nl.js +3 -0
- package/node_modules/zod/v4/locales/nn.cjs +138 -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 +111 -0
- package/node_modules/zod/v4/locales/no.cjs +5 -2
- package/node_modules/zod/v4/locales/no.js +5 -2
- package/node_modules/zod/v4/locales/ota.cjs +3 -0
- package/node_modules/zod/v4/locales/ota.js +3 -0
- package/node_modules/zod/v4/locales/pl.cjs +3 -0
- package/node_modules/zod/v4/locales/pl.js +3 -0
- package/node_modules/zod/v4/locales/ps.cjs +3 -0
- package/node_modules/zod/v4/locales/ps.js +3 -0
- package/node_modules/zod/v4/locales/pt-BR.cjs +168 -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 +141 -0
- package/node_modules/zod/v4/locales/pt.cjs +87 -55
- package/node_modules/zod/v4/locales/pt.js +87 -55
- package/node_modules/zod/v4/locales/ro.cjs +1 -0
- package/node_modules/zod/v4/locales/ro.js +1 -0
- package/node_modules/zod/v4/locales/ru.cjs +10 -0
- package/node_modules/zod/v4/locales/ru.js +10 -0
- package/node_modules/zod/v4/locales/sk.cjs +141 -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 +114 -0
- package/node_modules/zod/v4/locales/sl.cjs +3 -0
- package/node_modules/zod/v4/locales/sl.js +3 -0
- package/node_modules/zod/v4/locales/sv.cjs +5 -2
- package/node_modules/zod/v4/locales/sv.js +5 -2
- package/node_modules/zod/v4/locales/ta.cjs +3 -0
- package/node_modules/zod/v4/locales/ta.js +3 -0
- package/node_modules/zod/v4/locales/th.cjs +3 -0
- package/node_modules/zod/v4/locales/th.js +3 -0
- package/node_modules/zod/v4/locales/tk.cjs +132 -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 +105 -0
- package/node_modules/zod/v4/locales/tr.cjs +3 -0
- package/node_modules/zod/v4/locales/tr.js +3 -0
- package/node_modules/zod/v4/locales/uk.cjs +3 -0
- package/node_modules/zod/v4/locales/uk.js +3 -0
- package/node_modules/zod/v4/locales/ur.cjs +3 -0
- package/node_modules/zod/v4/locales/ur.js +3 -0
- package/node_modules/zod/v4/locales/uz.cjs +1 -0
- package/node_modules/zod/v4/locales/uz.js +1 -0
- package/node_modules/zod/v4/locales/vi.cjs +3 -0
- package/node_modules/zod/v4/locales/vi.js +3 -0
- package/node_modules/zod/v4/locales/yo.cjs +3 -0
- package/node_modules/zod/v4/locales/yo.js +3 -0
- package/node_modules/zod/v4/locales/zh-CN.cjs +3 -0
- package/node_modules/zod/v4/locales/zh-CN.js +3 -0
- package/node_modules/zod/v4/locales/zh-TW.cjs +3 -0
- package/node_modules/zod/v4/locales/zh-TW.js +3 -0
- package/node_modules/zod/v4/mini/checks.cjs +2 -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/deep-partial.cjs +39 -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 +12 -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 +63 -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/parse.cjs +3 -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 +75 -47
- package/node_modules/zod/v4/mini/schemas.d.cts +43 -13
- package/node_modules/zod/v4/mini/schemas.d.ts +43 -13
- package/node_modules/zod/v4/mini/schemas.js +71 -45
- package/openclaw.plugin.json +120 -42
- package/package.json +16 -7
- package/dist/channel.runtime-CYHw3gcp.js +0 -4
- package/dist/monitor.runtime-BJ0XI3qK.js +0 -2
- package/dist/probe.runtime-CbtMgU4s.js +0 -2
- package/node_modules/zod/src/v4/core/config.ts +0 -15
- /package/dist/{account-helpers-BSUyZwLm.js → .setup/account-helpers-BSUyZwLm.mjs} +0 -0
- /package/dist/{accounts-BBEFMYbY.js → .setup/accounts-BBEFMYbY.mjs} +0 -0
- /package/dist/{webhook-spool-contract-1rY8OJw8.js → .setup/webhook-spool-contract-1rY8OJw8.mjs} +0 -0
|
@@ -1,58 +1,42 @@
|
|
|
1
|
-
import { i as resolveLineAccount, r as resolveDefaultLineAccountId } from "./accounts-BBEFMYbY.
|
|
2
|
-
import { f as
|
|
3
|
-
import { n as findLineHttpError, r as resolveLineNonDispatchRetryable, t as explainLineRefusal, w as
|
|
4
|
-
import { a as eventIdFor, n as LINE_WEBHOOK_SPOOL_INVALID_PAYLOAD_MESSAGE, o as laneKeyFor, r as LineWebhookPayloadError, t as LINE_WEBHOOK_SPOOL_INVALID_EVENT_REASON } from "./webhook-spool-contract-1rY8OJw8.
|
|
5
|
-
import { a as buildTemplateMessageFromPayload, r as processLineMessage } from "./markdown-to-line-
|
|
6
|
-
import { _ as showLoadingAnimation, a as getLineGroupName, d as pushMessageLine, f as pushMessagesLine, h as replyMessageLine, n as createLocationMessage, o as getUserDisplayName, s as getUserProfile, t as createFlexMessage, v as quotesLineBotMessage } from "./send-
|
|
1
|
+
import { i as resolveLineAccount, r as resolveDefaultLineAccountId } from "./accounts-BBEFMYbY.mjs";
|
|
2
|
+
import { b as normalizeAllowFrom, c as resolveLineQuestionPostback, f as buildLineQuickReplyFallbackText, g as resolveLineGroupConfigEntry, i as prepareLineReplyPayload, n as createLineQuickReply, p as getLineRuntime, s as parseLineQuestionPostbackData, x as normalizeLineAllowEntry, y as firstDefined } from "./rich-messages-Cp77q9NY.mjs";
|
|
3
|
+
import { D as recordLineQuoteToken, E as readLineQuoteToken, O as reportLineQuoteCarrierMissing, T as canCarryLineQuoteToken, j as buildLineMediaMessage, k as resolveLineQuoteToken, n as findLineHttpError, r as resolveLineNonDispatchRetryable, t as explainLineRefusal, w as applyLineQuoteToken } from "./send-retry-DaGwYlBO.mjs";
|
|
4
|
+
import { a as eventIdFor, n as LINE_WEBHOOK_SPOOL_INVALID_PAYLOAD_MESSAGE, o as laneKeyFor, r as LineWebhookPayloadError, t as LINE_WEBHOOK_SPOOL_INVALID_EVENT_REASON } from "./webhook-spool-contract-1rY8OJw8.mjs";
|
|
5
|
+
import { a as buildTemplateMessageFromPayload, r as processLineMessage } from "./markdown-to-line-Dvyr_6HD.mjs";
|
|
6
|
+
import { _ as showLoadingAnimation, a as getLineGroupName, d as pushMessageLine, f as pushMessagesLine, h as replyMessageLine, n as createLocationMessage, o as getUserDisplayName, s as getUserProfile, t as createFlexMessage, v as quotesLineBotMessage } from "./send-E6GiL_tr.mjs";
|
|
7
7
|
import { createChannelPairingChallengeIssuer } from "openclaw/plugin-sdk/channel-pairing";
|
|
8
8
|
import { resolveChannelGroupsConfigPath } from "openclaw/plugin-sdk/channel-policy";
|
|
9
9
|
import { normalizeOptionalString, normalizeStringEntries, readNonEmptyStringPreservingWhitespace } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
10
|
-
import { DEFAULT_INGRESS_ADOPTION_STALL_MS, DEFAULT_INGRESS_RETRY_MAX_ATTEMPTS, bindIngressLifecycleToReplyOptions, createChannelIngressMonitor } from "openclaw/plugin-sdk/channel-outbound";
|
|
10
|
+
import { DEFAULT_INGRESS_ADOPTION_STALL_MS, DEFAULT_INGRESS_RETRY_MAX_ATTEMPTS, bindIngressLifecycleToReplyOptions, createChannelIngressMonitor, resolveChannelStreamingBlockEnabled } from "openclaw/plugin-sdk/channel-outbound";
|
|
11
11
|
import { buildChannelInboundEventContext, buildMentionRegexes, formatInboundEnvelope, formatInboundMediaUnavailableText, formatLocationText, hasFinalInboundReplyDispatch, implicitMentionKindWhen, isChannelPartialDeliveryError, logInboundDrop, matchesMentionPatterns, resolveInboundSessionEnvelopeContext, toInboundMediaFactsWithMetadata, toLocationContext } from "openclaw/plugin-sdk/channel-inbound";
|
|
12
12
|
import { collectErrorGraphCandidates, extractErrorCode, formatErrorMessage, readErrorName, toErrorObject } from "openclaw/plugin-sdk/error-runtime";
|
|
13
13
|
import { resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload";
|
|
14
14
|
import { sanitizeAssistantVisibleText } from "openclaw/plugin-sdk/text-chunking";
|
|
15
|
+
import { createNonExitingRuntime, danger, logVerbose, shouldLogVerbose, waitForAbortSignal, warn } from "openclaw/plugin-sdk/runtime-env";
|
|
15
16
|
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
16
17
|
import { classifyTransientNetworkErrorCode } from "openclaw/plugin-sdk/retry-runtime";
|
|
17
18
|
import { fetchWithRuntimeDispatcherOrMockedGlobal } from "openclaw/plugin-sdk/runtime-fetch";
|
|
18
|
-
import { firstDefined } from "openclaw/plugin-sdk/allow-from";
|
|
19
19
|
import { setTimeout as setTimeout$1 } from "node:timers/promises";
|
|
20
20
|
import { MediaFetchError } from "openclaw/plugin-sdk/media-runtime";
|
|
21
21
|
import { saveMediaStream } from "openclaw/plugin-sdk/media-store";
|
|
22
|
-
import { createNonExitingRuntime, danger, logVerbose, shouldLogVerbose, waitForAbortSignal, warn } from "openclaw/plugin-sdk/runtime-env";
|
|
23
22
|
import crypto from "node:crypto";
|
|
24
23
|
import { recordChannelActivity } from "openclaw/plugin-sdk/channel-activity-runtime";
|
|
25
24
|
import { resolveHumanDelayConfig } from "openclaw/plugin-sdk/agent-runtime";
|
|
26
25
|
import { channelReadyPatch, channelStoppedPatch } from "openclaw/plugin-sdk/gateway-runtime";
|
|
27
|
-
import {
|
|
28
|
-
import { canonicalizeWebhookRouteKey, normalizePluginHttpPath, normalizeWebhookPath, registerWebhookTargetWithPluginRoute, resolveSingleWebhookTarget } from "openclaw/plugin-sdk/webhook-ingress";
|
|
26
|
+
import { canonicalizeWebhookRouteKey, registerWebhookTargetWithPluginRoute, resolveSingleWebhookTarget, resolveWebhookPath } from "openclaw/plugin-sdk/webhook-ingress";
|
|
29
27
|
import { beginWebhookRequestPipelineOrReject, createWebhookInFlightLimiter, isRequestBodyLimitError, readRequestBodyWithLimit, requestBodyErrorToText, runDetachedWebhookWork, sendHttpRequestRejection } from "openclaw/plugin-sdk/webhook-request-guards";
|
|
30
28
|
import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
|
|
29
|
+
import { chunkMarkdownText } from "openclaw/plugin-sdk/reply-runtime";
|
|
31
30
|
import { DEFAULT_GROUP_HISTORY_LIMIT, createChannelHistoryWindow } from "openclaw/plugin-sdk/reply-history";
|
|
32
31
|
import { getRuntimeConfig, getRuntimeConfigSnapshot, getRuntimeConfigSourceSnapshot, selectApplicableRuntimeConfig } from "openclaw/plugin-sdk/runtime-config-snapshot";
|
|
33
|
-
import { resolveChannelImplicitMentions, resolveStableChannelMessageIngress } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
32
|
+
import { fanInChannelIngressLifecycles, resolveChannelImplicitMentions, resolveStableChannelMessageIngress } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
34
33
|
import { reportChannelRoomJoin } from "openclaw/plugin-sdk/channel-join-intro-runtime";
|
|
35
34
|
import { hasControlCommand } from "openclaw/plugin-sdk/command-auth-native";
|
|
36
35
|
import { ensureConfiguredBindingRouteReady, readChannelAllowFromStore, resolveConfiguredBindingRoute, resolvePairingIdLabel, resolvePinnedMainDmOwnerFromAllowlist, resolveRuntimeConversationBindingRoute, upsertChannelPairingRequest } from "openclaw/plugin-sdk/conversation-runtime";
|
|
37
36
|
import { resolveAgentRoute, resolveInboundLastRouteSessionKey } from "openclaw/plugin-sdk/routing";
|
|
38
37
|
import { resolveAllowlistProviderRuntimeGroupPolicy, resolveDefaultGroupPolicy, warnMissingProviderGroupPolicyFallbackOnce } from "openclaw/plugin-sdk/runtime-group-policy";
|
|
38
|
+
import { enqueueKeyedTask } from "openclaw/plugin-sdk/keyed-async-queue";
|
|
39
39
|
import { safeEqualSecret } from "openclaw/plugin-sdk/security-runtime";
|
|
40
|
-
//#region extensions/line/src/bot-access.ts
|
|
41
|
-
function normalizeLineAllowEntry(value) {
|
|
42
|
-
const trimmed = String(value).trim();
|
|
43
|
-
if (!trimmed) return "";
|
|
44
|
-
if (trimmed === "*") return "*";
|
|
45
|
-
return trimmed.replace(/^line:(?:user:)?/i, "");
|
|
46
|
-
}
|
|
47
|
-
const normalizeAllowFrom = (list) => {
|
|
48
|
-
const entries = (list ?? []).map((value) => normalizeLineAllowEntry(value)).filter(Boolean);
|
|
49
|
-
return {
|
|
50
|
-
entries,
|
|
51
|
-
hasWildcard: entries.includes("*"),
|
|
52
|
-
hasEntries: entries.length > 0
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
//#endregion
|
|
56
40
|
//#region extensions/line/src/download.ts
|
|
57
41
|
const CONTENT_READY_MAX_ATTEMPTS = 6;
|
|
58
42
|
const CONTENT_READY_BASE_DELAY_MS = 500;
|
|
@@ -187,7 +171,7 @@ function markLineVisibleDeliveryError(error) {
|
|
|
187
171
|
return visibleError;
|
|
188
172
|
}
|
|
189
173
|
async function deliverLineAutoReply(params) {
|
|
190
|
-
const { payload, lineData, replyToken, accountId, to, textLimit
|
|
174
|
+
const { payload, lineData, replyToken, accountId, to, textLimit } = params;
|
|
191
175
|
let replyTokenUsed = params.replyTokenUsed;
|
|
192
176
|
let visibleReplySent = false;
|
|
193
177
|
const sendVisible = async (send) => {
|
|
@@ -201,14 +185,14 @@ async function deliverLineAutoReply(params) {
|
|
|
201
185
|
throw error;
|
|
202
186
|
}
|
|
203
187
|
};
|
|
204
|
-
const replyVisible = (...args) => sendVisible(() =>
|
|
188
|
+
const replyVisible = (...args) => sendVisible(() => replyMessageLine(...args));
|
|
205
189
|
const failedPushSegments = /* @__PURE__ */ new WeakMap();
|
|
206
190
|
const pushLineMessages = async (messages, allowFailedBatchTextRecovery, externalTail = []) => {
|
|
207
191
|
if (messages.length === 0) return;
|
|
208
192
|
for (let i = 0; i < messages.length; i += 5) {
|
|
209
193
|
const batch = messages.slice(i, i + 5);
|
|
210
194
|
try {
|
|
211
|
-
await sendVisible(() =>
|
|
195
|
+
await sendVisible(() => pushMessagesLine(to, batch, {
|
|
212
196
|
cfg: params.cfg,
|
|
213
197
|
accountId
|
|
214
198
|
}));
|
|
@@ -234,7 +218,7 @@ async function deliverLineAutoReply(params) {
|
|
|
234
218
|
});
|
|
235
219
|
} catch (err) {
|
|
236
220
|
if (isChannelPartialDeliveryError(err) || !canFallbackAfterLineReplyFailure(err)) throw err;
|
|
237
|
-
|
|
221
|
+
params.onReplyError?.(err);
|
|
238
222
|
await pushLineMessages(replyBatch, findLineHttpError(err)?.status === 400, remaining.slice(replyBatch.length));
|
|
239
223
|
} finally {
|
|
240
224
|
replyTokenUsed = true;
|
|
@@ -253,23 +237,23 @@ async function deliverLineAutoReply(params) {
|
|
|
253
237
|
}));
|
|
254
238
|
const quickReplyLabels = quickReplyItems.map((item) => item.label);
|
|
255
239
|
const hasQuickReplies = quickReplyItems.length > 0;
|
|
256
|
-
if (lineData.flexMessage) richMessages.push(
|
|
240
|
+
if (lineData.flexMessage) richMessages.push(createFlexMessage(lineData.flexMessage.altText, lineData.flexMessage.contents));
|
|
257
241
|
if (lineData.templateMessage) {
|
|
258
|
-
const templateMsg =
|
|
242
|
+
const templateMsg = buildTemplateMessageFromPayload(lineData.templateMessage);
|
|
259
243
|
if (templateMsg) richMessages.push(templateMsg);
|
|
260
244
|
}
|
|
261
|
-
if (lineData.location) richMessages.push(
|
|
245
|
+
if (lineData.location) richMessages.push(createLocationMessage(lineData.location));
|
|
262
246
|
const visibleText = payload.text ? sanitizeAssistantVisibleText(payload.text) : "";
|
|
263
|
-
const processed = visibleText ?
|
|
247
|
+
const processed = visibleText ? processLineMessage(visibleText) : {
|
|
264
248
|
text: "",
|
|
265
249
|
flexMessages: []
|
|
266
250
|
};
|
|
267
|
-
if (!processed.segments) for (const flexMsg of processed.flexMessages) richMessages.push(
|
|
268
|
-
const orderedMessages = processed.segments?.flatMap((segment) => segment.type === "flex" ? [
|
|
251
|
+
if (!processed.segments) for (const flexMsg of processed.flexMessages) richMessages.push(createFlexMessage(flexMsg.altText, flexMsg.contents));
|
|
252
|
+
const orderedMessages = processed.segments?.flatMap((segment) => segment.type === "flex" ? [createFlexMessage(segment.message.altText, segment.message.contents)] : chunkMarkdownText(segment.text, textLimit).map((text) => ({
|
|
269
253
|
type: "text",
|
|
270
254
|
text
|
|
271
255
|
})));
|
|
272
|
-
const chunks = orderedMessages ? orderedMessages.flatMap((message) => message.type === "text" ? [message.text] : []) : processed.text ?
|
|
256
|
+
const chunks = orderedMessages ? orderedMessages.flatMap((message) => message.type === "text" ? [message.text] : []) : processed.text ? chunkMarkdownText(processed.text, textLimit) : [];
|
|
273
257
|
const mediaUrls = resolveSendableOutboundReplyParts(payload).mediaUrls;
|
|
274
258
|
const mediaOpts = {
|
|
275
259
|
mediaKind: lineData.mediaKind,
|
|
@@ -283,7 +267,7 @@ async function deliverLineAutoReply(params) {
|
|
|
283
267
|
const url = rawUrl?.trim();
|
|
284
268
|
if (!url) continue;
|
|
285
269
|
try {
|
|
286
|
-
mediaMessages.push(await
|
|
270
|
+
mediaMessages.push(await buildLineMediaMessage(url, mediaOpts, to));
|
|
287
271
|
} catch (err) {
|
|
288
272
|
deliveryError ??= err;
|
|
289
273
|
}
|
|
@@ -310,7 +294,15 @@ async function deliverLineAutoReply(params) {
|
|
|
310
294
|
quickReply: createLineQuickReply(quickReplyItems)
|
|
311
295
|
};
|
|
312
296
|
}
|
|
313
|
-
const
|
|
297
|
+
const ordered = hasQuickReplies ? [...richMediaMessages, ...orderedDeliveryMessages ?? textMessages] : [...orderedDeliveryMessages ?? textMessages, ...richMediaMessages];
|
|
298
|
+
const replyQuoteToken = resolveLineQuoteToken({
|
|
299
|
+
cfg: params.cfg,
|
|
300
|
+
accountId,
|
|
301
|
+
chatId: to,
|
|
302
|
+
messageId: payload.replyToId
|
|
303
|
+
});
|
|
304
|
+
if (replyQuoteToken && !ordered.some(canCarryLineQuoteToken)) reportLineQuoteCarrierMissing(to);
|
|
305
|
+
const messages = applyLineQuoteToken(ordered, replyQuoteToken);
|
|
314
306
|
try {
|
|
315
307
|
await sendLineMessages(messages, true);
|
|
316
308
|
} catch (err) {
|
|
@@ -660,11 +652,22 @@ async function buildLineMessageContext(params) {
|
|
|
660
652
|
kind: nativeMediaKind
|
|
661
653
|
})) : nativeMediaKind ? [{ kind: nativeMediaKind }] : [];
|
|
662
654
|
const rawBody = textContent;
|
|
663
|
-
const
|
|
655
|
+
const shortfallNotice = params.missingParts ? `[line: ${params.missingParts === 1 ? "1 more image in this send was" : `${params.missingParts} more images in this send were`} not delivered]` : void 0;
|
|
656
|
+
const withShortfall = shortfallNotice ? formatInboundMediaUnavailableText({
|
|
664
657
|
body: rawBody,
|
|
665
|
-
notice:
|
|
658
|
+
notice: shortfallNotice
|
|
666
659
|
}) : rawBody;
|
|
660
|
+
const agentBody = mediaUnavailable ? formatInboundMediaUnavailableText({
|
|
661
|
+
body: withShortfall,
|
|
662
|
+
notice: "[line attachment unavailable]"
|
|
663
|
+
}) : withShortfall;
|
|
667
664
|
if (!agentBody && mediaFacts.length === 0) return null;
|
|
665
|
+
recordLineQuoteToken({
|
|
666
|
+
accountId: account.accountId,
|
|
667
|
+
chatId: peerId,
|
|
668
|
+
messageId,
|
|
669
|
+
quoteToken: readLineQuoteToken(message)
|
|
670
|
+
});
|
|
668
671
|
let locationContext;
|
|
669
672
|
if (message.type === "location") {
|
|
670
673
|
const loc = message;
|
|
@@ -836,6 +839,39 @@ function isDownloadableLineMessageType(messageType) {
|
|
|
836
839
|
function normalizeLineIngressEntry(value) {
|
|
837
840
|
return normalizeLineAllowEntry(value) || null;
|
|
838
841
|
}
|
|
842
|
+
/**
|
|
843
|
+
* Say one line back to a sender, preferring their reply token so the answer costs no
|
|
844
|
+
* push quota, and falling back to a push when no token is usable. A partial-delivery
|
|
845
|
+
* failure means the reply was seen, so it never falls back.
|
|
846
|
+
*/
|
|
847
|
+
async function sendLineHandlerText(params) {
|
|
848
|
+
const { context, logLabel, text } = params;
|
|
849
|
+
const sendOptions = {
|
|
850
|
+
cfg: context.cfg,
|
|
851
|
+
accountId: context.account.accountId,
|
|
852
|
+
channelAccessToken: context.account.channelAccessToken,
|
|
853
|
+
...params.authorize ? { authorize: params.authorize } : {}
|
|
854
|
+
};
|
|
855
|
+
if (params.replyToken) {
|
|
856
|
+
if (params.authorize && !await params.authorize()) return;
|
|
857
|
+
try {
|
|
858
|
+
await replyMessageLine(params.replyToken, [{
|
|
859
|
+
type: "text",
|
|
860
|
+
text
|
|
861
|
+
}], sendOptions);
|
|
862
|
+
return;
|
|
863
|
+
} catch (err) {
|
|
864
|
+
logVerbose(`${logLabel}: ${String(err)}`);
|
|
865
|
+
if (isChannelPartialDeliveryError(err)) return;
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
if (params.authorize && !await params.authorize()) return;
|
|
869
|
+
try {
|
|
870
|
+
await pushMessageLine(params.pushTarget, text, sendOptions);
|
|
871
|
+
} catch (err) {
|
|
872
|
+
logVerbose(`${logLabel}: ${String(err)}`);
|
|
873
|
+
}
|
|
874
|
+
}
|
|
839
875
|
async function sendLinePairingReply(params) {
|
|
840
876
|
const { senderId, replyToken, context } = params;
|
|
841
877
|
const idLabel = (() => {
|
|
@@ -860,33 +896,18 @@ async function sendLinePairingReply(params) {
|
|
|
860
896
|
onCreated: () => {
|
|
861
897
|
logVerbose(`line pairing request sender=${senderId}`);
|
|
862
898
|
},
|
|
863
|
-
sendPairingReply: async (text) => {
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
accountId: context.account.accountId,
|
|
871
|
-
channelAccessToken: context.account.channelAccessToken
|
|
872
|
-
});
|
|
873
|
-
return;
|
|
874
|
-
} catch (err) {
|
|
875
|
-
logVerbose(`line pairing reply failed for ${senderId}: ${String(err)}`);
|
|
876
|
-
if (isChannelPartialDeliveryError(err)) return;
|
|
877
|
-
}
|
|
878
|
-
try {
|
|
879
|
-
await pushMessageLine(`line:${senderId}`, text, {
|
|
880
|
-
cfg: context.cfg,
|
|
881
|
-
accountId: context.account.accountId,
|
|
882
|
-
channelAccessToken: context.account.channelAccessToken
|
|
883
|
-
});
|
|
884
|
-
} catch (err) {
|
|
885
|
-
logVerbose(`line pairing reply failed for ${senderId}: ${String(err)}`);
|
|
886
|
-
}
|
|
887
|
-
}
|
|
899
|
+
sendPairingReply: async (text) => await sendLineHandlerText({
|
|
900
|
+
context,
|
|
901
|
+
text,
|
|
902
|
+
replyToken,
|
|
903
|
+
pushTarget: `line:${senderId}`,
|
|
904
|
+
logLabel: `line pairing reply failed for ${senderId}`
|
|
905
|
+
})
|
|
888
906
|
});
|
|
889
907
|
}
|
|
908
|
+
function isLineEventAdmitted(access) {
|
|
909
|
+
return access.senderAccess.decision === "allow" && (access.ingress.admission === "dispatch" || access.ingress.admission === "observe" || access.ingress.admission === "skip");
|
|
910
|
+
}
|
|
890
911
|
async function resolveLineEventAdmission(event, context) {
|
|
891
912
|
const { cfg, account } = context;
|
|
892
913
|
const { userId, groupId, roomId, isGroup } = getLineSourceInfo(event.source);
|
|
@@ -983,7 +1004,7 @@ async function resolveLineEventAdmission(event, context) {
|
|
|
983
1004
|
access,
|
|
984
1005
|
resolveBoundAccess: resolveAccess
|
|
985
1006
|
} : null;
|
|
986
|
-
if (
|
|
1007
|
+
if (isLineEventAdmitted(access)) return {
|
|
987
1008
|
access,
|
|
988
1009
|
resolveBoundAccess: resolveAccess,
|
|
989
1010
|
mentions: mentionFacts ? {
|
|
@@ -1048,7 +1069,7 @@ function resolveEventRawText(event) {
|
|
|
1048
1069
|
if (event.type === "postback") return event.postback?.data?.trim() ?? "";
|
|
1049
1070
|
return "";
|
|
1050
1071
|
}
|
|
1051
|
-
async function handleMessageEvent(event, context) {
|
|
1072
|
+
async function handleMessageEvent(event, context, setParts) {
|
|
1052
1073
|
const { cfg, account, runtime, mediaMaxBytes, processMessage } = context;
|
|
1053
1074
|
const message = event.message;
|
|
1054
1075
|
const decision = await resolveLineEventAdmission(event, context);
|
|
@@ -1098,11 +1119,12 @@ async function handleMessageEvent(event, context) {
|
|
|
1098
1119
|
try {
|
|
1099
1120
|
const allMedia = [];
|
|
1100
1121
|
let mediaUnavailable = false;
|
|
1101
|
-
|
|
1102
|
-
|
|
1122
|
+
const abortSignal = context.turnAdoptionLifecycle?.abortSignal;
|
|
1123
|
+
for (const part of orderedLineSetMessages(message, setParts)) {
|
|
1124
|
+
if (!isDownloadableLineMessageType(part.type)) continue;
|
|
1103
1125
|
try {
|
|
1104
|
-
const originalFilename =
|
|
1105
|
-
const media = await downloadLineMedia(
|
|
1126
|
+
const originalFilename = part.type === "file" ? normalizeOptionalString(part.fileName) : void 0;
|
|
1127
|
+
const media = await downloadLineMedia(part.id, account.channelAccessToken, mediaMaxBytes, {
|
|
1106
1128
|
originalFilename,
|
|
1107
1129
|
...abortSignal ? { signal: abortSignal } : {}
|
|
1108
1130
|
});
|
|
@@ -1117,14 +1139,15 @@ async function handleMessageEvent(event, context) {
|
|
|
1117
1139
|
if (isRetryableLineInboundMediaError(err)) throw err;
|
|
1118
1140
|
mediaUnavailable = true;
|
|
1119
1141
|
const errMsg = String(err);
|
|
1120
|
-
if (errMsg.includes("exceeds") && errMsg.includes("limit")) logVerbose(`line: media exceeds size limit for message ${
|
|
1142
|
+
if (errMsg.includes("exceeds") && errMsg.includes("limit")) logVerbose(`line: media exceeds size limit for message ${part.id}`);
|
|
1121
1143
|
else runtime.error?.(danger(`line: failed to download media: ${errMsg}`));
|
|
1122
1144
|
}
|
|
1123
1145
|
}
|
|
1124
1146
|
const messageContext = await buildLineMessageContext({
|
|
1125
|
-
event,
|
|
1126
|
-
allMedia,
|
|
1147
|
+
event: setParts.reduce((freshest, part) => part.timestamp > freshest.timestamp ? part : freshest, event),
|
|
1148
|
+
allMedia: [...allMedia],
|
|
1127
1149
|
mediaUnavailable,
|
|
1150
|
+
...context.missingParts === void 0 ? {} : { missingParts: context.missingParts },
|
|
1128
1151
|
cfg,
|
|
1129
1152
|
account,
|
|
1130
1153
|
commandAuthorized: decision.access.commandAccess.authorized,
|
|
@@ -1133,15 +1156,14 @@ async function handleMessageEvent(event, context) {
|
|
|
1133
1156
|
mentions: decision.mentions,
|
|
1134
1157
|
buildContext: context.buildContext
|
|
1135
1158
|
});
|
|
1136
|
-
if (!messageContext)
|
|
1137
|
-
|
|
1138
|
-
|
|
1159
|
+
if (!messageContext) logVerbose("line: skipping empty message");
|
|
1160
|
+
else {
|
|
1161
|
+
await processMessage(messageContext, {
|
|
1162
|
+
cfg: context.cfg,
|
|
1163
|
+
...context.turnAdoptionLifecycle ? { turnAdoptionLifecycle: context.turnAdoptionLifecycle } : {}
|
|
1164
|
+
});
|
|
1165
|
+
historyReservation.commit();
|
|
1139
1166
|
}
|
|
1140
|
-
await processMessage(messageContext, {
|
|
1141
|
-
cfg,
|
|
1142
|
-
...context.turnAdoptionLifecycle ? { turnAdoptionLifecycle: context.turnAdoptionLifecycle } : {}
|
|
1143
|
-
});
|
|
1144
|
-
historyReservation.commit();
|
|
1145
1167
|
} finally {
|
|
1146
1168
|
historyReservation.release();
|
|
1147
1169
|
}
|
|
@@ -1195,11 +1217,39 @@ async function handleLeaveEvent(event, _context) {
|
|
|
1195
1217
|
const { groupId, roomId } = getLineSourceInfo(event.source);
|
|
1196
1218
|
logVerbose(`line: bot left ${groupId ? `group ${groupId}` : `room ${roomId}`}`);
|
|
1197
1219
|
}
|
|
1220
|
+
/** What a tap that did not answer the question has to tell the person who tapped. */
|
|
1221
|
+
function lineQuestionOutcomeNotice(status) {
|
|
1222
|
+
if (status === "already-terminal") return "That question is no longer waiting for an answer.";
|
|
1223
|
+
return "Could not record that answer. Reply with the option text instead.";
|
|
1224
|
+
}
|
|
1198
1225
|
async function handlePostbackEvent(event, context) {
|
|
1199
1226
|
const data = event.postback.data;
|
|
1200
1227
|
logVerbose(`line: received postback: ${data}`);
|
|
1201
1228
|
const decision = await resolveLineEventAdmission(event, context);
|
|
1202
1229
|
if (!decision) return;
|
|
1230
|
+
const question = parseLineQuestionPostbackData(data ?? "");
|
|
1231
|
+
if (question) {
|
|
1232
|
+
const { userId, groupId, roomId } = getLineSourceInfo(event.source);
|
|
1233
|
+
const authorize = async () => isLineEventAdmitted(await decision.resolveBoundAccess());
|
|
1234
|
+
const outcome = await resolveLineQuestionPostback({
|
|
1235
|
+
cfg: context.cfg,
|
|
1236
|
+
callback: question,
|
|
1237
|
+
accountId: context.account.accountId,
|
|
1238
|
+
...userId ? { senderId: userId } : {},
|
|
1239
|
+
authorize
|
|
1240
|
+
});
|
|
1241
|
+
const pushTarget = groupId ?? roomId ?? (userId ? `line:${userId}` : void 0);
|
|
1242
|
+
if (outcome.status === "answered" || outcome.status === "denied" || !pushTarget) return;
|
|
1243
|
+
await sendLineHandlerText({
|
|
1244
|
+
context,
|
|
1245
|
+
replyToken: event.replyToken,
|
|
1246
|
+
pushTarget,
|
|
1247
|
+
logLabel: "line: question answer notice failed",
|
|
1248
|
+
text: lineQuestionOutcomeNotice(outcome.status),
|
|
1249
|
+
authorize
|
|
1250
|
+
});
|
|
1251
|
+
return;
|
|
1252
|
+
}
|
|
1203
1253
|
const postbackContext = await buildLinePostbackContext({
|
|
1204
1254
|
event,
|
|
1205
1255
|
cfg: context.cfg,
|
|
@@ -1214,20 +1264,31 @@ async function handlePostbackEvent(event, context) {
|
|
|
1214
1264
|
...context.turnAdoptionLifecycle ? { turnAdoptionLifecycle: context.turnAdoptionLifecycle } : {}
|
|
1215
1265
|
});
|
|
1216
1266
|
}
|
|
1267
|
+
/** Media reads in the order the sender picked, whatever order LINE delivered. */
|
|
1268
|
+
function orderedLineSetMessages(message, setParts) {
|
|
1269
|
+
const messages = [message, ...setParts.map((partEvent) => partEvent.message)];
|
|
1270
|
+
const indexOf = (part) => part.type === "image" ? part.imageSet?.index ?? Number.MAX_SAFE_INTEGER : 0;
|
|
1271
|
+
return messages.toSorted((left, right) => indexOf(left) - indexOf(right));
|
|
1272
|
+
}
|
|
1273
|
+
/**
|
|
1274
|
+
* Answers one delivery as one turn. The ingress spool decides which events share
|
|
1275
|
+
* a turn - a multi-image send is handed over as one delivery - so the first
|
|
1276
|
+
* event is the turn's own and the rest are the set parts behind it.
|
|
1277
|
+
*/
|
|
1217
1278
|
async function handleLineWebhookEvents(events, context) {
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1279
|
+
const [event, ...setParts] = events;
|
|
1280
|
+
if (!event) return;
|
|
1281
|
+
try {
|
|
1282
|
+
await handleLineWebhookEvent(event, context, setParts);
|
|
1221
1283
|
} catch (err) {
|
|
1222
1284
|
context.runtime.error?.(danger(`line: event handler failed: ${String(err)}`));
|
|
1223
|
-
|
|
1285
|
+
throw toErrorObject(err, "Non-Error thrown");
|
|
1224
1286
|
}
|
|
1225
|
-
if (firstError) throw toErrorObject(firstError, "Non-Error thrown");
|
|
1226
1287
|
}
|
|
1227
|
-
async function handleLineWebhookEvent(event, context) {
|
|
1288
|
+
async function handleLineWebhookEvent(event, context, setParts = []) {
|
|
1228
1289
|
switch (event.type) {
|
|
1229
1290
|
case "message":
|
|
1230
|
-
await handleMessageEvent(event, context);
|
|
1291
|
+
await handleMessageEvent(event, context, setParts.filter((part) => part.type === "message"));
|
|
1231
1292
|
break;
|
|
1232
1293
|
case "follow":
|
|
1233
1294
|
await handleFollowEvent(event, context);
|
|
@@ -1248,6 +1309,125 @@ async function handleLineWebhookEvent(event, context) {
|
|
|
1248
1309
|
}
|
|
1249
1310
|
}
|
|
1250
1311
|
//#endregion
|
|
1312
|
+
//#region extensions/line/src/inbound-image-set.ts
|
|
1313
|
+
const IMAGE_SET_FLUSH_DELAY_MS = 4e3;
|
|
1314
|
+
/**
|
|
1315
|
+
* Ordered by the index the sender picked, falling back to arrival.
|
|
1316
|
+
*
|
|
1317
|
+
* `index` is optional per part in LINE's contract, so a set can arrive partly
|
|
1318
|
+
* indexed. Choosing the key per pair would make the comparator intransitive and
|
|
1319
|
+
* the resulting order depend on insertion; ranking unindexed parts last keeps
|
|
1320
|
+
* one total order for every mix.
|
|
1321
|
+
*/
|
|
1322
|
+
function orderedParts(pending) {
|
|
1323
|
+
return [...pending.parts.values()].toSorted((left, right) => (left.index ?? Number.MAX_SAFE_INTEGER) - (right.index ?? Number.MAX_SAFE_INTEGER) || left.arrivedAt - right.arrivedAt);
|
|
1324
|
+
}
|
|
1325
|
+
/**
|
|
1326
|
+
* Buffers the parts of a LINE image set until the set is whole.
|
|
1327
|
+
*
|
|
1328
|
+
* The first part becomes the set's holder: its call does not resolve until the
|
|
1329
|
+
* set completes or its wait expires, and it is the one that delivers. Keeping
|
|
1330
|
+
* that call open is what keeps the combined turn inside a live ingress
|
|
1331
|
+
* adoption - a turn dispatched after every part had returned is refused by
|
|
1332
|
+
* admission, so a set that never completes would never be delivered at all.
|
|
1333
|
+
*/
|
|
1334
|
+
function createLineImageSetIngressBuffer() {
|
|
1335
|
+
const pendingBySet = /* @__PURE__ */ new Map();
|
|
1336
|
+
const deliveredBySet = /* @__PURE__ */ new Map();
|
|
1337
|
+
const pendingKey = (laneKey, senderKey, setId) => `${laneKey}\u0000${senderKey}\u0000${setId}`;
|
|
1338
|
+
const laneChain = /* @__PURE__ */ new Map();
|
|
1339
|
+
const enterLane = async (laneKey) => {
|
|
1340
|
+
let release = () => {};
|
|
1341
|
+
const held = new Promise((resolve) => {
|
|
1342
|
+
release = resolve;
|
|
1343
|
+
});
|
|
1344
|
+
let entered = () => {};
|
|
1345
|
+
const turn = new Promise((resolve) => {
|
|
1346
|
+
entered = resolve;
|
|
1347
|
+
});
|
|
1348
|
+
enqueueKeyedTask({
|
|
1349
|
+
tails: laneChain,
|
|
1350
|
+
key: laneKey,
|
|
1351
|
+
task: async () => {
|
|
1352
|
+
entered();
|
|
1353
|
+
await held;
|
|
1354
|
+
}
|
|
1355
|
+
});
|
|
1356
|
+
await turn;
|
|
1357
|
+
return release;
|
|
1358
|
+
};
|
|
1359
|
+
const admit = async (input) => {
|
|
1360
|
+
const part = {
|
|
1361
|
+
index: input.index,
|
|
1362
|
+
arrivedAt: Date.now(),
|
|
1363
|
+
event: input.event,
|
|
1364
|
+
lifecycle: input.lifecycle
|
|
1365
|
+
};
|
|
1366
|
+
const key = pendingKey(input.laneKey, input.senderKey, input.setId);
|
|
1367
|
+
const forming = pendingBySet.get(key);
|
|
1368
|
+
if (forming) {
|
|
1369
|
+
forming.parts.set(input.messageId, part);
|
|
1370
|
+
forming.total ??= input.total;
|
|
1371
|
+
if (forming.total !== void 0 && forming.parts.size >= forming.total) {
|
|
1372
|
+
forming.release();
|
|
1373
|
+
return null;
|
|
1374
|
+
}
|
|
1375
|
+
if (forming.timer) {
|
|
1376
|
+
clearTimeout(forming.timer);
|
|
1377
|
+
forming.timer = setTimeout(forming.release, forming.flushDelayMs);
|
|
1378
|
+
forming.timer.unref?.();
|
|
1379
|
+
}
|
|
1380
|
+
return null;
|
|
1381
|
+
}
|
|
1382
|
+
let release = () => {};
|
|
1383
|
+
const whole = new Promise((resolve) => {
|
|
1384
|
+
release = resolve;
|
|
1385
|
+
});
|
|
1386
|
+
const pending = {
|
|
1387
|
+
parts: /* @__PURE__ */ new Map([[input.messageId, part]]),
|
|
1388
|
+
total: input.total,
|
|
1389
|
+
flushDelayMs: input.flushDelayMs ?? IMAGE_SET_FLUSH_DELAY_MS,
|
|
1390
|
+
release: () => {
|
|
1391
|
+
clearTimeout(pending.timer);
|
|
1392
|
+
release();
|
|
1393
|
+
}
|
|
1394
|
+
};
|
|
1395
|
+
pendingBySet.set(key, pending);
|
|
1396
|
+
const carried = deliveredBySet.get(key);
|
|
1397
|
+
if (carried) {
|
|
1398
|
+
clearTimeout(carried.timer);
|
|
1399
|
+
deliveredBySet.delete(key);
|
|
1400
|
+
}
|
|
1401
|
+
const carriedMessageIds = carried?.messageIds ?? /* @__PURE__ */ new Set();
|
|
1402
|
+
const releaseLane = await enterLane(input.laneKey);
|
|
1403
|
+
pending.timer = setTimeout(pending.release, pending.flushDelayMs);
|
|
1404
|
+
pending.timer.unref?.();
|
|
1405
|
+
if (pending.total !== void 0 && pending.parts.size >= pending.total) pending.release();
|
|
1406
|
+
await whole;
|
|
1407
|
+
pendingBySet.delete(key);
|
|
1408
|
+
const ordered = orderedParts(pending);
|
|
1409
|
+
const deliveredMessageIds = /* @__PURE__ */ new Set([...carriedMessageIds, ...pending.parts.keys()]);
|
|
1410
|
+
const missing = pending.total === void 0 ? 0 : pending.total - deliveredMessageIds.size;
|
|
1411
|
+
if (missing > 0) {
|
|
1412
|
+
const carry = { messageIds: deliveredMessageIds };
|
|
1413
|
+
carry.timer = setTimeout(() => deliveredBySet.delete(key), pending.flushDelayMs * 5);
|
|
1414
|
+
carry.timer.unref?.();
|
|
1415
|
+
deliveredBySet.set(key, carry);
|
|
1416
|
+
}
|
|
1417
|
+
return {
|
|
1418
|
+
events: ordered.map((entry) => entry.event),
|
|
1419
|
+
lifecycles: ordered.map((entry) => entry.lifecycle),
|
|
1420
|
+
...missing > 0 ? { missing } : {},
|
|
1421
|
+
finish: releaseLane
|
|
1422
|
+
};
|
|
1423
|
+
};
|
|
1424
|
+
return {
|
|
1425
|
+
admit,
|
|
1426
|
+
enterLane,
|
|
1427
|
+
isBusy: (laneKey) => laneChain.has(laneKey)
|
|
1428
|
+
};
|
|
1429
|
+
}
|
|
1430
|
+
//#endregion
|
|
1251
1431
|
//#region extensions/line/src/webhook-spool.ts
|
|
1252
1432
|
const LINE_WEBHOOK_DRAIN_INTERVAL_MS = 500;
|
|
1253
1433
|
const LINE_WEBHOOK_MAX_CONCURRENT_DELIVERIES = 8;
|
|
@@ -1285,7 +1465,24 @@ async function waitForActiveDeliveriesBeforeDispose(activeDeliveries) {
|
|
|
1285
1465
|
if (timeout) clearTimeout(timeout);
|
|
1286
1466
|
}
|
|
1287
1467
|
}
|
|
1468
|
+
/** The imageSet a LINE inbound event belongs to, when it reported one. */
|
|
1469
|
+
function senderKeyFor(event) {
|
|
1470
|
+
const source = event.source;
|
|
1471
|
+
return source && "userId" in source && source.userId ? `user:${source.userId}` : "anonymous";
|
|
1472
|
+
}
|
|
1473
|
+
function resolveLineInboundImageSet(event) {
|
|
1474
|
+
if (event.type !== "message" || event.message.type !== "image") return;
|
|
1475
|
+
const imageSet = event.message.imageSet;
|
|
1476
|
+
return imageSet?.id ? {
|
|
1477
|
+
setId: imageSet.id,
|
|
1478
|
+
senderKey: senderKeyFor(event),
|
|
1479
|
+
messageId: event.message.id,
|
|
1480
|
+
...imageSet.index === void 0 ? {} : { index: imageSet.index },
|
|
1481
|
+
...imageSet.total === void 0 ? {} : { total: imageSet.total }
|
|
1482
|
+
} : void 0;
|
|
1483
|
+
}
|
|
1288
1484
|
function createLineWebhookSpool(options) {
|
|
1485
|
+
const imageSets = createLineImageSetIngressBuffer();
|
|
1289
1486
|
const queue = options.queue ?? getLineRuntime().state.openChannelIngressQueue({ accountId: options.accountId });
|
|
1290
1487
|
const activeDeliveries = /* @__PURE__ */ new Set();
|
|
1291
1488
|
let acceptsDeferredClaims = true;
|
|
@@ -1326,39 +1523,90 @@ function createLineWebhookSpool(options) {
|
|
|
1326
1523
|
createClaimError: (kind) => new LineWebhookPayloadError(kind === "invalid-version" ? LINE_WEBHOOK_SPOOL_INVALID_PAYLOAD_MESSAGE : "LINE webhook event identity changed after durable admission.")
|
|
1327
1524
|
},
|
|
1328
1525
|
deliver: async ({ event, destination }, lifecycle) => {
|
|
1329
|
-
const
|
|
1526
|
+
const laneKey = laneKeyFor(event, eventIdFor(event));
|
|
1527
|
+
const imageSet = resolveLineInboundImageSet(event);
|
|
1528
|
+
let turnEvents = [event];
|
|
1529
|
+
let turnLifecycles = [lifecycle];
|
|
1530
|
+
let releaseLane;
|
|
1531
|
+
let missingParts;
|
|
1532
|
+
if (imageSet) {
|
|
1533
|
+
if (!acceptsDeferredClaims) {
|
|
1534
|
+
await lifecycle.onAbandoned();
|
|
1535
|
+
return;
|
|
1536
|
+
}
|
|
1537
|
+
lifecycle.onDeferred();
|
|
1538
|
+
const set = await imageSets.admit({
|
|
1539
|
+
laneKey,
|
|
1540
|
+
setId: imageSet.setId,
|
|
1541
|
+
senderKey: imageSet.senderKey,
|
|
1542
|
+
messageId: imageSet.messageId,
|
|
1543
|
+
event,
|
|
1544
|
+
lifecycle,
|
|
1545
|
+
...imageSet.index === void 0 ? {} : { index: imageSet.index },
|
|
1546
|
+
...imageSet.total === void 0 ? {} : { total: imageSet.total }
|
|
1547
|
+
});
|
|
1548
|
+
if (!set) return;
|
|
1549
|
+
if (set.missing) {
|
|
1550
|
+
missingParts = set.missing;
|
|
1551
|
+
options.runtime.error?.(danger(`line: image set ${imageSet.setId} delivered ${set.events.length} of the send's parts, ${set.missing} still missing`));
|
|
1552
|
+
}
|
|
1553
|
+
turnEvents = set.events;
|
|
1554
|
+
turnLifecycles = set.lifecycles;
|
|
1555
|
+
releaseLane = set.finish;
|
|
1556
|
+
} else if (imageSets.isBusy(laneKey)) {
|
|
1557
|
+
if (!acceptsDeferredClaims) {
|
|
1558
|
+
await lifecycle.onAbandoned();
|
|
1559
|
+
return;
|
|
1560
|
+
}
|
|
1561
|
+
lifecycle.onDeferred();
|
|
1562
|
+
releaseLane = await imageSets.enterLane(laneKey);
|
|
1563
|
+
}
|
|
1564
|
+
const fannedIn = fanInChannelIngressLifecycles(turnLifecycles);
|
|
1565
|
+
const boundLifecycle = bindIngressLifecycleToReplyOptions(fannedIn.lifecycle ?? lifecycle).turnAdoptionLifecycle;
|
|
1330
1566
|
let handedOff = false;
|
|
1331
|
-
const delivery = options.deliver(
|
|
1332
|
-
...
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1567
|
+
const delivery = options.deliver(turnEvents, destination, {
|
|
1568
|
+
...missingParts === void 0 ? {} : { missingParts },
|
|
1569
|
+
turnAdoptionLifecycle: {
|
|
1570
|
+
...boundLifecycle,
|
|
1571
|
+
onAdopted: async () => {
|
|
1572
|
+
handedOff = true;
|
|
1573
|
+
await boundLifecycle.onAdopted();
|
|
1574
|
+
},
|
|
1575
|
+
onDeferred: () => {
|
|
1576
|
+
handedOff = true;
|
|
1577
|
+
if (!acceptsDeferredClaims) {
|
|
1578
|
+
Promise.resolve().then(() => boundLifecycle.onAbandoned()).catch((error) => {
|
|
1579
|
+
options.runtime.error?.(danger(`line: failed to abandon a late webhook delivery: ${formatErrorMessage(error)}`));
|
|
1580
|
+
});
|
|
1581
|
+
return;
|
|
1582
|
+
}
|
|
1583
|
+
boundLifecycle.onDeferred();
|
|
1584
|
+
},
|
|
1585
|
+
onAbandoned: async () => {
|
|
1586
|
+
handedOff = true;
|
|
1587
|
+
await boundLifecycle.onAbandoned();
|
|
1344
1588
|
}
|
|
1345
|
-
boundLifecycle.onDeferred();
|
|
1346
|
-
},
|
|
1347
|
-
onAbandoned: async () => {
|
|
1348
|
-
handedOff = true;
|
|
1349
|
-
await boundLifecycle.onAbandoned();
|
|
1350
1589
|
}
|
|
1351
|
-
}
|
|
1590
|
+
});
|
|
1352
1591
|
activeDeliveries.add(delivery);
|
|
1353
1592
|
try {
|
|
1354
1593
|
await delivery;
|
|
1594
|
+
} catch (error) {
|
|
1595
|
+
await fannedIn.abandon(error);
|
|
1596
|
+
handedOff = true;
|
|
1597
|
+
throw error;
|
|
1355
1598
|
} finally {
|
|
1356
1599
|
activeDeliveries.delete(delivery);
|
|
1600
|
+
releaseLane?.();
|
|
1601
|
+
}
|
|
1602
|
+
if (!handedOff && !stopTask) {
|
|
1603
|
+
await fannedIn.settle();
|
|
1604
|
+
handedOff = true;
|
|
1605
|
+
}
|
|
1606
|
+
if (stopTask && !handedOff) {
|
|
1607
|
+
await fannedIn.abandon();
|
|
1608
|
+
return;
|
|
1357
1609
|
}
|
|
1358
|
-
if (stopTask && !handedOff) return {
|
|
1359
|
-
kind: "failed-retryable",
|
|
1360
|
-
error: /* @__PURE__ */ new Error("LINE webhook spool stopped before delivery handoff.")
|
|
1361
|
-
};
|
|
1362
1610
|
},
|
|
1363
1611
|
pollIntervalMs: LINE_WEBHOOK_DRAIN_INTERVAL_MS,
|
|
1364
1612
|
retention: {
|
|
@@ -1374,6 +1622,7 @@ function createLineWebhookSpool(options) {
|
|
|
1374
1622
|
admissionMode: "durable-after-stop",
|
|
1375
1623
|
drain: {
|
|
1376
1624
|
adoptionStallTimeoutMs: DEFAULT_INGRESS_ADOPTION_STALL_MS,
|
|
1625
|
+
deferredLaneOccupancy: "release",
|
|
1377
1626
|
orderBy: "received",
|
|
1378
1627
|
scanLimit: LINE_WEBHOOK_DRAIN_SCAN_LIMIT,
|
|
1379
1628
|
startLimit: LINE_WEBHOOK_MAX_CONCURRENT_DELIVERIES,
|
|
@@ -1457,9 +1706,9 @@ function createLineBot(opts) {
|
|
|
1457
1706
|
const spool = createLineWebhookSpool({
|
|
1458
1707
|
accountId: account.accountId,
|
|
1459
1708
|
runtime,
|
|
1460
|
-
deliver: async (
|
|
1709
|
+
deliver: async (events, _destination, control) => {
|
|
1461
1710
|
const cfg = resolveTurnConfig();
|
|
1462
|
-
await handleLineWebhookEvents([
|
|
1711
|
+
await handleLineWebhookEvents([...events], {
|
|
1463
1712
|
cfg,
|
|
1464
1713
|
account,
|
|
1465
1714
|
runtime,
|
|
@@ -1467,6 +1716,7 @@ function createLineBot(opts) {
|
|
|
1467
1716
|
mediaMaxBytes,
|
|
1468
1717
|
processMessage,
|
|
1469
1718
|
...control.turnAdoptionLifecycle ? { turnAdoptionLifecycle: control.turnAdoptionLifecycle } : {},
|
|
1719
|
+
...control.missingParts === void 0 ? {} : { missingParts: control.missingParts },
|
|
1470
1720
|
groupHistories,
|
|
1471
1721
|
historyLimit: account.config.historyLimit ?? cfg.messages?.groupChat?.historyLimit ?? DEFAULT_GROUP_HISTORY_LIMIT
|
|
1472
1722
|
});
|
|
@@ -1501,6 +1751,18 @@ function validateLineSignature(body, signature, channelSecret) {
|
|
|
1501
1751
|
}
|
|
1502
1752
|
//#endregion
|
|
1503
1753
|
//#region extensions/line/src/webhook-utils.ts
|
|
1754
|
+
/** Route the gateway serves when an account configures no `webhookPath`. */
|
|
1755
|
+
const LINE_DEFAULT_WEBHOOK_PATH = "/line/webhook";
|
|
1756
|
+
/** The route this account's monitor serves, which is the one an operator has to register
|
|
1757
|
+
* with LINE. Every surface resolves it here so a warning cannot name a path the gateway
|
|
1758
|
+
* does not answer on. Route registration canonicalizes further, and matches requests the
|
|
1759
|
+
* same way, so a path resolved here always reaches the route the monitor registered. */
|
|
1760
|
+
function resolveLineWebhookPath(webhookPath) {
|
|
1761
|
+
return resolveWebhookPath({
|
|
1762
|
+
webhookPath,
|
|
1763
|
+
defaultPath: LINE_DEFAULT_WEBHOOK_PATH
|
|
1764
|
+
}) ?? LINE_DEFAULT_WEBHOOK_PATH;
|
|
1765
|
+
}
|
|
1504
1766
|
function parseLineWebhookBody(rawBody) {
|
|
1505
1767
|
try {
|
|
1506
1768
|
return JSON.parse(rawBody);
|
|
@@ -1661,9 +1923,15 @@ async function monitorLineProvider(opts) {
|
|
|
1661
1923
|
const ingressLifecycle = deliveryControl.turnAdoptionLifecycle;
|
|
1662
1924
|
const turnAbortSignal = ingressLifecycle?.abortSignal;
|
|
1663
1925
|
const skillFilter = ctx.skillFilter;
|
|
1664
|
-
const
|
|
1926
|
+
const blockStreaming = resolveChannelStreamingBlockEnabled(resolveLineAccount({
|
|
1927
|
+
cfg: turnConfig,
|
|
1928
|
+
accountId: route.accountId
|
|
1929
|
+
}).config) ?? resolveChannelStreamingBlockEnabled(turnConfig.channels?.line);
|
|
1930
|
+
const disableBlockStreaming = typeof blockStreaming === "boolean" ? !blockStreaming : void 0;
|
|
1931
|
+
const replyOptions = turnAbortSignal || skillFilter || disableBlockStreaming !== void 0 ? {
|
|
1665
1932
|
...turnAbortSignal ? { abortSignal: turnAbortSignal } : {},
|
|
1666
|
-
...skillFilter ? { skillFilter } : {}
|
|
1933
|
+
...skillFilter ? { skillFilter } : {},
|
|
1934
|
+
...disableBlockStreaming !== void 0 ? { disableBlockStreaming } : {}
|
|
1667
1935
|
} : void 0;
|
|
1668
1936
|
try {
|
|
1669
1937
|
const textLimit = 5e3;
|
|
@@ -1698,7 +1966,7 @@ async function monitorLineProvider(opts) {
|
|
|
1698
1966
|
dispatcherOptions: { humanDelay: resolveHumanDelayConfig(turnConfig, route.agentId) },
|
|
1699
1967
|
...replyOptions ? { replyOptions } : {},
|
|
1700
1968
|
delivery: {
|
|
1701
|
-
preparePayload: prepareLineReplyPayload,
|
|
1969
|
+
preparePayload: (payload) => prepareLineReplyPayload(payload, ctxPayload.From),
|
|
1702
1970
|
durable: (payload, info) => resolveLineDurableReplyOptions({
|
|
1703
1971
|
payload,
|
|
1704
1972
|
infoKind: info.kind,
|
|
@@ -1721,18 +1989,8 @@ async function monitorLineProvider(opts) {
|
|
|
1721
1989
|
accountId: ctx.accountId,
|
|
1722
1990
|
cfg: turnConfig,
|
|
1723
1991
|
textLimit,
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
processLineMessage,
|
|
1727
|
-
chunkMarkdownText,
|
|
1728
|
-
replyMessageLine,
|
|
1729
|
-
pushMessagesLine,
|
|
1730
|
-
createFlexMessage,
|
|
1731
|
-
buildMediaMessage: buildLineMediaMessage,
|
|
1732
|
-
createLocationMessage,
|
|
1733
|
-
onReplyError: (replyErr) => {
|
|
1734
|
-
logVerbose(`line: reply token failed, falling back to push: ${String(replyErr)}`);
|
|
1735
|
-
}
|
|
1992
|
+
onReplyError: (replyErr) => {
|
|
1993
|
+
logVerbose(`line: reply token failed, falling back to push: ${String(replyErr)}`);
|
|
1736
1994
|
}
|
|
1737
1995
|
});
|
|
1738
1996
|
replyTokenUsed = deliveryResult.replyTokenUsed;
|
|
@@ -1757,7 +2015,7 @@ async function monitorLineProvider(opts) {
|
|
|
1757
2015
|
}
|
|
1758
2016
|
}
|
|
1759
2017
|
});
|
|
1760
|
-
const normalizedPath =
|
|
2018
|
+
const normalizedPath = resolveLineWebhookPath(webhookPath);
|
|
1761
2019
|
const webhookRouteKey = canonicalizeWebhookRouteKey(normalizedPath);
|
|
1762
2020
|
const createScopedLineWebhookHandler = (target) => createLineNodeWebhookHandler({
|
|
1763
2021
|
channelSecret: target.channelSecret,
|
|
@@ -1885,4 +2143,4 @@ async function monitorLineProvider(opts) {
|
|
|
1885
2143
|
};
|
|
1886
2144
|
}
|
|
1887
2145
|
//#endregion
|
|
1888
|
-
export {
|
|
2146
|
+
export { resolveLineWebhookPath as a, parseLineWebhookBody as i, createLineNodeWebhookHandler as n, validateLineSignature as o, readLineWebhookRequestBody as r, downloadLineMedia as s, monitorLineProvider as t };
|