@openclaw/voice-call 2026.7.1-beta.2 → 2026.7.1-beta.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/README.md +1 -0
- package/dist/{config-DNtTB7Iw.js → config-CgigQDrF.js} +31 -13
- package/dist/{config-compat-CCEjHjAJ.js → config-compat-DAFd5tVH.js} +3 -2
- package/dist/doctor-contract-api.js +4 -22
- package/dist/{guarded-json-api-7ITxTL6G.js → guarded-json-api-BrBbW_RJ.js} +19 -57
- package/dist/index.js +46 -33
- package/dist/{mock-YAo3QDri.js → mock-YsvBTX-7.js} +18 -2
- package/dist/{plivo-wmeT9r_t.js → plivo-BnCuAGwj.js} +25 -6
- package/dist/{realtime-handler-DdViwdCW.js → realtime-handler-Bz-MNWtD.js} +103 -43
- package/dist/response-generator-PXuisI3L.js +272 -0
- package/dist/{runtime-entry-DN7HllXj.js → runtime-entry-kCq5Xjph.js} +234 -96
- package/dist/runtime-entry.js +1 -1
- package/dist/setup-api.js +1 -1
- package/dist/{store-8M2m4Isq.js → store-DtewuuOb.js} +23 -6
- package/dist/{telnyx-DuUBsPW2.js → telnyx-DTHQGeaW.js} +1 -1
- package/dist/{twilio-CsJBvC3a.js → twilio-xNIXGJ-M.js} +16 -8
- package/dist/webhook-replay-aaP79dI8.js +32 -0
- package/node_modules/commander/Readme.md +11 -15
- package/node_modules/commander/index.js +14 -17
- package/node_modules/commander/lib/argument.js +3 -6
- package/node_modules/commander/lib/command.js +46 -33
- package/node_modules/commander/lib/error.js +2 -5
- package/node_modules/commander/lib/help.js +4 -20
- package/node_modules/commander/lib/option.js +3 -6
- package/node_modules/commander/lib/suggestSimilar.js +2 -4
- package/node_modules/commander/package.json +10 -28
- package/node_modules/commander/typings/index.d.ts +3 -3
- package/node_modules/typebox/build/compile/validator.d.mts +2 -7
- package/node_modules/typebox/build/compile/validator.mjs +6 -36
- package/node_modules/typebox/build/error/errors.d.mts +1 -7
- package/node_modules/typebox/build/format/_idna.mjs +36 -6
- package/node_modules/typebox/build/format/_puny.mjs +4 -1
- package/node_modules/typebox/build/format/uuid.d.mts +2 -2
- package/node_modules/typebox/build/format/uuid.mjs +3 -3
- package/node_modules/typebox/build/guard/emit.d.mts +0 -4
- package/node_modules/typebox/build/guard/emit.mjs +0 -8
- package/node_modules/typebox/build/guard/guard.d.mts +4 -8
- package/node_modules/typebox/build/guard/guard.mjs +5 -13
- package/node_modules/typebox/build/schema/engine/boolean.d.mts +3 -3
- package/node_modules/typebox/build/schema/engine/boolean.mjs +4 -4
- package/node_modules/typebox/build/schema/engine/index.d.mts +0 -1
- package/node_modules/typebox/build/schema/engine/index.mjs +0 -1
- package/node_modules/typebox/build/schema/engine/schema.mjs +5 -10
- package/node_modules/typebox/build/schema/engine/type.mjs +14 -18
- package/node_modules/typebox/build/schema/types/dependencies.mjs +1 -1
- package/node_modules/typebox/build/schema/types/index.d.mts +0 -1
- package/node_modules/typebox/build/schema/types/index.mjs +0 -1
- package/node_modules/typebox/build/schema/types/schema.d.mts +1 -1
- package/node_modules/typebox/build/schema/types/schema.mjs +2 -2
- package/node_modules/typebox/build/system/locale/ar_001.mjs +0 -1
- package/node_modules/typebox/build/system/locale/bn_BD.mjs +0 -1
- package/node_modules/typebox/build/system/locale/cs_CZ.mjs +0 -1
- package/node_modules/typebox/build/system/locale/de_DE.mjs +0 -1
- package/node_modules/typebox/build/system/locale/el_GR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/en_US.mjs +0 -1
- package/node_modules/typebox/build/system/locale/es_419.mjs +0 -1
- package/node_modules/typebox/build/system/locale/es_AR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/es_ES.mjs +0 -1
- package/node_modules/typebox/build/system/locale/es_MX.mjs +0 -1
- package/node_modules/typebox/build/system/locale/fa_IR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/fil_PH.mjs +0 -1
- package/node_modules/typebox/build/system/locale/fr_CA.mjs +0 -1
- package/node_modules/typebox/build/system/locale/fr_FR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ha_NG.mjs +0 -1
- package/node_modules/typebox/build/system/locale/hi_IN.mjs +0 -1
- package/node_modules/typebox/build/system/locale/hu_HU.mjs +0 -1
- package/node_modules/typebox/build/system/locale/id_ID.mjs +0 -1
- package/node_modules/typebox/build/system/locale/it_IT.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ja_JP.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ko_KR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ms_MY.mjs +0 -1
- package/node_modules/typebox/build/system/locale/nl_NL.mjs +0 -1
- package/node_modules/typebox/build/system/locale/pl_PL.mjs +0 -1
- package/node_modules/typebox/build/system/locale/pt_BR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/pt_PT.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ro_RO.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ru_RU.mjs +0 -1
- package/node_modules/typebox/build/system/locale/sv_SE.mjs +0 -1
- package/node_modules/typebox/build/system/locale/sw_TZ.mjs +0 -1
- package/node_modules/typebox/build/system/locale/th_TH.mjs +0 -1
- package/node_modules/typebox/build/system/locale/tr_TR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/uk_UA.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ur_PK.mjs +0 -1
- package/node_modules/typebox/build/system/locale/vi_VN.mjs +0 -1
- package/node_modules/typebox/build/system/locale/yo_NG.mjs +0 -1
- package/node_modules/typebox/build/system/locale/zh_Hans.mjs +0 -1
- package/node_modules/typebox/build/system/locale/zh_Hant.mjs +0 -1
- package/node_modules/typebox/build/system/memory/clone.d.mts +2 -3
- package/node_modules/typebox/build/system/memory/clone.mjs +73 -26
- package/node_modules/typebox/build/system/settings/settings.d.mts +15 -0
- package/node_modules/typebox/build/system/settings/settings.mjs +3 -1
- package/node_modules/typebox/build/type/action/_add_immutable.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_add_immutable.mjs +11 -0
- package/node_modules/typebox/build/type/action/_add_optional.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_add_optional.mjs +11 -0
- package/node_modules/typebox/build/type/action/_add_readonly.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_add_readonly.mjs +11 -0
- package/node_modules/typebox/build/type/action/_remove_immutable.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_remove_immutable.mjs +11 -0
- package/node_modules/typebox/build/type/action/_remove_optional.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_remove_optional.mjs +11 -0
- package/node_modules/typebox/build/type/action/_remove_readonly.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_remove_readonly.mjs +11 -0
- package/node_modules/typebox/build/type/action/conditional.d.mts +2 -3
- package/node_modules/typebox/build/type/action/conditional.mjs +2 -1
- package/node_modules/typebox/build/type/action/index.d.mts +7 -4
- package/node_modules/typebox/build/type/action/index.mjs +7 -4
- package/node_modules/typebox/build/type/action/mapped.d.mts +2 -3
- package/node_modules/typebox/build/type/action/mapped.mjs +2 -1
- package/node_modules/typebox/build/type/action/module.d.mts +8 -7
- package/node_modules/typebox/build/type/action/module.mjs +7 -6
- package/node_modules/typebox/build/type/action/readonly_object.d.mts +0 -5
- package/node_modules/typebox/build/type/action/readonly_object.mjs +0 -5
- package/node_modules/typebox/build/type/action/with.d.mts +11 -0
- package/node_modules/typebox/build/type/action/with.mjs +11 -0
- package/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs +1 -1
- package/node_modules/typebox/build/type/engine/call/instantiate.d.mts +1 -3
- package/node_modules/typebox/build/type/engine/call/instantiate.mjs +3 -2
- package/node_modules/typebox/build/type/engine/call/resolve_arguments.mjs +2 -2
- package/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.d.mts +3 -4
- package/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.mjs +2 -1
- package/node_modules/typebox/build/type/engine/cyclic/candidates.d.mts +2 -3
- package/node_modules/typebox/build/type/engine/cyclic/candidates.mjs +3 -6
- package/node_modules/typebox/build/type/engine/cyclic/check.d.mts +6 -9
- package/node_modules/typebox/build/type/engine/cyclic/check.mjs +10 -16
- package/node_modules/typebox/build/type/engine/cyclic/dependencies.d.mts +1 -4
- package/node_modules/typebox/build/type/engine/cyclic/dependencies.mjs +9 -15
- package/node_modules/typebox/build/type/engine/cyclic/extends.d.mts +1 -4
- package/node_modules/typebox/build/type/engine/cyclic/extends.mjs +8 -14
- package/node_modules/typebox/build/type/engine/cyclic/instantiate.d.mts +2 -5
- package/node_modules/typebox/build/type/engine/cyclic/instantiate.mjs +3 -2
- package/node_modules/typebox/build/type/engine/enum/index.d.mts +0 -1
- package/node_modules/typebox/build/type/engine/enum/index.mjs +0 -1
- package/node_modules/typebox/build/type/engine/evaluate/broaden.d.mts +1 -2
- package/node_modules/typebox/build/type/engine/evaluate/broaden.mjs +2 -6
- package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +10 -6
- package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +10 -6
- package/node_modules/typebox/build/type/engine/evaluate/distribute.d.mts +2 -1
- package/node_modules/typebox/build/type/engine/evaluate/distribute.mjs +3 -3
- package/node_modules/typebox/build/type/engine/evaluate/evaluate.d.mts +17 -5
- package/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs +34 -8
- package/node_modules/typebox/build/type/engine/exclude/operation.d.mts +5 -6
- package/node_modules/typebox/build/type/engine/exclude/operation.mjs +11 -12
- package/node_modules/typebox/build/type/engine/extract/operation.d.mts +5 -6
- package/node_modules/typebox/build/type/engine/extract/operation.mjs +11 -12
- package/node_modules/typebox/build/type/engine/immutable/instantiate_add.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/immutable/instantiate_add.mjs +14 -0
- package/node_modules/typebox/build/type/engine/immutable/instantiate_remove.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/immutable/instantiate_remove.mjs +14 -0
- package/node_modules/typebox/build/type/engine/index.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/index.mjs +2 -2
- package/node_modules/typebox/build/type/engine/indexable/from_dependent.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/indexable/from_dependent.mjs +8 -0
- package/node_modules/typebox/build/type/engine/indexable/from_enum.d.mts +3 -3
- package/node_modules/typebox/build/type/engine/indexable/from_enum.mjs +4 -4
- package/node_modules/typebox/build/type/engine/indexable/from_template_literal.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/indexable/from_template_literal.mjs +3 -3
- package/node_modules/typebox/build/type/engine/indexable/from_type.d.mts +3 -1
- package/node_modules/typebox/build/type/engine/indexable/from_type.mjs +9 -6
- package/node_modules/typebox/build/type/engine/indexed/instantiate.d.mts +2 -1
- package/node_modules/typebox/build/type/engine/indexed/instantiate.mjs +5 -2
- package/node_modules/typebox/build/type/engine/instantiate.d.mts +44 -31
- package/node_modules/typebox/build/type/engine/instantiate.mjs +82 -83
- package/node_modules/typebox/build/type/engine/interface/instantiate.d.mts +3 -6
- package/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.mjs +3 -3
- package/node_modules/typebox/build/type/engine/keyof/instantiate.d.mts +2 -1
- package/node_modules/typebox/build/type/engine/keyof/instantiate.mjs +5 -1
- package/node_modules/typebox/build/type/engine/mapped/mapped_operation.d.mts +4 -4
- package/node_modules/typebox/build/type/engine/mapped/mapped_operation.mjs +3 -3
- package/node_modules/typebox/build/type/engine/mapped/mapped_variants.d.mts +5 -4
- package/node_modules/typebox/build/type/engine/mapped/mapped_variants.mjs +10 -5
- package/node_modules/typebox/build/type/engine/module/instantiate.d.mts +7 -9
- package/node_modules/typebox/build/type/engine/module/instantiate.mjs +17 -15
- package/node_modules/typebox/build/type/engine/object/from_dependent.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/object/from_dependent.mjs +8 -0
- package/node_modules/typebox/build/type/engine/object/from_type.d.mts +3 -1
- package/node_modules/typebox/build/type/engine/object/from_type.mjs +8 -5
- package/node_modules/typebox/build/type/engine/object/from_union.mjs +2 -2
- package/node_modules/typebox/build/type/engine/optional/instantiate_add.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/optional/instantiate_add.mjs +14 -0
- package/node_modules/typebox/build/type/engine/optional/instantiate_remove.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/optional/instantiate_remove.mjs +14 -0
- package/node_modules/typebox/build/type/engine/parameters/instantiate.d.mts +3 -4
- package/node_modules/typebox/build/type/engine/parameters/instantiate.mjs +2 -1
- package/node_modules/typebox/build/type/engine/partial/from_dependent.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/partial/from_dependent.mjs +8 -0
- package/node_modules/typebox/build/type/engine/partial/from_intersect.d.mts +1 -1
- package/node_modules/typebox/build/type/engine/partial/from_intersect.mjs +3 -2
- package/node_modules/typebox/build/type/engine/partial/from_object.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/partial/from_object.mjs +2 -2
- package/node_modules/typebox/build/type/engine/partial/from_type.d.mts +3 -1
- package/node_modules/typebox/build/type/engine/partial/from_type.mjs +7 -4
- package/node_modules/typebox/build/type/engine/priority/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/priority/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/priority/priority.d.mts +20 -0
- package/node_modules/typebox/build/type/engine/priority/priority.mjs +28 -0
- package/node_modules/typebox/build/type/engine/readonly/instantiate_add.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/readonly/instantiate_add.mjs +14 -0
- package/node_modules/typebox/build/type/engine/readonly/instantiate_remove.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/readonly/instantiate_remove.mjs +14 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_array.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_array.mjs +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_dependent.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_dependent.mjs +8 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_intersect.d.mts +1 -1
- package/node_modules/typebox/build/type/engine/readonly_object/from_intersect.mjs +3 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_object.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_object.mjs +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_tuple.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_tuple.mjs +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_type.d.mts +3 -1
- package/node_modules/typebox/build/type/engine/readonly_object/from_type.mjs +8 -5
- package/node_modules/typebox/build/type/engine/record/from_key_enum.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/record/from_key_enum.mjs +2 -2
- package/node_modules/typebox/build/type/engine/record/from_key_template_literal.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/record/from_key_template_literal.mjs +2 -2
- package/node_modules/typebox/build/type/engine/ref/instantiate.d.mts +3 -3
- package/node_modules/typebox/build/type/engine/ref/instantiate.mjs +6 -6
- package/node_modules/typebox/build/type/engine/required/from_dependent.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/required/from_dependent.mjs +8 -0
- package/node_modules/typebox/build/type/engine/required/from_intersect.d.mts +1 -1
- package/node_modules/typebox/build/type/engine/required/from_intersect.mjs +3 -2
- package/node_modules/typebox/build/type/engine/required/from_object.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/required/from_object.mjs +2 -2
- package/node_modules/typebox/build/type/engine/required/from_type.d.mts +3 -1
- package/node_modules/typebox/build/type/engine/required/from_type.mjs +7 -4
- package/node_modules/typebox/build/type/engine/template_literal/decode.mjs +3 -3
- package/node_modules/typebox/build/type/engine/template_literal/encode.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/template_literal/encode.mjs +6 -6
- package/node_modules/typebox/build/type/engine/template_literal/is_finite.mjs +1 -1
- package/node_modules/typebox/build/type/engine/template_literal/is_pattern.mjs +1 -0
- package/node_modules/typebox/build/type/engine/this/expand_this.d.mts +1 -4
- package/node_modules/typebox/build/type/engine/this/expand_this.mjs +7 -13
- package/node_modules/typebox/build/type/engine/with/instantiate.d.mts +8 -0
- package/node_modules/typebox/build/type/engine/{options → with}/instantiate.mjs +5 -5
- package/node_modules/typebox/build/type/extends/dependent.d.mts +6 -0
- package/node_modules/typebox/build/type/extends/dependent.mjs +6 -0
- package/node_modules/typebox/build/type/extends/enum.d.mts +4 -4
- package/node_modules/typebox/build/type/extends/enum.mjs +3 -2
- package/node_modules/typebox/build/type/extends/extends_left.d.mts +5 -7
- package/node_modules/typebox/build/type/extends/extends_left.mjs +24 -27
- package/node_modules/typebox/build/type/extends/extends_right.d.mts +7 -5
- package/node_modules/typebox/build/type/extends/extends_right.mjs +20 -15
- package/node_modules/typebox/build/type/extends/inference.mjs +1 -1
- package/node_modules/typebox/build/type/extends/object.d.mts +8 -1
- package/node_modules/typebox/build/type/extends/object.mjs +25 -3
- package/node_modules/typebox/build/type/extends/parameters.mjs +2 -2
- package/node_modules/typebox/build/type/extends/record.d.mts +13 -0
- package/node_modules/typebox/build/type/extends/record.mjs +23 -0
- package/node_modules/typebox/build/type/extends/template_literal.d.mts +3 -3
- package/node_modules/typebox/build/type/extends/template_literal.mjs +3 -3
- package/node_modules/typebox/build/type/extends/tuple.d.mts +3 -6
- package/node_modules/typebox/build/type/extends/tuple.mjs +6 -5
- package/node_modules/typebox/build/type/extends/union.mjs +2 -2
- package/node_modules/typebox/build/type/script/mapping.d.mts +84 -99
- package/node_modules/typebox/build/type/script/mapping.mjs +81 -85
- package/node_modules/typebox/build/type/script/parser.d.mts +40 -40
- package/node_modules/typebox/build/type/script/parser.mjs +22 -22
- package/node_modules/typebox/build/type/script/script.d.mts +3 -4
- package/node_modules/typebox/build/type/script/script.mjs +3 -2
- package/node_modules/typebox/build/type/script/token/internal/guard.d.mts +1 -1
- package/node_modules/typebox/build/type/script/token/internal/guard.mjs +1 -1
- package/node_modules/typebox/build/type/script/token/internal/take.mjs +1 -1
- package/node_modules/typebox/build/type/script/token/until.mjs +2 -2
- package/node_modules/typebox/build/type/types/_codec.d.mts +12 -12
- package/node_modules/typebox/build/type/types/_codec.mjs +0 -1
- package/node_modules/typebox/build/type/types/_immutable.d.mts +2 -9
- package/node_modules/typebox/build/type/types/_immutable.mjs +2 -10
- package/node_modules/typebox/build/type/types/_optional.d.mts +2 -9
- package/node_modules/typebox/build/type/types/_optional.mjs +2 -11
- package/node_modules/typebox/build/type/types/_readonly.d.mts +2 -9
- package/node_modules/typebox/build/type/types/_readonly.mjs +2 -10
- package/node_modules/typebox/build/type/types/_refine.d.mts +8 -10
- package/node_modules/typebox/build/type/types/_refine.mjs +1 -2
- package/node_modules/typebox/build/type/types/call.d.mts +3 -3
- package/node_modules/typebox/build/type/types/call.mjs +3 -2
- package/node_modules/typebox/build/type/types/deferred.d.mts +1 -0
- package/node_modules/typebox/build/type/types/deferred.mjs +1 -1
- package/node_modules/typebox/build/type/types/dependent.d.mts +17 -0
- package/node_modules/typebox/build/type/types/dependent.mjs +24 -0
- package/node_modules/typebox/build/type/types/enum.d.mts +3 -1
- package/node_modules/typebox/build/type/types/enum.mjs +5 -0
- package/node_modules/typebox/build/type/types/index.d.mts +1 -4
- package/node_modules/typebox/build/type/types/index.mjs +1 -4
- package/node_modules/typebox/build/type/types/number.d.mts +1 -1
- package/node_modules/typebox/build/type/types/number.mjs +1 -1
- package/node_modules/typebox/build/type/types/record.d.mts +13 -7
- package/node_modules/typebox/build/type/types/record.mjs +15 -9
- package/node_modules/typebox/build/type/types/static.d.mts +2 -5
- package/node_modules/typebox/build/typebox.d.mts +4 -8
- package/node_modules/typebox/build/typebox.mjs +4 -8
- package/node_modules/typebox/build/value/clean/clean.mjs +4 -2
- package/node_modules/typebox/build/value/clean/from_intersect.mjs +2 -2
- package/node_modules/typebox/build/value/clean/from_type.mjs +8 -10
- package/node_modules/typebox/build/value/clean/from_union.d.mts +1 -1
- package/node_modules/typebox/build/value/clean/from_union.mjs +1 -2
- package/node_modules/typebox/build/value/clone/clone.mjs +2 -73
- package/node_modules/typebox/build/value/codec/decode.mjs +4 -2
- package/node_modules/typebox/build/value/codec/encode.mjs +4 -2
- package/node_modules/typebox/build/value/codec/from_array.mjs +1 -4
- package/node_modules/typebox/build/value/codec/from_object.mjs +1 -4
- package/node_modules/typebox/build/value/codec/from_record.mjs +2 -7
- package/node_modules/typebox/build/value/codec/from_tuple.mjs +1 -4
- package/node_modules/typebox/build/value/codec/from_union.mjs +2 -3
- package/node_modules/typebox/build/value/convert/from_enum.mjs +3 -4
- package/node_modules/typebox/build/value/convert/from_template_literal.d.mts +1 -1
- package/node_modules/typebox/build/value/convert/from_template_literal.mjs +2 -3
- package/node_modules/typebox/build/value/convert/from_type.mjs +19 -21
- package/node_modules/typebox/build/value/create/from_enum.mjs +2 -2
- package/node_modules/typebox/build/value/create/from_type.mjs +23 -31
- package/node_modules/typebox/build/value/default/from_object.mjs +1 -1
- package/node_modules/typebox/build/value/default/from_type.mjs +8 -10
- package/node_modules/typebox/build/value/index.d.mts +0 -1
- package/node_modules/typebox/build/value/index.mjs +0 -1
- package/node_modules/typebox/build/value/repair/from_enum.mjs +2 -3
- package/node_modules/typebox/build/value/repair/from_type.mjs +24 -22
- package/node_modules/typebox/build/value/shared/union_priority_sort.d.mts +6 -2
- package/node_modules/typebox/build/value/shared/union_priority_sort.mjs +62 -26
- package/node_modules/typebox/build/value/value.d.mts +0 -1
- package/node_modules/typebox/build/value/value.mjs +0 -1
- package/node_modules/typebox/package.json +25 -25
- package/node_modules/typebox/readme.md +97 -80
- package/npm-shrinkwrap.json +12 -12
- package/openclaw.plugin.json +8 -0
- package/package.json +6 -6
- package/dist/response-generator-CXBGKbAp.js +0 -212
- package/node_modules/commander/esm.mjs +0 -16
- package/node_modules/commander/typings/esm.d.mts +0 -3
- package/node_modules/typebox/build/schema/engine/_guard.d.mts +0 -6
- package/node_modules/typebox/build/schema/engine/_guard.mjs +0 -26
- package/node_modules/typebox/build/schema/types/_guard.d.mts +0 -10
- package/node_modules/typebox/build/schema/types/_guard.mjs +0 -16
- package/node_modules/typebox/build/type/action/_optional.d.mts +0 -19
- package/node_modules/typebox/build/type/action/_optional.mjs +0 -40
- package/node_modules/typebox/build/type/action/_readonly.d.mts +0 -19
- package/node_modules/typebox/build/type/action/_readonly.mjs +0 -40
- package/node_modules/typebox/build/type/action/awaited.d.mts +0 -15
- package/node_modules/typebox/build/type/action/awaited.mjs +0 -15
- package/node_modules/typebox/build/type/action/options.d.mts +0 -11
- package/node_modules/typebox/build/type/action/options.mjs +0 -11
- package/node_modules/typebox/build/type/engine/awaited/instantiate.d.mts +0 -11
- package/node_modules/typebox/build/type/engine/awaited/instantiate.mjs +0 -20
- package/node_modules/typebox/build/type/engine/enum/enum_to_union.d.mts +0 -14
- package/node_modules/typebox/build/type/engine/enum/enum_to_union.mjs +0 -24
- package/node_modules/typebox/build/type/engine/options/index.d.mts +0 -1
- package/node_modules/typebox/build/type/engine/options/index.mjs +0 -1
- package/node_modules/typebox/build/type/engine/options/instantiate.d.mts +0 -8
- package/node_modules/typebox/build/type/extends/async_iterator.d.mts +0 -7
- package/node_modules/typebox/build/type/extends/async_iterator.mjs +0 -9
- package/node_modules/typebox/build/type/extends/iterator.d.mts +0 -7
- package/node_modules/typebox/build/type/extends/iterator.mjs +0 -9
- package/node_modules/typebox/build/type/extends/promise.d.mts +0 -7
- package/node_modules/typebox/build/type/extends/promise.mjs +0 -9
- package/node_modules/typebox/build/type/types/async_iterator.d.mts +0 -20
- package/node_modules/typebox/build/type/types/async_iterator.mjs +0 -28
- package/node_modules/typebox/build/type/types/base.d.mts +0 -50
- package/node_modules/typebox/build/type/types/base.mjs +0 -84
- package/node_modules/typebox/build/type/types/iterator.d.mts +0 -20
- package/node_modules/typebox/build/type/types/iterator.mjs +0 -28
- package/node_modules/typebox/build/type/types/promise.d.mts +0 -21
- package/node_modules/typebox/build/type/types/promise.mjs +0 -29
- package/node_modules/typebox/build/value/clean/from_base.d.mts +0 -2
- package/node_modules/typebox/build/value/clean/from_base.mjs +0 -4
- package/node_modules/typebox/build/value/convert/from_base.d.mts +0 -2
- package/node_modules/typebox/build/value/convert/from_base.mjs +0 -4
- package/node_modules/typebox/build/value/create/from_async_iterator.d.mts +0 -2
- package/node_modules/typebox/build/value/create/from_async_iterator.mjs +0 -5
- package/node_modules/typebox/build/value/create/from_base.d.mts +0 -2
- package/node_modules/typebox/build/value/create/from_base.mjs +0 -4
- package/node_modules/typebox/build/value/create/from_iterator.d.mts +0 -2
- package/node_modules/typebox/build/value/create/from_iterator.mjs +0 -5
- package/node_modules/typebox/build/value/create/from_promise.d.mts +0 -2
- package/node_modules/typebox/build/value/create/from_promise.mjs +0 -5
- package/node_modules/typebox/build/value/default/from_base.d.mts +0 -2
- package/node_modules/typebox/build/value/default/from_base.mjs +0 -5
- package/node_modules/typebox/build/value/mutate/error.d.mts +0 -3
- package/node_modules/typebox/build/value/mutate/error.mjs +0 -6
- package/node_modules/typebox/build/value/mutate/from_array.d.mts +0 -2
- package/node_modules/typebox/build/value/mutate/from_array.mjs +0 -16
- package/node_modules/typebox/build/value/mutate/from_object.d.mts +0 -2
- package/node_modules/typebox/build/value/mutate/from_object.mjs +0 -40
- package/node_modules/typebox/build/value/mutate/from_unknown.d.mts +0 -2
- package/node_modules/typebox/build/value/mutate/from_unknown.mjs +0 -7
- package/node_modules/typebox/build/value/mutate/from_value.d.mts +0 -2
- package/node_modules/typebox/build/value/mutate/from_value.mjs +0 -12
- package/node_modules/typebox/build/value/mutate/index.d.mts +0 -1
- package/node_modules/typebox/build/value/mutate/index.mjs +0 -1
- package/node_modules/typebox/build/value/mutate/mutate.d.mts +0 -11
- package/node_modules/typebox/build/value/mutate/mutate.mjs +0 -41
- package/node_modules/typebox/build/value/repair/from_base.d.mts +0 -2
- package/node_modules/typebox/build/value/repair/from_base.mjs +0 -8
- /package/node_modules/typebox/build/type/engine/{awaited → with}/index.d.mts +0 -0
- /package/node_modules/typebox/build/type/engine/{awaited → with}/index.mjs +0 -0
|
@@ -50,7 +50,7 @@ type T = Type.Static<typeof T> // type T = {
|
|
|
50
50
|
|
|
51
51
|
[Documentation](https://sinclairzx81.github.io/typebox/)
|
|
52
52
|
|
|
53
|
-
TypeBox is a runtime type system that creates in-memory JSON Schema objects that infer as TypeScript types. The schematics produced by this library are designed to match the static type checking rules of the TypeScript compiler. TypeBox offers a unified type
|
|
53
|
+
TypeBox is a runtime type system that creates in-memory JSON Schema objects that infer as TypeScript types. The schematics produced by this library are designed to match the static type checking rules of the TypeScript compiler. TypeBox offers a unified type that can be statically checked by TypeScript and runtime checked using standard JSON Schema validation.
|
|
54
54
|
|
|
55
55
|
This library is designed to allow JSON Schema to compose similar to how types compose within TypeScript's type system. It can be used as a simple tool to build up complex schematics or integrated into REST and RPC services to help validate data received over the wire.
|
|
56
56
|
|
|
@@ -73,7 +73,7 @@ License: MIT
|
|
|
73
73
|
|
|
74
74
|
TypeBox types are JSON Schema fragments that compose into more complex types. The library offers a set of types used to construct JSON Schema compliant schematics as well as a set of extended types used to model constructs native to the JavaScript language. The schematics produced by TypeBox can be passed directly to any JSON Schema compliant validator.
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
### Example
|
|
77
77
|
|
|
78
78
|
The following creates a User type and infers with Static.
|
|
79
79
|
|
|
@@ -111,113 +111,130 @@ type User = Type.Static<typeof User> // type User = {
|
|
|
111
111
|
|
|
112
112
|
## Script
|
|
113
113
|
|
|
114
|
-
[Documentation](https://sinclairzx81.github.io/typebox/#/docs/script/overview) | [Example 1](https://www.typescriptlang.org/play
|
|
114
|
+
[Documentation](https://sinclairzx81.github.io/typebox/#/docs/script/overview) | [Example 1](https://www.typescriptlang.org/play/?target=99&module=7#code/JYWwDg9gTgLgBAFQJ5gKZwGZQiOByGFVAIwgA88AoSgehrgFonmXW32POv3b7k0AdAGUAxlGBgYACjwC5eAJS9G3VWvXdqdOADkAhiFQBnMHpGpKIiADsj8ALJ6YACzgBeREWFiJ0gAaUcHCEaHAAaqgiMNAATO5wAN5wZABccNYAriDEqFAANHBIaZnZuXAAvoHBROGR0VAAzPEAogBuegA2GU6oADwRUbFwAGSJcABexVk5UBUAfFUh6AP1ACwt7V09-XXQTaNJAO5TpbPlC35KygAiqGjWACao1vD6hiZmFla28En2xq5yvF+KhvOJJFIknIBI4XBUCn4gosahFYKgyPEElUgpAjMAYMAbGkVtBVnlseloCBOsTdo1yUEghlWrTBlAYlVKkElnAAOKoHCoGBQJCYimtXIE8xGWlosgAbQAugzGcBHsBpScZkrOcjQrDcsBOmLGXADMRgM8YKy1iqgg9gBgMBkjKgbaS7XATJEMh09FB3VBVrruTV-kZXB4saaAOYCwzCop8+NCkWe6kwQ00uAG8SdXWXLT0ABKGReoHQxdQGA6dUJ1ko4ecAjA2DQsEtRgEccFiZbbclnYEEo70oE+NQIC7rYg7YJxhbEDxBJs-dng4XZEbALXc6HPYTIt3G67I6lC4nU+PHYX1ipnWv867W6bj-3Kb7M73C7PGovmavL8TwEZk303bcIzArsMyzDooIEB0nRdUEgJvZ8IObVCnwEGC8zgrCh3NS0Xngl8dwIhdcKNfCBzQgRvREX1-VIos4CEGAnA1OAAElrAwXJnnMShnWsKJ6zgKBnieKApHeZw0hBYQOKlXolggDAcwBOYFESKo5O7D8j1-aV5QABkVRdl3rAQtyCfSD1TJBh0HEzzIEO8oGpODbLgezDKc4zjDMizQJ8-SqIfRDnVdGy9J3CK4KIq1Yrs+Kejw+i0EYv0oFi8ogA) | [Example 2](https://www.typescriptlang.org/play/?target=99&module=7#code/JYWwDg9gTgLgBAFQJ5gKZwGZQiOByGFVAIwgA88AoSgehrgFonmXW32POv3b7k0AdACpejbuImTu1OnAByAQxCoAzmAUBjVJQB2S1eq1wAsgpgALOAG9KcOKjKRYcDRB0r4ANVQaY0AExwALyIRAIA8sQAVj4wABRWcGQAXKGCcgCuIMSoUHEAlAA0cEip-KgCmdm5BXAAvvm29o7Q8K7uXrHQAMzBaRUAogBuCgA2GWaoceUCAJI6MLkqsXEA2t6+AcUzkTG+CXAAXmVhVTl5+fX5ALr5jXYOTm1uHnAbflAALH0zw2MTi2mYXmiygy326y6UG62zCuxWiQA7id0llzrUGrdGnUZPQACKoNA6AAmqAW8n0ak02nar28sAcPzh0QRTUgKmAMGAblSpgsAne0E+hSaOmgIDGvLM5gFUJhTQyQyl-MFUH8lAalFp8AA4qgcKgYFAkEzBPD9jY7ENclytCoURUAIJQKAKJBxemLMhFJrAEnAO0OgTO13umZnGp3DWNbUmSZQYBjU0Vc3xS1wJTEYBkmDKmWq4VNYnADAYDLLPOyzZfEV2NQ+DKjBRQSsF6Nal7wYyqSwhHYsi1NADm+uURtKcD1BvHtbgEtBidGytyi-bogAShkFqB0OvUBhRrFuTpKN2VDKwNg0LBsyoBCPp8aBJeINeuaoBNab3aBJzUCA7xfN9b2fCAOS5NxnyvG0QLIU8eyg18YI-B8xyfIDkLvL9bQ-P8AMQ4CPzFKAJVGAjMIEOCzwvaCbxQ0dDXQ2j3ywmCfzwwDmJAxVyLou8qIQjC+IEecVzGXiWIEYtS3LCohMkgTzwkkDRITcT5JAzNswWZSP0UmikOE1TF10u96w0Rtm1MyjcTgABlGAzADOB5gwXIyS0Sgyx0XxjzgKAyVJPJlHPIMHKcjQAB5CDQCAMBMHsAD5LnTEKZVQxikE-NjVFWAAGa5QPA48bLsNL7wY8dsu-XKCoEYjSNKucEIyqrsIDWrCp4uCyoQ4zxOkstlia8r+rIrScxGvr4xM8zLKgGy6iAA) | [Challenge](test/typescript/readme.md)
|
|
115
115
|
|
|
116
|
-
|
|
116
|
+
TypeBox includes a syntax engine that can transform TypeScript declarations into JSON Schema. The engine is a full syntactic frontend to Type.* and supports many advanced type-level constructs such as Conditional, Mapped, Indexed, Infer, Generics, Distributed types and more. This feature is implemented symmetrically at runtime and statically via TypeScript Template Literal types.
|
|
117
117
|
|
|
118
|
-
|
|
118
|
+
Syntax highlighting is available via the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=sinclairzx81.typebox-script)
|
|
119
119
|
|
|
120
|
-
The following uses the Script function to parse TypeScript interfaces into JSON Schema.
|
|
121
120
|
|
|
122
|
-
|
|
123
|
-
import Type from 'typebox'
|
|
121
|
+
### Example
|
|
124
122
|
|
|
125
|
-
|
|
123
|
+
The following uses Script to parse TypeScript declarations into JSON Schema.
|
|
126
124
|
|
|
127
|
-
|
|
125
|
+
```typescript
|
|
126
|
+
// Module
|
|
127
|
+
const Math = Type.Script(`
|
|
128
|
+
type Vector2 = { x: number, y: number }
|
|
129
|
+
type Vector3 = Evaluate<Vector2 & { z: number }>
|
|
130
|
+
type Vector4 = Evaluate<Vector3 & { w: number }>
|
|
131
|
+
`)
|
|
128
132
|
|
|
129
|
-
|
|
130
|
-
|
|
133
|
+
// Dependent Module
|
|
134
|
+
const { Mesh } = Type.Script({ ...Math }, `
|
|
135
|
+
type Vertex = {
|
|
136
|
+
position: Vector4,
|
|
137
|
+
normal: Vector3,
|
|
138
|
+
uv: Vector2
|
|
131
139
|
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
140
|
+
type Geometry = {
|
|
141
|
+
vertices: Vertex[],
|
|
142
|
+
indices: number[]
|
|
143
|
+
}
|
|
144
|
+
type Material = {
|
|
145
|
+
ambient: Vector4,
|
|
146
|
+
diffuse: Vector4,
|
|
147
|
+
specular: Vector4
|
|
148
|
+
}
|
|
149
|
+
type Mesh = {
|
|
150
|
+
geometry: Geometry,
|
|
151
|
+
material: Material
|
|
136
152
|
}
|
|
137
|
-
|
|
138
|
-
type UserUpdate = Evaluate<
|
|
139
|
-
Pick<User, keyof Entity> &
|
|
140
|
-
Partial<Omit<User, keyof Entity>>
|
|
141
|
-
>
|
|
142
|
-
|
|
143
153
|
`)
|
|
144
154
|
|
|
145
|
-
//
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
// type: 'object',
|
|
163
|
-
// properties: {
|
|
164
|
-
// id: { type: 'string' },
|
|
165
|
-
// name: { type: 'string' },
|
|
166
|
-
// email: { type: 'string' }
|
|
167
|
-
// },
|
|
168
|
-
// required: ['id']
|
|
169
|
-
// }
|
|
170
|
-
|
|
171
|
-
// Static
|
|
172
|
-
|
|
173
|
-
type User = Type.Static<typeof User> // type User = {
|
|
174
|
-
// id: string,
|
|
175
|
-
// name: string,
|
|
176
|
-
// email: string
|
|
177
|
-
// }
|
|
178
|
-
|
|
179
|
-
type UserUpdate = Type.Static<typeof UserUpdate> // type UserUpdate = {
|
|
180
|
-
// id: string,
|
|
181
|
-
// name?: string,
|
|
182
|
-
// email?: string
|
|
183
|
-
// }
|
|
184
|
-
|
|
185
|
-
|
|
155
|
+
// Runtime Reflection
|
|
156
|
+
Mesh.properties.geometry.properties.vertices.items.properties.position.properties.x
|
|
157
|
+
Mesh.properties.geometry.properties.vertices.items.properties.normal.properties.x
|
|
158
|
+
Mesh.properties.geometry.properties.vertices.items.properties.uv.properties.x
|
|
159
|
+
Mesh.properties.material.properties.diffuse.properties.x
|
|
160
|
+
Mesh.properties.material.properties.ambient.properties.x
|
|
161
|
+
Mesh.properties.material.properties.specular.properties.x
|
|
162
|
+
|
|
163
|
+
// Static Inference
|
|
164
|
+
function render(mesh: Type.Static<typeof Mesh>) {
|
|
165
|
+
mesh.geometry.vertices[0].position.x
|
|
166
|
+
mesh.geometry.vertices[0].normal.x
|
|
167
|
+
mesh.geometry.vertices[0].uv.x
|
|
168
|
+
mesh.material.diffuse.x
|
|
169
|
+
mesh.material.ambient.x
|
|
170
|
+
mesh.material.specular.x
|
|
171
|
+
}
|
|
186
172
|
```
|
|
187
173
|
|
|
188
174
|
<a name="Schema"></a>
|
|
189
175
|
|
|
190
176
|
## Schema
|
|
191
177
|
|
|
192
|
-
[Documentation](https://sinclairzx81.github.io/typebox/#/docs/schema/overview) | [Example 1](https://www.typescriptlang.org/play
|
|
178
|
+
[Documentation](https://sinclairzx81.github.io/typebox/#/docs/schema/overview) | [Example 1](https://www.typescriptlang.org/play/#code/JYWwDg9gTgLgBAZQMYAsCmICGcBmUIhwDkMAnmGgEYQAeA9AM6oaZEBQbddcAtH-wMFDhI0WPESenbgGECYYABs003pPUbNW-hyQQAdg3gBVBmihwAvImZYAdHPBK0ACgDebOHDIUAXMQhKACs0JBgiABpPODB8ClhgNAZ-Dy8vYAATFO9yNH8iIyhgfQBzIjgAXyi0uH1MEDy4Nxy-YkLissrqtJYlbJ9Ggpgi0sjcaCwYfN7FcoroquioNABHAFdgZay4AG1oryJMsf3iOobjmqIZ9i8AXTYKgEoOLjVtd4+P1QAFTCgzVSfIHAyS6AxGOBrMwWaymcx2X7-VzNGqotHouCvPSGeBQ8wpaKZfIANgArDgAIyYABMlAAzEgACwZUloYk4ADsmAAHJQAJxIAAMGQpYwx6Ne6W27VK3TOgzxUDF4pVqq8ktq9UaMpK3Rm+UVAAEMgRMMU7HoQOU1SqNfq4DqHo8bS7XajXhUrHA7D6gA) | [Example 2](https://www.typescriptlang.org/play/?#code/JYWwDg9gTgLgBAZQMYAsCmICGcBmUIhwDkMAnmGgEYQAeA9AM6oaZEBQokscAKuWrnyES-ajXZs6dOAFo58hYqXKVqteo0zJ0gMIEwwADZptszeYuWr8tmyQQAdg3gBVBmihwAvImZYAdHrgRmgAFHwU-gDylABWaEgwoQDebHBwwAAmAFy8-P4IMFDADgDmoQCUADRpcA6YIGi5EWgFRSXl1bUsRs35hcVlKbjQWDC5RD2GRHAAvhVs8wum1qtr61pScAAKmFDuKxtHx6q29k7wAK7unj5uHv67+2HJ6W-vH5-vW+fOcNceXKpdJZCYANgArDgAIyYABMlAAzEgACyZCFoME4ADsmAAHJQAJxIAAMmWhRCqX2pcC2IJycGcg1KNXS9UaEwBUEpNN5fO+0jZDSajPaZVZcCmnJuAAFMgRMCV-PYQDN+by6ZKsL1RczFhV1YajR8trNvHB-JagA)
|
|
193
179
|
|
|
194
|
-
TypeBox includes a high-performance
|
|
180
|
+
TypeBox includes a high-performance JIT compiler that supports JSON Schema Draft 3 through to 2020-12. It is designed to be a lightweight industry-grade alternative to Ajv and offers improved compilation and validation performance. It also provides automatic fallback to dynamic validation in JIT restricted environments such as Cloudflare Workers.
|
|
195
181
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
The following uses the Schema submodule to compile a TypeBox type.
|
|
182
|
+
The compiler is available via optional sub module import.
|
|
199
183
|
|
|
200
184
|
```typescript
|
|
201
185
|
import Schema from 'typebox/schema'
|
|
186
|
+
```
|
|
202
187
|
|
|
203
|
-
|
|
188
|
+
### Compile
|
|
204
189
|
|
|
205
|
-
|
|
206
|
-
id: Type.String(), // id: Type.TString;
|
|
207
|
-
name: Type.String(), // name: Type.TString;
|
|
208
|
-
email: Type.String({ format: 'email' }) // email: Type.TString;
|
|
209
|
-
})) // }>, { ... }>
|
|
190
|
+
The compiler accepts JSON Schema and returns Validator instances.
|
|
210
191
|
|
|
211
|
-
|
|
192
|
+
```typescript
|
|
193
|
+
const Vector = Schema.Compile(Type.Object({ // const Vector: Validator<TObject<{
|
|
194
|
+
x: Type.Number(), // x: TNumber
|
|
195
|
+
y: Type.Number(), // y: TNumber
|
|
196
|
+
z: Type.Number() // z: TNumber
|
|
197
|
+
})) // }>>
|
|
198
|
+
```
|
|
199
|
+
With JSON Schema
|
|
200
|
+
```typescript
|
|
201
|
+
const Vector = Schema.Compile({ // const Vector: Validator<{
|
|
202
|
+
type: 'object', // type: "object";
|
|
203
|
+
required: ['x', 'y', 'z'], // required: ["x", "y", "z"];
|
|
204
|
+
properties: { // properties: { ... };
|
|
205
|
+
x: { type: 'number' }, // }, { ... }>
|
|
206
|
+
y: { type: 'number' },
|
|
207
|
+
z: { type: 'number' }
|
|
208
|
+
}
|
|
209
|
+
})
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### Validate
|
|
212
213
|
|
|
213
|
-
|
|
214
|
-
id: '65f1a2b3c4d5e6f7a8b9c0d1', // id: string,
|
|
215
|
-
name: 'user', // name: string,
|
|
216
|
-
email: 'user@domain.com' // email: string
|
|
217
|
-
}) // } = ...
|
|
214
|
+
Validator instances provide functions to Check and Parse values.
|
|
218
215
|
|
|
216
|
+
```typescript
|
|
217
|
+
const Vector = Schema.Compile(Type.Script(`{
|
|
218
|
+
x: number
|
|
219
|
+
y: number
|
|
220
|
+
z: number
|
|
221
|
+
}`))
|
|
222
|
+
|
|
223
|
+
const valid = Vector.Check({ // const valid: boolean
|
|
224
|
+
x: 1,
|
|
225
|
+
y: 0,
|
|
226
|
+
z: 0
|
|
227
|
+
})
|
|
228
|
+
|
|
229
|
+
const value = Vector.Parse({ // const value: {
|
|
230
|
+
x: 1, // x: number
|
|
231
|
+
y: 0, // y: number
|
|
232
|
+
z: 0 // z: number
|
|
233
|
+
}) // }
|
|
219
234
|
```
|
|
220
235
|
|
|
236
|
+
|
|
237
|
+
|
|
221
238
|
### Coverage
|
|
222
239
|
|
|
223
240
|
The following table shows specification coverage implemented by TypeBox.
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/voice-call",
|
|
3
|
-
"version": "2026.7.1-beta.
|
|
3
|
+
"version": "2026.7.1-beta.5",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@openclaw/voice-call",
|
|
9
|
-
"version": "2026.7.1-beta.
|
|
9
|
+
"version": "2026.7.1-beta.5",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"commander": "
|
|
12
|
-
"typebox": "1.
|
|
11
|
+
"commander": "15.0.0",
|
|
12
|
+
"typebox": "1.3.3",
|
|
13
13
|
"ws": "8.21.0",
|
|
14
14
|
"zod": "4.4.3"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
|
-
"openclaw": ">=2026.7.1-beta.
|
|
17
|
+
"openclaw": ">=2026.7.1-beta.5"
|
|
18
18
|
},
|
|
19
19
|
"peerDependenciesMeta": {
|
|
20
20
|
"openclaw": {
|
|
@@ -23,18 +23,18 @@
|
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
"node_modules/commander": {
|
|
26
|
-
"version": "
|
|
27
|
-
"resolved": "https://registry.npmjs.org/commander/-/commander-
|
|
28
|
-
"integrity": "sha512-
|
|
26
|
+
"version": "15.0.0",
|
|
27
|
+
"resolved": "https://registry.npmjs.org/commander/-/commander-15.0.0.tgz",
|
|
28
|
+
"integrity": "sha512-z67u4ZhzCL/Tydu1lJARtEZYWbWaN7oYLHbsuzocr6y4N6WZAagG3RQ4FW61V1/0+jImpj293XfrcYnd1qxtPg==",
|
|
29
29
|
"license": "MIT",
|
|
30
30
|
"engines": {
|
|
31
|
-
"node": ">=
|
|
31
|
+
"node": ">=22.12.0"
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
34
|
"node_modules/typebox": {
|
|
35
|
-
"version": "1.
|
|
36
|
-
"resolved": "https://registry.npmjs.org/typebox/-/typebox-1.
|
|
37
|
-
"integrity": "sha512-
|
|
35
|
+
"version": "1.3.3",
|
|
36
|
+
"resolved": "https://registry.npmjs.org/typebox/-/typebox-1.3.3.tgz",
|
|
37
|
+
"integrity": "sha512-URXGUE31PJDQC+PtRMJeLdF4kmmOdFoVPikPCtV2oOIhUpNpppEdIz7W8bH8cFYPYHdDpaRvqwdegMTmHliudg==",
|
|
38
38
|
"license": "MIT"
|
|
39
39
|
},
|
|
40
40
|
"node_modules/ws": {
|
package/openclaw.plugin.json
CHANGED
|
@@ -71,6 +71,10 @@
|
|
|
71
71
|
"label": "Twilio Auth Token",
|
|
72
72
|
"sensitive": true
|
|
73
73
|
},
|
|
74
|
+
"twilio.region": {
|
|
75
|
+
"label": "Twilio Region",
|
|
76
|
+
"advanced": true
|
|
77
|
+
},
|
|
74
78
|
"outbound.defaultMode": {
|
|
75
79
|
"label": "Default Call Mode"
|
|
76
80
|
},
|
|
@@ -286,6 +290,10 @@
|
|
|
286
290
|
},
|
|
287
291
|
"authToken": {
|
|
288
292
|
"type": ["string", "object"]
|
|
293
|
+
},
|
|
294
|
+
"region": {
|
|
295
|
+
"type": "string",
|
|
296
|
+
"enum": ["us1", "ie1", "au1"]
|
|
289
297
|
}
|
|
290
298
|
}
|
|
291
299
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/voice-call",
|
|
3
|
-
"version": "2026.7.1-beta.
|
|
3
|
+
"version": "2026.7.1-beta.5",
|
|
4
4
|
"description": "OpenClaw voice-call plugin for Twilio, Telnyx, and Plivo phone calls.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
},
|
|
9
9
|
"type": "module",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"commander": "
|
|
12
|
-
"typebox": "1.
|
|
11
|
+
"commander": "15.0.0",
|
|
12
|
+
"typebox": "1.3.3",
|
|
13
13
|
"ws": "8.21.0",
|
|
14
14
|
"zod": "4.4.3"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
|
-
"openclaw": ">=2026.7.1-beta.
|
|
17
|
+
"openclaw": ">=2026.7.1-beta.5"
|
|
18
18
|
},
|
|
19
19
|
"peerDependenciesMeta": {
|
|
20
20
|
"openclaw": {
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
"minHostVersion": ">=2026.4.10"
|
|
32
32
|
},
|
|
33
33
|
"compat": {
|
|
34
|
-
"pluginApi": ">=2026.7.1-beta.
|
|
34
|
+
"pluginApi": ">=2026.7.1-beta.5"
|
|
35
35
|
},
|
|
36
36
|
"build": {
|
|
37
|
-
"openclawVersion": "2026.7.1-beta.
|
|
37
|
+
"openclawVersion": "2026.7.1-beta.5"
|
|
38
38
|
},
|
|
39
39
|
"release": {
|
|
40
40
|
"publishToClawHub": true,
|
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
import { s as resolveVoiceCallSessionKey } from "./config-DNtTB7Iw.js";
|
|
2
|
-
import { f as resolveVoiceResponseModel } from "./runtime-entry-DN7HllXj.js";
|
|
3
|
-
import { isRecord, normalizeLowercaseStringOrEmpty, normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
|
-
import crypto from "node:crypto";
|
|
5
|
-
import { applyModelOverrideToSessionEntry } from "openclaw/plugin-sdk/model-session-runtime";
|
|
6
|
-
//#region extensions/voice-call/src/response-generator.ts
|
|
7
|
-
/**
|
|
8
|
-
* Voice call response generator - uses the embedded OpenClaw agent for tool support.
|
|
9
|
-
* Routes voice responses through the same agent infrastructure as messaging.
|
|
10
|
-
*/
|
|
11
|
-
function readExplicitToolsAllow(value) {
|
|
12
|
-
if (!isRecord(value)) return;
|
|
13
|
-
const allow = value.allow;
|
|
14
|
-
if (!Array.isArray(allow)) return;
|
|
15
|
-
return allow.filter((entry) => typeof entry === "string");
|
|
16
|
-
}
|
|
17
|
-
function resolveVoiceAgentToolsAllow(config, agentId) {
|
|
18
|
-
const agents = isRecord(config.agents) ? config.agents : void 0;
|
|
19
|
-
const agent = (Array.isArray(agents?.list) ? agents.list : []).find((entry) => isRecord(entry) && entry.id === agentId);
|
|
20
|
-
if (!isRecord(agent)) return;
|
|
21
|
-
return readExplicitToolsAllow(isRecord(agent.tools) ? agent.tools : void 0);
|
|
22
|
-
}
|
|
23
|
-
const VOICE_SPOKEN_OUTPUT_CONTRACT = [
|
|
24
|
-
"Output format requirements:",
|
|
25
|
-
"- Return only valid JSON in this exact shape: {\"spoken\":\"...\"}",
|
|
26
|
-
"- Do not include markdown, code fences, planning text, or extra keys.",
|
|
27
|
-
"- Put exactly what should be spoken to the caller into \"spoken\".",
|
|
28
|
-
"- If there is nothing to say, return {\"spoken\":\"\"}."
|
|
29
|
-
].join("\n");
|
|
30
|
-
function normalizeSpokenText(value) {
|
|
31
|
-
const normalized = value.replace(/\s+/g, " ").trim();
|
|
32
|
-
return normalized.length > 0 ? normalized : null;
|
|
33
|
-
}
|
|
34
|
-
function tryParseSpokenJson(text) {
|
|
35
|
-
const candidates = [];
|
|
36
|
-
const trimmed = text.trim();
|
|
37
|
-
if (!trimmed) return null;
|
|
38
|
-
candidates.push(trimmed);
|
|
39
|
-
const fenced = trimmed.match(/^```(?:json)?\s*([\s\S]*?)\s*```$/i);
|
|
40
|
-
if (fenced?.[1]) candidates.push(fenced[1]);
|
|
41
|
-
const firstBrace = trimmed.indexOf("{");
|
|
42
|
-
const lastBrace = trimmed.lastIndexOf("}");
|
|
43
|
-
if (firstBrace >= 0 && lastBrace > firstBrace) candidates.push(trimmed.slice(firstBrace, lastBrace + 1));
|
|
44
|
-
for (const candidate of candidates) try {
|
|
45
|
-
const parsed = JSON.parse(candidate);
|
|
46
|
-
if (typeof parsed?.spoken !== "string") continue;
|
|
47
|
-
return normalizeSpokenText(parsed.spoken) ?? "";
|
|
48
|
-
} catch {}
|
|
49
|
-
const inlineSpokenMatch = trimmed.match(/"spoken"\s*:\s*"((?:[^"\\]|\\.)*)"/i);
|
|
50
|
-
if (!inlineSpokenMatch) return null;
|
|
51
|
-
try {
|
|
52
|
-
return normalizeSpokenText(JSON.parse(`"${inlineSpokenMatch[1] ?? ""}"`)) ?? "";
|
|
53
|
-
} catch {
|
|
54
|
-
return null;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
function isLikelyMetaReasoningParagraph(paragraph) {
|
|
58
|
-
const lower = normalizeLowercaseStringOrEmpty(paragraph);
|
|
59
|
-
if (!lower) return false;
|
|
60
|
-
if (lower.startsWith("thinking process")) return true;
|
|
61
|
-
if (lower.startsWith("reasoning:") || lower.startsWith("analysis:")) return true;
|
|
62
|
-
if (lower.startsWith("the user ") && (lower.includes("i should") || lower.includes("i need to") || lower.includes("i will"))) return true;
|
|
63
|
-
if (lower.includes("this is a natural continuation of the conversation") || lower.includes("keep the conversation flowing")) return true;
|
|
64
|
-
return false;
|
|
65
|
-
}
|
|
66
|
-
function sanitizePlainSpokenText(text) {
|
|
67
|
-
const withoutCodeFences = text.replace(/```[\s\S]*?```/g, " ").trim();
|
|
68
|
-
if (!withoutCodeFences) return null;
|
|
69
|
-
const paragraphs = normalizeStringEntries(withoutCodeFences.split(/\n\s*\n+/));
|
|
70
|
-
while (paragraphs.length > 1 && isLikelyMetaReasoningParagraph(paragraphs[0])) paragraphs.shift();
|
|
71
|
-
return normalizeSpokenText(paragraphs.join(" "));
|
|
72
|
-
}
|
|
73
|
-
function extractSpokenTextFromPayloads(payloads) {
|
|
74
|
-
const spokenSegments = [];
|
|
75
|
-
for (const payload of payloads) {
|
|
76
|
-
if (payload.isError || payload.isReasoning) continue;
|
|
77
|
-
const rawText = payload.text?.trim() ?? "";
|
|
78
|
-
if (!rawText) continue;
|
|
79
|
-
const structured = tryParseSpokenJson(rawText);
|
|
80
|
-
if (structured !== null) {
|
|
81
|
-
if (structured.length > 0) spokenSegments.push(structured);
|
|
82
|
-
continue;
|
|
83
|
-
}
|
|
84
|
-
const plain = sanitizePlainSpokenText(rawText);
|
|
85
|
-
if (plain) spokenSegments.push(plain);
|
|
86
|
-
}
|
|
87
|
-
return spokenSegments.length > 0 ? spokenSegments.join(" ").trim() : null;
|
|
88
|
-
}
|
|
89
|
-
function resolveVoiceSandboxSessionKey(agentId, sessionKey) {
|
|
90
|
-
const trimmed = sessionKey.trim();
|
|
91
|
-
if (trimmed.toLowerCase().startsWith("agent:")) return trimmed;
|
|
92
|
-
return `agent:${agentId}:${trimmed}`;
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Generate a voice response using the embedded OpenClaw agent with full tool support.
|
|
96
|
-
* Uses the same agent infrastructure as messaging for consistent behavior.
|
|
97
|
-
*/
|
|
98
|
-
async function generateVoiceResponse(params) {
|
|
99
|
-
const { voiceConfig, callId, sessionKey, from, transcript, userMessage, coreConfig, agentRuntime } = params;
|
|
100
|
-
if (!coreConfig) return {
|
|
101
|
-
text: null,
|
|
102
|
-
error: "Core config unavailable for voice response"
|
|
103
|
-
};
|
|
104
|
-
const cfg = coreConfig;
|
|
105
|
-
const resolvedSessionKey = resolveVoiceCallSessionKey({
|
|
106
|
-
config: voiceConfig,
|
|
107
|
-
callId,
|
|
108
|
-
phone: from,
|
|
109
|
-
explicitSessionKey: sessionKey,
|
|
110
|
-
coreSession: coreConfig.session
|
|
111
|
-
});
|
|
112
|
-
const agentId = voiceConfig.agentId ?? "main";
|
|
113
|
-
const toolsAllow = resolveVoiceAgentToolsAllow(cfg, agentId);
|
|
114
|
-
const storePath = agentRuntime.session.resolveStorePath(cfg.session?.store, { agentId });
|
|
115
|
-
const agentDir = agentRuntime.resolveAgentDir(cfg, agentId);
|
|
116
|
-
const workspaceDir = agentRuntime.resolveAgentWorkspaceDir(cfg, agentId);
|
|
117
|
-
await agentRuntime.ensureAgentWorkspace({ dir: workspaceDir });
|
|
118
|
-
const now = Date.now();
|
|
119
|
-
const existingSessionEntry = agentRuntime.session.getSessionEntry({
|
|
120
|
-
storePath,
|
|
121
|
-
sessionKey: resolvedSessionKey
|
|
122
|
-
});
|
|
123
|
-
const { provider, model } = resolveVoiceResponseModel({
|
|
124
|
-
voiceConfig,
|
|
125
|
-
agentRuntime
|
|
126
|
-
});
|
|
127
|
-
let sessionEntry = existingSessionEntry;
|
|
128
|
-
if (!sessionEntry?.sessionId || voiceConfig.responseModel) sessionEntry = await agentRuntime.session.patchSessionEntry({
|
|
129
|
-
storePath,
|
|
130
|
-
sessionKey: resolvedSessionKey,
|
|
131
|
-
replaceEntry: true,
|
|
132
|
-
fallbackEntry: sessionEntry ?? {
|
|
133
|
-
sessionId: crypto.randomUUID(),
|
|
134
|
-
updatedAt: now
|
|
135
|
-
},
|
|
136
|
-
update: (entry) => {
|
|
137
|
-
const next = entry.sessionId ? { ...entry } : {
|
|
138
|
-
...entry,
|
|
139
|
-
sessionId: crypto.randomUUID(),
|
|
140
|
-
updatedAt: now
|
|
141
|
-
};
|
|
142
|
-
if (voiceConfig.responseModel) applyModelOverrideToSessionEntry({
|
|
143
|
-
entry: next,
|
|
144
|
-
selection: {
|
|
145
|
-
provider,
|
|
146
|
-
model
|
|
147
|
-
},
|
|
148
|
-
selectionSource: "auto"
|
|
149
|
-
});
|
|
150
|
-
return next;
|
|
151
|
-
}
|
|
152
|
-
}) ?? void 0;
|
|
153
|
-
if (!sessionEntry?.sessionId) return {
|
|
154
|
-
text: null,
|
|
155
|
-
error: "Voice response session could not be initialized"
|
|
156
|
-
};
|
|
157
|
-
const sessionId = sessionEntry.sessionId;
|
|
158
|
-
const thinkLevel = agentRuntime.resolveThinkingDefault({
|
|
159
|
-
cfg,
|
|
160
|
-
provider,
|
|
161
|
-
model
|
|
162
|
-
});
|
|
163
|
-
const agentName = agentRuntime.resolveAgentIdentity(cfg, agentId)?.name?.trim() || "assistant";
|
|
164
|
-
const basePrompt = voiceConfig.responseSystemPrompt ?? `You are ${agentName}, a helpful voice assistant on a phone call. Keep responses brief and conversational (1-2 sentences max). Be natural and friendly. The caller's phone number is ${from}. You have access to tools - use them when helpful.`;
|
|
165
|
-
let extraSystemPrompt = basePrompt;
|
|
166
|
-
if (transcript.length > 0) extraSystemPrompt = `${basePrompt}\n\nConversation so far:\n${transcript.map((entry) => `${entry.speaker === "bot" ? "You" : "Caller"}: ${entry.text}`).join("\n")}`;
|
|
167
|
-
extraSystemPrompt = `${extraSystemPrompt}\n\n${VOICE_SPOKEN_OUTPUT_CONTRACT}`;
|
|
168
|
-
const timeoutMs = voiceConfig.responseTimeoutMs ?? agentRuntime.resolveAgentTimeoutMs({ cfg });
|
|
169
|
-
const runId = `voice:${callId}:${Date.now()}`;
|
|
170
|
-
try {
|
|
171
|
-
const result = await agentRuntime.runEmbeddedAgent({
|
|
172
|
-
sessionId,
|
|
173
|
-
sessionKey: resolvedSessionKey,
|
|
174
|
-
sessionTarget: {
|
|
175
|
-
agentId,
|
|
176
|
-
sessionId,
|
|
177
|
-
sessionKey: resolvedSessionKey,
|
|
178
|
-
storePath
|
|
179
|
-
},
|
|
180
|
-
sandboxSessionKey: resolveVoiceSandboxSessionKey(agentId, resolvedSessionKey),
|
|
181
|
-
agentId,
|
|
182
|
-
messageProvider: "voice",
|
|
183
|
-
workspaceDir,
|
|
184
|
-
config: cfg,
|
|
185
|
-
prompt: userMessage,
|
|
186
|
-
provider,
|
|
187
|
-
model,
|
|
188
|
-
thinkLevel,
|
|
189
|
-
verboseLevel: "off",
|
|
190
|
-
timeoutMs,
|
|
191
|
-
runId,
|
|
192
|
-
lane: "voice",
|
|
193
|
-
extraSystemPrompt,
|
|
194
|
-
agentDir,
|
|
195
|
-
toolsAllow
|
|
196
|
-
});
|
|
197
|
-
const text = extractSpokenTextFromPayloads(result.payloads ?? []);
|
|
198
|
-
if (!text && result.meta?.aborted) return {
|
|
199
|
-
text: null,
|
|
200
|
-
error: "Response generation was aborted"
|
|
201
|
-
};
|
|
202
|
-
return { text };
|
|
203
|
-
} catch (err) {
|
|
204
|
-
console.error(`[voice-call] Response generation failed:`, err);
|
|
205
|
-
return {
|
|
206
|
-
text: null,
|
|
207
|
-
error: String(err)
|
|
208
|
-
};
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
//#endregion
|
|
212
|
-
export { generateVoiceResponse };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import commander from './index.js';
|
|
2
|
-
|
|
3
|
-
// wrapper to provide named exports for ESM.
|
|
4
|
-
export const {
|
|
5
|
-
program,
|
|
6
|
-
createCommand,
|
|
7
|
-
createArgument,
|
|
8
|
-
createOption,
|
|
9
|
-
CommanderError,
|
|
10
|
-
InvalidArgumentError,
|
|
11
|
-
InvalidOptionArgumentError, // deprecated old name
|
|
12
|
-
Command,
|
|
13
|
-
Argument,
|
|
14
|
-
Option,
|
|
15
|
-
Help,
|
|
16
|
-
} = commander;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import * as Schema from '../types/index.mjs';
|
|
2
|
-
import { Stack } from './_stack.mjs';
|
|
3
|
-
import { BuildContext, CheckContext, ErrorContext } from './_context.mjs';
|
|
4
|
-
export declare function BuildGuard(_stack: Stack, _context: BuildContext, schema: Schema.XGuard, value: string): string;
|
|
5
|
-
export declare function CheckGuard(_stack: Stack, _context: CheckContext, schema: Schema.XGuard, value: unknown): boolean;
|
|
6
|
-
export declare function ErrorGuard(_stack: Stack, context: ErrorContext, schemaPath: string, instancePath: string, schema: Schema.XGuard, value: unknown): boolean;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// deno-fmt-ignore-file
|
|
2
|
-
import * as Externals from './_externals.mjs';
|
|
3
|
-
import { EmitGuard as E } from '../../guard/index.mjs';
|
|
4
|
-
// ------------------------------------------------------------------
|
|
5
|
-
// Build
|
|
6
|
-
// ------------------------------------------------------------------
|
|
7
|
-
export function BuildGuard(_stack, _context, schema, value) {
|
|
8
|
-
return E.Call(E.Member(E.Member(Externals.CreateVariable(schema), '~guard'), 'check'), [value]);
|
|
9
|
-
}
|
|
10
|
-
// ------------------------------------------------------------------
|
|
11
|
-
// Check
|
|
12
|
-
// ------------------------------------------------------------------
|
|
13
|
-
export function CheckGuard(_stack, _context, schema, value) {
|
|
14
|
-
return schema['~guard'].check(value);
|
|
15
|
-
}
|
|
16
|
-
// ------------------------------------------------------------------
|
|
17
|
-
// Error
|
|
18
|
-
// ------------------------------------------------------------------
|
|
19
|
-
export function ErrorGuard(_stack, context, schemaPath, instancePath, schema, value) {
|
|
20
|
-
return schema['~guard'].check(value) || context.AddError({
|
|
21
|
-
keyword: '~guard',
|
|
22
|
-
schemaPath,
|
|
23
|
-
instancePath,
|
|
24
|
-
params: { errors: schema['~guard'].errors(value) },
|
|
25
|
-
});
|
|
26
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { XSchemaObject } from './schema.mjs';
|
|
2
|
-
export interface XGuardInterface<Value extends unknown = unknown> {
|
|
3
|
-
check(value: unknown): value is Value;
|
|
4
|
-
errors(value: unknown): object[];
|
|
5
|
-
}
|
|
6
|
-
export interface XGuard<Value extends unknown = unknown> {
|
|
7
|
-
'~guard': XGuardInterface<Value>;
|
|
8
|
-
}
|
|
9
|
-
export declare function IsGuardInterface(value: unknown): value is XGuardInterface;
|
|
10
|
-
export declare function IsGuard(value: XSchemaObject): value is XGuard;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// deno-fmt-ignore-file
|
|
2
|
-
import { Guard } from '../../guard/index.mjs';
|
|
3
|
-
// ------------------------------------------------------------------
|
|
4
|
-
// Guard
|
|
5
|
-
// ------------------------------------------------------------------
|
|
6
|
-
export function IsGuardInterface(value) {
|
|
7
|
-
return Guard.IsObject(value)
|
|
8
|
-
&& Guard.HasPropertyKey(value, 'check')
|
|
9
|
-
&& Guard.HasPropertyKey(value, 'errors')
|
|
10
|
-
&& Guard.IsFunction(value.check)
|
|
11
|
-
&& Guard.IsFunction(value.errors);
|
|
12
|
-
}
|
|
13
|
-
export function IsGuard(value) {
|
|
14
|
-
return Guard.HasPropertyKey(value, '~guard')
|
|
15
|
-
&& IsGuardInterface(value['~guard']);
|
|
16
|
-
}
|