pi-proactive 0.0.0-stage → 0.2.0-beta.2
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/CHANGELOG.md +119 -0
- package/LICENSE +54 -0
- package/README.md +705 -2
- package/build/extensions/proactive.js +2467 -0
- package/build/src/activity.js +130 -0
- package/build/src/commands.js +496 -0
- package/build/src/config.js +483 -0
- package/build/src/content.js +198 -0
- package/build/src/daemon-config.js +488 -0
- package/build/src/daemon.js +702 -0
- package/build/src/dedupe.js +187 -0
- package/build/src/envelope.js +283 -0
- package/build/src/guard.js +74 -0
- package/build/src/health.js +734 -0
- package/build/src/idle.js +388 -0
- package/build/src/lineage.js +426 -0
- package/build/src/mailbox.js +984 -0
- package/build/src/outbox.js +26 -0
- package/build/src/peer-spawn.js +383 -0
- package/build/src/peer.js +1002 -0
- package/build/src/registry.js +583 -0
- package/build/src/scheduler.js +301 -0
- package/build/src/socket.js +496 -0
- package/build/src/task-store.js +438 -0
- package/build/src/thread.js +196 -0
- package/build/src/trigger.js +458 -0
- package/build/src/types.js +1 -0
- package/node_modules/typebox/build/compile/code.d.mts +12 -0
- package/node_modules/typebox/build/compile/code.mjs +64 -0
- package/node_modules/typebox/build/compile/compile.d.mts +6 -0
- package/node_modules/typebox/build/compile/compile.mjs +12 -0
- package/node_modules/typebox/build/compile/index.d.mts +8 -0
- package/node_modules/typebox/build/compile/index.mjs +14 -0
- package/node_modules/typebox/build/compile/validator.d.mts +35 -0
- package/node_modules/typebox/build/compile/validator.mjs +95 -0
- package/node_modules/typebox/build/error/errors.d.mts +208 -0
- package/node_modules/typebox/build/error/errors.mjs +18 -0
- package/node_modules/typebox/build/error/index.d.mts +1 -0
- package/node_modules/typebox/build/error/index.mjs +1 -0
- package/node_modules/typebox/build/format/_registry.d.mts +15 -0
- package/node_modules/typebox/build/format/_registry.mjs +96 -0
- package/node_modules/typebox/build/format/date.d.mts +6 -0
- package/node_modules/typebox/build/format/date.mjs +19 -0
- package/node_modules/typebox/build/format/date_time.d.mts +7 -0
- package/node_modules/typebox/build/format/date_time.mjs +20 -0
- package/node_modules/typebox/build/format/duration.d.mts +5 -0
- package/node_modules/typebox/build/format/duration.mjs +8 -0
- package/node_modules/typebox/build/format/email.d.mts +5 -0
- package/node_modules/typebox/build/format/email.mjs +8 -0
- package/node_modules/typebox/build/format/format.d.mts +22 -0
- package/node_modules/typebox/build/format/format.mjs +22 -0
- package/node_modules/typebox/build/format/hostname.d.mts +7 -0
- package/node_modules/typebox/build/format/hostname.mjs +10 -0
- package/node_modules/typebox/build/format/idn_email.d.mts +6 -0
- package/node_modules/typebox/build/format/idn_email.mjs +9 -0
- package/node_modules/typebox/build/format/idn_hostname.d.mts +8 -0
- package/node_modules/typebox/build/format/idn_hostname.mjs +11 -0
- package/node_modules/typebox/build/format/idna/format/bidi.d.mts +3 -0
- package/node_modules/typebox/build/format/idna/format/bidi.mjs +98 -0
- package/node_modules/typebox/build/format/idna/format/puny.d.mts +3 -0
- package/node_modules/typebox/build/format/idna/format/puny.mjs +144 -0
- package/node_modules/typebox/build/format/idna/hostname.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/hostname.mjs +16 -0
- package/node_modules/typebox/build/format/idna/idn-hostname.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/idn-hostname.mjs +43 -0
- package/node_modules/typebox/build/format/idna/index.d.mts +2 -0
- package/node_modules/typebox/build/format/idna/index.mjs +2 -0
- package/node_modules/typebox/build/format/idna/label/ascii.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/label/ascii.mjs +9 -0
- package/node_modules/typebox/build/format/idna/label/puny.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/label/puny.mjs +28 -0
- package/node_modules/typebox/build/format/idna/label/unicode.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/label/unicode.mjs +106 -0
- package/node_modules/typebox/build/format/idna/pattern/pattern.d.mts +30 -0
- package/node_modules/typebox/build/format/idna/pattern/pattern.mjs +70 -0
- package/node_modules/typebox/build/format/index.d.mts +4 -0
- package/node_modules/typebox/build/format/index.mjs +4 -0
- package/node_modules/typebox/build/format/ipv4.d.mts +5 -0
- package/node_modules/typebox/build/format/ipv4.mjs +8 -0
- package/node_modules/typebox/build/format/ipv6.d.mts +5 -0
- package/node_modules/typebox/build/format/ipv6.mjs +8 -0
- package/node_modules/typebox/build/format/iri.d.mts +5 -0
- package/node_modules/typebox/build/format/iri.mjs +42 -0
- package/node_modules/typebox/build/format/iri_reference.d.mts +5 -0
- package/node_modules/typebox/build/format/iri_reference.mjs +14 -0
- package/node_modules/typebox/build/format/json_pointer.d.mts +6 -0
- package/node_modules/typebox/build/format/json_pointer.mjs +9 -0
- package/node_modules/typebox/build/format/json_pointer_uri_fragment.d.mts +6 -0
- package/node_modules/typebox/build/format/json_pointer_uri_fragment.mjs +9 -0
- package/node_modules/typebox/build/format/regex.d.mts +5 -0
- package/node_modules/typebox/build/format/regex.mjs +13 -0
- package/node_modules/typebox/build/format/relative_json_pointer.d.mts +6 -0
- package/node_modules/typebox/build/format/relative_json_pointer.mjs +9 -0
- package/node_modules/typebox/build/format/time.d.mts +5 -0
- package/node_modules/typebox/build/format/time.mjs +32 -0
- package/node_modules/typebox/build/format/uri.d.mts +5 -0
- package/node_modules/typebox/build/format/uri.mjs +8 -0
- package/node_modules/typebox/build/format/uri_reference.d.mts +5 -0
- package/node_modules/typebox/build/format/uri_reference.mjs +8 -0
- package/node_modules/typebox/build/format/uri_template.d.mts +5 -0
- package/node_modules/typebox/build/format/uri_template.mjs +9 -0
- package/node_modules/typebox/build/format/url.d.mts +6 -0
- package/node_modules/typebox/build/format/url.mjs +8 -0
- package/node_modules/typebox/build/format/uuid.d.mts +6 -0
- package/node_modules/typebox/build/format/uuid.mjs +9 -0
- package/node_modules/typebox/build/guard/emit.d.mts +56 -0
- package/node_modules/typebox/build/guard/emit.mjs +191 -0
- package/node_modules/typebox/build/guard/globals.d.mts +35 -0
- package/node_modules/typebox/build/guard/globals.mjs +90 -0
- package/node_modules/typebox/build/guard/guard.d.mts +73 -0
- package/node_modules/typebox/build/guard/guard.mjs +226 -0
- package/node_modules/typebox/build/guard/index.d.mts +6 -0
- package/node_modules/typebox/build/guard/index.mjs +12 -0
- package/node_modules/typebox/build/guard/native.d.mts +20 -0
- package/node_modules/typebox/build/guard/native.mjs +60 -0
- package/node_modules/typebox/build/guard/unicode/unicode.d.mts +6 -0
- package/node_modules/typebox/build/guard/unicode/unicode.mjs +35 -0
- package/node_modules/typebox/build/guard/unicode/unicode_segment.d.mts +6 -0
- package/node_modules/typebox/build/guard/unicode/unicode_segment.mjs +165 -0
- package/node_modules/typebox/build/index.d.mts +8 -0
- package/node_modules/typebox/build/index.mjs +14 -0
- package/node_modules/typebox/build/schema/build.d.mts +39 -0
- package/node_modules/typebox/build/schema/build.mjs +118 -0
- package/node_modules/typebox/build/schema/check.d.mts +6 -0
- package/node_modules/typebox/build/schema/check.mjs +14 -0
- package/node_modules/typebox/build/schema/compile.d.mts +23 -0
- package/node_modules/typebox/build/schema/compile.mjs +46 -0
- package/node_modules/typebox/build/schema/engine/_context.d.mts +34 -0
- package/node_modules/typebox/build/schema/engine/_context.mjs +137 -0
- package/node_modules/typebox/build/schema/engine/_exact_optional.d.mts +3 -0
- package/node_modules/typebox/build/schema/engine/_exact_optional.mjs +20 -0
- package/node_modules/typebox/build/schema/engine/_externals.d.mts +7 -0
- package/node_modules/typebox/build/schema/engine/_externals.mjs +25 -0
- package/node_modules/typebox/build/schema/engine/_functions.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/_functions.mjs +65 -0
- package/node_modules/typebox/build/schema/engine/_pathing.d.mts +1 -0
- package/node_modules/typebox/build/schema/engine/_pathing.mjs +11 -0
- package/node_modules/typebox/build/schema/engine/_reducer.d.mts +4 -0
- package/node_modules/typebox/build/schema/engine/_reducer.mjs +45 -0
- package/node_modules/typebox/build/schema/engine/_refine.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/_refine.mjs +34 -0
- package/node_modules/typebox/build/schema/engine/_regexp.d.mts +2 -0
- package/node_modules/typebox/build/schema/engine/_regexp.mjs +4 -0
- package/node_modules/typebox/build/schema/engine/_stack.d.mts +36 -0
- package/node_modules/typebox/build/schema/engine/_stack.mjs +150 -0
- package/node_modules/typebox/build/schema/engine/_unique.d.mts +4 -0
- package/node_modules/typebox/build/schema/engine/_unique.mjs +9 -0
- package/node_modules/typebox/build/schema/engine/additionalItems.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/additionalItems.mjs +60 -0
- package/node_modules/typebox/build/schema/engine/additionalProperties.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +118 -0
- package/node_modules/typebox/build/schema/engine/allOf.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/allOf.mjs +47 -0
- package/node_modules/typebox/build/schema/engine/anyOf.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/anyOf.mjs +47 -0
- package/node_modules/typebox/build/schema/engine/boolean.d.mts +5 -0
- package/node_modules/typebox/build/schema/engine/boolean.mjs +21 -0
- package/node_modules/typebox/build/schema/engine/const.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/const.mjs +26 -0
- package/node_modules/typebox/build/schema/engine/contains.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/contains.mjs +50 -0
- package/node_modules/typebox/build/schema/engine/dependencies.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/dependencies.mjs +43 -0
- package/node_modules/typebox/build/schema/engine/dependentRequired.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/dependentRequired.mjs +36 -0
- package/node_modules/typebox/build/schema/engine/dependentSchemas.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/dependentSchemas.mjs +39 -0
- package/node_modules/typebox/build/schema/engine/dynamicRef.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/dynamicRef.mjs +29 -0
- package/node_modules/typebox/build/schema/engine/enum.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/enum.mjs +29 -0
- package/node_modules/typebox/build/schema/engine/exclusiveMaximum.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/exclusiveMaximum.mjs +21 -0
- package/node_modules/typebox/build/schema/engine/exclusiveMinimum.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/exclusiveMinimum.mjs +21 -0
- package/node_modules/typebox/build/schema/engine/format.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/format.mjs +29 -0
- package/node_modules/typebox/build/schema/engine/if.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/if.mjs +39 -0
- package/node_modules/typebox/build/schema/engine/index.d.mts +49 -0
- package/node_modules/typebox/build/schema/engine/index.mjs +55 -0
- package/node_modules/typebox/build/schema/engine/items.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/items.mjs +91 -0
- package/node_modules/typebox/build/schema/engine/maxContains.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/maxContains.mjs +38 -0
- package/node_modules/typebox/build/schema/engine/maxItems.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/maxItems.mjs +21 -0
- package/node_modules/typebox/build/schema/engine/maxLength.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/maxLength.mjs +21 -0
- package/node_modules/typebox/build/schema/engine/maxProperties.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/maxProperties.mjs +21 -0
- package/node_modules/typebox/build/schema/engine/maximum.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/maximum.mjs +21 -0
- package/node_modules/typebox/build/schema/engine/minContains.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/minContains.mjs +47 -0
- package/node_modules/typebox/build/schema/engine/minItems.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/minItems.mjs +21 -0
- package/node_modules/typebox/build/schema/engine/minLength.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/minLength.mjs +21 -0
- package/node_modules/typebox/build/schema/engine/minProperties.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/minProperties.mjs +21 -0
- package/node_modules/typebox/build/schema/engine/minimum.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/minimum.mjs +21 -0
- package/node_modules/typebox/build/schema/engine/multipleOf.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/multipleOf.mjs +21 -0
- package/node_modules/typebox/build/schema/engine/not.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/not.mjs +35 -0
- package/node_modules/typebox/build/schema/engine/oneOf.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/oneOf.mjs +54 -0
- package/node_modules/typebox/build/schema/engine/pattern.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/pattern.mjs +25 -0
- package/node_modules/typebox/build/schema/engine/patternProperties.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/patternProperties.mjs +46 -0
- package/node_modules/typebox/build/schema/engine/prefixItems.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/prefixItems.mjs +35 -0
- package/node_modules/typebox/build/schema/engine/properties.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/properties.mjs +76 -0
- package/node_modules/typebox/build/schema/engine/propertyNames.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/propertyNames.mjs +34 -0
- package/node_modules/typebox/build/schema/engine/recursiveRef.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/recursiveRef.mjs +29 -0
- package/node_modules/typebox/build/schema/engine/ref.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/ref.mjs +56 -0
- package/node_modules/typebox/build/schema/engine/required.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/required.mjs +28 -0
- package/node_modules/typebox/build/schema/engine/schema.d.mts +9 -0
- package/node_modules/typebox/build/schema/engine/schema.mjs +360 -0
- package/node_modules/typebox/build/schema/engine/type.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/type.mjs +66 -0
- package/node_modules/typebox/build/schema/engine/unevaluatedItems.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/unevaluatedItems.mjs +47 -0
- package/node_modules/typebox/build/schema/engine/unevaluatedProperties.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/unevaluatedProperties.mjs +47 -0
- package/node_modules/typebox/build/schema/engine/uniqueItems.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/uniqueItems.mjs +47 -0
- package/node_modules/typebox/build/schema/errors.d.mts +6 -0
- package/node_modules/typebox/build/schema/errors.mjs +18 -0
- package/node_modules/typebox/build/schema/index.d.mts +3 -0
- package/node_modules/typebox/build/schema/index.mjs +9 -0
- 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 +14 -0
- package/node_modules/typebox/build/schema/parse.mjs +35 -0
- package/node_modules/typebox/build/schema/pointer/index.d.mts +2 -0
- package/node_modules/typebox/build/schema/pointer/index.mjs +2 -0
- package/node_modules/typebox/build/schema/pointer/pointer.d.mts +5 -0
- package/node_modules/typebox/build/schema/pointer/pointer.mjs +89 -0
- package/node_modules/typebox/build/schema/pointer/pointer_get.d.mts +9 -0
- package/node_modules/typebox/build/schema/pointer/pointer_get.mjs +2 -0
- package/node_modules/typebox/build/schema/resolve/index.d.mts +1 -0
- package/node_modules/typebox/build/schema/resolve/index.mjs +1 -0
- package/node_modules/typebox/build/schema/resolve/resolve.d.mts +9 -0
- package/node_modules/typebox/build/schema/resolve/resolve.mjs +331 -0
- package/node_modules/typebox/build/schema/schema.d.mts +12 -0
- package/node_modules/typebox/build/schema/schema.mjs +12 -0
- package/node_modules/typebox/build/schema/static/_canonical.d.mts +7 -0
- package/node_modules/typebox/build/schema/static/_canonical.mjs +2 -0
- package/node_modules/typebox/build/schema/static/_comparer.d.mts +6 -0
- package/node_modules/typebox/build/schema/static/_comparer.mjs +2 -0
- package/node_modules/typebox/build/schema/static/_elements.d.mts +18 -0
- package/node_modules/typebox/build/schema/static/_elements.mjs +2 -0
- package/node_modules/typebox/build/schema/static/additionalProperties.d.mts +7 -0
- package/node_modules/typebox/build/schema/static/additionalProperties.mjs +3 -0
- package/node_modules/typebox/build/schema/static/allOf.d.mts +3 -0
- package/node_modules/typebox/build/schema/static/allOf.mjs +2 -0
- package/node_modules/typebox/build/schema/static/anyOf.d.mts +3 -0
- package/node_modules/typebox/build/schema/static/anyOf.mjs +2 -0
- package/node_modules/typebox/build/schema/static/const.d.mts +1 -0
- package/node_modules/typebox/build/schema/static/const.mjs +2 -0
- package/node_modules/typebox/build/schema/static/enum.d.mts +1 -0
- package/node_modules/typebox/build/schema/static/enum.mjs +2 -0
- package/node_modules/typebox/build/schema/static/if.d.mts +15 -0
- package/node_modules/typebox/build/schema/static/if.mjs +2 -0
- package/node_modules/typebox/build/schema/static/index.d.mts +1 -0
- package/node_modules/typebox/build/schema/static/index.mjs +1 -0
- package/node_modules/typebox/build/schema/static/items.d.mts +7 -0
- package/node_modules/typebox/build/schema/static/items.mjs +2 -0
- package/node_modules/typebox/build/schema/static/oneOf.d.mts +3 -0
- package/node_modules/typebox/build/schema/static/oneOf.mjs +2 -0
- package/node_modules/typebox/build/schema/static/patternProperties.d.mts +7 -0
- package/node_modules/typebox/build/schema/static/patternProperties.mjs +2 -0
- package/node_modules/typebox/build/schema/static/prefixItems.d.mts +3 -0
- package/node_modules/typebox/build/schema/static/prefixItems.mjs +2 -0
- package/node_modules/typebox/build/schema/static/properties.d.mts +32 -0
- package/node_modules/typebox/build/schema/static/properties.mjs +2 -0
- package/node_modules/typebox/build/schema/static/propertyNames.d.mts +5 -0
- package/node_modules/typebox/build/schema/static/propertyNames.mjs +3 -0
- package/node_modules/typebox/build/schema/static/ref.d.mts +8 -0
- package/node_modules/typebox/build/schema/static/ref.mjs +3 -0
- package/node_modules/typebox/build/schema/static/required.d.mts +3 -0
- package/node_modules/typebox/build/schema/static/required.mjs +3 -0
- package/node_modules/typebox/build/schema/static/schema.d.mts +59 -0
- package/node_modules/typebox/build/schema/static/schema.mjs +2 -0
- package/node_modules/typebox/build/schema/static/static.d.mts +4 -0
- package/node_modules/typebox/build/schema/static/static.mjs +3 -0
- package/node_modules/typebox/build/schema/static/type.d.mts +4 -0
- package/node_modules/typebox/build/schema/static/type.mjs +3 -0
- package/node_modules/typebox/build/schema/static/unevaluatedProperties.d.mts +7 -0
- package/node_modules/typebox/build/schema/static/unevaluatedProperties.mjs +3 -0
- package/node_modules/typebox/build/schema/types/_refine.d.mts +13 -0
- package/node_modules/typebox/build/schema/types/_refine.mjs +18 -0
- package/node_modules/typebox/build/schema/types/additionalItems.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/additionalItems.mjs +14 -0
- package/node_modules/typebox/build/schema/types/additionalProperties.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/additionalProperties.mjs +14 -0
- package/node_modules/typebox/build/schema/types/allOf.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/allOf.mjs +15 -0
- package/node_modules/typebox/build/schema/types/anchor.d.mts +8 -0
- package/node_modules/typebox/build/schema/types/anchor.mjs +12 -0
- package/node_modules/typebox/build/schema/types/anyOf.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/anyOf.mjs +15 -0
- package/node_modules/typebox/build/schema/types/const.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/const.mjs +12 -0
- package/node_modules/typebox/build/schema/types/contains.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/contains.mjs +14 -0
- package/node_modules/typebox/build/schema/types/default.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/default.mjs +12 -0
- package/node_modules/typebox/build/schema/types/defs.d.mts +6 -0
- package/node_modules/typebox/build/schema/types/defs.mjs +12 -0
- package/node_modules/typebox/build/schema/types/dependencies.d.mts +11 -0
- package/node_modules/typebox/build/schema/types/dependencies.mjs +16 -0
- package/node_modules/typebox/build/schema/types/dependentRequired.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/dependentRequired.mjs +15 -0
- package/node_modules/typebox/build/schema/types/dependentSchemas.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/dependentSchemas.mjs +15 -0
- package/node_modules/typebox/build/schema/types/dynamicAnchor.d.mts +8 -0
- package/node_modules/typebox/build/schema/types/dynamicAnchor.mjs +12 -0
- package/node_modules/typebox/build/schema/types/dynamicRef.d.mts +8 -0
- package/node_modules/typebox/build/schema/types/dynamicRef.mjs +12 -0
- package/node_modules/typebox/build/schema/types/else.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/else.mjs +14 -0
- package/node_modules/typebox/build/schema/types/enum.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/enum.mjs +13 -0
- package/node_modules/typebox/build/schema/types/exclusiveMaximum.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/exclusiveMaximum.mjs +13 -0
- package/node_modules/typebox/build/schema/types/exclusiveMinimum.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/exclusiveMinimum.mjs +13 -0
- package/node_modules/typebox/build/schema/types/format.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/format.mjs +13 -0
- package/node_modules/typebox/build/schema/types/id.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/id.mjs +13 -0
- package/node_modules/typebox/build/schema/types/if.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/if.mjs +14 -0
- package/node_modules/typebox/build/schema/types/index.d.mts +51 -0
- package/node_modules/typebox/build/schema/types/index.mjs +57 -0
- package/node_modules/typebox/build/schema/types/items.d.mts +19 -0
- package/node_modules/typebox/build/schema/types/items.mjs +26 -0
- package/node_modules/typebox/build/schema/types/maxContains.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/maxContains.mjs +13 -0
- package/node_modules/typebox/build/schema/types/maxItems.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/maxItems.mjs +13 -0
- package/node_modules/typebox/build/schema/types/maxLength.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/maxLength.mjs +13 -0
- package/node_modules/typebox/build/schema/types/maxProperties.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/maxProperties.mjs +13 -0
- package/node_modules/typebox/build/schema/types/maximum.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/maximum.mjs +13 -0
- package/node_modules/typebox/build/schema/types/minContains.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/minContains.mjs +13 -0
- package/node_modules/typebox/build/schema/types/minItems.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/minItems.mjs +13 -0
- package/node_modules/typebox/build/schema/types/minLength.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/minLength.mjs +13 -0
- package/node_modules/typebox/build/schema/types/minProperties.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/minProperties.mjs +13 -0
- package/node_modules/typebox/build/schema/types/minimum.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/minimum.mjs +13 -0
- package/node_modules/typebox/build/schema/types/multipleOf.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/multipleOf.mjs +13 -0
- package/node_modules/typebox/build/schema/types/not.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/not.mjs +14 -0
- package/node_modules/typebox/build/schema/types/oneOf.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/oneOf.mjs +15 -0
- package/node_modules/typebox/build/schema/types/pattern.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/pattern.mjs +14 -0
- package/node_modules/typebox/build/schema/types/patternProperties.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/patternProperties.mjs +15 -0
- package/node_modules/typebox/build/schema/types/prefixItems.d.mts +8 -0
- package/node_modules/typebox/build/schema/types/prefixItems.mjs +14 -0
- package/node_modules/typebox/build/schema/types/properties.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/properties.mjs +15 -0
- package/node_modules/typebox/build/schema/types/propertyNames.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/propertyNames.mjs +15 -0
- package/node_modules/typebox/build/schema/types/recursiveAnchor.d.mts +12 -0
- package/node_modules/typebox/build/schema/types/recursiveAnchor.mjs +19 -0
- package/node_modules/typebox/build/schema/types/recursiveRef.d.mts +8 -0
- package/node_modules/typebox/build/schema/types/recursiveRef.mjs +12 -0
- package/node_modules/typebox/build/schema/types/ref.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/ref.mjs +13 -0
- package/node_modules/typebox/build/schema/types/required.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/required.mjs +14 -0
- package/node_modules/typebox/build/schema/types/schema.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/schema.mjs +14 -0
- package/node_modules/typebox/build/schema/types/then.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/then.mjs +14 -0
- package/node_modules/typebox/build/schema/types/type.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/type.mjs +15 -0
- package/node_modules/typebox/build/schema/types/unevaluatedItems.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/unevaluatedItems.mjs +14 -0
- package/node_modules/typebox/build/schema/types/unevaluatedProperties.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/unevaluatedProperties.mjs +14 -0
- package/node_modules/typebox/build/schema/types/uniqueItems.d.mts +9 -0
- package/node_modules/typebox/build/schema/types/uniqueItems.mjs +13 -0
- package/node_modules/typebox/build/system/arguments/arguments.d.mts +5 -0
- package/node_modules/typebox/build/system/arguments/arguments.mjs +9 -0
- package/node_modules/typebox/build/system/arguments/index.d.mts +1 -0
- package/node_modules/typebox/build/system/arguments/index.mjs +1 -0
- package/node_modules/typebox/build/system/environment/environment.d.mts +1 -0
- package/node_modules/typebox/build/system/environment/environment.mjs +1 -0
- package/node_modules/typebox/build/system/environment/evaluate.d.mts +9 -0
- package/node_modules/typebox/build/system/environment/evaluate.mjs +37 -0
- package/node_modules/typebox/build/system/environment/index.d.mts +1 -0
- package/node_modules/typebox/build/system/environment/index.mjs +1 -0
- package/node_modules/typebox/build/system/hashing/hash.d.mts +4 -0
- package/node_modules/typebox/build/system/hashing/hash.mjs +261 -0
- package/node_modules/typebox/build/system/hashing/index.d.mts +1 -0
- package/node_modules/typebox/build/system/hashing/index.mjs +1 -0
- package/node_modules/typebox/build/system/index.d.mts +4 -0
- package/node_modules/typebox/build/system/index.mjs +4 -0
- package/node_modules/typebox/build/system/locale/_config.d.mts +7 -0
- package/node_modules/typebox/build/system/locale/_config.mjs +15 -0
- package/node_modules/typebox/build/system/locale/_locale.d.mts +40 -0
- package/node_modules/typebox/build/system/locale/_locale.mjs +40 -0
- package/node_modules/typebox/build/system/locale/ar_001.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/ar_001.mjs +40 -0
- package/node_modules/typebox/build/system/locale/bn_BD.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/bn_BD.mjs +40 -0
- package/node_modules/typebox/build/system/locale/cs_CZ.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/cs_CZ.mjs +40 -0
- package/node_modules/typebox/build/system/locale/de_DE.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/de_DE.mjs +40 -0
- package/node_modules/typebox/build/system/locale/el_GR.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/el_GR.mjs +40 -0
- package/node_modules/typebox/build/system/locale/en_US.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/en_US.mjs +40 -0
- package/node_modules/typebox/build/system/locale/es_419.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/es_419.mjs +40 -0
- package/node_modules/typebox/build/system/locale/es_AR.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/es_AR.mjs +40 -0
- package/node_modules/typebox/build/system/locale/es_ES.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/es_ES.mjs +40 -0
- package/node_modules/typebox/build/system/locale/es_MX.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/es_MX.mjs +40 -0
- package/node_modules/typebox/build/system/locale/fa_IR.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/fa_IR.mjs +40 -0
- package/node_modules/typebox/build/system/locale/fil_PH.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/fil_PH.mjs +40 -0
- package/node_modules/typebox/build/system/locale/fr_CA.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/fr_CA.mjs +40 -0
- package/node_modules/typebox/build/system/locale/fr_FR.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/fr_FR.mjs +40 -0
- package/node_modules/typebox/build/system/locale/ha_NG.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/ha_NG.mjs +40 -0
- package/node_modules/typebox/build/system/locale/hi_IN.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/hi_IN.mjs +40 -0
- package/node_modules/typebox/build/system/locale/hu_HU.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/hu_HU.mjs +40 -0
- package/node_modules/typebox/build/system/locale/id_ID.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/id_ID.mjs +40 -0
- package/node_modules/typebox/build/system/locale/index.d.mts +1 -0
- package/node_modules/typebox/build/system/locale/index.mjs +1 -0
- package/node_modules/typebox/build/system/locale/it_IT.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/it_IT.mjs +40 -0
- package/node_modules/typebox/build/system/locale/ja_JP.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/ja_JP.mjs +40 -0
- package/node_modules/typebox/build/system/locale/ko_KR.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/ko_KR.mjs +40 -0
- package/node_modules/typebox/build/system/locale/ms_MY.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/ms_MY.mjs +40 -0
- package/node_modules/typebox/build/system/locale/nl_NL.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/nl_NL.mjs +40 -0
- package/node_modules/typebox/build/system/locale/pl_PL.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/pl_PL.mjs +40 -0
- package/node_modules/typebox/build/system/locale/pt_BR.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/pt_BR.mjs +40 -0
- package/node_modules/typebox/build/system/locale/pt_PT.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/pt_PT.mjs +40 -0
- package/node_modules/typebox/build/system/locale/ro_RO.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/ro_RO.mjs +40 -0
- package/node_modules/typebox/build/system/locale/ru_RU.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/ru_RU.mjs +40 -0
- package/node_modules/typebox/build/system/locale/sv_SE.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/sv_SE.mjs +40 -0
- package/node_modules/typebox/build/system/locale/sw_TZ.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/sw_TZ.mjs +40 -0
- package/node_modules/typebox/build/system/locale/th_TH.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/th_TH.mjs +40 -0
- package/node_modules/typebox/build/system/locale/tr_TR.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/tr_TR.mjs +40 -0
- package/node_modules/typebox/build/system/locale/uk_UA.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/uk_UA.mjs +40 -0
- package/node_modules/typebox/build/system/locale/ur_PK.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/ur_PK.mjs +40 -0
- package/node_modules/typebox/build/system/locale/vi_VN.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/vi_VN.mjs +40 -0
- package/node_modules/typebox/build/system/locale/yo_NG.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/yo_NG.mjs +40 -0
- package/node_modules/typebox/build/system/locale/zh_Hans.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/zh_Hans.mjs +40 -0
- package/node_modules/typebox/build/system/locale/zh_Hant.d.mts +3 -0
- package/node_modules/typebox/build/system/locale/zh_Hant.mjs +40 -0
- package/node_modules/typebox/build/system/memory/assign.d.mts +8 -0
- package/node_modules/typebox/build/system/memory/assign.mjs +19 -0
- package/node_modules/typebox/build/system/memory/clone.d.mts +4 -0
- package/node_modules/typebox/build/system/memory/clone.mjs +25 -0
- package/node_modules/typebox/build/system/memory/create.d.mts +4 -0
- package/node_modules/typebox/build/system/memory/create.mjs +34 -0
- package/node_modules/typebox/build/system/memory/deep.d.mts +2 -0
- package/node_modules/typebox/build/system/memory/deep.mjs +108 -0
- package/node_modules/typebox/build/system/memory/discard.d.mts +4 -0
- package/node_modules/typebox/build/system/memory/discard.mjs +19 -0
- package/node_modules/typebox/build/system/memory/finalize.d.mts +4 -0
- package/node_modules/typebox/build/system/memory/finalize.mjs +30 -0
- package/node_modules/typebox/build/system/memory/index.d.mts +1 -0
- package/node_modules/typebox/build/system/memory/index.mjs +1 -0
- package/node_modules/typebox/build/system/memory/keys.d.mts +2 -0
- package/node_modules/typebox/build/system/memory/keys.mjs +8 -0
- package/node_modules/typebox/build/system/memory/memory.d.mts +6 -0
- package/node_modules/typebox/build/system/memory/memory.mjs +7 -0
- package/node_modules/typebox/build/system/memory/metrics.d.mts +14 -0
- package/node_modules/typebox/build/system/memory/metrics.mjs +8 -0
- package/node_modules/typebox/build/system/memory/update.d.mts +4 -0
- package/node_modules/typebox/build/system/memory/update.mjs +60 -0
- package/node_modules/typebox/build/system/settings/index.d.mts +1 -0
- package/node_modules/typebox/build/system/settings/index.mjs +1 -0
- package/node_modules/typebox/build/system/settings/internal.d.mts +2 -0
- package/node_modules/typebox/build/system/settings/internal.mjs +20 -0
- package/node_modules/typebox/build/system/settings/settings.d.mts +91 -0
- package/node_modules/typebox/build/system/settings/settings.mjs +50 -0
- package/node_modules/typebox/build/system/system.d.mts +6 -0
- package/node_modules/typebox/build/system/system.mjs +6 -0
- package/node_modules/typebox/build/system/unreachable/index.d.mts +1 -0
- package/node_modules/typebox/build/system/unreachable/index.mjs +1 -0
- package/node_modules/typebox/build/system/unreachable/unreachable.d.mts +3 -0
- package/node_modules/typebox/build/system/unreachable/unreachable.mjs +6 -0
- 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/capitalize.d.mts +11 -0
- package/node_modules/typebox/build/type/action/capitalize.mjs +11 -0
- package/node_modules/typebox/build/type/action/conditional.d.mts +12 -0
- package/node_modules/typebox/build/type/action/conditional.mjs +13 -0
- package/node_modules/typebox/build/type/action/constructor_parameters.d.mts +11 -0
- package/node_modules/typebox/build/type/action/constructor_parameters.mjs +11 -0
- package/node_modules/typebox/build/type/action/evaluate.d.mts +11 -0
- package/node_modules/typebox/build/type/action/evaluate.mjs +11 -0
- package/node_modules/typebox/build/type/action/exclude.d.mts +11 -0
- package/node_modules/typebox/build/type/action/exclude.mjs +11 -0
- package/node_modules/typebox/build/type/action/extract.d.mts +11 -0
- package/node_modules/typebox/build/type/action/extract.mjs +11 -0
- package/node_modules/typebox/build/type/action/index.d.mts +30 -0
- package/node_modules/typebox/build/type/action/index.mjs +30 -0
- package/node_modules/typebox/build/type/action/indexed.d.mts +14 -0
- package/node_modules/typebox/build/type/action/indexed.mjs +14 -0
- package/node_modules/typebox/build/type/action/instance_type.d.mts +11 -0
- package/node_modules/typebox/build/type/action/instance_type.mjs +11 -0
- package/node_modules/typebox/build/type/action/interface.d.mts +14 -0
- package/node_modules/typebox/build/type/action/interface.mjs +22 -0
- package/node_modules/typebox/build/type/action/keyof.d.mts +11 -0
- package/node_modules/typebox/build/type/action/keyof.mjs +11 -0
- package/node_modules/typebox/build/type/action/lowercase.d.mts +11 -0
- package/node_modules/typebox/build/type/action/lowercase.mjs +11 -0
- package/node_modules/typebox/build/type/action/mapped.d.mts +13 -0
- package/node_modules/typebox/build/type/action/mapped.mjs +13 -0
- package/node_modules/typebox/build/type/action/module.d.mts +13 -0
- package/node_modules/typebox/build/type/action/module.mjs +13 -0
- package/node_modules/typebox/build/type/action/non_nullable.d.mts +11 -0
- package/node_modules/typebox/build/type/action/non_nullable.mjs +11 -0
- package/node_modules/typebox/build/type/action/omit.d.mts +14 -0
- package/node_modules/typebox/build/type/action/omit.mjs +14 -0
- package/node_modules/typebox/build/type/action/parameters.d.mts +11 -0
- package/node_modules/typebox/build/type/action/parameters.mjs +11 -0
- package/node_modules/typebox/build/type/action/partial.d.mts +11 -0
- package/node_modules/typebox/build/type/action/partial.mjs +11 -0
- package/node_modules/typebox/build/type/action/pick.d.mts +14 -0
- package/node_modules/typebox/build/type/action/pick.mjs +14 -0
- package/node_modules/typebox/build/type/action/readonly_object.d.mts +16 -0
- package/node_modules/typebox/build/type/action/readonly_object.mjs +19 -0
- package/node_modules/typebox/build/type/action/required.d.mts +11 -0
- package/node_modules/typebox/build/type/action/required.mjs +11 -0
- package/node_modules/typebox/build/type/action/return_type.d.mts +11 -0
- package/node_modules/typebox/build/type/action/return_type.mjs +11 -0
- package/node_modules/typebox/build/type/action/uncapitalize.d.mts +11 -0
- package/node_modules/typebox/build/type/action/uncapitalize.mjs +11 -0
- package/node_modules/typebox/build/type/action/uppercase.d.mts +11 -0
- package/node_modules/typebox/build/type/action/uppercase.mjs +11 -0
- 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.d.mts +20 -0
- package/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs +66 -0
- package/node_modules/typebox/build/type/engine/call/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/call/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/call/instantiate.d.mts +21 -0
- package/node_modules/typebox/build/type/engine/call/instantiate.mjs +79 -0
- package/node_modules/typebox/build/type/engine/call/resolve_arguments.d.mts +13 -0
- package/node_modules/typebox/build/type/engine/call/resolve_arguments.mjs +33 -0
- package/node_modules/typebox/build/type/engine/call/resolve_target.d.mts +25 -0
- package/node_modules/typebox/build/type/engine/call/resolve_target.mjs +27 -0
- package/node_modules/typebox/build/type/engine/conditional/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/conditional/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/conditional/instantiate.d.mts +12 -0
- package/node_modules/typebox/build/type/engine/conditional/instantiate.mjs +23 -0
- package/node_modules/typebox/build/type/engine/constructor_parameters/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/constructor_parameters/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.d.mts +14 -0
- package/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.mjs +25 -0
- package/node_modules/typebox/build/type/engine/cyclic/candidates.d.mts +8 -0
- package/node_modules/typebox/build/type/engine/cyclic/candidates.mjs +16 -0
- package/node_modules/typebox/build/type/engine/cyclic/check.d.mts +21 -0
- package/node_modules/typebox/build/type/engine/cyclic/check.mjs +45 -0
- package/node_modules/typebox/build/type/engine/cyclic/dependencies.d.mts +22 -0
- package/node_modules/typebox/build/type/engine/cyclic/dependencies.mjs +47 -0
- package/node_modules/typebox/build/type/engine/cyclic/extends.d.mts +28 -0
- package/node_modules/typebox/build/type/engine/cyclic/extends.mjs +47 -0
- package/node_modules/typebox/build/type/engine/cyclic/index.d.mts +6 -0
- package/node_modules/typebox/build/type/engine/cyclic/index.mjs +6 -0
- package/node_modules/typebox/build/type/engine/cyclic/instantiate.d.mts +17 -0
- package/node_modules/typebox/build/type/engine/cyclic/instantiate.mjs +31 -0
- package/node_modules/typebox/build/type/engine/cyclic/target.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/cyclic/target.mjs +16 -0
- package/node_modules/typebox/build/type/engine/enum/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/enum/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/enum/typescript_enum_to_enum_values.d.mts +8 -0
- package/node_modules/typebox/build/type/engine/enum/typescript_enum_to_enum_values.mjs +9 -0
- package/node_modules/typebox/build/type/engine/evaluate/broaden.d.mts +15 -0
- package/node_modules/typebox/build/type/engine/evaluate/broaden.mjs +37 -0
- package/node_modules/typebox/build/type/engine/evaluate/compare.d.mts +11 -0
- package/node_modules/typebox/build/type/engine/evaluate/compare.mjs +18 -0
- package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +15 -0
- package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +33 -0
- package/node_modules/typebox/build/type/engine/evaluate/distribute.d.mts +12 -0
- package/node_modules/typebox/build/type/engine/evaluate/distribute.mjs +33 -0
- package/node_modules/typebox/build/type/engine/evaluate/evaluate.d.mts +26 -0
- package/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs +56 -0
- package/node_modules/typebox/build/type/engine/evaluate/flatten.d.mts +6 -0
- package/node_modules/typebox/build/type/engine/evaluate/flatten.mjs +10 -0
- package/node_modules/typebox/build/type/engine/evaluate/index.d.mts +9 -0
- package/node_modules/typebox/build/type/engine/evaluate/index.mjs +9 -0
- package/node_modules/typebox/build/type/engine/evaluate/instantiate.d.mts +8 -0
- package/node_modules/typebox/build/type/engine/evaluate/instantiate.mjs +12 -0
- package/node_modules/typebox/build/type/engine/evaluate/narrow.d.mts +24 -0
- package/node_modules/typebox/build/type/engine/evaluate/narrow.mjs +36 -0
- package/node_modules/typebox/build/type/engine/evaluate/property.d.mts +30 -0
- package/node_modules/typebox/build/type/engine/evaluate/property.mjs +29 -0
- package/node_modules/typebox/build/type/engine/exclude/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/exclude/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/exclude/instantiate.d.mts +9 -0
- package/node_modules/typebox/build/type/engine/exclude/instantiate.mjs +16 -0
- package/node_modules/typebox/build/type/engine/exclude/operation.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/exclude/operation.mjs +22 -0
- package/node_modules/typebox/build/type/engine/extract/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/extract/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/extract/instantiate.d.mts +9 -0
- package/node_modules/typebox/build/type/engine/extract/instantiate.mjs +16 -0
- package/node_modules/typebox/build/type/engine/extract/operation.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/extract/operation.mjs +22 -0
- package/node_modules/typebox/build/type/engine/helpers/index.d.mts +3 -0
- package/node_modules/typebox/build/type/engine/helpers/index.mjs +3 -0
- package/node_modules/typebox/build/type/engine/helpers/keys.d.mts +3 -0
- package/node_modules/typebox/build/type/engine/helpers/keys.mjs +8 -0
- package/node_modules/typebox/build/type/engine/helpers/keys_to_indexer.d.mts +7 -0
- package/node_modules/typebox/build/type/engine/helpers/keys_to_indexer.mjs +15 -0
- package/node_modules/typebox/build/type/engine/helpers/union.d.mts +7 -0
- package/node_modules/typebox/build/type/engine/helpers/union.mjs +3 -0
- package/node_modules/typebox/build/type/engine/immutable/instantiate_add.d.mts +8 -0
- package/node_modules/typebox/build/type/engine/immutable/instantiate_add.mjs +11 -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 +31 -0
- package/node_modules/typebox/build/type/engine/index.mjs +37 -0
- package/node_modules/typebox/build/type/engine/indexable/from_cyclic.d.mts +6 -0
- package/node_modules/typebox/build/type/engine/indexable/from_cyclic.mjs +8 -0
- 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 +6 -0
- package/node_modules/typebox/build/type/engine/indexable/from_enum.mjs +8 -0
- package/node_modules/typebox/build/type/engine/indexable/from_intersect.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/indexable/from_intersect.mjs +8 -0
- package/node_modules/typebox/build/type/engine/indexable/from_literal.d.mts +3 -0
- package/node_modules/typebox/build/type/engine/indexable/from_literal.mjs +5 -0
- package/node_modules/typebox/build/type/engine/indexable/from_template_literal.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/indexable/from_template_literal.mjs +8 -0
- package/node_modules/typebox/build/type/engine/indexable/from_type.d.mts +19 -0
- package/node_modules/typebox/build/type/engine/indexable/from_type.mjs +25 -0
- package/node_modules/typebox/build/type/engine/indexable/from_union.d.mts +4 -0
- package/node_modules/typebox/build/type/engine/indexable/from_union.mjs +7 -0
- package/node_modules/typebox/build/type/engine/indexable/to_indexable.d.mts +9 -0
- package/node_modules/typebox/build/type/engine/indexable/to_indexable.mjs +14 -0
- package/node_modules/typebox/build/type/engine/indexable/to_indexable_keys.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/indexable/to_indexable_keys.mjs +12 -0
- package/node_modules/typebox/build/type/engine/indexed/array_indexer.d.mts +12 -0
- package/node_modules/typebox/build/type/engine/indexed/array_indexer.mjs +18 -0
- package/node_modules/typebox/build/type/engine/indexed/from_array.d.mts +15 -0
- package/node_modules/typebox/build/type/engine/indexed/from_array.mjs +35 -0
- package/node_modules/typebox/build/type/engine/indexed/from_object.d.mts +16 -0
- package/node_modules/typebox/build/type/engine/indexed/from_object.mjs +40 -0
- package/node_modules/typebox/build/type/engine/indexed/from_tuple.d.mts +13 -0
- package/node_modules/typebox/build/type/engine/indexed/from_tuple.mjs +35 -0
- package/node_modules/typebox/build/type/engine/indexed/from_type.d.mts +11 -0
- package/node_modules/typebox/build/type/engine/indexed/from_type.mjs +14 -0
- package/node_modules/typebox/build/type/engine/indexed/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/indexed/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/indexed/instantiate.d.mts +16 -0
- package/node_modules/typebox/build/type/engine/indexed/instantiate.mjs +28 -0
- package/node_modules/typebox/build/type/engine/instance_type/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/instance_type/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/instance_type/instantiate.d.mts +12 -0
- package/node_modules/typebox/build/type/engine/instance_type/instantiate.mjs +21 -0
- package/node_modules/typebox/build/type/engine/instantiate.d.mts +178 -0
- package/node_modules/typebox/build/type/engine/instantiate.mjs +158 -0
- package/node_modules/typebox/build/type/engine/interface/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/interface/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/interface/instantiate.d.mts +15 -0
- package/node_modules/typebox/build/type/engine/interface/instantiate.mjs +23 -0
- package/node_modules/typebox/build/type/engine/intrinsics/from_literal.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/intrinsics/from_literal.mjs +9 -0
- package/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.d.mts +6 -0
- package/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.mjs +8 -0
- package/node_modules/typebox/build/type/engine/intrinsics/from_type.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/intrinsics/from_type.mjs +13 -0
- package/node_modules/typebox/build/type/engine/intrinsics/from_union.d.mts +6 -0
- package/node_modules/typebox/build/type/engine/intrinsics/from_union.mjs +7 -0
- package/node_modules/typebox/build/type/engine/intrinsics/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/intrinsics/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/intrinsics/instantiate.d.mts +38 -0
- package/node_modules/typebox/build/type/engine/intrinsics/instantiate.mjs +52 -0
- package/node_modules/typebox/build/type/engine/intrinsics/mapping.d.mts +9 -0
- package/node_modules/typebox/build/type/engine/intrinsics/mapping.mjs +4 -0
- package/node_modules/typebox/build/type/engine/keyof/from_any.d.mts +6 -0
- package/node_modules/typebox/build/type/engine/keyof/from_any.mjs +8 -0
- package/node_modules/typebox/build/type/engine/keyof/from_array.d.mts +4 -0
- package/node_modules/typebox/build/type/engine/keyof/from_array.mjs +5 -0
- package/node_modules/typebox/build/type/engine/keyof/from_object.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/keyof/from_object.mjs +20 -0
- package/node_modules/typebox/build/type/engine/keyof/from_record.d.mts +4 -0
- package/node_modules/typebox/build/type/engine/keyof/from_record.mjs +5 -0
- package/node_modules/typebox/build/type/engine/keyof/from_tuple.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/keyof/from_tuple.mjs +7 -0
- package/node_modules/typebox/build/type/engine/keyof/from_type.d.mts +15 -0
- package/node_modules/typebox/build/type/engine/keyof/from_type.mjs +23 -0
- package/node_modules/typebox/build/type/engine/keyof/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/keyof/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/keyof/instantiate.d.mts +16 -0
- package/node_modules/typebox/build/type/engine/keyof/instantiate.mjs +29 -0
- package/node_modules/typebox/build/type/engine/mapped/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/mapped/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/mapped/instantiate.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/mapped/instantiate.mjs +15 -0
- package/node_modules/typebox/build/type/engine/mapped/mapped_operation.d.mts +22 -0
- package/node_modules/typebox/build/type/engine/mapped/mapped_operation.mjs +42 -0
- package/node_modules/typebox/build/type/engine/mapped/mapped_variants.d.mts +17 -0
- package/node_modules/typebox/build/type/engine/mapped/mapped_variants.mjs +39 -0
- package/node_modules/typebox/build/type/engine/module/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/module/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/module/instantiate.d.mts +19 -0
- package/node_modules/typebox/build/type/engine/module/instantiate.mjs +36 -0
- package/node_modules/typebox/build/type/engine/non_nullable/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/non_nullable/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/non_nullable/instantiate.d.mts +14 -0
- package/node_modules/typebox/build/type/engine/non_nullable/instantiate.mjs +22 -0
- package/node_modules/typebox/build/type/engine/object/collapse.d.mts +12 -0
- package/node_modules/typebox/build/type/engine/object/collapse.mjs +14 -0
- package/node_modules/typebox/build/type/engine/object/from_cyclic.d.mts +6 -0
- package/node_modules/typebox/build/type/engine/object/from_cyclic.mjs +8 -0
- 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_intersect.d.mts +17 -0
- package/node_modules/typebox/build/type/engine/object/from_intersect.mjs +22 -0
- package/node_modules/typebox/build/type/engine/object/from_object.d.mts +3 -0
- package/node_modules/typebox/build/type/engine/object/from_object.mjs +4 -0
- package/node_modules/typebox/build/type/engine/object/from_tuple.d.mts +6 -0
- package/node_modules/typebox/build/type/engine/object/from_tuple.mjs +9 -0
- package/node_modules/typebox/build/type/engine/object/from_type.d.mts +16 -0
- package/node_modules/typebox/build/type/engine/object/from_type.mjs +23 -0
- package/node_modules/typebox/build/type/engine/object/from_union.d.mts +12 -0
- package/node_modules/typebox/build/type/engine/object/from_union.mjs +19 -0
- package/node_modules/typebox/build/type/engine/object/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/object/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/omit/from_type.d.mts +12 -0
- package/node_modules/typebox/build/type/engine/omit/from_type.mjs +18 -0
- package/node_modules/typebox/build/type/engine/omit/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/omit/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/omit/instantiate.d.mts +9 -0
- package/node_modules/typebox/build/type/engine/omit/instantiate.mjs +16 -0
- package/node_modules/typebox/build/type/engine/optional/instantiate_add.d.mts +8 -0
- package/node_modules/typebox/build/type/engine/optional/instantiate_add.mjs +11 -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/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/parameters/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/parameters/instantiate.d.mts +14 -0
- package/node_modules/typebox/build/type/engine/parameters/instantiate.mjs +25 -0
- package/node_modules/typebox/build/type/engine/partial/from_cyclic.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/partial/from_cyclic.mjs +11 -0
- 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 +5 -0
- package/node_modules/typebox/build/type/engine/partial/from_intersect.mjs +8 -0
- package/node_modules/typebox/build/type/engine/partial/from_object.d.mts +8 -0
- package/node_modules/typebox/build/type/engine/partial/from_object.mjs +11 -0
- package/node_modules/typebox/build/type/engine/partial/from_type.d.mts +14 -0
- package/node_modules/typebox/build/type/engine/partial/from_type.mjs +20 -0
- package/node_modules/typebox/build/type/engine/partial/from_union.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/partial/from_union.mjs +7 -0
- package/node_modules/typebox/build/type/engine/partial/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/partial/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/partial/instantiate.d.mts +9 -0
- package/node_modules/typebox/build/type/engine/partial/instantiate.mjs +15 -0
- package/node_modules/typebox/build/type/engine/patterns/index.d.mts +2 -0
- package/node_modules/typebox/build/type/engine/patterns/index.mjs +2 -0
- package/node_modules/typebox/build/type/engine/patterns/pattern.d.mts +6 -0
- package/node_modules/typebox/build/type/engine/patterns/pattern.mjs +11 -0
- package/node_modules/typebox/build/type/engine/patterns/template.d.mts +7 -0
- package/node_modules/typebox/build/type/engine/patterns/template.mjs +20 -0
- package/node_modules/typebox/build/type/engine/pick/from_type.d.mts +13 -0
- package/node_modules/typebox/build/type/engine/pick/from_type.mjs +20 -0
- package/node_modules/typebox/build/type/engine/pick/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/pick/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/pick/instantiate.d.mts +9 -0
- package/node_modules/typebox/build/type/engine/pick/instantiate.mjs +16 -0
- 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 +27 -0
- package/node_modules/typebox/build/type/engine/readonly/instantiate_add.d.mts +8 -0
- package/node_modules/typebox/build/type/engine/readonly/instantiate_add.mjs +11 -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 +5 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_array.mjs +7 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_cyclic.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_cyclic.mjs +11 -0
- 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 +5 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_intersect.mjs +8 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_object.d.mts +8 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_object.mjs +11 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_tuple.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_tuple.mjs +7 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_type.d.mts +18 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_type.mjs +25 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_union.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_union.mjs +7 -0
- package/node_modules/typebox/build/type/engine/readonly_object/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/readonly_object/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/readonly_object/instantiate.d.mts +9 -0
- package/node_modules/typebox/build/type/engine/readonly_object/instantiate.mjs +15 -0
- package/node_modules/typebox/build/type/engine/record/from_key.d.mts +24 -0
- package/node_modules/typebox/build/type/engine/record/from_key.mjs +40 -0
- package/node_modules/typebox/build/type/engine/record/from_key_any.d.mts +4 -0
- package/node_modules/typebox/build/type/engine/record/from_key_any.mjs +6 -0
- package/node_modules/typebox/build/type/engine/record/from_key_boolean.d.mts +7 -0
- package/node_modules/typebox/build/type/engine/record/from_key_boolean.mjs +5 -0
- package/node_modules/typebox/build/type/engine/record/from_key_enum.d.mts +6 -0
- package/node_modules/typebox/build/type/engine/record/from_key_enum.mjs +8 -0
- package/node_modules/typebox/build/type/engine/record/from_key_integer.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/record/from_key_integer.mjs +7 -0
- package/node_modules/typebox/build/type/engine/record/from_key_intersect.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/record/from_key_intersect.mjs +8 -0
- package/node_modules/typebox/build/type/engine/record/from_key_literal.d.mts +11 -0
- package/node_modules/typebox/build/type/engine/record/from_key_literal.mjs +10 -0
- package/node_modules/typebox/build/type/engine/record/from_key_number.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/record/from_key_number.mjs +7 -0
- package/node_modules/typebox/build/type/engine/record/from_key_string.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/record/from_key_string.mjs +12 -0
- package/node_modules/typebox/build/type/engine/record/from_key_template_literal.d.mts +8 -0
- package/node_modules/typebox/build/type/engine/record/from_key_template_literal.mjs +12 -0
- package/node_modules/typebox/build/type/engine/record/from_key_union.d.mts +20 -0
- package/node_modules/typebox/build/type/engine/record/from_key_union.mjs +39 -0
- package/node_modules/typebox/build/type/engine/record/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/record/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/record/instantiate.d.mts +9 -0
- package/node_modules/typebox/build/type/engine/record/instantiate.mjs +17 -0
- package/node_modules/typebox/build/type/engine/record/record_create.d.mts +3 -0
- package/node_modules/typebox/build/type/engine/record/record_create.mjs +7 -0
- package/node_modules/typebox/build/type/engine/ref/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/ref/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/ref/instantiate.d.mts +6 -0
- package/node_modules/typebox/build/type/engine/ref/instantiate.mjs +10 -0
- package/node_modules/typebox/build/type/engine/required/from_cyclic.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/required/from_cyclic.mjs +11 -0
- 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 +5 -0
- package/node_modules/typebox/build/type/engine/required/from_intersect.mjs +8 -0
- package/node_modules/typebox/build/type/engine/required/from_object.d.mts +8 -0
- package/node_modules/typebox/build/type/engine/required/from_object.mjs +11 -0
- package/node_modules/typebox/build/type/engine/required/from_type.d.mts +14 -0
- package/node_modules/typebox/build/type/engine/required/from_type.mjs +20 -0
- package/node_modules/typebox/build/type/engine/required/from_union.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/required/from_union.mjs +7 -0
- package/node_modules/typebox/build/type/engine/required/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/required/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/required/instantiate.d.mts +9 -0
- package/node_modules/typebox/build/type/engine/required/instantiate.mjs +15 -0
- package/node_modules/typebox/build/type/engine/rest/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/rest/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/rest/spread.d.mts +12 -0
- package/node_modules/typebox/build/type/engine/rest/spread.mjs +19 -0
- package/node_modules/typebox/build/type/engine/return_type/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/return_type/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/return_type/instantiate.d.mts +12 -0
- package/node_modules/typebox/build/type/engine/return_type/instantiate.mjs +21 -0
- package/node_modules/typebox/build/type/engine/template_literal/create.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/template_literal/create.mjs +5 -0
- package/node_modules/typebox/build/type/engine/template_literal/decode.d.mts +30 -0
- package/node_modules/typebox/build/type/engine/template_literal/decode.mjs +81 -0
- package/node_modules/typebox/build/type/engine/template_literal/encode.d.mts +33 -0
- package/node_modules/typebox/build/type/engine/template_literal/encode.mjs +81 -0
- package/node_modules/typebox/build/type/engine/template_literal/index.d.mts +6 -0
- package/node_modules/typebox/build/type/engine/template_literal/index.mjs +6 -0
- package/node_modules/typebox/build/type/engine/template_literal/instantiate.d.mts +9 -0
- package/node_modules/typebox/build/type/engine/template_literal/instantiate.mjs +15 -0
- package/node_modules/typebox/build/type/engine/template_literal/is_finite.d.mts +12 -0
- package/node_modules/typebox/build/type/engine/template_literal/is_finite.mjs +26 -0
- package/node_modules/typebox/build/type/engine/template_literal/is_pattern.d.mts +6 -0
- package/node_modules/typebox/build/type/engine/template_literal/is_pattern.mjs +10 -0
- package/node_modules/typebox/build/type/engine/template_literal/static.d.mts +18 -0
- package/node_modules/typebox/build/type/engine/template_literal/static.mjs +2 -0
- package/node_modules/typebox/build/type/engine/this/expand_this.d.mts +16 -0
- package/node_modules/typebox/build/type/engine/this/expand_this.mjs +26 -0
- package/node_modules/typebox/build/type/engine/this/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/this/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/tuple/to_object.d.mts +12 -0
- package/node_modules/typebox/build/type/engine/tuple/to_object.mjs +14 -0
- package/node_modules/typebox/build/type/engine/with/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/with/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/with/instantiate.d.mts +8 -0
- package/node_modules/typebox/build/type/engine/with/instantiate.mjs +14 -0
- package/node_modules/typebox/build/type/extends/any.d.mts +9 -0
- package/node_modules/typebox/build/type/extends/any.mjs +12 -0
- package/node_modules/typebox/build/type/extends/array.d.mts +20 -0
- package/node_modules/typebox/build/type/extends/array.mjs +21 -0
- package/node_modules/typebox/build/type/extends/bigint.d.mts +7 -0
- package/node_modules/typebox/build/type/extends/bigint.mjs +9 -0
- package/node_modules/typebox/build/type/extends/boolean.d.mts +7 -0
- package/node_modules/typebox/build/type/extends/boolean.mjs +9 -0
- package/node_modules/typebox/build/type/extends/constructor.d.mts +10 -0
- package/node_modules/typebox/build/type/extends/constructor.mjs +17 -0
- 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 +7 -0
- package/node_modules/typebox/build/type/extends/enum.mjs +7 -0
- package/node_modules/typebox/build/type/extends/extends.d.mts +13 -0
- package/node_modules/typebox/build/type/extends/extends.mjs +17 -0
- package/node_modules/typebox/build/type/extends/extends_left.d.mts +53 -0
- package/node_modules/typebox/build/type/extends/extends_left.mjs +80 -0
- package/node_modules/typebox/build/type/extends/extends_right.d.mts +27 -0
- package/node_modules/typebox/build/type/extends/extends_right.mjs +49 -0
- package/node_modules/typebox/build/type/extends/function.d.mts +10 -0
- package/node_modules/typebox/build/type/extends/function.mjs +17 -0
- package/node_modules/typebox/build/type/extends/index.d.mts +2 -0
- package/node_modules/typebox/build/type/extends/index.mjs +2 -0
- package/node_modules/typebox/build/type/extends/inference.d.mts +34 -0
- package/node_modules/typebox/build/type/extends/inference.mjs +75 -0
- package/node_modules/typebox/build/type/extends/integer.d.mts +8 -0
- package/node_modules/typebox/build/type/extends/integer.mjs +10 -0
- package/node_modules/typebox/build/type/extends/intersect.d.mts +6 -0
- package/node_modules/typebox/build/type/extends/intersect.mjs +15 -0
- package/node_modules/typebox/build/type/extends/literal.d.mts +18 -0
- package/node_modules/typebox/build/type/extends/literal.mjs +44 -0
- package/node_modules/typebox/build/type/extends/never.d.mts +8 -0
- package/node_modules/typebox/build/type/extends/never.mjs +9 -0
- package/node_modules/typebox/build/type/extends/null.d.mts +7 -0
- package/node_modules/typebox/build/type/extends/null.mjs +9 -0
- package/node_modules/typebox/build/type/extends/number.d.mts +7 -0
- package/node_modules/typebox/build/type/extends/number.mjs +9 -0
- package/node_modules/typebox/build/type/extends/object.d.mts +32 -0
- package/node_modules/typebox/build/type/extends/object.mjs +109 -0
- package/node_modules/typebox/build/type/extends/parameters.d.mts +15 -0
- package/node_modules/typebox/build/type/extends/parameters.mjs +28 -0
- 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/result.d.mts +24 -0
- package/node_modules/typebox/build/type/extends/result.mjs +36 -0
- package/node_modules/typebox/build/type/extends/return_type.d.mts +7 -0
- package/node_modules/typebox/build/type/extends/return_type.mjs +9 -0
- package/node_modules/typebox/build/type/extends/string.d.mts +7 -0
- package/node_modules/typebox/build/type/extends/string.mjs +9 -0
- package/node_modules/typebox/build/type/extends/symbol.d.mts +7 -0
- package/node_modules/typebox/build/type/extends/symbol.mjs +9 -0
- package/node_modules/typebox/build/type/extends/template_literal.d.mts +6 -0
- package/node_modules/typebox/build/type/extends/template_literal.mjs +7 -0
- package/node_modules/typebox/build/type/extends/tuple.d.mts +23 -0
- package/node_modules/typebox/build/type/extends/tuple.mjs +81 -0
- package/node_modules/typebox/build/type/extends/undefined.d.mts +8 -0
- package/node_modules/typebox/build/type/extends/undefined.mjs +10 -0
- package/node_modules/typebox/build/type/extends/union.d.mts +11 -0
- package/node_modules/typebox/build/type/extends/union.mjs +24 -0
- package/node_modules/typebox/build/type/extends/unknown.d.mts +9 -0
- package/node_modules/typebox/build/type/extends/unknown.mjs +12 -0
- package/node_modules/typebox/build/type/extends/void.d.mts +7 -0
- package/node_modules/typebox/build/type/extends/void.mjs +9 -0
- package/node_modules/typebox/build/type/index.d.mts +5 -0
- package/node_modules/typebox/build/type/index.mjs +5 -0
- package/node_modules/typebox/build/type/script/index.d.mts +1 -0
- package/node_modules/typebox/build/type/script/index.mjs +1 -0
- package/node_modules/typebox/build/type/script/mapping.d.mts +356 -0
- package/node_modules/typebox/build/type/script/mapping.mjs +528 -0
- package/node_modules/typebox/build/type/script/parser.d.mts +256 -0
- package/node_modules/typebox/build/type/script/parser.mjs +140 -0
- package/node_modules/typebox/build/type/script/script.d.mts +16 -0
- package/node_modules/typebox/build/type/script/script.mjs +22 -0
- package/node_modules/typebox/build/type/script/token/bigint.d.mts +8 -0
- package/node_modules/typebox/build/type/script/token/bigint.mjs +14 -0
- package/node_modules/typebox/build/type/script/token/const.d.mts +11 -0
- package/node_modules/typebox/build/type/script/token/const.mjs +18 -0
- package/node_modules/typebox/build/type/script/token/ident.d.mts +16 -0
- package/node_modules/typebox/build/type/script/token/ident.mjs +26 -0
- package/node_modules/typebox/build/type/script/token/index.d.mts +12 -0
- package/node_modules/typebox/build/type/script/token/index.mjs +12 -0
- package/node_modules/typebox/build/type/script/token/integer.d.mts +11 -0
- package/node_modules/typebox/build/type/script/token/integer.mjs +19 -0
- package/node_modules/typebox/build/type/script/token/internal/char.d.mts +75 -0
- package/node_modules/typebox/build/type/script/token/internal/char.mjs +26 -0
- package/node_modules/typebox/build/type/script/token/internal/guard.d.mts +1 -0
- package/node_modules/typebox/build/type/script/token/internal/guard.mjs +15 -0
- package/node_modules/typebox/build/type/script/token/internal/many.d.mts +7 -0
- package/node_modules/typebox/build/type/script/token/internal/many.mjs +14 -0
- package/node_modules/typebox/build/type/script/token/internal/match.d.mts +6 -0
- package/node_modules/typebox/build/type/script/token/internal/match.mjs +11 -0
- package/node_modules/typebox/build/type/script/token/internal/optional.d.mts +5 -0
- package/node_modules/typebox/build/type/script/token/internal/optional.mjs +9 -0
- package/node_modules/typebox/build/type/script/token/internal/take.d.mts +6 -0
- package/node_modules/typebox/build/type/script/token/internal/take.mjs +30 -0
- package/node_modules/typebox/build/type/script/token/internal/trim.d.mts +19 -0
- package/node_modules/typebox/build/type/script/token/internal/trim.mjs +34 -0
- package/node_modules/typebox/build/type/script/token/number.d.mts +11 -0
- package/node_modules/typebox/build/type/script/token/number.mjs +19 -0
- package/node_modules/typebox/build/type/script/token/rest.d.mts +4 -0
- package/node_modules/typebox/build/type/script/token/rest.mjs +9 -0
- package/node_modules/typebox/build/type/script/token/span.d.mts +11 -0
- package/node_modules/typebox/build/type/script/token/span.mjs +24 -0
- package/node_modules/typebox/build/type/script/token/string.d.mts +11 -0
- package/node_modules/typebox/build/type/script/token/string.mjs +20 -0
- package/node_modules/typebox/build/type/script/token/unsigned_integer.d.mts +16 -0
- package/node_modules/typebox/build/type/script/token/unsigned_integer.mjs +26 -0
- package/node_modules/typebox/build/type/script/token/unsigned_number.d.mts +17 -0
- package/node_modules/typebox/build/type/script/token/unsigned_number.mjs +38 -0
- package/node_modules/typebox/build/type/script/token/until.d.mts +7 -0
- package/node_modules/typebox/build/type/script/token/until.mjs +21 -0
- package/node_modules/typebox/build/type/script/token/until_1.d.mts +5 -0
- package/node_modules/typebox/build/type/script/token/until_1.mjs +12 -0
- package/node_modules/typebox/build/type/types/_codec.d.mts +30 -0
- package/node_modules/typebox/build/type/types/_codec.mjs +60 -0
- package/node_modules/typebox/build/type/types/_immutable.d.mts +9 -0
- package/node_modules/typebox/build/type/types/_immutable.mjs +18 -0
- package/node_modules/typebox/build/type/types/_optional.d.mts +9 -0
- package/node_modules/typebox/build/type/types/_optional.mjs +18 -0
- package/node_modules/typebox/build/type/types/_readonly.d.mts +9 -0
- package/node_modules/typebox/build/type/types/_readonly.mjs +18 -0
- package/node_modules/typebox/build/type/types/_refine.d.mts +24 -0
- package/node_modules/typebox/build/type/types/_refine.mjs +36 -0
- package/node_modules/typebox/build/type/types/any.d.mts +10 -0
- package/node_modules/typebox/build/type/types/any.mjs +18 -0
- package/node_modules/typebox/build/type/types/array.d.mts +18 -0
- package/node_modules/typebox/build/type/types/array.mjs +25 -0
- package/node_modules/typebox/build/type/types/bigint.d.mts +12 -0
- package/node_modules/typebox/build/type/types/bigint.mjs +21 -0
- package/node_modules/typebox/build/type/types/boolean.d.mts +11 -0
- package/node_modules/typebox/build/type/types/boolean.mjs +17 -0
- package/node_modules/typebox/build/type/types/call.d.mts +16 -0
- package/node_modules/typebox/build/type/types/call.mjs +23 -0
- package/node_modules/typebox/build/type/types/constructor.d.mts +18 -0
- package/node_modules/typebox/build/type/types/constructor.mjs +24 -0
- package/node_modules/typebox/build/type/types/cyclic.d.mts +16 -0
- package/node_modules/typebox/build/type/types/cyclic.mjs +29 -0
- package/node_modules/typebox/build/type/types/deferred.d.mts +13 -0
- package/node_modules/typebox/build/type/types/deferred.mjs +16 -0
- 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 +18 -0
- package/node_modules/typebox/build/type/types/enum.mjs +22 -0
- package/node_modules/typebox/build/type/types/function.d.mts +21 -0
- package/node_modules/typebox/build/type/types/function.mjs +25 -0
- package/node_modules/typebox/build/type/types/generic.d.mts +13 -0
- package/node_modules/typebox/build/type/types/generic.mjs +17 -0
- package/node_modules/typebox/build/type/types/identifier.d.mts +11 -0
- package/node_modules/typebox/build/type/types/identifier.mjs +17 -0
- package/node_modules/typebox/build/type/types/index.d.mts +45 -0
- package/node_modules/typebox/build/type/types/index.mjs +51 -0
- package/node_modules/typebox/build/type/types/infer.d.mts +15 -0
- package/node_modules/typebox/build/type/types/infer.mjs +20 -0
- package/node_modules/typebox/build/type/types/integer.d.mts +12 -0
- package/node_modules/typebox/build/type/types/integer.mjs +21 -0
- package/node_modules/typebox/build/type/types/intersect.d.mts +15 -0
- package/node_modules/typebox/build/type/types/intersect.mjs +24 -0
- package/node_modules/typebox/build/type/types/literal.d.mts +31 -0
- package/node_modules/typebox/build/type/types/literal.mjs +62 -0
- package/node_modules/typebox/build/type/types/never.d.mts +12 -0
- package/node_modules/typebox/build/type/types/never.mjs +22 -0
- package/node_modules/typebox/build/type/types/null.d.mts +11 -0
- package/node_modules/typebox/build/type/types/null.mjs +17 -0
- package/node_modules/typebox/build/type/types/number.d.mts +12 -0
- package/node_modules/typebox/build/type/types/number.mjs +21 -0
- package/node_modules/typebox/build/type/types/object.d.mts +18 -0
- package/node_modules/typebox/build/type/types/object.mjs +28 -0
- package/node_modules/typebox/build/type/types/parameter.d.mts +17 -0
- package/node_modules/typebox/build/type/types/parameter.mjs +21 -0
- package/node_modules/typebox/build/type/types/properties.d.mts +43 -0
- package/node_modules/typebox/build/type/types/properties.mjs +15 -0
- package/node_modules/typebox/build/type/types/record.d.mts +52 -0
- package/node_modules/typebox/build/type/types/record.mjs +66 -0
- package/node_modules/typebox/build/type/types/ref.d.mts +19 -0
- package/node_modules/typebox/build/type/types/ref.mjs +18 -0
- package/node_modules/typebox/build/type/types/rest.d.mts +11 -0
- package/node_modules/typebox/build/type/types/rest.mjs +17 -0
- package/node_modules/typebox/build/type/types/schema.d.mts +176 -0
- package/node_modules/typebox/build/type/types/schema.mjs +15 -0
- package/node_modules/typebox/build/type/types/static.d.mts +45 -0
- package/node_modules/typebox/build/type/types/static.mjs +3 -0
- package/node_modules/typebox/build/type/types/string.d.mts +12 -0
- package/node_modules/typebox/build/type/types/string.mjs +22 -0
- package/node_modules/typebox/build/type/types/symbol.d.mts +11 -0
- package/node_modules/typebox/build/type/types/symbol.mjs +17 -0
- package/node_modules/typebox/build/type/types/template_literal.d.mts +28 -0
- package/node_modules/typebox/build/type/types/template_literal.mjs +37 -0
- package/node_modules/typebox/build/type/types/this.d.mts +14 -0
- package/node_modules/typebox/build/type/types/this.mjs +17 -0
- package/node_modules/typebox/build/type/types/tuple.d.mts +38 -0
- package/node_modules/typebox/build/type/types/tuple.mjs +25 -0
- package/node_modules/typebox/build/type/types/undefined.d.mts +11 -0
- package/node_modules/typebox/build/type/types/undefined.mjs +17 -0
- package/node_modules/typebox/build/type/types/union.d.mts +15 -0
- package/node_modules/typebox/build/type/types/union.mjs +24 -0
- package/node_modules/typebox/build/type/types/unknown.d.mts +10 -0
- package/node_modules/typebox/build/type/types/unknown.mjs +17 -0
- package/node_modules/typebox/build/type/types/unsafe.d.mts +10 -0
- package/node_modules/typebox/build/type/types/unsafe.mjs +20 -0
- package/node_modules/typebox/build/type/types/void.d.mts +11 -0
- package/node_modules/typebox/build/type/types/void.mjs +17 -0
- package/node_modules/typebox/build/typebox.d.mts +69 -0
- package/node_modules/typebox/build/typebox.mjs +85 -0
- package/node_modules/typebox/build/value/assert/assert.d.mts +14 -0
- package/node_modules/typebox/build/value/assert/assert.mjs +28 -0
- package/node_modules/typebox/build/value/assert/index.d.mts +1 -0
- package/node_modules/typebox/build/value/assert/index.mjs +1 -0
- package/node_modules/typebox/build/value/check/check.d.mts +5 -0
- package/node_modules/typebox/build/value/check/check.mjs +11 -0
- package/node_modules/typebox/build/value/check/index.d.mts +1 -0
- package/node_modules/typebox/build/value/check/index.mjs +1 -0
- package/node_modules/typebox/build/value/clean/additional.d.mts +2 -0
- package/node_modules/typebox/build/value/clean/additional.mjs +6 -0
- package/node_modules/typebox/build/value/clean/clean.d.mts +15 -0
- package/node_modules/typebox/build/value/clean/clean.mjs +17 -0
- package/node_modules/typebox/build/value/clean/from_array.d.mts +2 -0
- package/node_modules/typebox/build/value/clean/from_array.mjs +8 -0
- package/node_modules/typebox/build/value/clean/from_cyclic.d.mts +2 -0
- package/node_modules/typebox/build/value/clean/from_cyclic.mjs +6 -0
- package/node_modules/typebox/build/value/clean/from_intersect.d.mts +2 -0
- package/node_modules/typebox/build/value/clean/from_intersect.mjs +26 -0
- package/node_modules/typebox/build/value/clean/from_object.d.mts +2 -0
- package/node_modules/typebox/build/value/clean/from_object.mjs +31 -0
- package/node_modules/typebox/build/value/clean/from_record.d.mts +2 -0
- package/node_modules/typebox/build/value/clean/from_record.mjs +32 -0
- package/node_modules/typebox/build/value/clean/from_ref.d.mts +2 -0
- package/node_modules/typebox/build/value/clean/from_ref.mjs +8 -0
- package/node_modules/typebox/build/value/clean/from_tuple.d.mts +2 -0
- package/node_modules/typebox/build/value/clean/from_tuple.mjs +14 -0
- package/node_modules/typebox/build/value/clean/from_type.d.mts +2 -0
- package/node_modules/typebox/build/value/clean/from_type.mjs +21 -0
- package/node_modules/typebox/build/value/clean/from_union.d.mts +2 -0
- package/node_modules/typebox/build/value/clean/from_union.mjs +12 -0
- package/node_modules/typebox/build/value/clean/index.d.mts +1 -0
- package/node_modules/typebox/build/value/clean/index.mjs +1 -0
- package/node_modules/typebox/build/value/clone/clone.d.mts +6 -0
- package/node_modules/typebox/build/value/clone/clone.mjs +10 -0
- package/node_modules/typebox/build/value/clone/index.d.mts +1 -0
- package/node_modules/typebox/build/value/clone/index.mjs +1 -0
- package/node_modules/typebox/build/value/codec/callback.d.mts +2 -0
- package/node_modules/typebox/build/value/codec/callback.mjs +25 -0
- package/node_modules/typebox/build/value/codec/decode.d.mts +12 -0
- package/node_modules/typebox/build/value/codec/decode.mjs +52 -0
- package/node_modules/typebox/build/value/codec/encode.d.mts +12 -0
- package/node_modules/typebox/build/value/codec/encode.mjs +52 -0
- package/node_modules/typebox/build/value/codec/from_array.d.mts +2 -0
- package/node_modules/typebox/build/value/codec/from_array.mjs +35 -0
- package/node_modules/typebox/build/value/codec/from_cyclic.d.mts +2 -0
- package/node_modules/typebox/build/value/codec/from_cyclic.mjs +8 -0
- package/node_modules/typebox/build/value/codec/from_intersect.d.mts +2 -0
- package/node_modules/typebox/build/value/codec/from_intersect.mjs +58 -0
- package/node_modules/typebox/build/value/codec/from_object.d.mts +2 -0
- package/node_modules/typebox/build/value/codec/from_object.mjs +42 -0
- package/node_modules/typebox/build/value/codec/from_record.d.mts +2 -0
- package/node_modules/typebox/build/value/codec/from_record.mjs +39 -0
- package/node_modules/typebox/build/value/codec/from_ref.d.mts +2 -0
- package/node_modules/typebox/build/value/codec/from_ref.mjs +31 -0
- package/node_modules/typebox/build/value/codec/from_tuple.d.mts +2 -0
- package/node_modules/typebox/build/value/codec/from_tuple.mjs +32 -0
- package/node_modules/typebox/build/value/codec/from_type.d.mts +2 -0
- package/node_modules/typebox/build/value/codec/from_type.mjs +22 -0
- package/node_modules/typebox/build/value/codec/from_union.d.mts +2 -0
- package/node_modules/typebox/build/value/codec/from_union.mjs +39 -0
- package/node_modules/typebox/build/value/codec/has.d.mts +5 -0
- package/node_modules/typebox/build/value/codec/has.mjs +93 -0
- package/node_modules/typebox/build/value/codec/index.d.mts +3 -0
- package/node_modules/typebox/build/value/codec/index.mjs +3 -0
- package/node_modules/typebox/build/value/convert/convert.d.mts +13 -0
- package/node_modules/typebox/build/value/convert/convert.mjs +15 -0
- package/node_modules/typebox/build/value/convert/from_additional.d.mts +6 -0
- package/node_modules/typebox/build/value/convert/from_additional.mjs +18 -0
- package/node_modules/typebox/build/value/convert/from_array.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from_array.mjs +7 -0
- package/node_modules/typebox/build/value/convert/from_bigint.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from_bigint.mjs +6 -0
- package/node_modules/typebox/build/value/convert/from_boolean.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from_boolean.mjs +6 -0
- package/node_modules/typebox/build/value/convert/from_cyclic.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from_cyclic.mjs +6 -0
- package/node_modules/typebox/build/value/convert/from_enum.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from_enum.mjs +6 -0
- package/node_modules/typebox/build/value/convert/from_integer.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from_integer.mjs +6 -0
- package/node_modules/typebox/build/value/convert/from_intersect.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from_intersect.mjs +8 -0
- package/node_modules/typebox/build/value/convert/from_literal.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from_literal.mjs +44 -0
- package/node_modules/typebox/build/value/convert/from_null.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from_null.mjs +6 -0
- package/node_modules/typebox/build/value/convert/from_number.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from_number.mjs +6 -0
- package/node_modules/typebox/build/value/convert/from_object.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from_object.mjs +28 -0
- package/node_modules/typebox/build/value/convert/from_record.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from_record.mjs +23 -0
- package/node_modules/typebox/build/value/convert/from_ref.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from_ref.mjs +8 -0
- package/node_modules/typebox/build/value/convert/from_string.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from_string.mjs +6 -0
- package/node_modules/typebox/build/value/convert/from_template_literal.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from_template_literal.mjs +6 -0
- package/node_modules/typebox/build/value/convert/from_tuple.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from_tuple.mjs +11 -0
- package/node_modules/typebox/build/value/convert/from_type.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from_type.mjs +43 -0
- package/node_modules/typebox/build/value/convert/from_undefined.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from_undefined.mjs +6 -0
- package/node_modules/typebox/build/value/convert/from_union.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from_union.mjs +13 -0
- package/node_modules/typebox/build/value/convert/from_void.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/from_void.mjs +6 -0
- package/node_modules/typebox/build/value/convert/index.d.mts +1 -0
- package/node_modules/typebox/build/value/convert/index.mjs +1 -0
- package/node_modules/typebox/build/value/convert/try/index.d.mts +1 -0
- package/node_modules/typebox/build/value/convert/try/index.mjs +1 -0
- package/node_modules/typebox/build/value/convert/try/try.d.mts +8 -0
- package/node_modules/typebox/build/value/convert/try/try.mjs +8 -0
- package/node_modules/typebox/build/value/convert/try/try_array.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/try/try_array.mjs +6 -0
- package/node_modules/typebox/build/value/convert/try/try_bigint.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/try/try_bigint.mjs +45 -0
- package/node_modules/typebox/build/value/convert/try/try_boolean.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/try/try_boolean.mjs +41 -0
- package/node_modules/typebox/build/value/convert/try/try_null.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/try/try_null.mjs +44 -0
- package/node_modules/typebox/build/value/convert/try/try_number.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/try/try_number.mjs +44 -0
- package/node_modules/typebox/build/value/convert/try/try_result.d.mts +8 -0
- package/node_modules/typebox/build/value/convert/try/try_result.mjs +17 -0
- package/node_modules/typebox/build/value/convert/try/try_string.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/try/try_string.mjs +12 -0
- package/node_modules/typebox/build/value/convert/try/try_undefined.d.mts +2 -0
- package/node_modules/typebox/build/value/convert/try/try_undefined.mjs +44 -0
- package/node_modules/typebox/build/value/create/create.d.mts +5 -0
- package/node_modules/typebox/build/value/create/create.mjs +11 -0
- package/node_modules/typebox/build/value/create/error.d.mts +5 -0
- package/node_modules/typebox/build/value/create/error.mjs +7 -0
- package/node_modules/typebox/build/value/create/from_array.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from_array.mjs +10 -0
- package/node_modules/typebox/build/value/create/from_bigint.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from_bigint.mjs +7 -0
- package/node_modules/typebox/build/value/create/from_boolean.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from_boolean.mjs +4 -0
- package/node_modules/typebox/build/value/create/from_constructor.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from_constructor.mjs +10 -0
- package/node_modules/typebox/build/value/create/from_cyclic.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from_cyclic.mjs +6 -0
- package/node_modules/typebox/build/value/create/from_default.d.mts +3 -0
- package/node_modules/typebox/build/value/create/from_default.mjs +10 -0
- package/node_modules/typebox/build/value/create/from_enum.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from_enum.mjs +6 -0
- package/node_modules/typebox/build/value/create/from_function.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from_function.mjs +6 -0
- package/node_modules/typebox/build/value/create/from_integer.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from_integer.mjs +8 -0
- package/node_modules/typebox/build/value/create/from_intersect.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from_intersect.mjs +8 -0
- package/node_modules/typebox/build/value/create/from_literal.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from_literal.mjs +4 -0
- package/node_modules/typebox/build/value/create/from_never.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from_never.mjs +5 -0
- package/node_modules/typebox/build/value/create/from_null.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from_null.mjs +4 -0
- package/node_modules/typebox/build/value/create/from_number.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from_number.mjs +8 -0
- package/node_modules/typebox/build/value/create/from_object.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from_object.mjs +9 -0
- package/node_modules/typebox/build/value/create/from_record.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from_record.mjs +8 -0
- package/node_modules/typebox/build/value/create/from_ref.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from_ref.mjs +9 -0
- package/node_modules/typebox/build/value/create/from_string.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from_string.mjs +9 -0
- package/node_modules/typebox/build/value/create/from_symbol.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from_symbol.mjs +4 -0
- package/node_modules/typebox/build/value/create/from_template_literal.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from_template_literal.mjs +11 -0
- package/node_modules/typebox/build/value/create/from_tuple.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from_tuple.mjs +5 -0
- package/node_modules/typebox/build/value/create/from_type.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from_type.mjs +61 -0
- package/node_modules/typebox/build/value/create/from_undefined.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from_undefined.mjs +4 -0
- package/node_modules/typebox/build/value/create/from_union.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from_union.mjs +9 -0
- package/node_modules/typebox/build/value/create/from_void.d.mts +2 -0
- package/node_modules/typebox/build/value/create/from_void.mjs +4 -0
- package/node_modules/typebox/build/value/create/index.d.mts +2 -0
- package/node_modules/typebox/build/value/create/index.mjs +2 -0
- package/node_modules/typebox/build/value/default/default.d.mts +13 -0
- package/node_modules/typebox/build/value/default/default.mjs +15 -0
- package/node_modules/typebox/build/value/default/from_array.d.mts +2 -0
- package/node_modules/typebox/build/value/default/from_array.mjs +12 -0
- package/node_modules/typebox/build/value/default/from_cyclic.d.mts +2 -0
- package/node_modules/typebox/build/value/default/from_cyclic.mjs +7 -0
- package/node_modules/typebox/build/value/default/from_default.d.mts +3 -0
- package/node_modules/typebox/build/value/default/from_default.mjs +13 -0
- package/node_modules/typebox/build/value/default/from_intersect.d.mts +2 -0
- package/node_modules/typebox/build/value/default/from_intersect.mjs +9 -0
- package/node_modules/typebox/build/value/default/from_object.d.mts +2 -0
- package/node_modules/typebox/build/value/default/from_object.mjs +32 -0
- package/node_modules/typebox/build/value/default/from_record.d.mts +2 -0
- package/node_modules/typebox/build/value/default/from_record.mjs +26 -0
- package/node_modules/typebox/build/value/default/from_ref.d.mts +2 -0
- package/node_modules/typebox/build/value/default/from_ref.mjs +9 -0
- package/node_modules/typebox/build/value/default/from_tuple.d.mts +2 -0
- package/node_modules/typebox/build/value/default/from_tuple.mjs +14 -0
- package/node_modules/typebox/build/value/default/from_type.d.mts +2 -0
- package/node_modules/typebox/build/value/default/from_type.mjs +25 -0
- package/node_modules/typebox/build/value/default/from_union.d.mts +2 -0
- package/node_modules/typebox/build/value/default/from_union.mjs +14 -0
- package/node_modules/typebox/build/value/default/index.d.mts +1 -0
- package/node_modules/typebox/build/value/default/index.mjs +1 -0
- package/node_modules/typebox/build/value/delta/diff.d.mts +10 -0
- package/node_modules/typebox/build/value/delta/diff.mjs +135 -0
- package/node_modules/typebox/build/value/delta/edit.d.mts +24 -0
- package/node_modules/typebox/build/value/delta/edit.mjs +17 -0
- package/node_modules/typebox/build/value/delta/index.d.mts +3 -0
- package/node_modules/typebox/build/value/delta/index.mjs +3 -0
- package/node_modules/typebox/build/value/delta/patch.d.mts +8 -0
- package/node_modules/typebox/build/value/delta/patch.mjs +42 -0
- package/node_modules/typebox/build/value/equal/equal.d.mts +2 -0
- package/node_modules/typebox/build/value/equal/equal.mjs +6 -0
- package/node_modules/typebox/build/value/equal/index.d.mts +1 -0
- package/node_modules/typebox/build/value/equal/index.mjs +1 -0
- package/node_modules/typebox/build/value/errors/errors.d.mts +6 -0
- package/node_modules/typebox/build/value/errors/errors.mjs +12 -0
- package/node_modules/typebox/build/value/errors/index.d.mts +1 -0
- package/node_modules/typebox/build/value/errors/index.mjs +1 -0
- package/node_modules/typebox/build/value/hash/hash.d.mts +6 -0
- package/node_modules/typebox/build/value/hash/hash.mjs +10 -0
- package/node_modules/typebox/build/value/hash/index.d.mts +1 -0
- package/node_modules/typebox/build/value/hash/index.mjs +1 -0
- package/node_modules/typebox/build/value/index.d.mts +20 -0
- package/node_modules/typebox/build/value/index.mjs +29 -0
- package/node_modules/typebox/build/value/parse/index.d.mts +1 -0
- package/node_modules/typebox/build/value/parse/index.mjs +1 -0
- package/node_modules/typebox/build/value/parse/parse.d.mts +11 -0
- package/node_modules/typebox/build/value/parse/parse.mjs +53 -0
- package/node_modules/typebox/build/value/pipeline/index.d.mts +1 -0
- package/node_modules/typebox/build/value/pipeline/index.mjs +1 -0
- package/node_modules/typebox/build/value/pipeline/pipeline.d.mts +10 -0
- package/node_modules/typebox/build/value/pipeline/pipeline.mjs +15 -0
- package/node_modules/typebox/build/value/pointer/index.d.mts +1 -0
- package/node_modules/typebox/build/value/pointer/index.mjs +1 -0
- package/node_modules/typebox/build/value/repair/error.d.mts +7 -0
- package/node_modules/typebox/build/value/repair/error.mjs +8 -0
- package/node_modules/typebox/build/value/repair/from_array.d.mts +2 -0
- package/node_modules/typebox/build/value/repair/from_array.mjs +39 -0
- package/node_modules/typebox/build/value/repair/from_cyclic.d.mts +2 -0
- package/node_modules/typebox/build/value/repair/from_cyclic.mjs +6 -0
- package/node_modules/typebox/build/value/repair/from_enum.d.mts +2 -0
- package/node_modules/typebox/build/value/repair/from_enum.mjs +6 -0
- package/node_modules/typebox/build/value/repair/from_intersect.d.mts +2 -0
- package/node_modules/typebox/build/value/repair/from_intersect.mjs +8 -0
- package/node_modules/typebox/build/value/repair/from_object.d.mts +2 -0
- package/node_modules/typebox/build/value/repair/from_object.mjs +33 -0
- package/node_modules/typebox/build/value/repair/from_record.d.mts +2 -0
- package/node_modules/typebox/build/value/repair/from_record.mjs +33 -0
- package/node_modules/typebox/build/value/repair/from_ref.d.mts +2 -0
- package/node_modules/typebox/build/value/repair/from_ref.mjs +9 -0
- package/node_modules/typebox/build/value/repair/from_template_literal.d.mts +2 -0
- package/node_modules/typebox/build/value/repair/from_template_literal.mjs +7 -0
- package/node_modules/typebox/build/value/repair/from_tuple.d.mts +2 -0
- package/node_modules/typebox/build/value/repair/from_tuple.mjs +12 -0
- package/node_modules/typebox/build/value/repair/from_type.d.mts +2 -0
- package/node_modules/typebox/build/value/repair/from_type.mjs +88 -0
- package/node_modules/typebox/build/value/repair/from_union.d.mts +2 -0
- package/node_modules/typebox/build/value/repair/from_union.mjs +24 -0
- package/node_modules/typebox/build/value/repair/from_unknown.d.mts +2 -0
- package/node_modules/typebox/build/value/repair/from_unknown.mjs +12 -0
- package/node_modules/typebox/build/value/repair/index.d.mts +1 -0
- package/node_modules/typebox/build/value/repair/index.mjs +1 -0
- package/node_modules/typebox/build/value/repair/repair.d.mts +17 -0
- package/node_modules/typebox/build/value/repair/repair.mjs +20 -0
- package/node_modules/typebox/build/value/shared/index.d.mts +3 -0
- package/node_modules/typebox/build/value/shared/index.mjs +4 -0
- package/node_modules/typebox/build/value/shared/optional_undefined.d.mts +2 -0
- package/node_modules/typebox/build/value/shared/optional_undefined.mjs +15 -0
- package/node_modules/typebox/build/value/shared/union_priority_sort.d.mts +7 -0
- package/node_modules/typebox/build/value/shared/union_priority_sort.mjs +83 -0
- package/node_modules/typebox/build/value/shared/union_score_select.d.mts +3 -0
- package/node_modules/typebox/build/value/shared/union_score_select.mjs +51 -0
- package/node_modules/typebox/build/value/value.d.mts +15 -0
- package/node_modules/typebox/build/value/value.mjs +15 -0
- package/node_modules/typebox/license +23 -0
- package/node_modules/typebox/package.json +87 -0
- package/node_modules/typebox/readme.md +339 -0
- package/package.json +51 -4
- package/skills/pi-proactive/SKILL.md +182 -0
|
@@ -0,0 +1,1002 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `src/peer.ts` —— M5a:**逐条** reply 归因(问 → 答 → 回信 一一对应)。
|
|
3
|
+
*
|
|
4
|
+
* 定位:纯逻辑模块 —— **无 IO、不 import 宿主包**,只依赖 `envelope.ts` / `types.ts`。
|
|
5
|
+
* 这样才能在单测里独立验证「哪条回答属于哪条提问」,不牵动宿主运行时。
|
|
6
|
+
*
|
|
7
|
+
* 为什么需要它:M4i 的 ask→reply 是一回合一封 reply(拿到「下一条」assistant 文本就回)。
|
|
8
|
+
* 并发提问时无法关联 —— 回答可能被回给错的提问。本模块用 **pending 登记表** 把
|
|
9
|
+
* 「谁问的(requester / correlationId / threadId)」与「哪条回答」显式绑定。
|
|
10
|
+
*
|
|
11
|
+
* 归因规则(**逐条关联**):
|
|
12
|
+
* 1. 无 pending → 返回 `null`(**不回复**:不把用户自己的话当回答回信);
|
|
13
|
+
* 2. 恰好一个 pending → 归给它,`ambiguous:false`;
|
|
14
|
+
* 3. 多个 pending → 归给**最早未决**(`askedAt` 最小,平局取先登记者),
|
|
15
|
+
* 并置 `ambiguous:true`(**歧义降级**:如实标注,不假装确定);其余 pending **保留**;
|
|
16
|
+
* 4. `buildReply()` 把 `correlationId` 与 `threadId` **原样带回**,`from`=我、`to`=对端、
|
|
17
|
+
* `kind:"reply"`、`intent:"queue"`(**回信是后续,不是插话**:ADR-3「默认 followUp 不打断」);
|
|
18
|
+
* 5. 归因成功后该 pending **移出**(同一条回答不会被回两次)。
|
|
19
|
+
*/
|
|
20
|
+
import { randomUUID } from "node:crypto";
|
|
21
|
+
import { createEnvelope, HUMAN_ORIGIN_CUSTOM_TYPE } from "./envelope.js";
|
|
22
|
+
/** 默认等待回信窗口:10 分钟。 */
|
|
23
|
+
export const DEFAULT_EXPECT_REPLY_WITHIN_MS = 600_000;
|
|
24
|
+
/** 默认登记表上限:64 条。 */
|
|
25
|
+
export const DEFAULT_MAX_PENDING = 64;
|
|
26
|
+
/** 缺省的 agentId(接线方应显式传入真实 agentId)。 */
|
|
27
|
+
const DEFAULT_AGENT_ID = "self";
|
|
28
|
+
/** 歧义归因的正文标注前缀(**如实告知对端**,不假装确定)。 */
|
|
29
|
+
export const AMBIGUOUS_MARKER = "【歧义归因】";
|
|
30
|
+
/** 迟到回答的正文标注前缀(**如实告知对端**:回答来晚了)。 */
|
|
31
|
+
export const LATE_MARKER = "【回答已超过等待时限】";
|
|
32
|
+
/** 歧义原因:提问登记之后**用户又说了话**(这条回答可能是在回答用户,不是在回答对端)。 */
|
|
33
|
+
export const USER_SPOKE_REASON = "提问后用户曾发言,回答归属存疑";
|
|
34
|
+
/**
|
|
35
|
+
* 构造回信信封:`correlationId` / `threadId` **原样带回**,`from`=我、`to`=对端、
|
|
36
|
+
* `kind:"reply"`、`intent:"queue"`。
|
|
37
|
+
*
|
|
38
|
+
* **`intent:"queue"`(M5c)**:回信是**后续**,不是插话 —— ADR-3「默认 followUp 不打断」。
|
|
39
|
+
*
|
|
40
|
+
* `threadId` 缺失时**不携带** `threadId` 键(不写 `undefined` 字段)。
|
|
41
|
+
*/
|
|
42
|
+
export function buildReply(input) {
|
|
43
|
+
const { pending, agentId } = input;
|
|
44
|
+
// 正文标注(**如实**,不假装确定):歧义(含原因)→ 迟到 → 原文。
|
|
45
|
+
let body = input.body;
|
|
46
|
+
if (input.ambiguous === true) {
|
|
47
|
+
body = `${AMBIGUOUS_MARKER}${input.ambiguousReason ? `(${input.ambiguousReason})` : ""}${body}`;
|
|
48
|
+
}
|
|
49
|
+
if (input.late === true)
|
|
50
|
+
body = `${LATE_MARKER}${body}`;
|
|
51
|
+
const reply = createEnvelope({
|
|
52
|
+
from: agentId,
|
|
53
|
+
to: pending.requester,
|
|
54
|
+
kind: "reply",
|
|
55
|
+
intent: "queue",
|
|
56
|
+
body,
|
|
57
|
+
subject: pending.subject ? `Re: ${pending.subject}` : undefined,
|
|
58
|
+
threadId: pending.threadId,
|
|
59
|
+
correlationId: pending.correlationId,
|
|
60
|
+
replyTo: pending.requester,
|
|
61
|
+
...(input.now === undefined ? {} : { createdAt: input.now }),
|
|
62
|
+
});
|
|
63
|
+
// 继承 ask 的 hop / maxHops(Minor-5):否则信封级 hop 上限在「问→答」之间被重置,
|
|
64
|
+
// 防不住 A→B→A 的多轮往返(hop 不得大于 maxHops —— ask 本身已通过校验)。
|
|
65
|
+
//
|
|
66
|
+
// **G-R2 —— 待规格裁决**:规格(docs/a2a-protocol.md §4.1 字段表 / §4.4 / §4.5)**只**给
|
|
67
|
+
// `correlationId` 写了兜底链,对 `reply` 是否继承被回复信封的 `hop`/`maxHops` **只字未提** →
|
|
68
|
+
// 第三方只能猜(继承 or 归零),两边在 `hop=maxHops` 的链路上会给出不同的拒绝行为。
|
|
69
|
+
// 在协调者裁决前**保持现状(继承)**,**不改行为**;改法文本见 SPECFIX 任务卡的报告
|
|
70
|
+
// (由协调者落文档)。
|
|
71
|
+
if (pending.hop !== undefined)
|
|
72
|
+
reply.hop = pending.hop;
|
|
73
|
+
if (pending.maxHops !== undefined)
|
|
74
|
+
reply.maxHops = pending.maxHops;
|
|
75
|
+
return reply;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* 逐条 reply 归因器:登记待答的 ask,把模型回答归给对应的那一条并生成回信。
|
|
79
|
+
*
|
|
80
|
+
* 无状态外部依赖 —— 不碰文件、不碰 socket、不碰宿主 API。
|
|
81
|
+
*/
|
|
82
|
+
export class PeerResponder {
|
|
83
|
+
expectReplyWithinMs;
|
|
84
|
+
maxPending;
|
|
85
|
+
nowFn;
|
|
86
|
+
agentId;
|
|
87
|
+
entries = [];
|
|
88
|
+
/**
|
|
89
|
+
* **已过期但保留**的 pending(Major-2)。
|
|
90
|
+
*
|
|
91
|
+
* 过期 ≠ 丢弃:迟到的回答仍必须回信(否则闭环在「回答来得慢」这一正常场景下静默断裂)。
|
|
92
|
+
* 保留有上界(`maxPending`)→ 不会无限增长。
|
|
93
|
+
*/
|
|
94
|
+
expiredEntries = [];
|
|
95
|
+
seq = 0;
|
|
96
|
+
constructor(opts = {}) {
|
|
97
|
+
this.expectReplyWithinMs = opts.expectReplyWithinMs ?? DEFAULT_EXPECT_REPLY_WITHIN_MS;
|
|
98
|
+
this.maxPending = opts.maxPending ?? DEFAULT_MAX_PENDING;
|
|
99
|
+
this.nowFn = opts.now ?? (() => Date.now());
|
|
100
|
+
this.agentId = opts.agentId ?? DEFAULT_AGENT_ID;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* 登记一条待答的 ask。
|
|
104
|
+
*
|
|
105
|
+
* - 非 `kind:"ask"` → 返回 `null`(不登记);
|
|
106
|
+
* - 登记表已满(`maxPending`)→ 返回 `null`(**拒收**,防堆积);
|
|
107
|
+
* - 成功 → 返回登记好的 `PendingAsk`。
|
|
108
|
+
*/
|
|
109
|
+
onAsk(envelope) {
|
|
110
|
+
if (!envelope || envelope.kind !== "ask")
|
|
111
|
+
return null;
|
|
112
|
+
if (this.entries.length >= this.maxPending)
|
|
113
|
+
return null;
|
|
114
|
+
const pending = {
|
|
115
|
+
// ask 没带 correlationId 时用 ask 的 id 兜底 —— 对端仍能对上号。
|
|
116
|
+
correlationId: envelope.correlationId ?? envelope.id,
|
|
117
|
+
requester: envelope.from,
|
|
118
|
+
askedAt: this.nowFn(),
|
|
119
|
+
};
|
|
120
|
+
if (envelope.threadId !== undefined)
|
|
121
|
+
pending.threadId = envelope.threadId;
|
|
122
|
+
if (envelope.subject !== undefined)
|
|
123
|
+
pending.subject = envelope.subject;
|
|
124
|
+
// 记住 hop / maxHops → 回信继承(Minor-5)。
|
|
125
|
+
if (typeof envelope.hop === "number")
|
|
126
|
+
pending.hop = envelope.hop;
|
|
127
|
+
if (typeof envelope.maxHops === "number")
|
|
128
|
+
pending.maxHops = envelope.maxHops;
|
|
129
|
+
this.entries.push({ pending, seq: this.seq++, userSpoke: false });
|
|
130
|
+
return pending;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* 把一条 assistant 文本归因给某条 pending,并生成回信计划。
|
|
134
|
+
*
|
|
135
|
+
* - 无 pending / 空白文本 → `null`(**不回信**);
|
|
136
|
+
* - 唯一 pending → 归给它(`ambiguous:false`);
|
|
137
|
+
* - 多个 pending → 归给**最早未决**(`ambiguous:true`),其余保留;
|
|
138
|
+
* - 归因成功后该 pending 移出登记表(同一段文本不会被回两次)。
|
|
139
|
+
*/
|
|
140
|
+
onAssistantText(text, now) {
|
|
141
|
+
if (typeof text !== "string")
|
|
142
|
+
return null;
|
|
143
|
+
const body = text.trim();
|
|
144
|
+
if (body === "")
|
|
145
|
+
return null;
|
|
146
|
+
if (this.entries.length === 0 && this.expiredEntries.length === 0)
|
|
147
|
+
return null;
|
|
148
|
+
// 有未决提问就归给未决的;**全部过期**时归给最早那条过期提问(Major-2:迟到回答仍要回信)。
|
|
149
|
+
const late = this.entries.length === 0;
|
|
150
|
+
const pool = late ? this.expiredEntries : this.entries;
|
|
151
|
+
const ambiguous = pool.length > 1;
|
|
152
|
+
const idx = this.pickEarliest(pool);
|
|
153
|
+
const entry = pool.splice(idx, 1)[0];
|
|
154
|
+
// 提问之后用户又说了话 → 归因存疑(Major-3):不得当作确定答案回给对端。
|
|
155
|
+
const userSpoke = entry.userSpoke === true;
|
|
156
|
+
const ambiguousFinal = ambiguous || userSpoke;
|
|
157
|
+
const reason = userSpoke ? USER_SPOKE_REASON : undefined;
|
|
158
|
+
const reply = buildReply({
|
|
159
|
+
pending: entry.pending,
|
|
160
|
+
body,
|
|
161
|
+
agentId: this.agentId,
|
|
162
|
+
ambiguous: ambiguousFinal,
|
|
163
|
+
...(reason === undefined ? {} : { ambiguousReason: reason }),
|
|
164
|
+
late,
|
|
165
|
+
...(now === undefined ? {} : { now }),
|
|
166
|
+
});
|
|
167
|
+
return {
|
|
168
|
+
reply,
|
|
169
|
+
ambiguous: ambiguousFinal,
|
|
170
|
+
pending: entry.pending,
|
|
171
|
+
late,
|
|
172
|
+
...(reason === undefined ? {} : { ambiguousReason: reason }),
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* 把超时的 pending 标过期并移出,返回被移出的那些(供调用方记日志/告警)。
|
|
177
|
+
*
|
|
178
|
+
* 判定:`now - askedAt > expectReplyWithinMs`(**严格超过**才算过期)。
|
|
179
|
+
*/
|
|
180
|
+
expireStale(now) {
|
|
181
|
+
const t = now ?? this.nowFn();
|
|
182
|
+
const expired = [];
|
|
183
|
+
const kept = [];
|
|
184
|
+
for (const e of this.entries) {
|
|
185
|
+
if (t - e.pending.askedAt > this.expectReplyWithinMs)
|
|
186
|
+
expired.push(e);
|
|
187
|
+
else
|
|
188
|
+
kept.push(e);
|
|
189
|
+
}
|
|
190
|
+
this.entries.length = 0;
|
|
191
|
+
this.entries.push(...kept);
|
|
192
|
+
// **过期 ≠ 丢弃**(Major-2):移入「已过期但保留」区 → 迟到的回答仍会回信。
|
|
193
|
+
// 保留有上界(`maxPending`)→ 内存不会无限增长。
|
|
194
|
+
this.expiredEntries.push(...expired);
|
|
195
|
+
while (this.expiredEntries.length > this.maxPending)
|
|
196
|
+
this.expiredEntries.shift();
|
|
197
|
+
return expired.map((e) => e.pending);
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* 记录「用户又说了话」(Major-3)。
|
|
201
|
+
*
|
|
202
|
+
* 语义:宿主不携带 correlationId → 实现**无法判别**一条 assistant 文本是在回答对端
|
|
203
|
+
* 还是在回答用户。凡是在提问登记**之后**发生过用户输入的 pending,其后续回答的归因
|
|
204
|
+
* 必须标为歧义(或干脆不回信)—— 不得当作确定答案回过去。
|
|
205
|
+
*
|
|
206
|
+
* @param at 用户发言的时刻(缺省 = 当前时间)。
|
|
207
|
+
*/
|
|
208
|
+
noteUserInput(at = this.nowFn()) {
|
|
209
|
+
for (const e of [...this.entries, ...this.expiredEntries]) {
|
|
210
|
+
if (e.pending.askedAt <= at)
|
|
211
|
+
e.userSpoke = true;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
/** 当前待答条数。 */
|
|
215
|
+
pendingCount() {
|
|
216
|
+
return this.entries.length;
|
|
217
|
+
}
|
|
218
|
+
/** 当前待答列表(副本,改动不影响内部状态)。 */
|
|
219
|
+
pendingList() {
|
|
220
|
+
return this.entries.map((e) => e.pending);
|
|
221
|
+
}
|
|
222
|
+
/** 取「最早未决」的下标:`askedAt` 最小,平局取先登记者。 */
|
|
223
|
+
pickEarliest(pool) {
|
|
224
|
+
let best = 0;
|
|
225
|
+
for (let i = 1; i < pool.length; i++) {
|
|
226
|
+
const a = pool[i].pending.askedAt;
|
|
227
|
+
const b = pool[best].pending.askedAt;
|
|
228
|
+
if (a < b || (a === b && pool[i].seq < pool[best].seq))
|
|
229
|
+
best = i;
|
|
230
|
+
}
|
|
231
|
+
return best;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
// ============================================================================
|
|
235
|
+
// ASKLOOP:提问方侧的语义闭环(ask → reply → 结局 → 不再追问)
|
|
236
|
+
// ============================================================================
|
|
237
|
+
/**
|
|
238
|
+
* 「等待超时」通知的**正文标记**(协议级约定,规范 §6.5)。
|
|
239
|
+
*
|
|
240
|
+
* 为什么需要它:提问方收到的是一条 `kind:"reply"`,但它可能**不是答案**,
|
|
241
|
+
* 而是对端「我没在时限内回答」的如实通知 → 必须能把它与真答案区分开,
|
|
242
|
+
* 否则会把「超时」记成「已答」(闭环假绿)。
|
|
243
|
+
*
|
|
244
|
+
* 约定写在协议里 → 第三方对端也能照此实现(参考对端 `reference-peer/peer.py`)。
|
|
245
|
+
*/
|
|
246
|
+
export const TIMEOUT_NOTICE_MARKER = "【等待超时】";
|
|
247
|
+
/**
|
|
248
|
+
* 「**对端已下线**」的正文标记(协议级约定,与 `TIMEOUT_NOTICE_MARKER` 同族)。
|
|
249
|
+
*
|
|
250
|
+
* 用途:会话优雅退出前 **drain**(把在途 ask 逐条回一条)时,回信用这个标记开头 →
|
|
251
|
+
* 提问方据此把这条提问判为 **`unreachable`**(不是 `answered`)——
|
|
252
|
+
* 「对方下线了」**不是答案**(否则闭环会假绿:提问方以为问到了答案)。
|
|
253
|
+
*
|
|
254
|
+
* 第三方对端照此实现即可对齐语义(见 `docs/a2a-protocol.md`)。
|
|
255
|
+
*/
|
|
256
|
+
export const PEER_OFFLINE_MARKER = "【对端已下线】";
|
|
257
|
+
/** 默认等待回信上界:10 分钟(与对端一致)。 */
|
|
258
|
+
export const DEFAULT_ASK_WAIT_MS = 600_000;
|
|
259
|
+
/** 默认「连续未答达上限即停止」的次数。 */
|
|
260
|
+
export const DEFAULT_MAX_UNANSWERED = 3;
|
|
261
|
+
/** 默认退避基数:5 分钟。 */
|
|
262
|
+
export const DEFAULT_ASK_BACKOFF_MS = 300_000;
|
|
263
|
+
/**
|
|
264
|
+
* 提问方的 **ask 账本**:登记已发出的 ask → 配对回信 → 记结局 → **决定还问不ask。
|
|
265
|
+
*
|
|
266
|
+
* 为什么必须有它(KK-7):没有「已问过/已回应」状态时,提问方只能靠频率护栏压制,
|
|
267
|
+
* 频率被限住、**语义没闭环**(实测 196 问 / 3 答,还在一直问)。
|
|
268
|
+
*
|
|
269
|
+
* 状态机(每个对端一份):
|
|
270
|
+
*
|
|
271
|
+
* ```
|
|
272
|
+
* 发出 ask
|
|
273
|
+
* idle ──────────────────▶ waiting
|
|
274
|
+
* ▲ │
|
|
275
|
+
* │ 对端重新 busy(复位) ├─ 收到 reply(真答案)──▶ answered(不再追问)
|
|
276
|
+
* │ ├─ 收到「等待超时」通知 ─▶ unanswered
|
|
277
|
+
* │ └─ 超过等待上界 ─────────▶ unanswered
|
|
278
|
+
* │ │
|
|
279
|
+
* │ 未达上限 ────┴──▶ idle(退避后重试)
|
|
280
|
+
* │ 达上限 ────────────▶ stopped(停止该对端)
|
|
281
|
+
* └────────────────────────────────────────────────────────────┘
|
|
282
|
+
* ```
|
|
283
|
+
*
|
|
284
|
+
* - **answered / stopped 都由「对端重新进入 busy」复位**(对端开始新工作 → 再问才有意义);
|
|
285
|
+
* - **不可达**(提问没送达)→ 记 `unreachable` + 退避(不计入「连续未答」,避免把离线的对端误停)。
|
|
286
|
+
*/
|
|
287
|
+
export class AskLedger {
|
|
288
|
+
nowFn;
|
|
289
|
+
waitMs;
|
|
290
|
+
maxUnanswered;
|
|
291
|
+
backoffMs;
|
|
292
|
+
/** correlationId → 未决 ask。 */
|
|
293
|
+
outstanding = new Map();
|
|
294
|
+
/** peer → 状态。 */
|
|
295
|
+
peers = new Map();
|
|
296
|
+
constructor(opts = {}) {
|
|
297
|
+
this.nowFn = opts.now ?? (() => Date.now());
|
|
298
|
+
this.waitMs = opts.waitMs ?? DEFAULT_ASK_WAIT_MS;
|
|
299
|
+
this.maxUnanswered = opts.maxUnanswered ?? DEFAULT_MAX_UNANSWERED;
|
|
300
|
+
this.backoffMs = opts.backoffMs ?? DEFAULT_ASK_BACKOFF_MS;
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* 登记一条**已发出**的 ask(提问方视角)。
|
|
304
|
+
*
|
|
305
|
+
* 只登记**对端已收下**的 ask(投递失败/不可达 → 走 `noteUnreachable`)——
|
|
306
|
+
* 否则会把「根本没送到」算成「问了没答」。
|
|
307
|
+
*/
|
|
308
|
+
recordAsk(input) {
|
|
309
|
+
const at = input.askedAt ?? this.nowFn();
|
|
310
|
+
const ask = {
|
|
311
|
+
peer: input.peer,
|
|
312
|
+
correlationId: input.correlationId,
|
|
313
|
+
askedAt: at,
|
|
314
|
+
};
|
|
315
|
+
if (input.threadKey !== undefined)
|
|
316
|
+
ask.threadKey = input.threadKey;
|
|
317
|
+
if (input.humanOrigin === true)
|
|
318
|
+
ask.humanOrigin = true;
|
|
319
|
+
this.outstanding.set(ask.correlationId, ask);
|
|
320
|
+
const rec = this.recordOf(input.peer);
|
|
321
|
+
rec.state = "waiting";
|
|
322
|
+
rec.askCount += 1;
|
|
323
|
+
rec.latestCorrelationId = ask.correlationId;
|
|
324
|
+
rec.reason = `已提问,等待回答(${ask.correlationId})`;
|
|
325
|
+
rec.nextAskAt = undefined;
|
|
326
|
+
return ask;
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* 收到一条回信 → 配对未决 ask → 记结局。
|
|
330
|
+
*
|
|
331
|
+
* - 配不上(迟到的回答 / 对不上号的回信)→ 返回 `null`(**不臆造**对应关系);
|
|
332
|
+
* - 正文以 `TIMEOUT_NOTICE_MARKER` 开头 → 结局是 `unanswered`(不是 `answered`)。
|
|
333
|
+
*/
|
|
334
|
+
onReply(reply) {
|
|
335
|
+
if (!reply || typeof reply.from !== "string")
|
|
336
|
+
return null;
|
|
337
|
+
let ask;
|
|
338
|
+
if (reply.correlationId !== undefined) {
|
|
339
|
+
ask = this.outstanding.get(reply.correlationId);
|
|
340
|
+
}
|
|
341
|
+
else {
|
|
342
|
+
// **没有** correlationId → 只在「该对端恰好有一条未决」时兜底配对。
|
|
343
|
+
// 带了 correlationId 却对不上 → **不配对**(不得臆造对应关系)。
|
|
344
|
+
const candidates = [...this.outstanding.values()].filter((a) => a.peer === reply.from);
|
|
345
|
+
if (candidates.length === 1)
|
|
346
|
+
ask = candidates[0];
|
|
347
|
+
}
|
|
348
|
+
if (ask === undefined)
|
|
349
|
+
return null;
|
|
350
|
+
this.outstanding.delete(ask.correlationId);
|
|
351
|
+
const replyBody = typeof reply.body === "string" ? reply.body : "";
|
|
352
|
+
const timedOut = replyBody.startsWith(TIMEOUT_NOTICE_MARKER);
|
|
353
|
+
// 「对端已下线」≠ 答案:结局记 unreachable(对方走了,这条提问永远不会有答案)。
|
|
354
|
+
const wentOffline = replyBody.startsWith(PEER_OFFLINE_MARKER);
|
|
355
|
+
const outcome = timedOut ? "unanswered" : wentOffline ? "unreachable" : "answered";
|
|
356
|
+
const reason = timedOut
|
|
357
|
+
? "对端等待超时(未在时限内回答)"
|
|
358
|
+
: wentOffline
|
|
359
|
+
? "对端已下线(会话结束,未作答)"
|
|
360
|
+
: "已收到对端的回答";
|
|
361
|
+
return this.applyOutcome(ask, outcome, reason);
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* 扫描超时未答的 ask → 结局 `unanswered`。
|
|
365
|
+
*
|
|
366
|
+
* 判定:`now - askedAt > waitMs`(**严格超过**才算超时,与对端 pending 的过期口径一致)。
|
|
367
|
+
*/
|
|
368
|
+
expire(now) {
|
|
369
|
+
const t = now ?? this.nowFn();
|
|
370
|
+
const events = [];
|
|
371
|
+
for (const ask of [...this.outstanding.values()]) {
|
|
372
|
+
if (t - ask.askedAt <= this.waitMs)
|
|
373
|
+
continue;
|
|
374
|
+
this.outstanding.delete(ask.correlationId);
|
|
375
|
+
events.push(this.applyOutcome(ask, "unanswered", "等待回信超时(对端未在时限内回答)"));
|
|
376
|
+
}
|
|
377
|
+
return events;
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
* 提问**没送达**对端(对端不可达 / 被拒 / 已过期)→ 结局 `unreachable`。
|
|
381
|
+
*
|
|
382
|
+
* 不计入「连续未答」(避免把离线的对端误停),但**要退避**(别每轮都问一个离线对端)。
|
|
383
|
+
*/
|
|
384
|
+
noteUnreachable(input) {
|
|
385
|
+
const at = input.at ?? this.nowFn();
|
|
386
|
+
const ask = { peer: input.peer, correlationId: input.correlationId, askedAt: at };
|
|
387
|
+
if (input.threadKey !== undefined)
|
|
388
|
+
ask.threadKey = input.threadKey;
|
|
389
|
+
this.outstanding.delete(input.correlationId);
|
|
390
|
+
return this.applyOutcome(ask, "unreachable", input.reason ?? "对端不可达(提问未送达)");
|
|
391
|
+
}
|
|
392
|
+
/** 现在**该不该**问这个对端(停止追问的状态机判定)。 */
|
|
393
|
+
canAsk(peer, now) {
|
|
394
|
+
const rec = this.peers.get(peer);
|
|
395
|
+
if (rec === undefined)
|
|
396
|
+
return true;
|
|
397
|
+
if (rec.state === "waiting" || rec.state === "answered" || rec.state === "stopped")
|
|
398
|
+
return false;
|
|
399
|
+
const t = now ?? this.nowFn();
|
|
400
|
+
if (rec.nextAskAt !== undefined && t < rec.nextAskAt)
|
|
401
|
+
return false;
|
|
402
|
+
return true;
|
|
403
|
+
}
|
|
404
|
+
/** 某个对端的可观测状态。 */
|
|
405
|
+
status(peer) {
|
|
406
|
+
const rec = this.peers.get(peer);
|
|
407
|
+
if (rec === undefined) {
|
|
408
|
+
return { peer, state: "idle", askCount: 0, unansweredCount: 0 };
|
|
409
|
+
}
|
|
410
|
+
const out = {
|
|
411
|
+
peer,
|
|
412
|
+
state: rec.state,
|
|
413
|
+
askCount: rec.askCount,
|
|
414
|
+
unansweredCount: rec.unansweredCount,
|
|
415
|
+
};
|
|
416
|
+
if (rec.reason !== undefined)
|
|
417
|
+
out.reason = rec.reason;
|
|
418
|
+
if (rec.nextAskAt !== undefined)
|
|
419
|
+
out.nextAskAt = rec.nextAskAt;
|
|
420
|
+
if (rec.latestCorrelationId !== undefined) {
|
|
421
|
+
const ask = this.outstanding.get(rec.latestCorrelationId);
|
|
422
|
+
if (ask !== undefined)
|
|
423
|
+
out.outstanding = ask;
|
|
424
|
+
}
|
|
425
|
+
return out;
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
* 对端**重新进入忙碌**(开始新工作)→ 复位「已答 / 已停止」→ 可以再问。
|
|
429
|
+
*
|
|
430
|
+
* 理由:问的是「在忙什么」—— 对端开始新工作后,这个问题才重新有意义;
|
|
431
|
+
* 对端一直闲着还一直问,就是噪声(实测 196 问的来源)。
|
|
432
|
+
*/
|
|
433
|
+
notePeerBusy(peer) {
|
|
434
|
+
const rec = this.peers.get(peer);
|
|
435
|
+
if (rec === undefined)
|
|
436
|
+
return;
|
|
437
|
+
if (rec.state !== "answered" && rec.state !== "stopped")
|
|
438
|
+
return;
|
|
439
|
+
rec.state = "idle";
|
|
440
|
+
rec.reason = undefined;
|
|
441
|
+
rec.nextAskAt = undefined;
|
|
442
|
+
}
|
|
443
|
+
/** 当前未决 ask 数。 */
|
|
444
|
+
outstandingCount() {
|
|
445
|
+
return this.outstanding.size;
|
|
446
|
+
}
|
|
447
|
+
/** 还有**在途提问**的对端 id 集合(用于死亡检测:这些对端一死,提问立即结案)。 */
|
|
448
|
+
outstandingPeers() {
|
|
449
|
+
const out = new Set();
|
|
450
|
+
for (const ask of this.outstanding.values())
|
|
451
|
+
out.add(ask.peer);
|
|
452
|
+
return [...out];
|
|
453
|
+
}
|
|
454
|
+
/** 某个对端当前**未决**的 ask 列表(发出去了、还没收到结局)。 */
|
|
455
|
+
outstandingAsks(peer) {
|
|
456
|
+
const out = [];
|
|
457
|
+
for (const ask of this.outstanding.values()) {
|
|
458
|
+
if (ask.peer === peer)
|
|
459
|
+
out.push(ask);
|
|
460
|
+
}
|
|
461
|
+
return out;
|
|
462
|
+
}
|
|
463
|
+
/**
|
|
464
|
+
* **对端死亡**(心跳过期 / 判定不可达)→ 在途 ask **立即**结案「对端已死亡」,
|
|
465
|
+
* 并**不再追问**该对端。
|
|
466
|
+
*
|
|
467
|
+
* 语义(三条,缺一不可):
|
|
468
|
+
* 1. 每条在途 ask 的结局记为 `unreachable`(**不是** `unanswered`——它没有被回答的机会);
|
|
469
|
+
* 2. 该对端的状态置为 `stopped` → `canAsk()` 恒为 false → **不再追问**;
|
|
470
|
+
* 3. 复位条件不变:对端**重新进入忙碌**(`notePeerBusy`)才恢复(它可能换了新会话)。
|
|
471
|
+
*
|
|
472
|
+
* 复用既有账本(**不另造一套**「我发出的提问」台账)。
|
|
473
|
+
*/
|
|
474
|
+
notePeerDead(peer, opts) {
|
|
475
|
+
const reason = opts?.reason ?? "对端已死亡(心跳过期)";
|
|
476
|
+
const events = [];
|
|
477
|
+
for (const ask of [...this.outstanding.values()]) {
|
|
478
|
+
if (ask.peer !== peer)
|
|
479
|
+
continue;
|
|
480
|
+
this.outstanding.delete(ask.correlationId);
|
|
481
|
+
events.push(this.applyOutcome(ask, "unreachable", reason));
|
|
482
|
+
}
|
|
483
|
+
const rec = this.recordOf(peer);
|
|
484
|
+
rec.state = "stopped";
|
|
485
|
+
rec.reason = `${reason}(不再追问该对端)`;
|
|
486
|
+
rec.nextAskAt = undefined;
|
|
487
|
+
return events;
|
|
488
|
+
}
|
|
489
|
+
// ---- 内部实现 ----
|
|
490
|
+
recordOf(peer) {
|
|
491
|
+
let rec = this.peers.get(peer);
|
|
492
|
+
if (rec === undefined) {
|
|
493
|
+
rec = { peer, state: "idle", askCount: 0, unansweredCount: 0 };
|
|
494
|
+
this.peers.set(peer, rec);
|
|
495
|
+
}
|
|
496
|
+
return rec;
|
|
497
|
+
}
|
|
498
|
+
/** 记结局 + 推进该对端的状态机。 */
|
|
499
|
+
applyOutcome(ask, outcome, reason) {
|
|
500
|
+
const at = this.nowFn();
|
|
501
|
+
const rec = this.recordOf(ask.peer);
|
|
502
|
+
const event = {
|
|
503
|
+
type: "outcome",
|
|
504
|
+
at,
|
|
505
|
+
cause: "peer-ask",
|
|
506
|
+
outcome,
|
|
507
|
+
correlationId: ask.correlationId,
|
|
508
|
+
peer: ask.peer,
|
|
509
|
+
askedAt: ask.askedAt,
|
|
510
|
+
elapsedMs: Math.max(0, at - ask.askedAt),
|
|
511
|
+
reason,
|
|
512
|
+
};
|
|
513
|
+
// 人侧发起的提问 → 结局带上这个标记(回信要能通知到人眼前)。
|
|
514
|
+
if (ask.humanOrigin === true)
|
|
515
|
+
event.humanOrigin = true;
|
|
516
|
+
if (ask.threadKey !== undefined)
|
|
517
|
+
event.threadId = ask.threadKey;
|
|
518
|
+
if (outcome === "answered") {
|
|
519
|
+
rec.state = "answered";
|
|
520
|
+
rec.reason = reason;
|
|
521
|
+
rec.nextAskAt = undefined;
|
|
522
|
+
}
|
|
523
|
+
else if (outcome === "unanswered") {
|
|
524
|
+
rec.unansweredCount += 1;
|
|
525
|
+
if (rec.unansweredCount >= this.maxUnanswered) {
|
|
526
|
+
rec.state = "stopped";
|
|
527
|
+
rec.reason = `连续 ${rec.unansweredCount} 次未获回答 → 停止问该对端`;
|
|
528
|
+
rec.nextAskAt = undefined;
|
|
529
|
+
}
|
|
530
|
+
else {
|
|
531
|
+
rec.state = "idle";
|
|
532
|
+
const wait = this.backoffMs * rec.unansweredCount;
|
|
533
|
+
rec.nextAskAt = at + wait;
|
|
534
|
+
rec.reason = `未获回答(第 ${rec.unansweredCount} 次,退避 ${wait}ms 后再问)`;
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
else {
|
|
538
|
+
// unreachable:不算「未答」,但要退避(别每轮都问一个送不到的对端)。
|
|
539
|
+
rec.state = "idle";
|
|
540
|
+
rec.nextAskAt = at + this.backoffMs;
|
|
541
|
+
rec.reason = reason;
|
|
542
|
+
}
|
|
543
|
+
return event;
|
|
544
|
+
}
|
|
545
|
+
/** 某个对端当前**未决**的 ask 数(发出去了、还没收到结局)→ 「在途任务数」的一半。 */
|
|
546
|
+
outstandingFor(peer) {
|
|
547
|
+
let n = 0;
|
|
548
|
+
for (const ask of this.outstanding.values()) {
|
|
549
|
+
if (ask.peer === peer)
|
|
550
|
+
n += 1;
|
|
551
|
+
}
|
|
552
|
+
return n;
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
/** 默认连续空闲阈值(10 分钟)。 */
|
|
556
|
+
export const DEFAULT_AFTER_IDLE_MS = 600_000;
|
|
557
|
+
/** 默认心跳周期(30 秒,与注册表一致)。 */
|
|
558
|
+
export const DEFAULT_WATCH_HEARTBEAT_MS = 30_000;
|
|
559
|
+
/** 心跳过期倍数(与注册表 `OFFLINE_HEARTBEAT_FACTOR` 一致):超过 3 个周期未刷新即视为不新鲜。 */
|
|
560
|
+
/** peer watch 的最小询问周期(ms,5 分钟):防止 `afterIdleMs` 很小退化成刷屏。 */
|
|
561
|
+
export const DEFAULT_WATCH_CYCLE_MS = 300_000;
|
|
562
|
+
export const WATCH_OFFLINE_FACTOR = 3;
|
|
563
|
+
/**
|
|
564
|
+
* peer watch 判定器(纯逻辑)。
|
|
565
|
+
*
|
|
566
|
+
* 用法:`observe(当前在线 peer)` → `targets(当前在线 peer)` → 发出询问后 `markAsked(agentId)`。
|
|
567
|
+
*/
|
|
568
|
+
export class PeerWatch {
|
|
569
|
+
enabledFlag;
|
|
570
|
+
afterIdleMs;
|
|
571
|
+
cycleMs;
|
|
572
|
+
nowFn;
|
|
573
|
+
selfAgentId;
|
|
574
|
+
/** 会话角色(缺省 = 不限定)。 */
|
|
575
|
+
role;
|
|
576
|
+
/** 随会话的 watch 名单(空 = 不限定)。 */
|
|
577
|
+
watchList;
|
|
578
|
+
/** agentId → 本机第一次观察到它 idle 的时刻。 */
|
|
579
|
+
idleSince = new Map();
|
|
580
|
+
/** agentId → 上次询问的时刻。 */
|
|
581
|
+
lastAskedAt = new Map();
|
|
582
|
+
/** agentId → 未获回复的询问次数(环路计数)。 */
|
|
583
|
+
hops = new Map();
|
|
584
|
+
constructor(opts = {}) {
|
|
585
|
+
this.enabledFlag = opts.enabled ?? false;
|
|
586
|
+
this.afterIdleMs = opts.afterIdleMs ?? DEFAULT_AFTER_IDLE_MS;
|
|
587
|
+
this.cycleMs = opts.cycleMs ?? Math.max(this.afterIdleMs, DEFAULT_WATCH_CYCLE_MS);
|
|
588
|
+
this.nowFn = opts.now ?? (() => Date.now());
|
|
589
|
+
this.selfAgentId = opts.selfAgentId ?? "";
|
|
590
|
+
this.role = opts.role;
|
|
591
|
+
this.watchList = [...(opts.watchList ?? [])];
|
|
592
|
+
}
|
|
593
|
+
/** 是否开启。 */
|
|
594
|
+
get enabled() {
|
|
595
|
+
return this.enabledFlag;
|
|
596
|
+
}
|
|
597
|
+
/**
|
|
598
|
+
* 记录一次观测:更新每个 peer 的空闲起点。
|
|
599
|
+
*
|
|
600
|
+
* - 观察到 busy → 清空空闲起点(空闲时长不跨 busy 累计);
|
|
601
|
+
* - 观察到 idle → 首次见到时记下当前时刻;
|
|
602
|
+
* - 本轮没出现的 peer → 一并清掉(已下线)。
|
|
603
|
+
*/
|
|
604
|
+
observe(peers) {
|
|
605
|
+
const now = this.nowFn();
|
|
606
|
+
const seen = new Set();
|
|
607
|
+
for (const p of peers) {
|
|
608
|
+
seen.add(p.agentId);
|
|
609
|
+
if (p.status !== "idle") {
|
|
610
|
+
this.idleSince.delete(p.agentId);
|
|
611
|
+
continue;
|
|
612
|
+
}
|
|
613
|
+
if (!this.idleSince.has(p.agentId))
|
|
614
|
+
this.idleSince.set(p.agentId, now);
|
|
615
|
+
}
|
|
616
|
+
for (const id of [...this.idleSince.keys()]) {
|
|
617
|
+
if (!seen.has(id))
|
|
618
|
+
this.idleSince.delete(id);
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
/**
|
|
622
|
+
* 本轮应当询问的 peer(已过滤:非 idle / 心跳不新鲜 / 空闲不足 / 本周期已问过)。
|
|
623
|
+
*/
|
|
624
|
+
targets(peers) {
|
|
625
|
+
if (!this.enabledFlag)
|
|
626
|
+
return [];
|
|
627
|
+
// **角色作用域**(KK-10):执行者只被 watch → 永不主动问(避免 N² 问询)。
|
|
628
|
+
if (this.role === "worker")
|
|
629
|
+
return [];
|
|
630
|
+
const now = this.nowFn();
|
|
631
|
+
const out = [];
|
|
632
|
+
for (const p of peers) {
|
|
633
|
+
if (p.agentId === this.selfAgentId)
|
|
634
|
+
continue;
|
|
635
|
+
// **随会话的 watch 名单**:不在名单里的对端一律不问(名单外的对端只是「看得见」)。
|
|
636
|
+
if (this.watchList.length > 0 && !this.watchList.includes(p.agentId))
|
|
637
|
+
continue;
|
|
638
|
+
if (p.status !== "idle")
|
|
639
|
+
continue;
|
|
640
|
+
if (!this.isFresh(p, now))
|
|
641
|
+
continue;
|
|
642
|
+
const since = this.idleSince.get(p.agentId);
|
|
643
|
+
if (since === undefined)
|
|
644
|
+
continue;
|
|
645
|
+
if (now - since < this.afterIdleMs)
|
|
646
|
+
continue;
|
|
647
|
+
const asked = this.lastAskedAt.get(p.agentId);
|
|
648
|
+
if (asked !== undefined && now - asked < this.cycleMs)
|
|
649
|
+
continue;
|
|
650
|
+
out.push(p);
|
|
651
|
+
}
|
|
652
|
+
return out;
|
|
653
|
+
}
|
|
654
|
+
/** 标记已询问(进入下一个周期前不再询问同一个 peer)。 */
|
|
655
|
+
markAsked(agentId) {
|
|
656
|
+
this.lastAskedAt.set(agentId, this.nowFn());
|
|
657
|
+
}
|
|
658
|
+
/** 某个 peer 当前未获回复的询问次数。 */
|
|
659
|
+
hopFor(agentId) {
|
|
660
|
+
return this.hops.get(agentId) ?? 0;
|
|
661
|
+
}
|
|
662
|
+
/** 询问次数 +1 并返回新值。 */
|
|
663
|
+
noteHop(agentId) {
|
|
664
|
+
const next = this.hopFor(agentId) + 1;
|
|
665
|
+
this.hops.set(agentId, next);
|
|
666
|
+
return next;
|
|
667
|
+
}
|
|
668
|
+
/** 收到该 peer 的回复 → 环路计数归零。 */
|
|
669
|
+
resetHop(agentId) {
|
|
670
|
+
this.hops.delete(agentId);
|
|
671
|
+
}
|
|
672
|
+
/** 心跳是否新鲜(未超过 3 个心跳周期)。 */
|
|
673
|
+
isFresh(p, now) {
|
|
674
|
+
const hb = p.heartbeatMs ?? DEFAULT_WATCH_HEARTBEAT_MS;
|
|
675
|
+
return now - p.lastSeen <= hb * WATCH_OFFLINE_FACTOR;
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
/**
|
|
679
|
+
* `/proactive peers` 的文本:name / agentId / status / 距上次心跳 / currentTask。
|
|
680
|
+
*/
|
|
681
|
+
export function formatPeerList(peers, now) {
|
|
682
|
+
if (peers.length === 0)
|
|
683
|
+
return "当前没有在线的 peer。";
|
|
684
|
+
const lines = [`在线 peer(${peers.length} 个):`];
|
|
685
|
+
for (const p of peers) {
|
|
686
|
+
const since = Math.max(0, now - p.lastSeen);
|
|
687
|
+
const parts = [
|
|
688
|
+
`${p.name || p.agentId}`,
|
|
689
|
+
`(${p.agentId})`,
|
|
690
|
+
p.status === "idle" ? "空闲" : p.status === "offline" ? "离线" : "忙碌",
|
|
691
|
+
`心跳 ${Math.round(since / 1000)}s 前`,
|
|
692
|
+
p.currentTask ? `当前任务:${p.currentTask}` : "当前任务:—",
|
|
693
|
+
];
|
|
694
|
+
lines.push(`- ${parts.join(" · ")}`);
|
|
695
|
+
}
|
|
696
|
+
return lines.join("\n");
|
|
697
|
+
}
|
|
698
|
+
// ============================================================================
|
|
699
|
+
// 人侧发指令(人类 → agent peer):`/proactive tell`
|
|
700
|
+
// ============================================================================
|
|
701
|
+
//
|
|
702
|
+
// 定位:**纯逻辑**(无 IO)—— 命令解析 / 目标解析 / 信封构造 / 信任判定都在这里,
|
|
703
|
+
// 扩展层只做「接线 + 投递 + 回执」。这样单测能独立验证「人敲的命令到底变成了什么信封」。
|
|
704
|
+
//
|
|
705
|
+
// 三条硬纪律(与本项目的既有病根对着干):
|
|
706
|
+
// 1. **不得另造投递通道** —— 构造出来的信封只能走既有唯一出站入口 `deliverToPeer`;
|
|
707
|
+
// 2. **回执如实** —— 「已送达 / 已落盘待其上线 / 未送达」三态必须分清(queued ≠ 已送达);
|
|
708
|
+
// 3. **人类发起 ≠ 免检** —— 人类标记只增加**可识别性**,不豁免来源校验(`strict` 照旧)。
|
|
709
|
+
/**
|
|
710
|
+
* 人侧发指令允许的 `kind`(`reply` 不在其中:回信必须配 `correlationId`,不是人能直接下的语义)。
|
|
711
|
+
*
|
|
712
|
+
* **类型口径**:`kind` 的类型一律是 `DeliverKind`(唯一真源)—— 这里给的是**取值子集**,
|
|
713
|
+
* 由 `parseTellCommand()` 在运行时校验(不放宽 `DeliverKind`,也不另立一个 kind 类型)。
|
|
714
|
+
*/
|
|
715
|
+
export const TELL_KINDS = ["ask", "task", "notify"];
|
|
716
|
+
/** `/proactive tell` 的用法(错误提示与 help 共用同一句,避免两处说法漂移)。 */
|
|
717
|
+
export const TELL_USAGE = "用法:/proactive tell <peer> <内容> [--kind ask|task|notify] [--thread <id>] [--subject <标题>]";
|
|
718
|
+
/**
|
|
719
|
+
* 解析 `/proactive tell` 的参数串。
|
|
720
|
+
*
|
|
721
|
+
* 口径:
|
|
722
|
+
* - 目标 = 第一个非参数词;其余词(去掉参数后)原样拼成**正文**(内部空白不丢);
|
|
723
|
+
* - `--kind` 缺省 `ask`(人给对端下指令最常见的诉求是「要回话」);
|
|
724
|
+
* - `--kind` 只接受 `ask|task|notify`(`reply` 需配 `correlationId`,人侧不直接发);
|
|
725
|
+
* - 未知参数 → **报错**(不静默吞掉,避免拼错参数还发出去)。
|
|
726
|
+
*/
|
|
727
|
+
export function parseTellCommand(args) {
|
|
728
|
+
const flags = new Map();
|
|
729
|
+
let rest = args;
|
|
730
|
+
const take = (name, pattern) => {
|
|
731
|
+
const m = pattern.exec(rest);
|
|
732
|
+
if (m === null)
|
|
733
|
+
return null;
|
|
734
|
+
flags.set(name, m[1] ?? "");
|
|
735
|
+
rest = rest.replace(pattern, " ");
|
|
736
|
+
return m[1] ?? "";
|
|
737
|
+
};
|
|
738
|
+
const kindRaw = take("kind", /--kind[ \t]+(\S+)/);
|
|
739
|
+
if (kindRaw === null && /--kind(?![ \t]+\S)/.test(rest)) {
|
|
740
|
+
return { ok: false, error: `--kind 缺参数。${TELL_USAGE}` };
|
|
741
|
+
}
|
|
742
|
+
const threadRaw = take("thread", /--thread[ \t]+(\S+)/);
|
|
743
|
+
const subjectRaw = take("subject", /--subject[ \t]+(\S+)/);
|
|
744
|
+
const unknown = rest.match(/--[A-Za-z][\w-]*/);
|
|
745
|
+
if (unknown !== null) {
|
|
746
|
+
return { ok: false, error: `未知参数「${unknown[0]}」。${TELL_USAGE}` };
|
|
747
|
+
}
|
|
748
|
+
// 目标 = 第一个词;正文 = 余下**原样**(内部空白不丢)。
|
|
749
|
+
const split = /^(\S+)\s*([\s\S]*)$/.exec(rest.trim());
|
|
750
|
+
const target = split?.[1];
|
|
751
|
+
const body = (split?.[2] ?? "").trim();
|
|
752
|
+
if (target === undefined) {
|
|
753
|
+
return { ok: false, error: `缺少目标对端。${TELL_USAGE}` };
|
|
754
|
+
}
|
|
755
|
+
if (body === "") {
|
|
756
|
+
return { ok: false, error: `缺少指令内容。${TELL_USAGE}` };
|
|
757
|
+
}
|
|
758
|
+
let kind = "ask";
|
|
759
|
+
if (kindRaw !== null) {
|
|
760
|
+
if (!TELL_KINDS.includes(kindRaw)) {
|
|
761
|
+
return { ok: false, error: `--kind 非法「${kindRaw}」(允许 ${TELL_KINDS.join("|")})。${TELL_USAGE}` };
|
|
762
|
+
}
|
|
763
|
+
kind = kindRaw;
|
|
764
|
+
}
|
|
765
|
+
const command = { target, body, kind };
|
|
766
|
+
if (typeof threadRaw === "string" && threadRaw !== "")
|
|
767
|
+
command.threadId = threadRaw;
|
|
768
|
+
if (typeof subjectRaw === "string" && subjectRaw !== "")
|
|
769
|
+
command.subject = subjectRaw;
|
|
770
|
+
return { ok: true, command };
|
|
771
|
+
}
|
|
772
|
+
/**
|
|
773
|
+
* 解析目标对端(名字 / agentId / 前缀)。
|
|
774
|
+
*
|
|
775
|
+
* 口径(**比注册表的 `resolve()` 更保守**,理由见函数注释):
|
|
776
|
+
* - 完整 agentId 逐字命中 → 直接用它(无歧义);
|
|
777
|
+
* - 名字命中 1 个 → 用它;命中多个 → **拒绝 + 列出候选**(不替人挑一个);
|
|
778
|
+
* - 前缀命中 1 个 → 用它;命中多个 → **拒绝 + 列出候选**;
|
|
779
|
+
* - 一个都没命中 → **拒绝**(明确说找不到;**不**静默丢一封信到不存在的邮箱)。
|
|
780
|
+
*
|
|
781
|
+
* 为什么比 `Registry.resolve()` 更保守:注册表的口径是「在线优先」(同名里恰好一个在线就选它),
|
|
782
|
+
* 对**人**下指令来说「我 tell bob,结果发给了另一个 bob」是事故 → 人侧一律拒绝并列出候选。
|
|
783
|
+
* (模型侧 `message_agent` 仍走注册表原口径 —— 全局口径由 PEERLIFE2 裁决,不在本卡改动。)
|
|
784
|
+
*/
|
|
785
|
+
export function resolveTellTarget(entries, target) {
|
|
786
|
+
const exact = entries.filter((e) => e.agentId === target);
|
|
787
|
+
if (exact.length === 1)
|
|
788
|
+
return { ok: true, agentId: exact[0].agentId };
|
|
789
|
+
const byName = entries.filter((e) => e.name === target);
|
|
790
|
+
if (byName.length === 1)
|
|
791
|
+
return { ok: true, agentId: byName[0].agentId };
|
|
792
|
+
if (byName.length > 1) {
|
|
793
|
+
return {
|
|
794
|
+
ok: false,
|
|
795
|
+
error: `目标「${target}」存在同名歧义(匹配到 ${byName.length} 个 agent),无法确定发给谁:${formatTellCandidates(byName)}(请用完整 agentId 指定)`,
|
|
796
|
+
candidates: byName,
|
|
797
|
+
};
|
|
798
|
+
}
|
|
799
|
+
const byPrefix = entries.filter((e) => e.agentId.startsWith(target) || e.name.startsWith(target));
|
|
800
|
+
if (byPrefix.length === 1)
|
|
801
|
+
return { ok: true, agentId: byPrefix[0].agentId };
|
|
802
|
+
if (byPrefix.length > 1) {
|
|
803
|
+
return {
|
|
804
|
+
ok: false,
|
|
805
|
+
error: `目标「${target}」存在前缀歧义(匹配到 ${byPrefix.length} 个 agent),无法确定发给谁:${formatTellCandidates(byPrefix)}(请用完整 agentId 指定)`,
|
|
806
|
+
candidates: byPrefix,
|
|
807
|
+
};
|
|
808
|
+
}
|
|
809
|
+
const known = entries.map((e) => e.name || e.agentId);
|
|
810
|
+
return {
|
|
811
|
+
ok: false,
|
|
812
|
+
error: `找不到目标对端「${target}」(当前已知 ${entries.length} 个:${known.join(", ") || "无"})`,
|
|
813
|
+
candidates: [],
|
|
814
|
+
};
|
|
815
|
+
}
|
|
816
|
+
/** 候选清单的可读写法:`agentId(名字·状态)`。 */
|
|
817
|
+
export function formatTellCandidates(candidates) {
|
|
818
|
+
return candidates.map((c) => `${c.agentId}(${c.name}·${c.status})`).join(", ");
|
|
819
|
+
}
|
|
820
|
+
/**
|
|
821
|
+
* 构造人侧发指令的信封。
|
|
822
|
+
*
|
|
823
|
+
* 关键点:
|
|
824
|
+
* - `from` = 本会话 agentId → 收信侧的 strict 校验(注册表逐字命中 + 主机一致)**照旧通过**
|
|
825
|
+
* (人类发起**不豁免**任何校验);
|
|
826
|
+
* - `customType` = `proactive:human` → 收信侧**能识别**这条是人类直接下达的
|
|
827
|
+
* (是否给特权由收信侧的受信集合决定,见 `humanOriginLabel`);
|
|
828
|
+
* - `kind:"ask"` 必须带 `correlationId` → 回信能配回这条提问(否则人等不到答案)。
|
|
829
|
+
*/
|
|
830
|
+
export function buildTellEnvelope(input) {
|
|
831
|
+
const correlationId = input.kind === "ask" ? (input.correlationId ?? `ask-${randomUUID()}`) : input.correlationId;
|
|
832
|
+
return createEnvelope({
|
|
833
|
+
from: input.from,
|
|
834
|
+
to: input.to,
|
|
835
|
+
kind: input.kind,
|
|
836
|
+
intent: input.intent ?? "wake",
|
|
837
|
+
body: input.body,
|
|
838
|
+
subject: input.subject,
|
|
839
|
+
threadId: input.threadId ?? `human-${randomUUID()}`,
|
|
840
|
+
correlationId,
|
|
841
|
+
customType: HUMAN_ORIGIN_CUSTOM_TYPE,
|
|
842
|
+
...(input.now === undefined ? {} : { createdAt: input.now }),
|
|
843
|
+
});
|
|
844
|
+
}
|
|
845
|
+
/** 受信「人类发起方」集合的环境变量名(逗号分隔的 agentId)。 */
|
|
846
|
+
export const TRUSTED_HUMAN_SENDERS_ENV = "PI_PROACTIVE_TRUSTED_HUMAN_SENDERS";
|
|
847
|
+
/** 读受信「人类发起方」集合(缺省 = 空集 = **谁都不受信**)。 */
|
|
848
|
+
export function resolveTrustedHumanSenders(env = process.env) {
|
|
849
|
+
const raw = env[TRUSTED_HUMAN_SENDERS_ENV];
|
|
850
|
+
if (typeof raw !== "string" || raw.trim() === "")
|
|
851
|
+
return [];
|
|
852
|
+
return raw
|
|
853
|
+
.split(",")
|
|
854
|
+
.map((s) => s.trim())
|
|
855
|
+
.filter((s) => s !== "");
|
|
856
|
+
}
|
|
857
|
+
/** 发送方是否在受信「人类发起方」集合里。 */
|
|
858
|
+
export function isTrustedHumanSender(agentId, trusted) {
|
|
859
|
+
return trusted.includes(agentId);
|
|
860
|
+
}
|
|
861
|
+
/** 已验证的人类指令标记(收信侧注入给模型看)。 */
|
|
862
|
+
export const HUMAN_ORIGIN_VERIFIED_MARK = "【人类指令(已验证)】";
|
|
863
|
+
/** 未受信的人类指令声称标记(**如实标注**,不给特权)。 */
|
|
864
|
+
export const HUMAN_ORIGIN_UNVERIFIED_MARK = "【对端声称是人类指令(未受信)】";
|
|
865
|
+
/**
|
|
866
|
+
* 收信侧判定这条信封是不是「人类发起」,以及**能不能信**。
|
|
867
|
+
*
|
|
868
|
+
* - 不是人类发起(没有 `proactive:human` 标记)→ `undefined`(不标任何东西);
|
|
869
|
+
* - 是人类发起且发送方在受信集合里 → 已验证标记;
|
|
870
|
+
* - 是人类发起但发送方**不在**受信集合 → 未受信标记(如实说「对端声称」)。
|
|
871
|
+
*
|
|
872
|
+
* **为什么不把「带标记」直接当成人类**:任何 peer 都能在信封里写这个标记 →
|
|
873
|
+
* 把「带标记」直接当人类 = 任何对端都能冒充人类下指令。受信集合是**部署关注点**
|
|
874
|
+
* (与 §8.4「来源校验是部署关注点」同型):收信侧自己决定信谁。
|
|
875
|
+
*/
|
|
876
|
+
export function humanOriginLabel(envelope, trusted) {
|
|
877
|
+
if (envelope.customType !== HUMAN_ORIGIN_CUSTOM_TYPE)
|
|
878
|
+
return undefined;
|
|
879
|
+
return isTrustedHumanSender(envelope.from, trusted)
|
|
880
|
+
? HUMAN_ORIGIN_VERIFIED_MARK
|
|
881
|
+
: HUMAN_ORIGIN_UNVERIFIED_MARK;
|
|
882
|
+
}
|
|
883
|
+
export function formatPeerDirectory(dir) {
|
|
884
|
+
const lines = [];
|
|
885
|
+
const online = dir.peers.filter((p) => p.status !== "offline").length;
|
|
886
|
+
const offline = dir.peers.length - online;
|
|
887
|
+
if (dir.peers.length === 0) {
|
|
888
|
+
lines.push("没有匹配的对端。");
|
|
889
|
+
}
|
|
890
|
+
else {
|
|
891
|
+
lines.push(`对端(${dir.peers.length} 个:在线 ${online} · 离线 ${offline}):`);
|
|
892
|
+
for (const p of dir.peers) {
|
|
893
|
+
const parts = [
|
|
894
|
+
`${p.name || p.agentId}`,
|
|
895
|
+
`(${p.agentId})`,
|
|
896
|
+
p.status === "idle" ? "空闲" : p.status === "busy" ? "忙碌" : "离线",
|
|
897
|
+
`心跳 ${Math.round(p.heartbeatAgeMs / 1000)}s 前`,
|
|
898
|
+
`能力 ${p.capabilities.length > 0 ? p.capabilities.join(",") : "—"}`,
|
|
899
|
+
`在途 ${p.inFlight}`,
|
|
900
|
+
`传输 ${p.transport}`,
|
|
901
|
+
];
|
|
902
|
+
// 墓碑:离线条目带下线时间与原因(在线条目不带 → 字段集按状态裁剪,渲染口径统一)。
|
|
903
|
+
if (p.status === "offline") {
|
|
904
|
+
parts.push(`下线 ${p.offlineAt === undefined ? "时间未知" : new Date(p.offlineAt).toISOString()}`);
|
|
905
|
+
parts.push(`下线原因 ${p.offlineReason ?? "未记录"}`);
|
|
906
|
+
}
|
|
907
|
+
lines.push(`- ${parts.join(" · ")}`);
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
if (dir.ambiguous !== null) {
|
|
911
|
+
lines.push(`注意:同名歧义(${dir.ambiguous.join(", ")})—— message_agent 按这个名字发送也会因歧义被拒;请用完整 agentId 指定其中一个。`);
|
|
912
|
+
}
|
|
913
|
+
return lines.join("\n");
|
|
914
|
+
}
|
|
915
|
+
/**
|
|
916
|
+
* peer 生命周期状态机(**纯逻辑、无 IO**):跟踪每个对端处在哪个状态、何时进入、
|
|
917
|
+
* 以及**死亡**判定(心跳过期 = 崩溃)。
|
|
918
|
+
*
|
|
919
|
+
* 死亡判定的口径与注册表**逐字一致**(`registry.isExpired()`)→ 不造第二套「在不在」判定。
|
|
920
|
+
*/
|
|
921
|
+
export class PeerLifecycle {
|
|
922
|
+
nowFn;
|
|
923
|
+
entries = new Map();
|
|
924
|
+
constructor(opts = {}) {
|
|
925
|
+
this.nowFn = opts.now ?? (() => Date.now());
|
|
926
|
+
}
|
|
927
|
+
/** 某对端的状态;**未被跟踪** → `undefined`(不臆造)。 */
|
|
928
|
+
state(agentId) {
|
|
929
|
+
return this.entries.get(agentId)?.state;
|
|
930
|
+
}
|
|
931
|
+
/** 某对端的生命周期条目(副本)。 */
|
|
932
|
+
entry(agentId) {
|
|
933
|
+
const e = this.entries.get(agentId);
|
|
934
|
+
return e === undefined ? undefined : { ...e };
|
|
935
|
+
}
|
|
936
|
+
/** 全部被跟踪的对端(副本)。 */
|
|
937
|
+
list() {
|
|
938
|
+
return [...this.entries.values()].map((e) => ({ ...e }));
|
|
939
|
+
}
|
|
940
|
+
/**
|
|
941
|
+
* 推进状态(并记录进入时刻)。
|
|
942
|
+
*
|
|
943
|
+
* `dead` 是**终态**:已经死了的对端不会被推回别的状态(墓碑不被覆盖)。
|
|
944
|
+
*/
|
|
945
|
+
transition(agentId, to, reason) {
|
|
946
|
+
const prev = this.entries.get(agentId);
|
|
947
|
+
if (prev !== undefined && prev.state === "dead")
|
|
948
|
+
return { ...prev };
|
|
949
|
+
const at = this.nowFn();
|
|
950
|
+
const entry = { agentId, state: to, since: at };
|
|
951
|
+
if (to === "dead") {
|
|
952
|
+
entry.offlineAt = at;
|
|
953
|
+
entry.offlineReason = reason ?? "未记录原因";
|
|
954
|
+
}
|
|
955
|
+
this.entries.set(agentId, entry);
|
|
956
|
+
return entry;
|
|
957
|
+
}
|
|
958
|
+
/**
|
|
959
|
+
* **死亡检测**:对端心跳过期(= 崩溃,没走到 `unregister()`)→ 状态置 `dead` + 记墓碑。
|
|
960
|
+
*
|
|
961
|
+
* 只读注册表(**不写**)——写墓碑由调用方做(`registry.markDead()`),
|
|
962
|
+
* 这样本模块保持「纯逻辑、无 IO」。
|
|
963
|
+
*
|
|
964
|
+
* @param candidates 要检查的对端 id(缺省 = 被本状态机跟踪的全部对端)。
|
|
965
|
+
* @returns 本轮**新**死掉的对端(已死的不重复报)。
|
|
966
|
+
*/
|
|
967
|
+
detectDead(registry, candidates) {
|
|
968
|
+
const now = this.nowFn();
|
|
969
|
+
const dead = [];
|
|
970
|
+
const ids = candidates ?? [...this.entries.keys()];
|
|
971
|
+
for (const agentId of ids) {
|
|
972
|
+
const tracked = this.entries.get(agentId);
|
|
973
|
+
if (tracked !== undefined && tracked.state === "dead")
|
|
974
|
+
continue;
|
|
975
|
+
const info = registry.findByAgentId(agentId);
|
|
976
|
+
if (info === null || info === undefined) {
|
|
977
|
+
dead.push(this.transition(agentId, "dead", "注册表条目已消失"));
|
|
978
|
+
continue;
|
|
979
|
+
}
|
|
980
|
+
if (registry.isExpired(info, now)) {
|
|
981
|
+
dead.push(this.transition(agentId, "dead", "心跳过期(可能崩溃)"));
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
return dead;
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
/**
|
|
988
|
+
* **drain**:为每一条「我欠答的 ask」生成一条「我下线了」的回信(**纯逻辑,不做 IO**)。
|
|
989
|
+
*
|
|
990
|
+
* 语义:优雅退出前,把在途 ask **逐条**回执 —— 正文带 `PEER_OFFLINE_MARKER` →
|
|
991
|
+
* 提问方据此记 `unreachable`(对方下线 ≠ 得到答案)。
|
|
992
|
+
*
|
|
993
|
+
* 投递由调用方做(扩展层有 socket / 邮箱两条通道)。
|
|
994
|
+
*/
|
|
995
|
+
export function buildDrainReplies(pending, agentId, now) {
|
|
996
|
+
return pending.map((p) => buildReply({
|
|
997
|
+
pending: p,
|
|
998
|
+
body: `${PEER_OFFLINE_MARKER}我下线了(会话结束,未能作答)`,
|
|
999
|
+
agentId,
|
|
1000
|
+
...(now === undefined ? {} : { now }),
|
|
1001
|
+
}));
|
|
1002
|
+
}
|