pi-proactive 0.0.0-stage → 0.2.0-beta.3
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 +148 -0
- package/LICENSE +54 -0
- package/README.md +709 -2
- package/build/cli.mjs +121 -0
- package/build/extensions/proactive.js +2508 -0
- package/build/src/activity.js +130 -0
- package/build/src/commands.js +572 -0
- package/build/src/config.js +990 -0
- package/build/src/content.js +198 -0
- package/build/src/daemon-config.js +709 -0
- package/build/src/daemon-contact.js +103 -0
- package/build/src/daemon-host.js +84 -0
- package/build/src/daemon.js +892 -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 +818 -0
- package/build/src/idle.js +388 -0
- package/build/src/lineage.js +465 -0
- package/build/src/mailbox.js +984 -0
- package/build/src/notify.js +183 -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/progress-eta.js +134 -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 +501 -0
- package/build/src/trust-loop.js +321 -0
- package/build/src/trust-metrics.js +236 -0
- package/build/src/trust-notify.js +73 -0
- package/build/src/trust-policy.js +58 -0
- package/build/src/trust-registry.js +323 -0
- package/build/src/types.js +1 -0
- package/daemon/launchd.plist +48 -0
- package/daemon/pi-proactive-daemon.service +29 -0
- package/daemon/run-daemon.sh +84 -0
- package/node_modules/typebox/build/compile/code.d.mts +12 -0
- package/node_modules/typebox/build/compile/code.mjs +65 -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 +91 -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 +6 -0
- package/node_modules/typebox/build/format/date_time.mjs +11 -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 +5 -0
- package/node_modules/typebox/build/format/idn_email.mjs +8 -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 +35 -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 +71 -0
- package/node_modules/typebox/build/guard/guard.mjs +221 -0
- package/node_modules/typebox/build/guard/index.d.mts +6 -0
- package/node_modules/typebox/build/guard/index.mjs +6 -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/string.d.mts +6 -0
- package/node_modules/typebox/build/guard/string.mjs +168 -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 +30 -0
- package/node_modules/typebox/build/schema/engine/_context.mjs +124 -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/_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 +29 -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 +22 -0
- package/node_modules/typebox/build/schema/engine/_stack.mjs +209 -0
- package/node_modules/typebox/build/schema/engine/_unique.d.mts +2 -0
- package/node_modules/typebox/build/schema/engine/_unique.mjs +5 -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 +9 -0
- package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +123 -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 +52 -0
- package/node_modules/typebox/build/schema/engine/boolean.d.mts +5 -0
- package/node_modules/typebox/build/schema/engine/boolean.mjs +25 -0
- package/node_modules/typebox/build/schema/engine/const.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/const.mjs +30 -0
- package/node_modules/typebox/build/schema/engine/contains.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/contains.mjs +54 -0
- package/node_modules/typebox/build/schema/engine/dependencies.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/dependencies.mjs +45 -0
- package/node_modules/typebox/build/schema/engine/dependentRequired.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/dependentRequired.mjs +40 -0
- package/node_modules/typebox/build/schema/engine/dependentSchemas.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/dependentSchemas.mjs +38 -0
- package/node_modules/typebox/build/schema/engine/dynamicRef.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/dynamicRef.mjs +25 -0
- package/node_modules/typebox/build/schema/engine/enum.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/enum.mjs +33 -0
- package/node_modules/typebox/build/schema/engine/exclusiveMaximum.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/exclusiveMaximum.mjs +25 -0
- package/node_modules/typebox/build/schema/engine/exclusiveMinimum.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/exclusiveMinimum.mjs +25 -0
- package/node_modules/typebox/build/schema/engine/format.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/format.mjs +26 -0
- package/node_modules/typebox/build/schema/engine/if.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/if.mjs +47 -0
- package/node_modules/typebox/build/schema/engine/index.d.mts +48 -0
- package/node_modules/typebox/build/schema/engine/index.mjs +54 -0
- package/node_modules/typebox/build/schema/engine/items.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/items.mjs +88 -0
- package/node_modules/typebox/build/schema/engine/maxContains.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/maxContains.mjs +42 -0
- package/node_modules/typebox/build/schema/engine/maxItems.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/maxItems.mjs +25 -0
- package/node_modules/typebox/build/schema/engine/maxLength.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/maxLength.mjs +25 -0
- package/node_modules/typebox/build/schema/engine/maxProperties.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/maxProperties.mjs +25 -0
- package/node_modules/typebox/build/schema/engine/maximum.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/maximum.mjs +25 -0
- package/node_modules/typebox/build/schema/engine/minContains.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/minContains.mjs +51 -0
- package/node_modules/typebox/build/schema/engine/minItems.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/minItems.mjs +25 -0
- package/node_modules/typebox/build/schema/engine/minLength.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/minLength.mjs +25 -0
- package/node_modules/typebox/build/schema/engine/minProperties.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/minProperties.mjs +25 -0
- package/node_modules/typebox/build/schema/engine/minimum.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/minimum.mjs +25 -0
- package/node_modules/typebox/build/schema/engine/multipleOf.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/multipleOf.mjs +25 -0
- package/node_modules/typebox/build/schema/engine/not.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/not.mjs +39 -0
- package/node_modules/typebox/build/schema/engine/oneOf.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/oneOf.mjs +59 -0
- package/node_modules/typebox/build/schema/engine/pattern.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/pattern.mjs +29 -0
- package/node_modules/typebox/build/schema/engine/patternProperties.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/patternProperties.mjs +45 -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 +75 -0
- package/node_modules/typebox/build/schema/engine/propertyNames.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/propertyNames.mjs +37 -0
- package/node_modules/typebox/build/schema/engine/recursiveRef.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/recursiveRef.mjs +25 -0
- package/node_modules/typebox/build/schema/engine/ref.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/ref.mjs +52 -0
- package/node_modules/typebox/build/schema/engine/required.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/required.mjs +32 -0
- package/node_modules/typebox/build/schema/engine/schema.d.mts +9 -0
- package/node_modules/typebox/build/schema/engine/schema.mjs +362 -0
- package/node_modules/typebox/build/schema/engine/type.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/type.mjs +70 -0
- package/node_modules/typebox/build/schema/engine/unevaluatedItems.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/unevaluatedItems.mjs +51 -0
- package/node_modules/typebox/build/schema/engine/unevaluatedProperties.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/unevaluatedProperties.mjs +51 -0
- package/node_modules/typebox/build/schema/engine/uniqueItems.d.mts +6 -0
- package/node_modules/typebox/build/schema/engine/uniqueItems.mjs +51 -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 +14 -0
- package/node_modules/typebox/build/schema/intern/intern.mjs +259 -0
- package/node_modules/typebox/build/schema/parse.d.mts +14 -0
- package/node_modules/typebox/build/schema/parse.mjs +32 -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 +10 -0
- package/node_modules/typebox/build/schema/pointer/pointer.mjs +106 -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 +35 -0
- package/node_modules/typebox/build/schema/resolve/resolve.mjs +327 -0
- package/node_modules/typebox/build/schema/schema.d.mts +11 -0
- package/node_modules/typebox/build/schema/schema.mjs +11 -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 +232 -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 +39 -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 +14 -0
- package/node_modules/typebox/build/system/memory/assign.mjs +12 -0
- package/node_modules/typebox/build/system/memory/clone.d.mts +5 -0
- package/node_modules/typebox/build/system/memory/clone.mjs +113 -0
- package/node_modules/typebox/build/system/memory/create.d.mts +8 -0
- package/node_modules/typebox/build/system/memory/create.mjs +29 -0
- package/node_modules/typebox/build/system/memory/discard.d.mts +4 -0
- package/node_modules/typebox/build/system/memory/discard.mjs +18 -0
- package/node_modules/typebox/build/system/memory/freeze.d.mts +4 -0
- package/node_modules/typebox/build/system/memory/freeze.mjs +6 -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/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 +7 -0
- package/node_modules/typebox/build/system/memory/update.mjs +33 -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/settings.d.mts +80 -0
- package/node_modules/typebox/build/system/settings/settings.mjs +36 -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/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 +37 -0
- package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +60 -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 +8 -0
- package/node_modules/typebox/build/type/engine/evaluate/index.mjs +8 -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 +20 -0
- package/node_modules/typebox/build/type/engine/evaluate/narrow.mjs +31 -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 +10 -0
- package/node_modules/typebox/build/type/engine/immutable/instantiate_add.mjs +14 -0
- package/node_modules/typebox/build/type/engine/immutable/instantiate_remove.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/immutable/instantiate_remove.mjs +14 -0
- package/node_modules/typebox/build/type/engine/index.d.mts +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 +10 -0
- package/node_modules/typebox/build/type/engine/optional/instantiate_add.mjs +14 -0
- package/node_modules/typebox/build/type/engine/optional/instantiate_remove.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/optional/instantiate_remove.mjs +14 -0
- package/node_modules/typebox/build/type/engine/parameters/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 +10 -0
- package/node_modules/typebox/build/type/engine/readonly/instantiate_add.mjs +14 -0
- package/node_modules/typebox/build/type/engine/readonly/instantiate_remove.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/readonly/instantiate_remove.mjs +14 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_array.d.mts +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/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 +62 -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 +22 -0
- package/node_modules/typebox/build/type/extends/tuple.mjs +61 -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 +5 -0
- package/node_modules/typebox/build/value/clone/clone.mjs +12 -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 +47 -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_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 +72 -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 +371 -0
- package/package.json +59 -4
- package/skills/pi-proactive/SKILL.md +185 -0
- package/tools/cli.mjs +121 -0
- package/tools/daemon-install.sh +397 -0
- package/tools/daemon-uninstall.sh +226 -0
|
@@ -0,0 +1,990 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import os from "node:os";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { ContentStore } from "./content.js";
|
|
5
|
+
/**
|
|
6
|
+
* **跨模块共享的落盘原语**(目录/文件权限 + 原子写 + 版本判定)。
|
|
7
|
+
*
|
|
8
|
+
* 为什么放在本文件:`proactiveDir()` / `resolveAgentDir()` 已是所有持久化面的共同依赖,
|
|
9
|
+
* 落盘原语与它们同源 → 避免「每个面各写一套」(同一不变量在 6 处漂移的根因)。
|
|
10
|
+
*/
|
|
11
|
+
/** 落盘**目录**权限(0700)——规范 P0(docs/a2a-protocol.md §8.3)。 */
|
|
12
|
+
export const PROACTIVE_DIR_MODE = 0o700;
|
|
13
|
+
/** 落盘**文件**权限(0600)——规范 P0。 */
|
|
14
|
+
export const PROACTIVE_FILE_MODE = 0o600;
|
|
15
|
+
/**
|
|
16
|
+
* 落盘格式版本号。
|
|
17
|
+
*
|
|
18
|
+
* 命名与 `task-store` 的记录级 `version:"v1"` 约定一致(同一个 `v<major>` 记法)。
|
|
19
|
+
* **兼容规则**:文件**没有** version 字段 = 旧格式 = 按 `v1` 读(升级不丢数据)。
|
|
20
|
+
*/
|
|
21
|
+
export const ON_DISK_VERSION = "v1";
|
|
22
|
+
/**
|
|
23
|
+
* 版本是否可识别:缺省(无 version 字段)视为 `v1`;其它值 = **不认识**。
|
|
24
|
+
*
|
|
25
|
+
* 读方遇到不认识的版本必须**拒绝按已知格式解析**(规范 V3),且不得覆盖原文件。
|
|
26
|
+
*/
|
|
27
|
+
export function isKnownOnDiskVersion(value) {
|
|
28
|
+
return value === undefined || value === ON_DISK_VERSION;
|
|
29
|
+
}
|
|
30
|
+
/** 取落盘对象的 `version` 字段(非对象 / 无该字段 → undefined = 「无版本」= v1)。 */
|
|
31
|
+
export function onDiskVersionOf(value) {
|
|
32
|
+
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
33
|
+
return undefined;
|
|
34
|
+
return value.version;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* 确保目录存在且权限为 **0700**。
|
|
38
|
+
*
|
|
39
|
+
* 必须**显式 chmod**:`mkdirSync` 的 mode 会被 umask 削弱,且**已存在的目录**根本不会改权限
|
|
40
|
+
* → 只传 mode 不够(规范 P0 要求「实际权限」收紧)。
|
|
41
|
+
*/
|
|
42
|
+
export function ensureDir(dir) {
|
|
43
|
+
const existed = fs.existsSync(dir);
|
|
44
|
+
// 不用 mkdir 的 mode 选项(会被 umask 削弱,且**已存在的目录**不会改权限)→
|
|
45
|
+
// 紧接着显式 chmod 到目标权限(见下)。
|
|
46
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
47
|
+
if (!existed) {
|
|
48
|
+
// 新建目录:umask 可能削弱 owner 位 → 显式 chmod 到 0700。
|
|
49
|
+
chmodQuiet(dir, PROACTIVE_DIR_MODE);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
// **已存在**的目录:只**收紧 group/other**(不动 owner 位)。
|
|
53
|
+
// 为什么不动 owner 位:用户刻意设置的只读目录(如 0555)是「显式意图」,
|
|
54
|
+
// 把它加成 0700 等于替用户放开写权限 —— 落盘失败要如实报错,而不是被我们悄悄绕过。
|
|
55
|
+
try {
|
|
56
|
+
const perm = fs.statSync(dir).mode & 0o777;
|
|
57
|
+
if ((perm & 0o077) !== 0)
|
|
58
|
+
chmodQuiet(dir, perm & ~0o077);
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
// 读不到 mode 就放弃收紧(目录可能不属于当前用户)
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* chmod(**失败即抛**):用于「权限收紧失败不得静默放行」的硬边界(socket 端点)。
|
|
66
|
+
*
|
|
67
|
+
* 与 {@link chmodQuiet} 的区别:quiet 失败只忽略(尽力而为),strict 失败抛错
|
|
68
|
+
* → 调用方必须**拒绝继续**(例如:端点收紧失败 ⇒ 不开 socket 通道)。
|
|
69
|
+
*/
|
|
70
|
+
export function chmodStrict(file, perm) {
|
|
71
|
+
fs.chmodSync(file, perm);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* 路径包含性校验:把 `segments` 拼到 `base` 下,并**确认结果仍在 `base` 之内**。
|
|
75
|
+
*
|
|
76
|
+
* 为什么需要:目录名由外部可控的 `agentId` / 信封 id 派生(`agentSegment()` 只把
|
|
77
|
+
* `/ \\ 空白` 换成 `_`,**点号不动**)→ `agentId = ".."` 会让 `path.join()` 逃出一层目录。
|
|
78
|
+
* 这是**接收侧**的最后一道防线(写端 `outbox.ts` 的拼接本卡未改,见威胁模型残余风险)。
|
|
79
|
+
*
|
|
80
|
+
* 逃逸 → 抛错(**不得**静默继续:静默 = 把越界写当成正常路径)。
|
|
81
|
+
*/
|
|
82
|
+
export function containedPath(base, ...segments) {
|
|
83
|
+
const root = path.resolve(base);
|
|
84
|
+
const target = path.resolve(root, ...segments);
|
|
85
|
+
if (target !== root && !target.startsWith(root + path.sep)) {
|
|
86
|
+
throw new Error(`路径越界(必须位于 ${root} 之内):${segments.join("/")}`);
|
|
87
|
+
}
|
|
88
|
+
return target;
|
|
89
|
+
}
|
|
90
|
+
export function hardenProactivePermissions(agentDir) {
|
|
91
|
+
const report = { dirs: 0, files: 0, failures: [] };
|
|
92
|
+
const root = proactiveDir(agentDir);
|
|
93
|
+
const walk = (dir, depth) => {
|
|
94
|
+
if (depth > 8)
|
|
95
|
+
return;
|
|
96
|
+
let entries;
|
|
97
|
+
try {
|
|
98
|
+
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
99
|
+
}
|
|
100
|
+
catch {
|
|
101
|
+
return; // 目录不存在 → 无事可做
|
|
102
|
+
}
|
|
103
|
+
for (const entry of entries) {
|
|
104
|
+
const full = path.join(dir, entry.name);
|
|
105
|
+
if (entry.isSymbolicLink())
|
|
106
|
+
continue; // 不跟随符号链接
|
|
107
|
+
if (entry.isDirectory()) {
|
|
108
|
+
try {
|
|
109
|
+
fs.chmodSync(full, PROACTIVE_DIR_MODE);
|
|
110
|
+
report.dirs += 1;
|
|
111
|
+
}
|
|
112
|
+
catch (e) {
|
|
113
|
+
const error = e instanceof Error ? e.message : String(e);
|
|
114
|
+
report.failures.push({ path: full, error });
|
|
115
|
+
console.error(`[proactive] 目录权限收紧失败(0700):${full}:${error}`);
|
|
116
|
+
}
|
|
117
|
+
walk(full, depth + 1);
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
if (!entry.isFile())
|
|
121
|
+
continue;
|
|
122
|
+
try {
|
|
123
|
+
fs.chmodSync(full, PROACTIVE_FILE_MODE);
|
|
124
|
+
report.files += 1;
|
|
125
|
+
}
|
|
126
|
+
catch (e) {
|
|
127
|
+
const error = e instanceof Error ? e.message : String(e);
|
|
128
|
+
report.failures.push({ path: full, error });
|
|
129
|
+
console.error(`[proactive] 文件权限收紧失败(0600):${full}:${error}`);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
// 根目录自身也要收紧(`proactive/` 可能早于本次实现就已存在)。
|
|
134
|
+
try {
|
|
135
|
+
if (fs.existsSync(root)) {
|
|
136
|
+
fs.chmodSync(root, PROACTIVE_DIR_MODE);
|
|
137
|
+
report.dirs += 1;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
catch (e) {
|
|
141
|
+
const error = e instanceof Error ? e.message : String(e);
|
|
142
|
+
report.failures.push({ path: root, error });
|
|
143
|
+
console.error(`[proactive] 目录权限收紧失败(0700):${root}:${error}`);
|
|
144
|
+
}
|
|
145
|
+
walk(root, 0);
|
|
146
|
+
return report;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* 原子写(tmp + rename):**tmp 路径对并发写者独占**,文件权限 0600,可选 fsync。
|
|
150
|
+
*
|
|
151
|
+
* - **tmp 独占**(偏差 P-D6 / 规范 I2):先用 `O_EXCL` 抢占 `<file>.tmp`;抢不到(EEXIST,
|
|
152
|
+
* 说明另一个写者正在用)→ 退到唯一名 `<file>.tmp-<pid>-<ts36>-<rand>`。
|
|
153
|
+
* ⇒ 同一时刻**没有任何两个写者写同一个 tmp**,rename 发布的永远是**自己**写的内容。
|
|
154
|
+
* - **同目录**:tmp 与目标同目录 → `rename(2)` 原子(跨文件系统会失败)。
|
|
155
|
+
* - **0600**:建文件时带 mode,并**显式 chmod**(umask 只会削弱、既有文件不会改)。
|
|
156
|
+
* - **durable**:写完后 `fsync(文件)` → `rename` → `fsync(父目录)`(规范 I3,掉电持久性)。
|
|
157
|
+
*/
|
|
158
|
+
export function writeAtomicFile(file, content, opts) {
|
|
159
|
+
const dir = path.dirname(file);
|
|
160
|
+
ensureDir(dir);
|
|
161
|
+
const tmp = openExclusiveTemp(file);
|
|
162
|
+
try {
|
|
163
|
+
try {
|
|
164
|
+
fs.writeFileSync(tmp.fd, content, "utf8");
|
|
165
|
+
if (opts?.durable)
|
|
166
|
+
fs.fsyncSync(tmp.fd);
|
|
167
|
+
}
|
|
168
|
+
finally {
|
|
169
|
+
fs.closeSync(tmp.fd);
|
|
170
|
+
}
|
|
171
|
+
chmodQuiet(tmp.path, PROACTIVE_FILE_MODE);
|
|
172
|
+
fs.renameSync(tmp.path, file);
|
|
173
|
+
if (opts?.durable)
|
|
174
|
+
fsyncDir(dir);
|
|
175
|
+
}
|
|
176
|
+
catch (e) {
|
|
177
|
+
try {
|
|
178
|
+
fs.unlinkSync(tmp.path);
|
|
179
|
+
}
|
|
180
|
+
catch {
|
|
181
|
+
// tmp 残留由 GC 兜底(偏差 P-D2 的回收责任方)
|
|
182
|
+
}
|
|
183
|
+
throw e;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* 抢占一个**独占**的临时文件(O_EXCL):`<file>.tmp` 抢不到 → 退到带 pid/时间戳/随机后缀的唯一名。
|
|
188
|
+
*
|
|
189
|
+
* 返回已打开的 fd(调用方负责关闭)。
|
|
190
|
+
*/
|
|
191
|
+
function openExclusiveTemp(file) {
|
|
192
|
+
const candidates = [`${file}.tmp`];
|
|
193
|
+
for (let i = 0; i < 8; i++) {
|
|
194
|
+
candidates.push(`${file}.tmp-${process.pid}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`);
|
|
195
|
+
}
|
|
196
|
+
for (const candidate of candidates) {
|
|
197
|
+
try {
|
|
198
|
+
const fd = fs.openSync(candidate, "wx", PROACTIVE_FILE_MODE);
|
|
199
|
+
return { path: candidate, fd };
|
|
200
|
+
}
|
|
201
|
+
catch (e) {
|
|
202
|
+
if (e.code !== "EEXIST")
|
|
203
|
+
throw e;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
throw new Error(`无法取得独占临时文件:${file}.tmp`);
|
|
207
|
+
}
|
|
208
|
+
/** chmod(失败不抛:权限收紧是「尽力而为」,不能因此让落盘失败)。 */
|
|
209
|
+
export function chmodQuiet(file, perm) {
|
|
210
|
+
try {
|
|
211
|
+
fs.chmodSync(file, perm);
|
|
212
|
+
}
|
|
213
|
+
catch {
|
|
214
|
+
// 忽略(文件可能已被删除,或不属于当前用户)
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
/** fsync 父目录(rename 的持久性:目录项本身落盘)。失败不阻断(平台差异)。 */
|
|
218
|
+
function fsyncDir(dir) {
|
|
219
|
+
try {
|
|
220
|
+
const fd = fs.openSync(dir, "r");
|
|
221
|
+
try {
|
|
222
|
+
fs.fsyncSync(fd);
|
|
223
|
+
}
|
|
224
|
+
finally {
|
|
225
|
+
fs.closeSync(fd);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
catch {
|
|
229
|
+
// 目录 fsync 不可用时:内容已 fsync,rename 的持久性退化为「尽力而为」
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
export function resolveAgentDir() {
|
|
233
|
+
return process.env.PI_CODING_AGENT_DIR || path.join(os.homedir(), ".pi", "agent");
|
|
234
|
+
}
|
|
235
|
+
export function proactiveDir(agentDir = resolveAgentDir()) {
|
|
236
|
+
return path.join(agentDir, "proactive");
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* 决策环的**缺省**配置(brief-v4 §1.2 / §7 第 1 步)。
|
|
240
|
+
*
|
|
241
|
+
* 缺省值的语义(与旧 `afterMs` 判定的等价性见 `src/idle.ts` 的 `evaluateIdle`):
|
|
242
|
+
* - `threshold = 1`:`score = value * urgency / interruptionCost >= 1`;
|
|
243
|
+
* - `observeRatio = 0.5`:分数落在 `[0.5, 1)` → 降级为「只观察」(记账但不打扰);
|
|
244
|
+
* - `repeatedInterruptionWeight = 0.5`:**近 1 小时打扰次数 >= 2** 时打断代价才开始变贵
|
|
245
|
+
* (第 1 次打扰不加价 → 常规场景与旧行为一致)。
|
|
246
|
+
*/
|
|
247
|
+
export const DEFAULT_DECISION_CONFIG = {
|
|
248
|
+
enabled: true,
|
|
249
|
+
threshold: 1,
|
|
250
|
+
observeRatio: 0.5,
|
|
251
|
+
repeatedInterruptionWeight: 0.5,
|
|
252
|
+
busyInterruptionWeight: 1,
|
|
253
|
+
quietInterruptionWeight: 1,
|
|
254
|
+
};
|
|
255
|
+
/**
|
|
256
|
+
* 取生效的决策环配置(配置缺项 → 缺省值)。
|
|
257
|
+
*
|
|
258
|
+
* 为什么单独一个函数:`ProactiveConfig.decision` 是**可选**的(旧配置文件 / 既有测试用例里没有这一节),
|
|
259
|
+
* 而决策环**必须**拿到完整的可调输入 → 缺省补齐只在这一处发生。
|
|
260
|
+
*/
|
|
261
|
+
export function resolveDecisionConfig(config) {
|
|
262
|
+
const d = config.decision ?? {};
|
|
263
|
+
const base = DEFAULT_DECISION_CONFIG;
|
|
264
|
+
return {
|
|
265
|
+
enabled: typeof d.enabled === "boolean" ? d.enabled : base.enabled,
|
|
266
|
+
threshold: num(d.threshold, base.threshold),
|
|
267
|
+
observeRatio: num(d.observeRatio, base.observeRatio),
|
|
268
|
+
repeatedInterruptionWeight: num(d.repeatedInterruptionWeight, base.repeatedInterruptionWeight),
|
|
269
|
+
busyInterruptionWeight: num(d.busyInterruptionWeight, base.busyInterruptionWeight),
|
|
270
|
+
quietInterruptionWeight: num(d.quietInterruptionWeight, base.quietInterruptionWeight),
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
export function defaultConfig() {
|
|
274
|
+
return {
|
|
275
|
+
enabled: true,
|
|
276
|
+
idleDetect: "off",
|
|
277
|
+
askTimeoutMs: 120000,
|
|
278
|
+
idleTrigger: {
|
|
279
|
+
enabled: false,
|
|
280
|
+
afterMs: 600000,
|
|
281
|
+
intent: "wake",
|
|
282
|
+
prompt: "",
|
|
283
|
+
},
|
|
284
|
+
limits: {
|
|
285
|
+
minGapMs: 300000,
|
|
286
|
+
maxPerHour: 6,
|
|
287
|
+
},
|
|
288
|
+
decision: { ...DEFAULT_DECISION_CONFIG },
|
|
289
|
+
peerWatch: {
|
|
290
|
+
enabled: false,
|
|
291
|
+
afterIdleMs: 600000,
|
|
292
|
+
},
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
function isPlainObject(v) {
|
|
296
|
+
return typeof v === "object" && v !== null && !Array.isArray(v);
|
|
297
|
+
}
|
|
298
|
+
function num(v, fallback) {
|
|
299
|
+
return typeof v === "number" && Number.isFinite(v) ? v : fallback;
|
|
300
|
+
}
|
|
301
|
+
function bool(v, fallback) {
|
|
302
|
+
return typeof v === "boolean" ? v : fallback;
|
|
303
|
+
}
|
|
304
|
+
function str(v, fallback) {
|
|
305
|
+
return typeof v === "string" ? v : fallback;
|
|
306
|
+
}
|
|
307
|
+
function oneOf(v, allowed, fallback) {
|
|
308
|
+
return typeof v === "string" && allowed.includes(v) ? v : fallback;
|
|
309
|
+
}
|
|
310
|
+
function mergeConfig(base, raw) {
|
|
311
|
+
if (!isPlainObject(raw))
|
|
312
|
+
return base;
|
|
313
|
+
const idleDetect = oneOf(raw.idleDetect, ["terminal", "input-only", "off"], base.idleDetect);
|
|
314
|
+
const it = isPlainObject(raw.idleTrigger) ? raw.idleTrigger : {};
|
|
315
|
+
const limits = isPlainObject(raw.limits) ? raw.limits : {};
|
|
316
|
+
const decision = isPlainObject(raw.decision) ? raw.decision : {};
|
|
317
|
+
const qh = limits.quietHours;
|
|
318
|
+
const pw = isPlainObject(raw.peerWatch) ? raw.peerWatch : {};
|
|
319
|
+
let quietHours = base.limits.quietHours;
|
|
320
|
+
if (isPlainObject(qh)) {
|
|
321
|
+
quietHours = { from: str(qh.from, base.limits.quietHours?.from ?? "22:00"), to: str(qh.to, base.limits.quietHours?.to ?? "08:00") };
|
|
322
|
+
}
|
|
323
|
+
else if (qh !== undefined) {
|
|
324
|
+
quietHours = undefined;
|
|
325
|
+
}
|
|
326
|
+
const merged = {
|
|
327
|
+
enabled: bool(raw.enabled, base.enabled),
|
|
328
|
+
idleDetect,
|
|
329
|
+
askTimeoutMs: num(raw.askTimeoutMs, base.askTimeoutMs),
|
|
330
|
+
idleTrigger: {
|
|
331
|
+
enabled: bool(it.enabled, base.idleTrigger.enabled),
|
|
332
|
+
afterMs: num(it.afterMs, base.idleTrigger.afterMs),
|
|
333
|
+
intent: oneOf(it.intent, ["wake", "interrupt", "queue", "notify"], base.idleTrigger.intent),
|
|
334
|
+
prompt: str(it.prompt, base.idleTrigger.prompt),
|
|
335
|
+
},
|
|
336
|
+
limits: {
|
|
337
|
+
minGapMs: num(limits.minGapMs, base.limits.minGapMs),
|
|
338
|
+
maxPerHour: num(limits.maxPerHour, base.limits.maxPerHour),
|
|
339
|
+
},
|
|
340
|
+
decision: {
|
|
341
|
+
enabled: bool(decision.enabled, base.decision?.enabled ?? DEFAULT_DECISION_CONFIG.enabled),
|
|
342
|
+
threshold: num(decision.threshold, base.decision?.threshold ?? DEFAULT_DECISION_CONFIG.threshold),
|
|
343
|
+
observeRatio: num(decision.observeRatio, base.decision?.observeRatio ?? DEFAULT_DECISION_CONFIG.observeRatio),
|
|
344
|
+
repeatedInterruptionWeight: num(decision.repeatedInterruptionWeight, base.decision?.repeatedInterruptionWeight ?? DEFAULT_DECISION_CONFIG.repeatedInterruptionWeight),
|
|
345
|
+
busyInterruptionWeight: num(decision.busyInterruptionWeight, base.decision?.busyInterruptionWeight ?? DEFAULT_DECISION_CONFIG.busyInterruptionWeight),
|
|
346
|
+
quietInterruptionWeight: num(decision.quietInterruptionWeight, base.decision?.quietInterruptionWeight ?? DEFAULT_DECISION_CONFIG.quietInterruptionWeight),
|
|
347
|
+
},
|
|
348
|
+
peerWatch: {
|
|
349
|
+
enabled: bool(pw.enabled, base.peerWatch.enabled),
|
|
350
|
+
afterIdleMs: num(pw.afterIdleMs, base.peerWatch.afterIdleMs),
|
|
351
|
+
},
|
|
352
|
+
};
|
|
353
|
+
if (typeof it.askUser === "boolean")
|
|
354
|
+
merged.idleTrigger.askUser = it.askUser;
|
|
355
|
+
if (quietHours !== undefined)
|
|
356
|
+
merged.limits.quietHours = quietHours;
|
|
357
|
+
return merged;
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* 把配置里的**内容引用**(`promptRef` / `agentRef`)解析成实际内容(CFG1 · C1/C2)。
|
|
361
|
+
*
|
|
362
|
+
* 两种引用写法:
|
|
363
|
+
* 1. `idleTrigger.promptRef: "idle-probe"` → `<配置目录>/prompts/idle-probe.md`;
|
|
364
|
+
* 2. `contentRefs: { "<名字>": { "promptRef": "..." } | { "agentRef": "..." } }`
|
|
365
|
+
* → `prompts/` 或 `agents/` 下的同名 `.md`(agent 定义走这条路)。
|
|
366
|
+
*
|
|
367
|
+
* **优先级(规范 §4):内联优先。** 同层仍有内联 `prompt`(旧配置)时,内联生效并给一次性提示;
|
|
368
|
+
* 两者都无 → 用缺省。**加载失败一律抛错**(悬空 / 空 / 格式错 / 越界),
|
|
369
|
+
* **绝不**静默回退缺省(那会让「提示词悄悄变空」变成看不见的故障)。
|
|
370
|
+
*/
|
|
371
|
+
function applyContentRefs(cfg, raw, dir) {
|
|
372
|
+
const rawObj = isPlainObject(raw) ? raw : {};
|
|
373
|
+
const it = isPlainObject(rawObj.idleTrigger) ? rawObj.idleTrigger : {};
|
|
374
|
+
const prompts = new ContentStore(dir, "prompts");
|
|
375
|
+
const agents = new ContentStore(dir, "agents");
|
|
376
|
+
const resolved = {};
|
|
377
|
+
// ── idleTrigger.promptRef ──
|
|
378
|
+
const promptRef = typeof it.promptRef === "string" ? it.promptRef.trim() : "";
|
|
379
|
+
if (promptRef !== "") {
|
|
380
|
+
const inline = typeof it.prompt === "string" ? it.prompt : "";
|
|
381
|
+
if (inline !== "") {
|
|
382
|
+
// 内联优先(旧配置零改动继续可用)+ 一次性提示(让用户知道 ref 被忽略了)。
|
|
383
|
+
console.warn(`[proactive] idleTrigger 同时配置了内联 prompt 与 promptRef="${promptRef}" → 以内联 prompt 为准(promptRef 不生效;规范 §4)`);
|
|
384
|
+
}
|
|
385
|
+
else {
|
|
386
|
+
const entry = prompts.resolveEntry(promptRef);
|
|
387
|
+
cfg.idleTrigger.prompt = entry.body;
|
|
388
|
+
resolved["idleTrigger.prompt"] = entry;
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
// ── 通用引用表 contentRefs ──
|
|
392
|
+
const refs = isPlainObject(rawObj.contentRefs) ? rawObj.contentRefs : {};
|
|
393
|
+
for (const [name, value] of Object.entries(refs)) {
|
|
394
|
+
if (!isPlainObject(value))
|
|
395
|
+
continue;
|
|
396
|
+
const p = typeof value.promptRef === "string" ? value.promptRef.trim() : "";
|
|
397
|
+
const a = typeof value.agentRef === "string" ? value.agentRef.trim() : "";
|
|
398
|
+
if (p !== "" && a !== "") {
|
|
399
|
+
throw new Error(`[proactive] 外置内容引用冲突:contentRefs.${name} 同时配置了 promptRef 与 agentRef → 只允许一个`);
|
|
400
|
+
}
|
|
401
|
+
if (p !== "") {
|
|
402
|
+
resolved[name] = prompts.resolveEntry(p);
|
|
403
|
+
continue;
|
|
404
|
+
}
|
|
405
|
+
if (a !== "") {
|
|
406
|
+
resolved[name] = agents.resolveEntry(a);
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
if (Object.keys(resolved).length > 0)
|
|
410
|
+
cfg.externalContent = resolved;
|
|
411
|
+
}
|
|
412
|
+
/** 全部配置项(顺序 = 清单展示顺序)。 */
|
|
413
|
+
export const CONFIG_KEY_SPECS = [
|
|
414
|
+
{
|
|
415
|
+
path: "enabled",
|
|
416
|
+
section: "总开关与检测",
|
|
417
|
+
type: "boolean",
|
|
418
|
+
defaultValue: true,
|
|
419
|
+
range: "true / false",
|
|
420
|
+
description: "主动性总开关:关掉后定时投递与空闲触发都不发生。",
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
path: "idleDetect",
|
|
424
|
+
section: "总开关与检测",
|
|
425
|
+
type: "enum",
|
|
426
|
+
defaultValue: "off",
|
|
427
|
+
values: ["terminal", "input-only", "off"],
|
|
428
|
+
range: "terminal | input-only | off",
|
|
429
|
+
description: "空闲检测档位:terminal(仅 TUI)/ input-only(只靠输入事件)/ off(关闭)。",
|
|
430
|
+
},
|
|
431
|
+
{
|
|
432
|
+
path: "askTimeoutMs",
|
|
433
|
+
section: "总开关与检测",
|
|
434
|
+
type: "number",
|
|
435
|
+
defaultValue: 120000,
|
|
436
|
+
range: "≥ 0(毫秒)",
|
|
437
|
+
description: "向你提问后等待回答的超时(毫秒)。",
|
|
438
|
+
aliases: ["asktimeout", "asktimeoutms", "questiontimeout"],
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
path: "idleTrigger.enabled",
|
|
442
|
+
section: "空闲触发",
|
|
443
|
+
type: "boolean",
|
|
444
|
+
defaultValue: false,
|
|
445
|
+
range: "true / false",
|
|
446
|
+
description: "空闲触发开关(缺省关 → 装上不打扰你)。",
|
|
447
|
+
aliases: ["idletriggerenabled", "idletriggeron"],
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
path: "idleTrigger.afterMs",
|
|
451
|
+
section: "空闲触发",
|
|
452
|
+
type: "number",
|
|
453
|
+
defaultValue: 600000,
|
|
454
|
+
range: "≥ 0(毫秒)",
|
|
455
|
+
description: "连续空闲多久后触发一次(毫秒)。",
|
|
456
|
+
aliases: ["idletimeout", "idleafterms", "idletriggerafterms", "idleafter"],
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
path: "idleTrigger.intent",
|
|
460
|
+
section: "空闲触发",
|
|
461
|
+
type: "enum",
|
|
462
|
+
defaultValue: "wake",
|
|
463
|
+
values: ["wake", "interrupt", "queue", "notify"],
|
|
464
|
+
range: "wake | interrupt | queue | notify",
|
|
465
|
+
description: "空闲触发时的投递意图(wake 唤醒 / interrupt 打断 / queue 排队 / notify 知会)。",
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
path: "idleTrigger.askUser",
|
|
469
|
+
section: "空闲触发",
|
|
470
|
+
type: "boolean",
|
|
471
|
+
range: "true / false(不写 = 不问)",
|
|
472
|
+
description: "空闲触发时是否向你提问。",
|
|
473
|
+
aliases: ["askuser"],
|
|
474
|
+
},
|
|
475
|
+
{
|
|
476
|
+
path: "idleTrigger.prompt",
|
|
477
|
+
section: "空闲触发",
|
|
478
|
+
type: "string",
|
|
479
|
+
defaultValue: "",
|
|
480
|
+
range: "任意文本",
|
|
481
|
+
description: "空闲触发时投给模型的正文(空 = 用缺省)。",
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
path: "idleTrigger.promptRef",
|
|
485
|
+
section: "空闲触发",
|
|
486
|
+
type: "string",
|
|
487
|
+
range: "<配置目录>/prompts/<名字>.md",
|
|
488
|
+
description: "引用外部提示词文件(比把长提示词塞进 JSON 好维护)。",
|
|
489
|
+
aliases: ["promptref"],
|
|
490
|
+
},
|
|
491
|
+
{
|
|
492
|
+
path: "limits.minGapMs",
|
|
493
|
+
section: "频控与静默",
|
|
494
|
+
type: "number",
|
|
495
|
+
defaultValue: 300000,
|
|
496
|
+
range: "≥ 0(毫秒)",
|
|
497
|
+
description: "两次主动打扰之间的最小间隔(毫秒)。",
|
|
498
|
+
aliases: ["mingap", "mingapms", "mininterval"],
|
|
499
|
+
},
|
|
500
|
+
{
|
|
501
|
+
path: "limits.maxPerHour",
|
|
502
|
+
section: "频控与静默",
|
|
503
|
+
type: "number",
|
|
504
|
+
defaultValue: 6,
|
|
505
|
+
range: "≥ 0(次 / 小时)",
|
|
506
|
+
description: "每小时最多主动打扰几次。",
|
|
507
|
+
aliases: ["maxperhour", "hourlymax", "perhour"],
|
|
508
|
+
},
|
|
509
|
+
{
|
|
510
|
+
path: "limits.quietHours.from",
|
|
511
|
+
section: "频控与静默",
|
|
512
|
+
type: "string",
|
|
513
|
+
defaultValue: "22:00",
|
|
514
|
+
range: "HH:MM",
|
|
515
|
+
description: "静默时段开始(这段时间不主动打扰)。",
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
path: "limits.quietHours.to",
|
|
519
|
+
section: "频控与静默",
|
|
520
|
+
type: "string",
|
|
521
|
+
defaultValue: "08:00",
|
|
522
|
+
range: "HH:MM",
|
|
523
|
+
description: "静默时段结束。",
|
|
524
|
+
},
|
|
525
|
+
{
|
|
526
|
+
path: "decision.enabled",
|
|
527
|
+
section: "决策环",
|
|
528
|
+
type: "boolean",
|
|
529
|
+
defaultValue: true,
|
|
530
|
+
range: "true / false",
|
|
531
|
+
description: "决策环开关(false = 退回旧的 afterMs 判定)。",
|
|
532
|
+
},
|
|
533
|
+
{
|
|
534
|
+
path: "decision.threshold",
|
|
535
|
+
section: "决策环",
|
|
536
|
+
type: "number",
|
|
537
|
+
defaultValue: 1,
|
|
538
|
+
range: "≥ 0",
|
|
539
|
+
description: "触发阈值:分数 ≥ 阈值才触发。",
|
|
540
|
+
aliases: ["threshold", "scorethreshold"],
|
|
541
|
+
},
|
|
542
|
+
{
|
|
543
|
+
path: "decision.observeRatio",
|
|
544
|
+
section: "决策环",
|
|
545
|
+
type: "number",
|
|
546
|
+
defaultValue: 0.5,
|
|
547
|
+
range: "0 ~ 1",
|
|
548
|
+
description: "观察带下界(相对阈值):这一段只记账、不打扰。",
|
|
549
|
+
aliases: ["observeratio", "observethreshold"],
|
|
550
|
+
},
|
|
551
|
+
{
|
|
552
|
+
path: "decision.repeatedInterruptionWeight",
|
|
553
|
+
section: "决策环",
|
|
554
|
+
type: "number",
|
|
555
|
+
defaultValue: 0.5,
|
|
556
|
+
range: "≥ 0",
|
|
557
|
+
description: "近 1 小时重复打扰时,打断代价的加成。",
|
|
558
|
+
aliases: ["repeatedinterruptionweight"],
|
|
559
|
+
},
|
|
560
|
+
{
|
|
561
|
+
path: "decision.busyInterruptionWeight",
|
|
562
|
+
section: "决策环",
|
|
563
|
+
type: "number",
|
|
564
|
+
defaultValue: 1,
|
|
565
|
+
range: "≥ 0",
|
|
566
|
+
description: "你正忙(代理在跑)时,打断代价的加成。",
|
|
567
|
+
aliases: ["busyinterruptionweight"],
|
|
568
|
+
},
|
|
569
|
+
{
|
|
570
|
+
path: "decision.quietInterruptionWeight",
|
|
571
|
+
section: "决策环",
|
|
572
|
+
type: "number",
|
|
573
|
+
defaultValue: 1,
|
|
574
|
+
range: "≥ 0",
|
|
575
|
+
description: "落在静默时段时,打断代价的加成。",
|
|
576
|
+
aliases: ["quietinterruptionweight"],
|
|
577
|
+
},
|
|
578
|
+
{
|
|
579
|
+
path: "peerWatch.enabled",
|
|
580
|
+
section: "跨会话协作",
|
|
581
|
+
type: "boolean",
|
|
582
|
+
defaultValue: false,
|
|
583
|
+
range: "true / false",
|
|
584
|
+
description: "空闲时是否主动询问其它会话的进度。",
|
|
585
|
+
aliases: ["peerwatchenabled", "peerwatchon"],
|
|
586
|
+
},
|
|
587
|
+
{
|
|
588
|
+
path: "peerWatch.afterIdleMs",
|
|
589
|
+
section: "跨会话协作",
|
|
590
|
+
type: "number",
|
|
591
|
+
defaultValue: 600000,
|
|
592
|
+
range: "≥ 0(毫秒)",
|
|
593
|
+
description: "连续空闲多久后才去询问别的会话。",
|
|
594
|
+
aliases: ["afteridlems", "peeridle"],
|
|
595
|
+
},
|
|
596
|
+
{
|
|
597
|
+
path: "contentRefs",
|
|
598
|
+
section: "外置内容与版本",
|
|
599
|
+
type: "object",
|
|
600
|
+
range: "{ 名字: { promptRef | agentRef } }",
|
|
601
|
+
description: "引用外部提示词 / agent 定义的表(名字随便起,值里写 promptRef 或 agentRef)。",
|
|
602
|
+
aliases: ["contentrefs"],
|
|
603
|
+
},
|
|
604
|
+
{
|
|
605
|
+
path: "version",
|
|
606
|
+
section: "外置内容与版本",
|
|
607
|
+
type: "string",
|
|
608
|
+
defaultValue: ON_DISK_VERSION,
|
|
609
|
+
range: ON_DISK_VERSION,
|
|
610
|
+
description: "落盘格式版本(当前只认 v1)。",
|
|
611
|
+
},
|
|
612
|
+
];
|
|
613
|
+
/** 已知**容器**路径(对象本身不是可配置项,只承载子项)。 */
|
|
614
|
+
const CONFIG_CONTAINER_PATHS = [
|
|
615
|
+
"idleTrigger",
|
|
616
|
+
"limits",
|
|
617
|
+
"limits.quietHours",
|
|
618
|
+
"decision",
|
|
619
|
+
"peerWatch",
|
|
620
|
+
];
|
|
621
|
+
/** 归一化:只留小写字母与数字(别名 / 编辑距离比较用)。 */
|
|
622
|
+
function normalizeKey(text) {
|
|
623
|
+
return text.toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
624
|
+
}
|
|
625
|
+
/** 编辑距离(Levenshtein)——「最相近的已知键」用。 */
|
|
626
|
+
function editDistance(a, b) {
|
|
627
|
+
if (a === b)
|
|
628
|
+
return 0;
|
|
629
|
+
if (a.length === 0)
|
|
630
|
+
return b.length;
|
|
631
|
+
if (b.length === 0)
|
|
632
|
+
return a.length;
|
|
633
|
+
let prev = Array.from({ length: b.length + 1 }, (_unused, i) => i);
|
|
634
|
+
for (let i = 1; i <= a.length; i++) {
|
|
635
|
+
const cur = [i];
|
|
636
|
+
for (let j = 1; j <= b.length; j++) {
|
|
637
|
+
const cost = a[i - 1] === b[j - 1] ? 0 : 1;
|
|
638
|
+
cur[j] = Math.min((cur[j - 1] ?? 0) + 1, (prev[j] ?? 0) + 1, (prev[j - 1] ?? 0) + cost);
|
|
639
|
+
}
|
|
640
|
+
prev = cur;
|
|
641
|
+
}
|
|
642
|
+
return prev[b.length] ?? 0;
|
|
643
|
+
}
|
|
644
|
+
/**
|
|
645
|
+
* 「你是不是想写 …」的建议:给一个写错/不认识的键名,指到最相近的已知键。
|
|
646
|
+
*
|
|
647
|
+
* 两级策略(先精确后模糊):
|
|
648
|
+
* 1. **别名精确命中**(path 本身或口语别名)—— 用户嘴里的说法(「空闲超时」→ `idleTrigger.afterMs`);
|
|
649
|
+
* 2. **编辑距离最近**(path 与口语别名都参与比对;带路径时比全名,不带路径时比末段)
|
|
650
|
+
* —— 拼写笔误(「maxPerHOur」「ideltimeout」)。
|
|
651
|
+
*
|
|
652
|
+
* 毫无相近项(距离 > 2)时返回 undefined —— **不乱指**(乱指比不指更坏)。
|
|
653
|
+
*/
|
|
654
|
+
export function suggestConfigKey(unknown) {
|
|
655
|
+
const q = normalizeKey(unknown);
|
|
656
|
+
if (q === "")
|
|
657
|
+
return undefined;
|
|
658
|
+
for (const spec of CONFIG_KEY_SPECS) {
|
|
659
|
+
for (const alias of [spec.path, ...(spec.aliases ?? [])]) {
|
|
660
|
+
if (normalizeKey(alias) === q)
|
|
661
|
+
return spec.path;
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
const isPath = unknown.includes(".");
|
|
665
|
+
let best;
|
|
666
|
+
for (const spec of CONFIG_KEY_SPECS) {
|
|
667
|
+
const last = spec.path.split(".").pop() ?? spec.path;
|
|
668
|
+
const dFull = editDistance(q, normalizeKey(spec.path));
|
|
669
|
+
const dLast = editDistance(q, normalizeKey(last));
|
|
670
|
+
// 别名同样参与模糊比对:用户拼错的常是「口语别名」(ideltimeout ← idletimeout),
|
|
671
|
+
// 只比 path 会漏掉这类 → 指不出「你是不是想写 idleTrigger.afterMs」。
|
|
672
|
+
const dAlias = Math.min(Infinity, ...(spec.aliases ?? []).map((a) => editDistance(q, normalizeKey(a))));
|
|
673
|
+
const score = isPath ? Math.min(dFull, dAlias) : Math.min(dLast, dFull, dAlias);
|
|
674
|
+
if (best === undefined || score < best.score) {
|
|
675
|
+
best = { path: spec.path, score };
|
|
676
|
+
continue;
|
|
677
|
+
}
|
|
678
|
+
if (score === best.score) {
|
|
679
|
+
// 平手 → 取更短的路径(顶层项优先),再按字典序(结果确定)。
|
|
680
|
+
const shorter = spec.path.length < best.path.length;
|
|
681
|
+
const sameLen = spec.path.length === best.path.length && spec.path < best.path;
|
|
682
|
+
if (shorter || sameLen)
|
|
683
|
+
best = { path: spec.path, score };
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
if (best === undefined || best.score > 2)
|
|
687
|
+
return undefined;
|
|
688
|
+
return best.path;
|
|
689
|
+
}
|
|
690
|
+
/** 未知配置项 → 抛这个错(**不得**静默忽略)。 */
|
|
691
|
+
export class ConfigValidationError extends Error {
|
|
692
|
+
/** 逐条问题(机器可读)。 */
|
|
693
|
+
issues;
|
|
694
|
+
constructor(issues) {
|
|
695
|
+
super(formatConfigIssues(issues));
|
|
696
|
+
this.name = "ConfigValidationError";
|
|
697
|
+
this.issues = issues;
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
/** 问题的类型名(人话)。 */
|
|
701
|
+
function typeLabel(spec) {
|
|
702
|
+
switch (spec.type) {
|
|
703
|
+
case "boolean":
|
|
704
|
+
return "布尔(true / false)";
|
|
705
|
+
case "number":
|
|
706
|
+
return "数字";
|
|
707
|
+
case "string":
|
|
708
|
+
return "字符串";
|
|
709
|
+
case "enum":
|
|
710
|
+
return `枚举(${spec.values?.join(" | ") ?? ""})`;
|
|
711
|
+
case "object":
|
|
712
|
+
return "对象";
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
/** 实际值的类型名(人话)。 */
|
|
716
|
+
function valueTypeLabel(value) {
|
|
717
|
+
if (value === null)
|
|
718
|
+
return "null";
|
|
719
|
+
if (Array.isArray(value))
|
|
720
|
+
return "数组";
|
|
721
|
+
return typeof value;
|
|
722
|
+
}
|
|
723
|
+
/** 值是否与规格相符。 */
|
|
724
|
+
function matchesSpec(spec, value) {
|
|
725
|
+
switch (spec.type) {
|
|
726
|
+
case "boolean":
|
|
727
|
+
return typeof value === "boolean";
|
|
728
|
+
case "number":
|
|
729
|
+
return typeof value === "number" && Number.isFinite(value);
|
|
730
|
+
case "string":
|
|
731
|
+
return typeof value === "string";
|
|
732
|
+
case "enum":
|
|
733
|
+
return typeof value === "string" && (spec.values ?? []).includes(value);
|
|
734
|
+
case "object":
|
|
735
|
+
return isPlainObject(value);
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
/**
|
|
739
|
+
* 校验配置里的**键**(M8):未知键 → 指名(阻断加载);类型不符 → 指名(不阻断,按缺省回落)。
|
|
740
|
+
*
|
|
741
|
+
* 为什么类型不符不阻断:既有契约是「字段类型错误 → 回退缺省且不抛错」
|
|
742
|
+
* (`pi-proactive/tests/config.test.ts` 锁着这条)→ 改它会误伤既有用户配置。
|
|
743
|
+
* 但「静默」必须改成「**指名**」:问题照样进清单与体检报告。
|
|
744
|
+
*/
|
|
745
|
+
export function validateConfig(raw, file) {
|
|
746
|
+
const issues = [];
|
|
747
|
+
if (!isPlainObject(raw))
|
|
748
|
+
return issues;
|
|
749
|
+
const byPath = new Map(CONFIG_KEY_SPECS.map((spec) => [spec.path, spec]));
|
|
750
|
+
const walk = (obj, prefix) => {
|
|
751
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
752
|
+
const p = prefix === "" ? key : `${prefix}.${key}`;
|
|
753
|
+
if (p === "contentRefs") {
|
|
754
|
+
walkContentRefs(value, p, file, issues);
|
|
755
|
+
continue;
|
|
756
|
+
}
|
|
757
|
+
const spec = byPath.get(p);
|
|
758
|
+
if (spec !== undefined) {
|
|
759
|
+
if (!matchesSpec(spec, value)) {
|
|
760
|
+
issues.push({
|
|
761
|
+
category: "type-mismatch",
|
|
762
|
+
key: p,
|
|
763
|
+
file,
|
|
764
|
+
message: `配置项 "${p}" 类型不对(期望 ${typeLabel(spec)},实际 ${valueTypeLabel(value)})` +
|
|
765
|
+
`→ 已按缺省值处理(文件:${file})`,
|
|
766
|
+
});
|
|
767
|
+
}
|
|
768
|
+
continue;
|
|
769
|
+
}
|
|
770
|
+
if (CONFIG_CONTAINER_PATHS.includes(p)) {
|
|
771
|
+
if (isPlainObject(value)) {
|
|
772
|
+
walk(value, p);
|
|
773
|
+
}
|
|
774
|
+
else {
|
|
775
|
+
issues.push({
|
|
776
|
+
category: "type-mismatch",
|
|
777
|
+
key: p,
|
|
778
|
+
file,
|
|
779
|
+
message: `配置项 "${p}" 类型不对(期望对象,实际 ${valueTypeLabel(value)})→ 已按缺省值处理(文件:${file})`,
|
|
780
|
+
});
|
|
781
|
+
}
|
|
782
|
+
continue;
|
|
783
|
+
}
|
|
784
|
+
const suggestion = suggestConfigKey(p);
|
|
785
|
+
issues.push({
|
|
786
|
+
category: "unknown-key",
|
|
787
|
+
key: p,
|
|
788
|
+
file,
|
|
789
|
+
...(suggestion === undefined ? {} : { suggestion }),
|
|
790
|
+
message: `未知配置项 "${p}"(文件:${file})` +
|
|
791
|
+
(suggestion === undefined ? "→ 没有相近的已知配置项" : `→ 你是不是想写 "${suggestion}"?`),
|
|
792
|
+
});
|
|
793
|
+
}
|
|
794
|
+
};
|
|
795
|
+
walk(raw, "");
|
|
796
|
+
return issues;
|
|
797
|
+
}
|
|
798
|
+
/** `contentRefs` 的内层键(只允许 promptRef / agentRef)。 */
|
|
799
|
+
function walkContentRefs(value, prefix, file, issues) {
|
|
800
|
+
if (!isPlainObject(value)) {
|
|
801
|
+
issues.push({
|
|
802
|
+
category: "type-mismatch",
|
|
803
|
+
key: prefix,
|
|
804
|
+
file,
|
|
805
|
+
message: `配置项 "${prefix}" 类型不对(期望对象,实际 ${valueTypeLabel(value)})→ 已按缺省值处理(文件:${file})`,
|
|
806
|
+
});
|
|
807
|
+
return;
|
|
808
|
+
}
|
|
809
|
+
for (const [name, entry] of Object.entries(value)) {
|
|
810
|
+
if (!isPlainObject(entry))
|
|
811
|
+
continue;
|
|
812
|
+
for (const key of Object.keys(entry)) {
|
|
813
|
+
if (key === "promptRef" || key === "agentRef")
|
|
814
|
+
continue;
|
|
815
|
+
const p = `${prefix}.${name}.${key}`;
|
|
816
|
+
issues.push({
|
|
817
|
+
category: "unknown-key",
|
|
818
|
+
key: p,
|
|
819
|
+
file,
|
|
820
|
+
message: `未知配置项 "${p}"(文件:${file})→ 只允许 promptRef 或 agentRef`,
|
|
821
|
+
});
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
/** 问题清单 → 人话 + 机器可读的一整段文本。 */
|
|
826
|
+
export function formatConfigIssues(issues) {
|
|
827
|
+
const lines = ["[proactive] 配置校验失败(写错的配置项不会被静默忽略):"];
|
|
828
|
+
for (const issue of issues) {
|
|
829
|
+
lines.push(` · ${issue.message}`);
|
|
830
|
+
lines.push(` 未知键名:${issue.key}` +
|
|
831
|
+
` 机器可读:CONFIG_${issue.category === "unknown-key" ? "UNKNOWN_KEY" : "TYPE_MISMATCH"}` +
|
|
832
|
+
` key="${issue.key}" file="${issue.file}"` +
|
|
833
|
+
(issue.suggestion === undefined ? "" : ` suggestion="${issue.suggestion}"`));
|
|
834
|
+
}
|
|
835
|
+
return lines.join("\n");
|
|
836
|
+
}
|
|
837
|
+
/** 按点号路径取值(取不到 → undefined)。 */
|
|
838
|
+
function readPath(raw, dotted) {
|
|
839
|
+
let cur = raw;
|
|
840
|
+
for (const seg of dotted.split(".")) {
|
|
841
|
+
if (!isPlainObject(cur))
|
|
842
|
+
return undefined;
|
|
843
|
+
cur = cur[seg];
|
|
844
|
+
}
|
|
845
|
+
return cur;
|
|
846
|
+
}
|
|
847
|
+
/**
|
|
848
|
+
* 读配置清单(M6):全部项 + 当前值(**文件里写的**)+ 缺省值 + 取值范围 + 说明 + 问题清单。
|
|
849
|
+
*
|
|
850
|
+
* 为什么「当前值」取自**文件**而不是合并后的运行期配置:文件才是用户写的东西;
|
|
851
|
+
* 运行期配置在有未知项时会整体回落缺省 → 用它会把「你写的值」显示成「缺省值」(更迷惑)。
|
|
852
|
+
*/
|
|
853
|
+
export function readConfigReport(opts) {
|
|
854
|
+
const dir = proactiveDir(opts?.agentDir ?? resolveAgentDir());
|
|
855
|
+
const file = path.join(dir, "config.json");
|
|
856
|
+
let raw;
|
|
857
|
+
let exists = false;
|
|
858
|
+
try {
|
|
859
|
+
exists = fs.existsSync(file);
|
|
860
|
+
if (exists)
|
|
861
|
+
raw = JSON.parse(fs.readFileSync(file, "utf8"));
|
|
862
|
+
}
|
|
863
|
+
catch {
|
|
864
|
+
raw = undefined;
|
|
865
|
+
}
|
|
866
|
+
const items = CONFIG_KEY_SPECS.map((spec) => ({
|
|
867
|
+
path: spec.path,
|
|
868
|
+
section: spec.section,
|
|
869
|
+
type: typeLabel(spec),
|
|
870
|
+
current: readPath(raw, spec.path),
|
|
871
|
+
defaultValue: spec.defaultValue,
|
|
872
|
+
range: spec.range,
|
|
873
|
+
description: spec.description,
|
|
874
|
+
}));
|
|
875
|
+
return { file, exists, items, issues: validateConfig(raw, file) };
|
|
876
|
+
}
|
|
877
|
+
/** 备份文件后缀(M9)。 */
|
|
878
|
+
export const CONFIG_BACKUP_SUFFIX = ".bak";
|
|
879
|
+
/**
|
|
880
|
+
* 原子写配置(M9):**先备份**再原子写(tmp 独占 + 同目录 rename + 0600 + fsync)。
|
|
881
|
+
*
|
|
882
|
+
* 备份 = 写前的那份内容(`<config.json>.bak`)→ 撤销就是把它写回去。
|
|
883
|
+
*/
|
|
884
|
+
export function writeConfigAtomic(next, opts) {
|
|
885
|
+
const dir = proactiveDir(opts?.agentDir ?? resolveAgentDir());
|
|
886
|
+
const file = path.join(dir, "config.json");
|
|
887
|
+
let backup;
|
|
888
|
+
if (opts?.backup !== false && fs.existsSync(file)) {
|
|
889
|
+
backup = `${file}${CONFIG_BACKUP_SUFFIX}`;
|
|
890
|
+
writeAtomicFile(backup, fs.readFileSync(file, "utf8"), { durable: true });
|
|
891
|
+
}
|
|
892
|
+
writeAtomicFile(file, `${JSON.stringify(next, null, 2)}\n`, { durable: true });
|
|
893
|
+
return backup === undefined ? { file } : { file, backup };
|
|
894
|
+
}
|
|
895
|
+
/**
|
|
896
|
+
* 撤销上一次配置改动(M9):把备份写回配置文件(原子写),并消费掉这份备份。
|
|
897
|
+
*
|
|
898
|
+
* 没有备份 → 如实说「没有可撤销的改动」(不抛错)。
|
|
899
|
+
*/
|
|
900
|
+
export function undoConfigChange(opts) {
|
|
901
|
+
const dir = proactiveDir(opts?.agentDir ?? resolveAgentDir());
|
|
902
|
+
const file = path.join(dir, "config.json");
|
|
903
|
+
const backup = `${file}${CONFIG_BACKUP_SUFFIX}`;
|
|
904
|
+
if (!fs.existsSync(backup)) {
|
|
905
|
+
return { ok: false, file, message: `没有可撤销的改动:找不到备份文件 ${backup}` };
|
|
906
|
+
}
|
|
907
|
+
writeAtomicFile(file, fs.readFileSync(backup, "utf8"), { durable: true });
|
|
908
|
+
fs.rmSync(backup, { force: true });
|
|
909
|
+
return { ok: true, file, message: `已撤销上一次配置改动(备份 ${backup} 已写回 ${file})` };
|
|
910
|
+
}
|
|
911
|
+
/**
|
|
912
|
+
* 读取配置(含**外置内容解析**)。
|
|
913
|
+
*
|
|
914
|
+
* 失败语义(与「坏 JSON 回落缺省」刻意不同):
|
|
915
|
+
* - `config.json` 读不出 / 解析失败 → 回落缺省(老契约:配置文件坏掉不得拖垮宿主);
|
|
916
|
+
* - **外置内容引用失败** → **抛错**(规范 §9:失败必须抛错并指名 ref 与路径)。
|
|
917
|
+
*/
|
|
918
|
+
export function loadConfig(opts) {
|
|
919
|
+
const base = defaultConfig();
|
|
920
|
+
const dir = proactiveDir();
|
|
921
|
+
const file = path.join(dir, "config.json");
|
|
922
|
+
let raw;
|
|
923
|
+
try {
|
|
924
|
+
if (!fs.existsSync(file))
|
|
925
|
+
return base;
|
|
926
|
+
raw = JSON.parse(fs.readFileSync(file, "utf8"));
|
|
927
|
+
}
|
|
928
|
+
catch {
|
|
929
|
+
return base;
|
|
930
|
+
}
|
|
931
|
+
// 未知版本 → **拒绝按已知格式解析**(规范 V3):回落缺省 + 可观察提示,
|
|
932
|
+
// 且**不覆盖原文件**(saveEnabled 侧同样拒绝写入)。
|
|
933
|
+
if (isPlainObject(raw) && !isKnownOnDiskVersion(raw.version)) {
|
|
934
|
+
reportForeignVersion("config.json", file, raw.version);
|
|
935
|
+
return base;
|
|
936
|
+
}
|
|
937
|
+
// M8:**未知配置项 → 报错并指名**(不再静默忽略:拼错键名是最恶劣的一种体验)。
|
|
938
|
+
const issues = validateConfig(raw, file);
|
|
939
|
+
const unknown = issues.filter((issue) => issue.category === "unknown-key");
|
|
940
|
+
if (unknown.length > 0)
|
|
941
|
+
throw new ConfigValidationError(unknown);
|
|
942
|
+
// 类型不符 → **指名但不阻断**(既有契约:按缺省回落,不抛错)。
|
|
943
|
+
for (const issue of issues)
|
|
944
|
+
console.error(`[proactive] ${issue.message}`);
|
|
945
|
+
const merged = mergeConfig(base, raw);
|
|
946
|
+
// 外置内容引用失败 → **抛错**(不静默回退):ref 与路径都在错误消息里。
|
|
947
|
+
applyContentRefs(merged, raw, dir);
|
|
948
|
+
return merged;
|
|
949
|
+
}
|
|
950
|
+
/**
|
|
951
|
+
* 原子写配置(tmp + rename):`<agentDir>/proactive/config.json`。
|
|
952
|
+
*
|
|
953
|
+
* 只改 `enabled` 一个字段,**其余内容原样保留**(用户在配置文件里写的其它字段不能被
|
|
954
|
+
* 一次开关操作抹掉);文件不存在或读不出来 → 只写 `enabled`(不抛错)。
|
|
955
|
+
*
|
|
956
|
+
* 用途:M5c RP-11 M-4 —— `/proactive on|off` 必须落盘(重启后仍生效)。
|
|
957
|
+
*/
|
|
958
|
+
export function saveEnabled(enabled, opts) {
|
|
959
|
+
const agentDir = opts?.agentDir ?? resolveAgentDir();
|
|
960
|
+
const dir = proactiveDir(agentDir);
|
|
961
|
+
const file = path.join(dir, "config.json");
|
|
962
|
+
let raw = {};
|
|
963
|
+
try {
|
|
964
|
+
const parsed = JSON.parse(fs.readFileSync(file, "utf8"));
|
|
965
|
+
if (isPlainObject(parsed))
|
|
966
|
+
raw = parsed;
|
|
967
|
+
}
|
|
968
|
+
catch {
|
|
969
|
+
// 读不出来 → 只写 enabled(不抛错)
|
|
970
|
+
}
|
|
971
|
+
// 未知版本 → **拒绝写入**(不得用默认值覆盖用户数据,规范 V3②)。
|
|
972
|
+
if (!isKnownOnDiskVersion(raw.version)) {
|
|
973
|
+
reportForeignVersion("config.json", file, raw.version);
|
|
974
|
+
return file;
|
|
975
|
+
}
|
|
976
|
+
raw.enabled = enabled;
|
|
977
|
+
// 原子写 + **写前备份**(M9:tmp 独占 + 同目录 rename + 0600 + fsync;备份让「撤销上一次改动」可行)。
|
|
978
|
+
writeConfigAtomic(raw, { agentDir });
|
|
979
|
+
return file;
|
|
980
|
+
}
|
|
981
|
+
/**
|
|
982
|
+
* 未知版本的**可观察提示**(规范 V3③:不得只有静默)。
|
|
983
|
+
*
|
|
984
|
+
* 通道限制:当前只有 `task-store` 有宿主级用户可见通道(`ctx.ui.notify`,见 P-D5);
|
|
985
|
+
* 其余落盘面只有 stderr 通道 → 记为残余限制(deviations P-D1 的 residualLimits)。
|
|
986
|
+
*/
|
|
987
|
+
export function reportForeignVersion(surface, file, version) {
|
|
988
|
+
const text = typeof version === "string" ? version : (JSON.stringify(version) ?? "缺失");
|
|
989
|
+
console.error(`[proactive] ${surface} 版本无法识别(version=${text})→ 拒绝按已知格式解析(保留原文件,不覆盖):${file}`);
|
|
990
|
+
}
|