@yaag/cli 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/types/runtime/agent-names.d.ts +8 -0
- package/assets/types/runtime/agent-usage.d.ts +16 -0
- package/assets/types/runtime/agent.d.ts +36 -0
- package/assets/types/runtime/args-validation.d.ts +3 -0
- package/assets/types/runtime/ask-activity.d.ts +9 -0
- package/assets/types/runtime/ask-contract-identity.d.ts +25 -0
- package/assets/types/runtime/ask-exchange-events.d.ts +13 -0
- package/assets/types/runtime/ask-exchange-options.d.ts +30 -0
- package/assets/types/runtime/ask-exchange.d.ts +4 -0
- package/assets/types/runtime/ask-hash.d.ts +32 -0
- package/assets/types/runtime/ask-limit.d.ts +46 -0
- package/assets/types/runtime/ask-output-steering.d.ts +28 -0
- package/assets/types/runtime/ask-output-tail.d.ts +28 -0
- package/assets/types/runtime/ask-output.d.ts +29 -0
- package/assets/types/runtime/ask-settlement.d.ts +11 -0
- package/assets/types/runtime/ask-turn.d.ts +25 -0
- package/assets/types/runtime/cassette-loader.d.ts +11 -0
- package/assets/types/runtime/cassette-publish.d.ts +11 -0
- package/assets/types/runtime/cassette-replay.d.ts +24 -0
- package/assets/types/runtime/cassette-schema.d.ts +111 -0
- package/assets/types/runtime/cassette.d.ts +118 -0
- package/assets/types/runtime/checkpoint-dir.d.ts +30 -0
- package/assets/types/runtime/connection.d.ts +29 -0
- package/assets/types/runtime/define-agent.d.ts +48 -0
- package/assets/types/runtime/define-run.d.ts +40 -0
- package/assets/types/runtime/errors.d.ts +50 -0
- package/assets/types/runtime/events.d.ts +138 -0
- package/assets/types/runtime/extension-package.d.ts +17 -0
- package/assets/types/runtime/extension-paths.d.ts +16 -0
- package/assets/types/runtime/extension-source.d.ts +28 -0
- package/assets/types/runtime/fake-transport.d.ts +78 -0
- package/assets/types/runtime/frame-gap.d.ts +23 -0
- package/assets/types/runtime/frame-queue.d.ts +15 -0
- package/assets/types/runtime/git-facts.d.ts +7 -0
- package/assets/types/runtime/idle-watch.d.ts +44 -0
- package/assets/types/runtime/index.d.ts +33 -0
- package/assets/types/runtime/jsonl.d.ts +13 -0
- package/assets/types/runtime/live-transport.d.ts +3 -0
- package/assets/types/runtime/node-decoder-subagent.d.ts +7 -0
- package/assets/types/runtime/node-decoder-workflow.d.ts +12 -0
- package/assets/types/runtime/node-decoder.d.ts +21 -0
- package/assets/types/runtime/node-decoders.d.ts +3 -0
- package/assets/types/runtime/node-details.d.ts +22 -0
- package/assets/types/runtime/node-path.d.ts +19 -0
- package/assets/types/runtime/node-tracker.d.ts +30 -0
- package/assets/types/runtime/pi-state.d.ts +16 -0
- package/assets/types/runtime/prompt-gist.d.ts +8 -0
- package/assets/types/runtime/prompt.d.ts +9 -0
- package/assets/types/runtime/reap.d.ts +22 -0
- package/assets/types/runtime/recording-transport.d.ts +9 -0
- package/assets/types/runtime/replay-divergence.d.ts +19 -0
- package/assets/types/runtime/replay-transport.d.ts +9 -0
- package/assets/types/runtime/resume-preconditions.d.ts +8 -0
- package/assets/types/runtime/resume-transport.d.ts +9 -0
- package/assets/types/runtime/run-checkpoint.d.ts +28 -0
- package/assets/types/runtime/run-context.d.ts +18 -0
- package/assets/types/runtime/run.d.ts +60 -0
- package/assets/types/runtime/skill-probe.d.ts +71 -0
- package/assets/types/runtime/skill-restriction-transport.d.ts +8 -0
- package/assets/types/runtime/spawn.d.ts +24 -0
- package/assets/types/runtime/summary-agent.d.ts +123 -0
- package/assets/types/runtime/summary-nodes.d.ts +28 -0
- package/assets/types/runtime/summary.d.ts +55 -0
- package/assets/types/runtime/tool-probe-extension.d.ts +12 -0
- package/assets/types/runtime/tool-probe.d.ts +30 -0
- package/assets/types/runtime/transport.d.ts +143 -0
- package/assets/types/runtime/types.d.ts +120 -0
- package/assets/types/runtime/validation-errors.d.ts +3 -0
- package/assets/types/runtime/wire-constants.d.ts +18 -0
- package/assets/types/runtime/worktree-transport.d.ts +9 -0
- package/assets/types/typebox/build/compile/code.d.mts +12 -0
- package/assets/types/typebox/build/compile/compile.d.mts +6 -0
- package/assets/types/typebox/build/compile/index.d.mts +8 -0
- package/assets/types/typebox/build/compile/validator.d.mts +35 -0
- package/assets/types/typebox/build/error/errors.d.mts +208 -0
- package/assets/types/typebox/build/error/index.d.mts +1 -0
- package/assets/types/typebox/build/format/_idna.d.mts +2 -0
- package/assets/types/typebox/build/format/_puny.d.mts +1 -0
- package/assets/types/typebox/build/format/_registry.d.mts +15 -0
- package/assets/types/typebox/build/format/date.d.mts +6 -0
- package/assets/types/typebox/build/format/date_time.d.mts +6 -0
- package/assets/types/typebox/build/format/duration.d.mts +5 -0
- package/assets/types/typebox/build/format/email.d.mts +5 -0
- package/assets/types/typebox/build/format/format.d.mts +22 -0
- package/assets/types/typebox/build/format/hostname.d.mts +7 -0
- package/assets/types/typebox/build/format/idn_email.d.mts +5 -0
- package/assets/types/typebox/build/format/idn_hostname.d.mts +7 -0
- package/assets/types/typebox/build/format/index.d.mts +4 -0
- package/assets/types/typebox/build/format/ipv4.d.mts +6 -0
- package/assets/types/typebox/build/format/ipv6.d.mts +5 -0
- package/assets/types/typebox/build/format/iri.d.mts +5 -0
- package/assets/types/typebox/build/format/iri_reference.d.mts +5 -0
- package/assets/types/typebox/build/format/json_pointer.d.mts +6 -0
- package/assets/types/typebox/build/format/json_pointer_uri_fragment.d.mts +6 -0
- package/assets/types/typebox/build/format/regex.d.mts +6 -0
- package/assets/types/typebox/build/format/relative_json_pointer.d.mts +6 -0
- package/assets/types/typebox/build/format/time.d.mts +5 -0
- package/assets/types/typebox/build/format/uri.d.mts +5 -0
- package/assets/types/typebox/build/format/uri_reference.d.mts +5 -0
- package/assets/types/typebox/build/format/uri_template.d.mts +6 -0
- package/assets/types/typebox/build/format/url.d.mts +6 -0
- package/assets/types/typebox/build/format/uuid.d.mts +6 -0
- package/assets/types/typebox/build/guard/emit.d.mts +54 -0
- package/assets/types/typebox/build/guard/globals.d.mts +35 -0
- package/assets/types/typebox/build/guard/guard.d.mts +65 -0
- package/assets/types/typebox/build/guard/index.d.mts +6 -0
- package/assets/types/typebox/build/guard/native.d.mts +20 -0
- package/assets/types/typebox/build/guard/string.d.mts +6 -0
- package/assets/types/typebox/build/index.d.mts +8 -0
- package/assets/types/typebox/build/schema/build.d.mts +39 -0
- package/assets/types/typebox/build/schema/check.d.mts +6 -0
- package/assets/types/typebox/build/schema/compile.d.mts +22 -0
- package/assets/types/typebox/build/schema/engine/_context.d.mts +35 -0
- package/assets/types/typebox/build/schema/engine/_exact_optional.d.mts +3 -0
- package/assets/types/typebox/build/schema/engine/_externals.d.mts +7 -0
- package/assets/types/typebox/build/schema/engine/_functions.d.mts +6 -0
- package/assets/types/typebox/build/schema/engine/_reducer.d.mts +4 -0
- package/assets/types/typebox/build/schema/engine/_refine.d.mts +6 -0
- package/assets/types/typebox/build/schema/engine/_stack.d.mts +18 -0
- package/assets/types/typebox/build/schema/engine/_unique.d.mts +2 -0
- package/assets/types/typebox/build/schema/engine/additionalItems.d.mts +6 -0
- package/assets/types/typebox/build/schema/engine/additionalProperties.d.mts +9 -0
- package/assets/types/typebox/build/schema/engine/allOf.d.mts +6 -0
- package/assets/types/typebox/build/schema/engine/anyOf.d.mts +6 -0
- package/assets/types/typebox/build/schema/engine/boolean.d.mts +5 -0
- package/assets/types/typebox/build/schema/engine/const.d.mts +6 -0
- package/assets/types/typebox/build/schema/engine/contains.d.mts +6 -0
- package/assets/types/typebox/build/schema/engine/dependencies.d.mts +6 -0
- package/assets/types/typebox/build/schema/engine/dependentRequired.d.mts +6 -0
- package/assets/types/typebox/build/schema/engine/dependentSchemas.d.mts +6 -0
- package/assets/types/typebox/build/schema/engine/dynamicRef.d.mts +6 -0
- package/assets/types/typebox/build/schema/engine/enum.d.mts +6 -0
- package/assets/types/typebox/build/schema/engine/exclusiveMaximum.d.mts +6 -0
- package/assets/types/typebox/build/schema/engine/exclusiveMinimum.d.mts +6 -0
- package/assets/types/typebox/build/schema/engine/format.d.mts +6 -0
- package/assets/types/typebox/build/schema/engine/if.d.mts +6 -0
- package/assets/types/typebox/build/schema/engine/index.d.mts +48 -0
- package/assets/types/typebox/build/schema/engine/items.d.mts +6 -0
- package/assets/types/typebox/build/schema/engine/maxContains.d.mts +6 -0
- package/assets/types/typebox/build/schema/engine/maxItems.d.mts +6 -0
- package/assets/types/typebox/build/schema/engine/maxLength.d.mts +6 -0
- package/assets/types/typebox/build/schema/engine/maxProperties.d.mts +6 -0
- package/assets/types/typebox/build/schema/engine/maximum.d.mts +6 -0
- package/assets/types/typebox/build/schema/engine/minContains.d.mts +6 -0
- package/assets/types/typebox/build/schema/engine/minItems.d.mts +6 -0
- package/assets/types/typebox/build/schema/engine/minLength.d.mts +6 -0
- package/assets/types/typebox/build/schema/engine/minProperties.d.mts +6 -0
- package/assets/types/typebox/build/schema/engine/minimum.d.mts +6 -0
- package/assets/types/typebox/build/schema/engine/multipleOf.d.mts +6 -0
- package/assets/types/typebox/build/schema/engine/not.d.mts +6 -0
- package/assets/types/typebox/build/schema/engine/oneOf.d.mts +6 -0
- package/assets/types/typebox/build/schema/engine/pattern.d.mts +6 -0
- package/assets/types/typebox/build/schema/engine/patternProperties.d.mts +6 -0
- package/assets/types/typebox/build/schema/engine/prefixItems.d.mts +6 -0
- package/assets/types/typebox/build/schema/engine/properties.d.mts +6 -0
- package/assets/types/typebox/build/schema/engine/propertyNames.d.mts +6 -0
- package/assets/types/typebox/build/schema/engine/recursiveRef.d.mts +6 -0
- package/assets/types/typebox/build/schema/engine/ref.d.mts +6 -0
- package/assets/types/typebox/build/schema/engine/required.d.mts +6 -0
- package/assets/types/typebox/build/schema/engine/schema.d.mts +9 -0
- package/assets/types/typebox/build/schema/engine/type.d.mts +6 -0
- package/assets/types/typebox/build/schema/engine/unevaluatedItems.d.mts +6 -0
- package/assets/types/typebox/build/schema/engine/unevaluatedProperties.d.mts +6 -0
- package/assets/types/typebox/build/schema/engine/uniqueItems.d.mts +6 -0
- package/assets/types/typebox/build/schema/errors.d.mts +6 -0
- package/assets/types/typebox/build/schema/index.d.mts +3 -0
- package/assets/types/typebox/build/schema/parse.d.mts +13 -0
- package/assets/types/typebox/build/schema/pointer/index.d.mts +2 -0
- package/assets/types/typebox/build/schema/pointer/pointer.d.mts +10 -0
- package/assets/types/typebox/build/schema/pointer/pointer_get.d.mts +9 -0
- package/assets/types/typebox/build/schema/resolve/index.d.mts +1 -0
- package/assets/types/typebox/build/schema/resolve/ref.d.mts +3 -0
- package/assets/types/typebox/build/schema/resolve/resolve.d.mts +1 -0
- package/assets/types/typebox/build/schema/schema.d.mts +10 -0
- package/assets/types/typebox/build/schema/static/_canonical.d.mts +7 -0
- package/assets/types/typebox/build/schema/static/_comparer.d.mts +6 -0
- package/assets/types/typebox/build/schema/static/_elements.d.mts +18 -0
- package/assets/types/typebox/build/schema/static/additionalProperties.d.mts +7 -0
- package/assets/types/typebox/build/schema/static/allOf.d.mts +3 -0
- package/assets/types/typebox/build/schema/static/anyOf.d.mts +3 -0
- package/assets/types/typebox/build/schema/static/const.d.mts +1 -0
- package/assets/types/typebox/build/schema/static/enum.d.mts +1 -0
- package/assets/types/typebox/build/schema/static/if.d.mts +15 -0
- package/assets/types/typebox/build/schema/static/index.d.mts +1 -0
- package/assets/types/typebox/build/schema/static/items.d.mts +7 -0
- package/assets/types/typebox/build/schema/static/oneOf.d.mts +3 -0
- package/assets/types/typebox/build/schema/static/patternProperties.d.mts +7 -0
- package/assets/types/typebox/build/schema/static/prefixItems.d.mts +3 -0
- package/assets/types/typebox/build/schema/static/properties.d.mts +32 -0
- package/assets/types/typebox/build/schema/static/ref.d.mts +8 -0
- package/assets/types/typebox/build/schema/static/required.d.mts +3 -0
- package/assets/types/typebox/build/schema/static/schema.d.mts +56 -0
- package/assets/types/typebox/build/schema/static/static.d.mts +4 -0
- package/assets/types/typebox/build/schema/static/type.d.mts +4 -0
- package/assets/types/typebox/build/schema/static/unevaluatedProperties.d.mts +7 -0
- package/assets/types/typebox/build/schema/types/_refine.d.mts +13 -0
- package/assets/types/typebox/build/schema/types/additionalItems.d.mts +9 -0
- package/assets/types/typebox/build/schema/types/additionalProperties.d.mts +9 -0
- package/assets/types/typebox/build/schema/types/allOf.d.mts +9 -0
- package/assets/types/typebox/build/schema/types/anchor.d.mts +8 -0
- package/assets/types/typebox/build/schema/types/anyOf.d.mts +9 -0
- package/assets/types/typebox/build/schema/types/const.d.mts +9 -0
- package/assets/types/typebox/build/schema/types/contains.d.mts +9 -0
- package/assets/types/typebox/build/schema/types/contentEncoding.d.mts +9 -0
- package/assets/types/typebox/build/schema/types/contentMediaType.d.mts +9 -0
- package/assets/types/typebox/build/schema/types/default.d.mts +9 -0
- package/assets/types/typebox/build/schema/types/defs.d.mts +6 -0
- package/assets/types/typebox/build/schema/types/dependencies.d.mts +11 -0
- package/assets/types/typebox/build/schema/types/dependentRequired.d.mts +9 -0
- package/assets/types/typebox/build/schema/types/dependentSchemas.d.mts +9 -0
- package/assets/types/typebox/build/schema/types/dynamicAnchor.d.mts +8 -0
- package/assets/types/typebox/build/schema/types/dynamicRef.d.mts +8 -0
- package/assets/types/typebox/build/schema/types/else.d.mts +9 -0
- package/assets/types/typebox/build/schema/types/enum.d.mts +9 -0
- package/assets/types/typebox/build/schema/types/exclusiveMaximum.d.mts +9 -0
- package/assets/types/typebox/build/schema/types/exclusiveMinimum.d.mts +9 -0
- package/assets/types/typebox/build/schema/types/format.d.mts +9 -0
- package/assets/types/typebox/build/schema/types/id.d.mts +9 -0
- package/assets/types/typebox/build/schema/types/if.d.mts +9 -0
- package/assets/types/typebox/build/schema/types/index.d.mts +53 -0
- package/assets/types/typebox/build/schema/types/items.d.mts +19 -0
- package/assets/types/typebox/build/schema/types/maxContains.d.mts +9 -0
- package/assets/types/typebox/build/schema/types/maxItems.d.mts +9 -0
- package/assets/types/typebox/build/schema/types/maxLength.d.mts +9 -0
- package/assets/types/typebox/build/schema/types/maxProperties.d.mts +9 -0
- package/assets/types/typebox/build/schema/types/maximum.d.mts +9 -0
- package/assets/types/typebox/build/schema/types/minContains.d.mts +9 -0
- package/assets/types/typebox/build/schema/types/minItems.d.mts +9 -0
- package/assets/types/typebox/build/schema/types/minLength.d.mts +9 -0
- package/assets/types/typebox/build/schema/types/minProperties.d.mts +9 -0
- package/assets/types/typebox/build/schema/types/minimum.d.mts +9 -0
- package/assets/types/typebox/build/schema/types/multipleOf.d.mts +9 -0
- package/assets/types/typebox/build/schema/types/not.d.mts +9 -0
- package/assets/types/typebox/build/schema/types/oneOf.d.mts +9 -0
- package/assets/types/typebox/build/schema/types/pattern.d.mts +9 -0
- package/assets/types/typebox/build/schema/types/patternProperties.d.mts +9 -0
- package/assets/types/typebox/build/schema/types/prefixItems.d.mts +8 -0
- package/assets/types/typebox/build/schema/types/properties.d.mts +9 -0
- package/assets/types/typebox/build/schema/types/propertyNames.d.mts +9 -0
- package/assets/types/typebox/build/schema/types/recursiveAnchor.d.mts +12 -0
- package/assets/types/typebox/build/schema/types/recursiveRef.d.mts +8 -0
- package/assets/types/typebox/build/schema/types/ref.d.mts +9 -0
- package/assets/types/typebox/build/schema/types/required.d.mts +9 -0
- package/assets/types/typebox/build/schema/types/schema.d.mts +9 -0
- package/assets/types/typebox/build/schema/types/then.d.mts +9 -0
- package/assets/types/typebox/build/schema/types/type.d.mts +9 -0
- package/assets/types/typebox/build/schema/types/unevaluatedItems.d.mts +9 -0
- package/assets/types/typebox/build/schema/types/unevaluatedProperties.d.mts +9 -0
- package/assets/types/typebox/build/schema/types/uniqueItems.d.mts +9 -0
- package/assets/types/typebox/build/system/arguments/arguments.d.mts +5 -0
- package/assets/types/typebox/build/system/arguments/index.d.mts +1 -0
- package/assets/types/typebox/build/system/environment/environment.d.mts +1 -0
- package/assets/types/typebox/build/system/environment/evaluate.d.mts +9 -0
- package/assets/types/typebox/build/system/environment/index.d.mts +1 -0
- package/assets/types/typebox/build/system/hashing/hash.d.mts +4 -0
- package/assets/types/typebox/build/system/hashing/index.d.mts +1 -0
- package/assets/types/typebox/build/system/index.d.mts +4 -0
- package/assets/types/typebox/build/system/locale/_config.d.mts +7 -0
- package/assets/types/typebox/build/system/locale/_locale.d.mts +40 -0
- package/assets/types/typebox/build/system/locale/ar_001.d.mts +3 -0
- package/assets/types/typebox/build/system/locale/bn_BD.d.mts +3 -0
- package/assets/types/typebox/build/system/locale/cs_CZ.d.mts +3 -0
- package/assets/types/typebox/build/system/locale/de_DE.d.mts +3 -0
- package/assets/types/typebox/build/system/locale/el_GR.d.mts +3 -0
- package/assets/types/typebox/build/system/locale/en_US.d.mts +3 -0
- package/assets/types/typebox/build/system/locale/es_419.d.mts +3 -0
- package/assets/types/typebox/build/system/locale/es_AR.d.mts +3 -0
- package/assets/types/typebox/build/system/locale/es_ES.d.mts +3 -0
- package/assets/types/typebox/build/system/locale/es_MX.d.mts +3 -0
- package/assets/types/typebox/build/system/locale/fa_IR.d.mts +3 -0
- package/assets/types/typebox/build/system/locale/fil_PH.d.mts +3 -0
- package/assets/types/typebox/build/system/locale/fr_CA.d.mts +3 -0
- package/assets/types/typebox/build/system/locale/fr_FR.d.mts +3 -0
- package/assets/types/typebox/build/system/locale/ha_NG.d.mts +3 -0
- package/assets/types/typebox/build/system/locale/hi_IN.d.mts +3 -0
- package/assets/types/typebox/build/system/locale/hu_HU.d.mts +3 -0
- package/assets/types/typebox/build/system/locale/id_ID.d.mts +3 -0
- package/assets/types/typebox/build/system/locale/index.d.mts +1 -0
- package/assets/types/typebox/build/system/locale/it_IT.d.mts +3 -0
- package/assets/types/typebox/build/system/locale/ja_JP.d.mts +3 -0
- package/assets/types/typebox/build/system/locale/ko_KR.d.mts +3 -0
- package/assets/types/typebox/build/system/locale/ms_MY.d.mts +3 -0
- package/assets/types/typebox/build/system/locale/nl_NL.d.mts +3 -0
- package/assets/types/typebox/build/system/locale/pl_PL.d.mts +3 -0
- package/assets/types/typebox/build/system/locale/pt_BR.d.mts +3 -0
- package/assets/types/typebox/build/system/locale/pt_PT.d.mts +3 -0
- package/assets/types/typebox/build/system/locale/ro_RO.d.mts +3 -0
- package/assets/types/typebox/build/system/locale/ru_RU.d.mts +3 -0
- package/assets/types/typebox/build/system/locale/sv_SE.d.mts +3 -0
- package/assets/types/typebox/build/system/locale/sw_TZ.d.mts +3 -0
- package/assets/types/typebox/build/system/locale/th_TH.d.mts +3 -0
- package/assets/types/typebox/build/system/locale/tr_TR.d.mts +3 -0
- package/assets/types/typebox/build/system/locale/uk_UA.d.mts +3 -0
- package/assets/types/typebox/build/system/locale/ur_PK.d.mts +3 -0
- package/assets/types/typebox/build/system/locale/vi_VN.d.mts +3 -0
- package/assets/types/typebox/build/system/locale/yo_NG.d.mts +3 -0
- package/assets/types/typebox/build/system/locale/zh_Hans.d.mts +3 -0
- package/assets/types/typebox/build/system/locale/zh_Hant.d.mts +3 -0
- package/assets/types/typebox/build/system/memory/assign.d.mts +14 -0
- package/assets/types/typebox/build/system/memory/clone.d.mts +5 -0
- package/assets/types/typebox/build/system/memory/create.d.mts +8 -0
- package/assets/types/typebox/build/system/memory/discard.d.mts +4 -0
- package/assets/types/typebox/build/system/memory/index.d.mts +1 -0
- package/assets/types/typebox/build/system/memory/memory.d.mts +6 -0
- package/assets/types/typebox/build/system/memory/metrics.d.mts +14 -0
- package/assets/types/typebox/build/system/memory/update.d.mts +7 -0
- package/assets/types/typebox/build/system/settings/index.d.mts +1 -0
- package/assets/types/typebox/build/system/settings/settings.d.mts +71 -0
- package/assets/types/typebox/build/system/system.d.mts +6 -0
- package/assets/types/typebox/build/system/unreachable/index.d.mts +1 -0
- package/assets/types/typebox/build/system/unreachable/unreachable.d.mts +3 -0
- package/assets/types/typebox/build/type/action/_add_immutable.d.mts +11 -0
- package/assets/types/typebox/build/type/action/_add_optional.d.mts +11 -0
- package/assets/types/typebox/build/type/action/_add_readonly.d.mts +11 -0
- package/assets/types/typebox/build/type/action/_remove_immutable.d.mts +11 -0
- package/assets/types/typebox/build/type/action/_remove_optional.d.mts +11 -0
- package/assets/types/typebox/build/type/action/_remove_readonly.d.mts +11 -0
- package/assets/types/typebox/build/type/action/capitalize.d.mts +11 -0
- package/assets/types/typebox/build/type/action/conditional.d.mts +12 -0
- package/assets/types/typebox/build/type/action/constructor_parameters.d.mts +11 -0
- package/assets/types/typebox/build/type/action/evaluate.d.mts +11 -0
- package/assets/types/typebox/build/type/action/exclude.d.mts +11 -0
- package/assets/types/typebox/build/type/action/extract.d.mts +11 -0
- package/assets/types/typebox/build/type/action/index.d.mts +30 -0
- package/assets/types/typebox/build/type/action/indexed.d.mts +14 -0
- package/assets/types/typebox/build/type/action/instance_type.d.mts +11 -0
- package/assets/types/typebox/build/type/action/interface.d.mts +14 -0
- package/assets/types/typebox/build/type/action/keyof.d.mts +11 -0
- package/assets/types/typebox/build/type/action/lowercase.d.mts +11 -0
- package/assets/types/typebox/build/type/action/mapped.d.mts +13 -0
- package/assets/types/typebox/build/type/action/module.d.mts +13 -0
- package/assets/types/typebox/build/type/action/non_nullable.d.mts +11 -0
- package/assets/types/typebox/build/type/action/omit.d.mts +14 -0
- package/assets/types/typebox/build/type/action/parameters.d.mts +11 -0
- package/assets/types/typebox/build/type/action/partial.d.mts +11 -0
- package/assets/types/typebox/build/type/action/pick.d.mts +14 -0
- package/assets/types/typebox/build/type/action/readonly_object.d.mts +16 -0
- package/assets/types/typebox/build/type/action/required.d.mts +11 -0
- package/assets/types/typebox/build/type/action/return_type.d.mts +11 -0
- package/assets/types/typebox/build/type/action/uncapitalize.d.mts +11 -0
- package/assets/types/typebox/build/type/action/uppercase.d.mts +11 -0
- package/assets/types/typebox/build/type/action/with.d.mts +11 -0
- package/assets/types/typebox/build/type/engine/call/distribute_arguments.d.mts +15 -0
- package/assets/types/typebox/build/type/engine/call/instantiate.d.mts +21 -0
- package/assets/types/typebox/build/type/engine/call/resolve_arguments.d.mts +13 -0
- package/assets/types/typebox/build/type/engine/call/resolve_target.d.mts +25 -0
- package/assets/types/typebox/build/type/engine/conditional/index.d.mts +1 -0
- package/assets/types/typebox/build/type/engine/conditional/instantiate.d.mts +12 -0
- package/assets/types/typebox/build/type/engine/constructor_parameters/index.d.mts +1 -0
- package/assets/types/typebox/build/type/engine/constructor_parameters/instantiate.d.mts +14 -0
- package/assets/types/typebox/build/type/engine/cyclic/candidates.d.mts +8 -0
- package/assets/types/typebox/build/type/engine/cyclic/check.d.mts +21 -0
- package/assets/types/typebox/build/type/engine/cyclic/dependencies.d.mts +22 -0
- package/assets/types/typebox/build/type/engine/cyclic/extends.d.mts +28 -0
- package/assets/types/typebox/build/type/engine/cyclic/index.d.mts +6 -0
- package/assets/types/typebox/build/type/engine/cyclic/instantiate.d.mts +17 -0
- package/assets/types/typebox/build/type/engine/cyclic/target.d.mts +10 -0
- package/assets/types/typebox/build/type/engine/enum/index.d.mts +1 -0
- package/assets/types/typebox/build/type/engine/enum/typescript_enum_to_enum_values.d.mts +8 -0
- package/assets/types/typebox/build/type/engine/evaluate/broaden.d.mts +15 -0
- package/assets/types/typebox/build/type/engine/evaluate/compare.d.mts +15 -0
- package/assets/types/typebox/build/type/engine/evaluate/composite.d.mts +34 -0
- package/assets/types/typebox/build/type/engine/evaluate/distribute.d.mts +28 -0
- package/assets/types/typebox/build/type/engine/evaluate/evaluate.d.mts +26 -0
- package/assets/types/typebox/build/type/engine/evaluate/flatten.d.mts +6 -0
- package/assets/types/typebox/build/type/engine/evaluate/index.d.mts +8 -0
- package/assets/types/typebox/build/type/engine/evaluate/instantiate.d.mts +8 -0
- package/assets/types/typebox/build/type/engine/evaluate/narrow.d.mts +5 -0
- package/assets/types/typebox/build/type/engine/exclude/index.d.mts +1 -0
- package/assets/types/typebox/build/type/engine/exclude/instantiate.d.mts +9 -0
- package/assets/types/typebox/build/type/engine/exclude/operation.d.mts +10 -0
- package/assets/types/typebox/build/type/engine/extract/index.d.mts +1 -0
- package/assets/types/typebox/build/type/engine/extract/instantiate.d.mts +9 -0
- package/assets/types/typebox/build/type/engine/extract/operation.d.mts +10 -0
- package/assets/types/typebox/build/type/engine/helpers/index.d.mts +3 -0
- package/assets/types/typebox/build/type/engine/helpers/keys.d.mts +3 -0
- package/assets/types/typebox/build/type/engine/helpers/keys_to_indexer.d.mts +7 -0
- package/assets/types/typebox/build/type/engine/helpers/union.d.mts +7 -0
- package/assets/types/typebox/build/type/engine/immutable/instantiate_add.d.mts +10 -0
- package/assets/types/typebox/build/type/engine/immutable/instantiate_remove.d.mts +10 -0
- package/assets/types/typebox/build/type/engine/index.d.mts +31 -0
- package/assets/types/typebox/build/type/engine/indexable/from_cyclic.d.mts +6 -0
- package/assets/types/typebox/build/type/engine/indexable/from_dependent.d.mts +5 -0
- package/assets/types/typebox/build/type/engine/indexable/from_enum.d.mts +6 -0
- package/assets/types/typebox/build/type/engine/indexable/from_intersect.d.mts +5 -0
- package/assets/types/typebox/build/type/engine/indexable/from_literal.d.mts +3 -0
- package/assets/types/typebox/build/type/engine/indexable/from_template_literal.d.mts +5 -0
- package/assets/types/typebox/build/type/engine/indexable/from_type.d.mts +19 -0
- package/assets/types/typebox/build/type/engine/indexable/from_union.d.mts +4 -0
- package/assets/types/typebox/build/type/engine/indexable/to_indexable.d.mts +9 -0
- package/assets/types/typebox/build/type/engine/indexable/to_indexable_keys.d.mts +10 -0
- package/assets/types/typebox/build/type/engine/indexed/array_indexer.d.mts +12 -0
- package/assets/types/typebox/build/type/engine/indexed/from_array.d.mts +15 -0
- package/assets/types/typebox/build/type/engine/indexed/from_object.d.mts +16 -0
- package/assets/types/typebox/build/type/engine/indexed/from_tuple.d.mts +13 -0
- package/assets/types/typebox/build/type/engine/indexed/from_type.d.mts +11 -0
- package/assets/types/typebox/build/type/engine/indexed/index.d.mts +1 -0
- package/assets/types/typebox/build/type/engine/indexed/instantiate.d.mts +16 -0
- package/assets/types/typebox/build/type/engine/instance_type/index.d.mts +1 -0
- package/assets/types/typebox/build/type/engine/instance_type/instantiate.d.mts +12 -0
- package/assets/types/typebox/build/type/engine/instantiate.d.mts +178 -0
- package/assets/types/typebox/build/type/engine/interface/index.d.mts +1 -0
- package/assets/types/typebox/build/type/engine/interface/instantiate.d.mts +15 -0
- package/assets/types/typebox/build/type/engine/intrinsics/from_literal.d.mts +5 -0
- package/assets/types/typebox/build/type/engine/intrinsics/from_template_literal.d.mts +6 -0
- package/assets/types/typebox/build/type/engine/intrinsics/from_type.d.mts +10 -0
- package/assets/types/typebox/build/type/engine/intrinsics/from_union.d.mts +6 -0
- package/assets/types/typebox/build/type/engine/intrinsics/index.d.mts +1 -0
- package/assets/types/typebox/build/type/engine/intrinsics/instantiate.d.mts +38 -0
- package/assets/types/typebox/build/type/engine/intrinsics/mapping.d.mts +9 -0
- package/assets/types/typebox/build/type/engine/keyof/from_any.d.mts +6 -0
- package/assets/types/typebox/build/type/engine/keyof/from_array.d.mts +4 -0
- package/assets/types/typebox/build/type/engine/keyof/from_object.d.mts +10 -0
- package/assets/types/typebox/build/type/engine/keyof/from_record.d.mts +4 -0
- package/assets/types/typebox/build/type/engine/keyof/from_tuple.d.mts +5 -0
- package/assets/types/typebox/build/type/engine/keyof/from_type.d.mts +15 -0
- package/assets/types/typebox/build/type/engine/keyof/index.d.mts +1 -0
- package/assets/types/typebox/build/type/engine/keyof/instantiate.d.mts +16 -0
- package/assets/types/typebox/build/type/engine/mapped/index.d.mts +1 -0
- package/assets/types/typebox/build/type/engine/mapped/instantiate.d.mts +10 -0
- package/assets/types/typebox/build/type/engine/mapped/mapped_operation.d.mts +22 -0
- package/assets/types/typebox/build/type/engine/mapped/mapped_variants.d.mts +17 -0
- package/assets/types/typebox/build/type/engine/module/index.d.mts +1 -0
- package/assets/types/typebox/build/type/engine/module/instantiate.d.mts +19 -0
- package/assets/types/typebox/build/type/engine/non_nullable/index.d.mts +1 -0
- package/assets/types/typebox/build/type/engine/non_nullable/instantiate.d.mts +14 -0
- package/assets/types/typebox/build/type/engine/object/collapse.d.mts +12 -0
- package/assets/types/typebox/build/type/engine/object/from_cyclic.d.mts +6 -0
- package/assets/types/typebox/build/type/engine/object/from_dependent.d.mts +5 -0
- package/assets/types/typebox/build/type/engine/object/from_intersect.d.mts +17 -0
- package/assets/types/typebox/build/type/engine/object/from_object.d.mts +3 -0
- package/assets/types/typebox/build/type/engine/object/from_tuple.d.mts +6 -0
- package/assets/types/typebox/build/type/engine/object/from_type.d.mts +16 -0
- package/assets/types/typebox/build/type/engine/object/from_union.d.mts +12 -0
- package/assets/types/typebox/build/type/engine/object/index.d.mts +1 -0
- package/assets/types/typebox/build/type/engine/omit/from_type.d.mts +12 -0
- package/assets/types/typebox/build/type/engine/omit/index.d.mts +1 -0
- package/assets/types/typebox/build/type/engine/omit/instantiate.d.mts +9 -0
- package/assets/types/typebox/build/type/engine/optional/instantiate_add.d.mts +10 -0
- package/assets/types/typebox/build/type/engine/optional/instantiate_remove.d.mts +10 -0
- package/assets/types/typebox/build/type/engine/parameters/index.d.mts +1 -0
- package/assets/types/typebox/build/type/engine/parameters/instantiate.d.mts +14 -0
- package/assets/types/typebox/build/type/engine/partial/from_cyclic.d.mts +10 -0
- package/assets/types/typebox/build/type/engine/partial/from_dependent.d.mts +5 -0
- package/assets/types/typebox/build/type/engine/partial/from_intersect.d.mts +5 -0
- package/assets/types/typebox/build/type/engine/partial/from_object.d.mts +8 -0
- package/assets/types/typebox/build/type/engine/partial/from_type.d.mts +14 -0
- package/assets/types/typebox/build/type/engine/partial/from_union.d.mts +5 -0
- package/assets/types/typebox/build/type/engine/partial/index.d.mts +1 -0
- package/assets/types/typebox/build/type/engine/partial/instantiate.d.mts +9 -0
- package/assets/types/typebox/build/type/engine/patterns/index.d.mts +2 -0
- package/assets/types/typebox/build/type/engine/patterns/pattern.d.mts +6 -0
- package/assets/types/typebox/build/type/engine/patterns/template.d.mts +7 -0
- package/assets/types/typebox/build/type/engine/pick/from_type.d.mts +13 -0
- package/assets/types/typebox/build/type/engine/pick/index.d.mts +1 -0
- package/assets/types/typebox/build/type/engine/pick/instantiate.d.mts +9 -0
- package/assets/types/typebox/build/type/engine/priority/index.d.mts +1 -0
- package/assets/types/typebox/build/type/engine/priority/priority.d.mts +20 -0
- package/assets/types/typebox/build/type/engine/readonly/instantiate_add.d.mts +10 -0
- package/assets/types/typebox/build/type/engine/readonly/instantiate_remove.d.mts +10 -0
- package/assets/types/typebox/build/type/engine/readonly_object/from_array.d.mts +5 -0
- package/assets/types/typebox/build/type/engine/readonly_object/from_cyclic.d.mts +10 -0
- package/assets/types/typebox/build/type/engine/readonly_object/from_dependent.d.mts +5 -0
- package/assets/types/typebox/build/type/engine/readonly_object/from_intersect.d.mts +5 -0
- package/assets/types/typebox/build/type/engine/readonly_object/from_object.d.mts +8 -0
- package/assets/types/typebox/build/type/engine/readonly_object/from_tuple.d.mts +5 -0
- package/assets/types/typebox/build/type/engine/readonly_object/from_type.d.mts +18 -0
- package/assets/types/typebox/build/type/engine/readonly_object/from_union.d.mts +5 -0
- package/assets/types/typebox/build/type/engine/readonly_object/index.d.mts +1 -0
- package/assets/types/typebox/build/type/engine/readonly_object/instantiate.d.mts +9 -0
- package/assets/types/typebox/build/type/engine/record/from_key.d.mts +24 -0
- package/assets/types/typebox/build/type/engine/record/from_key_any.d.mts +4 -0
- package/assets/types/typebox/build/type/engine/record/from_key_boolean.d.mts +7 -0
- package/assets/types/typebox/build/type/engine/record/from_key_enum.d.mts +6 -0
- package/assets/types/typebox/build/type/engine/record/from_key_integer.d.mts +5 -0
- package/assets/types/typebox/build/type/engine/record/from_key_intersect.d.mts +5 -0
- package/assets/types/typebox/build/type/engine/record/from_key_literal.d.mts +11 -0
- package/assets/types/typebox/build/type/engine/record/from_key_number.d.mts +5 -0
- package/assets/types/typebox/build/type/engine/record/from_key_string.d.mts +5 -0
- package/assets/types/typebox/build/type/engine/record/from_key_template_literal.d.mts +8 -0
- package/assets/types/typebox/build/type/engine/record/from_key_union.d.mts +20 -0
- package/assets/types/typebox/build/type/engine/record/index.d.mts +1 -0
- package/assets/types/typebox/build/type/engine/record/instantiate.d.mts +9 -0
- package/assets/types/typebox/build/type/engine/record/record_create.d.mts +3 -0
- package/assets/types/typebox/build/type/engine/ref/index.d.mts +1 -0
- package/assets/types/typebox/build/type/engine/ref/instantiate.d.mts +6 -0
- package/assets/types/typebox/build/type/engine/required/from_cyclic.d.mts +10 -0
- package/assets/types/typebox/build/type/engine/required/from_dependent.d.mts +5 -0
- package/assets/types/typebox/build/type/engine/required/from_intersect.d.mts +5 -0
- package/assets/types/typebox/build/type/engine/required/from_object.d.mts +8 -0
- package/assets/types/typebox/build/type/engine/required/from_type.d.mts +14 -0
- package/assets/types/typebox/build/type/engine/required/from_union.d.mts +5 -0
- package/assets/types/typebox/build/type/engine/required/index.d.mts +1 -0
- package/assets/types/typebox/build/type/engine/required/instantiate.d.mts +9 -0
- package/assets/types/typebox/build/type/engine/rest/index.d.mts +1 -0
- package/assets/types/typebox/build/type/engine/rest/spread.d.mts +12 -0
- package/assets/types/typebox/build/type/engine/return_type/index.d.mts +1 -0
- package/assets/types/typebox/build/type/engine/return_type/instantiate.d.mts +12 -0
- package/assets/types/typebox/build/type/engine/template_literal/create.d.mts +1 -0
- package/assets/types/typebox/build/type/engine/template_literal/decode.d.mts +30 -0
- package/assets/types/typebox/build/type/engine/template_literal/encode.d.mts +33 -0
- package/assets/types/typebox/build/type/engine/template_literal/index.d.mts +6 -0
- package/assets/types/typebox/build/type/engine/template_literal/instantiate.d.mts +9 -0
- package/assets/types/typebox/build/type/engine/template_literal/is_finite.d.mts +12 -0
- package/assets/types/typebox/build/type/engine/template_literal/is_pattern.d.mts +6 -0
- package/assets/types/typebox/build/type/engine/template_literal/static.d.mts +18 -0
- package/assets/types/typebox/build/type/engine/this/expand_this.d.mts +16 -0
- package/assets/types/typebox/build/type/engine/tuple/to_object.d.mts +12 -0
- package/assets/types/typebox/build/type/engine/with/index.d.mts +1 -0
- package/assets/types/typebox/build/type/engine/with/instantiate.d.mts +8 -0
- package/assets/types/typebox/build/type/extends/any.d.mts +9 -0
- package/assets/types/typebox/build/type/extends/array.d.mts +20 -0
- package/assets/types/typebox/build/type/extends/bigint.d.mts +7 -0
- package/assets/types/typebox/build/type/extends/boolean.d.mts +7 -0
- package/assets/types/typebox/build/type/extends/constructor.d.mts +10 -0
- package/assets/types/typebox/build/type/extends/dependent.d.mts +6 -0
- package/assets/types/typebox/build/type/extends/enum.d.mts +7 -0
- package/assets/types/typebox/build/type/extends/extends.d.mts +13 -0
- package/assets/types/typebox/build/type/extends/extends_left.d.mts +53 -0
- package/assets/types/typebox/build/type/extends/extends_right.d.mts +27 -0
- package/assets/types/typebox/build/type/extends/function.d.mts +10 -0
- package/assets/types/typebox/build/type/extends/index.d.mts +2 -0
- package/assets/types/typebox/build/type/extends/inference.d.mts +34 -0
- package/assets/types/typebox/build/type/extends/integer.d.mts +8 -0
- package/assets/types/typebox/build/type/extends/intersect.d.mts +6 -0
- package/assets/types/typebox/build/type/extends/literal.d.mts +18 -0
- package/assets/types/typebox/build/type/extends/never.d.mts +8 -0
- package/assets/types/typebox/build/type/extends/null.d.mts +7 -0
- package/assets/types/typebox/build/type/extends/number.d.mts +7 -0
- package/assets/types/typebox/build/type/extends/object.d.mts +32 -0
- package/assets/types/typebox/build/type/extends/parameters.d.mts +15 -0
- package/assets/types/typebox/build/type/extends/record.d.mts +13 -0
- package/assets/types/typebox/build/type/extends/result.d.mts +24 -0
- package/assets/types/typebox/build/type/extends/return_type.d.mts +7 -0
- package/assets/types/typebox/build/type/extends/string.d.mts +7 -0
- package/assets/types/typebox/build/type/extends/symbol.d.mts +7 -0
- package/assets/types/typebox/build/type/extends/template_literal.d.mts +6 -0
- package/assets/types/typebox/build/type/extends/tuple.d.mts +22 -0
- package/assets/types/typebox/build/type/extends/undefined.d.mts +8 -0
- package/assets/types/typebox/build/type/extends/union.d.mts +11 -0
- package/assets/types/typebox/build/type/extends/unknown.d.mts +9 -0
- package/assets/types/typebox/build/type/extends/void.d.mts +7 -0
- package/assets/types/typebox/build/type/index.d.mts +5 -0
- package/assets/types/typebox/build/type/script/index.d.mts +1 -0
- package/assets/types/typebox/build/type/script/mapping.d.mts +353 -0
- package/assets/types/typebox/build/type/script/parser.d.mts +262 -0
- package/assets/types/typebox/build/type/script/script.d.mts +16 -0
- package/assets/types/typebox/build/type/script/token/bigint.d.mts +8 -0
- package/assets/types/typebox/build/type/script/token/const.d.mts +11 -0
- package/assets/types/typebox/build/type/script/token/ident.d.mts +16 -0
- package/assets/types/typebox/build/type/script/token/index.d.mts +12 -0
- package/assets/types/typebox/build/type/script/token/integer.d.mts +11 -0
- package/assets/types/typebox/build/type/script/token/internal/char.d.mts +75 -0
- package/assets/types/typebox/build/type/script/token/internal/guard.d.mts +1 -0
- package/assets/types/typebox/build/type/script/token/internal/many.d.mts +7 -0
- package/assets/types/typebox/build/type/script/token/internal/match.d.mts +6 -0
- package/assets/types/typebox/build/type/script/token/internal/optional.d.mts +5 -0
- package/assets/types/typebox/build/type/script/token/internal/take.d.mts +6 -0
- package/assets/types/typebox/build/type/script/token/internal/trim.d.mts +19 -0
- package/assets/types/typebox/build/type/script/token/number.d.mts +11 -0
- package/assets/types/typebox/build/type/script/token/rest.d.mts +4 -0
- package/assets/types/typebox/build/type/script/token/span.d.mts +11 -0
- package/assets/types/typebox/build/type/script/token/string.d.mts +11 -0
- package/assets/types/typebox/build/type/script/token/unsigned_integer.d.mts +16 -0
- package/assets/types/typebox/build/type/script/token/unsigned_number.d.mts +17 -0
- package/assets/types/typebox/build/type/script/token/until.d.mts +7 -0
- package/assets/types/typebox/build/type/script/token/until_1.d.mts +5 -0
- package/assets/types/typebox/build/type/types/_codec.d.mts +30 -0
- package/assets/types/typebox/build/type/types/_immutable.d.mts +9 -0
- package/assets/types/typebox/build/type/types/_optional.d.mts +9 -0
- package/assets/types/typebox/build/type/types/_readonly.d.mts +9 -0
- package/assets/types/typebox/build/type/types/_refine.d.mts +24 -0
- package/assets/types/typebox/build/type/types/any.d.mts +10 -0
- package/assets/types/typebox/build/type/types/array.d.mts +18 -0
- package/assets/types/typebox/build/type/types/bigint.d.mts +12 -0
- package/assets/types/typebox/build/type/types/boolean.d.mts +11 -0
- package/assets/types/typebox/build/type/types/call.d.mts +16 -0
- package/assets/types/typebox/build/type/types/constructor.d.mts +18 -0
- package/assets/types/typebox/build/type/types/cyclic.d.mts +16 -0
- package/assets/types/typebox/build/type/types/deferred.d.mts +13 -0
- package/assets/types/typebox/build/type/types/dependent.d.mts +17 -0
- package/assets/types/typebox/build/type/types/enum.d.mts +18 -0
- package/assets/types/typebox/build/type/types/function.d.mts +21 -0
- package/assets/types/typebox/build/type/types/generic.d.mts +13 -0
- package/assets/types/typebox/build/type/types/identifier.d.mts +11 -0
- package/assets/types/typebox/build/type/types/index.d.mts +45 -0
- package/assets/types/typebox/build/type/types/infer.d.mts +15 -0
- package/assets/types/typebox/build/type/types/integer.d.mts +12 -0
- package/assets/types/typebox/build/type/types/intersect.d.mts +15 -0
- package/assets/types/typebox/build/type/types/literal.d.mts +31 -0
- package/assets/types/typebox/build/type/types/never.d.mts +12 -0
- package/assets/types/typebox/build/type/types/null.d.mts +11 -0
- package/assets/types/typebox/build/type/types/number.d.mts +12 -0
- package/assets/types/typebox/build/type/types/object.d.mts +18 -0
- package/assets/types/typebox/build/type/types/parameter.d.mts +17 -0
- package/assets/types/typebox/build/type/types/properties.d.mts +43 -0
- package/assets/types/typebox/build/type/types/record.d.mts +52 -0
- package/assets/types/typebox/build/type/types/ref.d.mts +19 -0
- package/assets/types/typebox/build/type/types/rest.d.mts +11 -0
- package/assets/types/typebox/build/type/types/schema.d.mts +176 -0
- package/assets/types/typebox/build/type/types/static.d.mts +45 -0
- package/assets/types/typebox/build/type/types/string.d.mts +12 -0
- package/assets/types/typebox/build/type/types/symbol.d.mts +11 -0
- package/assets/types/typebox/build/type/types/template_literal.d.mts +28 -0
- package/assets/types/typebox/build/type/types/this.d.mts +14 -0
- package/assets/types/typebox/build/type/types/tuple.d.mts +38 -0
- package/assets/types/typebox/build/type/types/undefined.d.mts +11 -0
- package/assets/types/typebox/build/type/types/union.d.mts +15 -0
- package/assets/types/typebox/build/type/types/unknown.d.mts +10 -0
- package/assets/types/typebox/build/type/types/unsafe.d.mts +10 -0
- package/assets/types/typebox/build/type/types/void.d.mts +11 -0
- package/assets/types/typebox/build/typebox.d.mts +69 -0
- package/assets/types/typebox/build/value/assert/assert.d.mts +14 -0
- package/assets/types/typebox/build/value/assert/index.d.mts +1 -0
- package/assets/types/typebox/build/value/check/check.d.mts +5 -0
- package/assets/types/typebox/build/value/check/index.d.mts +1 -0
- package/assets/types/typebox/build/value/clean/additional.d.mts +2 -0
- package/assets/types/typebox/build/value/clean/clean.d.mts +15 -0
- package/assets/types/typebox/build/value/clean/from_array.d.mts +2 -0
- package/assets/types/typebox/build/value/clean/from_cyclic.d.mts +2 -0
- package/assets/types/typebox/build/value/clean/from_intersect.d.mts +2 -0
- package/assets/types/typebox/build/value/clean/from_object.d.mts +2 -0
- package/assets/types/typebox/build/value/clean/from_record.d.mts +2 -0
- package/assets/types/typebox/build/value/clean/from_ref.d.mts +2 -0
- package/assets/types/typebox/build/value/clean/from_tuple.d.mts +2 -0
- package/assets/types/typebox/build/value/clean/from_type.d.mts +2 -0
- package/assets/types/typebox/build/value/clean/from_union.d.mts +2 -0
- package/assets/types/typebox/build/value/clean/index.d.mts +1 -0
- package/assets/types/typebox/build/value/clone/clone.d.mts +5 -0
- package/assets/types/typebox/build/value/clone/index.d.mts +1 -0
- package/assets/types/typebox/build/value/codec/callback.d.mts +2 -0
- package/assets/types/typebox/build/value/codec/decode.d.mts +12 -0
- package/assets/types/typebox/build/value/codec/encode.d.mts +12 -0
- package/assets/types/typebox/build/value/codec/from_array.d.mts +2 -0
- package/assets/types/typebox/build/value/codec/from_cyclic.d.mts +2 -0
- package/assets/types/typebox/build/value/codec/from_intersect.d.mts +2 -0
- package/assets/types/typebox/build/value/codec/from_object.d.mts +2 -0
- package/assets/types/typebox/build/value/codec/from_record.d.mts +2 -0
- package/assets/types/typebox/build/value/codec/from_ref.d.mts +2 -0
- package/assets/types/typebox/build/value/codec/from_tuple.d.mts +2 -0
- package/assets/types/typebox/build/value/codec/from_type.d.mts +2 -0
- package/assets/types/typebox/build/value/codec/from_union.d.mts +2 -0
- package/assets/types/typebox/build/value/codec/has.d.mts +5 -0
- package/assets/types/typebox/build/value/codec/index.d.mts +3 -0
- package/assets/types/typebox/build/value/convert/convert.d.mts +13 -0
- package/assets/types/typebox/build/value/convert/from_additional.d.mts +6 -0
- package/assets/types/typebox/build/value/convert/from_array.d.mts +2 -0
- package/assets/types/typebox/build/value/convert/from_bigint.d.mts +2 -0
- package/assets/types/typebox/build/value/convert/from_boolean.d.mts +2 -0
- package/assets/types/typebox/build/value/convert/from_cyclic.d.mts +2 -0
- package/assets/types/typebox/build/value/convert/from_enum.d.mts +2 -0
- package/assets/types/typebox/build/value/convert/from_integer.d.mts +2 -0
- package/assets/types/typebox/build/value/convert/from_intersect.d.mts +2 -0
- package/assets/types/typebox/build/value/convert/from_literal.d.mts +2 -0
- package/assets/types/typebox/build/value/convert/from_null.d.mts +2 -0
- package/assets/types/typebox/build/value/convert/from_number.d.mts +2 -0
- package/assets/types/typebox/build/value/convert/from_object.d.mts +2 -0
- package/assets/types/typebox/build/value/convert/from_record.d.mts +2 -0
- package/assets/types/typebox/build/value/convert/from_ref.d.mts +2 -0
- package/assets/types/typebox/build/value/convert/from_string.d.mts +2 -0
- package/assets/types/typebox/build/value/convert/from_template_literal.d.mts +2 -0
- package/assets/types/typebox/build/value/convert/from_tuple.d.mts +2 -0
- package/assets/types/typebox/build/value/convert/from_type.d.mts +2 -0
- package/assets/types/typebox/build/value/convert/from_undefined.d.mts +2 -0
- package/assets/types/typebox/build/value/convert/from_union.d.mts +2 -0
- package/assets/types/typebox/build/value/convert/from_void.d.mts +2 -0
- package/assets/types/typebox/build/value/convert/index.d.mts +1 -0
- package/assets/types/typebox/build/value/convert/try/index.d.mts +1 -0
- package/assets/types/typebox/build/value/convert/try/try.d.mts +8 -0
- package/assets/types/typebox/build/value/convert/try/try_array.d.mts +2 -0
- package/assets/types/typebox/build/value/convert/try/try_bigint.d.mts +2 -0
- package/assets/types/typebox/build/value/convert/try/try_boolean.d.mts +2 -0
- package/assets/types/typebox/build/value/convert/try/try_null.d.mts +2 -0
- package/assets/types/typebox/build/value/convert/try/try_number.d.mts +2 -0
- package/assets/types/typebox/build/value/convert/try/try_result.d.mts +8 -0
- package/assets/types/typebox/build/value/convert/try/try_string.d.mts +2 -0
- package/assets/types/typebox/build/value/convert/try/try_undefined.d.mts +2 -0
- package/assets/types/typebox/build/value/create/create.d.mts +5 -0
- package/assets/types/typebox/build/value/create/error.d.mts +5 -0
- package/assets/types/typebox/build/value/create/from_array.d.mts +2 -0
- package/assets/types/typebox/build/value/create/from_bigint.d.mts +2 -0
- package/assets/types/typebox/build/value/create/from_boolean.d.mts +2 -0
- package/assets/types/typebox/build/value/create/from_constructor.d.mts +2 -0
- package/assets/types/typebox/build/value/create/from_cyclic.d.mts +2 -0
- package/assets/types/typebox/build/value/create/from_default.d.mts +3 -0
- package/assets/types/typebox/build/value/create/from_enum.d.mts +2 -0
- package/assets/types/typebox/build/value/create/from_function.d.mts +2 -0
- package/assets/types/typebox/build/value/create/from_integer.d.mts +2 -0
- package/assets/types/typebox/build/value/create/from_intersect.d.mts +2 -0
- package/assets/types/typebox/build/value/create/from_literal.d.mts +2 -0
- package/assets/types/typebox/build/value/create/from_never.d.mts +2 -0
- package/assets/types/typebox/build/value/create/from_null.d.mts +2 -0
- package/assets/types/typebox/build/value/create/from_number.d.mts +2 -0
- package/assets/types/typebox/build/value/create/from_object.d.mts +2 -0
- package/assets/types/typebox/build/value/create/from_record.d.mts +2 -0
- package/assets/types/typebox/build/value/create/from_ref.d.mts +2 -0
- package/assets/types/typebox/build/value/create/from_string.d.mts +2 -0
- package/assets/types/typebox/build/value/create/from_symbol.d.mts +2 -0
- package/assets/types/typebox/build/value/create/from_template_literal.d.mts +2 -0
- package/assets/types/typebox/build/value/create/from_tuple.d.mts +2 -0
- package/assets/types/typebox/build/value/create/from_type.d.mts +2 -0
- package/assets/types/typebox/build/value/create/from_undefined.d.mts +2 -0
- package/assets/types/typebox/build/value/create/from_union.d.mts +2 -0
- package/assets/types/typebox/build/value/create/from_void.d.mts +2 -0
- package/assets/types/typebox/build/value/create/index.d.mts +2 -0
- package/assets/types/typebox/build/value/default/default.d.mts +13 -0
- package/assets/types/typebox/build/value/default/from_array.d.mts +2 -0
- package/assets/types/typebox/build/value/default/from_cyclic.d.mts +2 -0
- package/assets/types/typebox/build/value/default/from_default.d.mts +3 -0
- package/assets/types/typebox/build/value/default/from_intersect.d.mts +2 -0
- package/assets/types/typebox/build/value/default/from_object.d.mts +2 -0
- package/assets/types/typebox/build/value/default/from_record.d.mts +2 -0
- package/assets/types/typebox/build/value/default/from_ref.d.mts +2 -0
- package/assets/types/typebox/build/value/default/from_tuple.d.mts +2 -0
- package/assets/types/typebox/build/value/default/from_type.d.mts +2 -0
- package/assets/types/typebox/build/value/default/from_union.d.mts +2 -0
- package/assets/types/typebox/build/value/default/index.d.mts +1 -0
- package/assets/types/typebox/build/value/delta/diff.d.mts +10 -0
- package/assets/types/typebox/build/value/delta/edit.d.mts +24 -0
- package/assets/types/typebox/build/value/delta/index.d.mts +3 -0
- package/assets/types/typebox/build/value/delta/patch.d.mts +8 -0
- package/assets/types/typebox/build/value/equal/equal.d.mts +2 -0
- package/assets/types/typebox/build/value/equal/index.d.mts +1 -0
- package/assets/types/typebox/build/value/errors/errors.d.mts +16 -0
- package/assets/types/typebox/build/value/errors/index.d.mts +1 -0
- package/assets/types/typebox/build/value/hash/hash.d.mts +6 -0
- package/assets/types/typebox/build/value/hash/index.d.mts +1 -0
- package/assets/types/typebox/build/value/index.d.mts +20 -0
- package/assets/types/typebox/build/value/parse/index.d.mts +1 -0
- package/assets/types/typebox/build/value/parse/parse.d.mts +11 -0
- package/assets/types/typebox/build/value/pipeline/index.d.mts +1 -0
- package/assets/types/typebox/build/value/pipeline/pipeline.d.mts +10 -0
- package/assets/types/typebox/build/value/pointer/index.d.mts +1 -0
- package/assets/types/typebox/build/value/repair/error.d.mts +7 -0
- package/assets/types/typebox/build/value/repair/from_array.d.mts +2 -0
- package/assets/types/typebox/build/value/repair/from_enum.d.mts +2 -0
- package/assets/types/typebox/build/value/repair/from_intersect.d.mts +2 -0
- package/assets/types/typebox/build/value/repair/from_object.d.mts +2 -0
- package/assets/types/typebox/build/value/repair/from_record.d.mts +2 -0
- package/assets/types/typebox/build/value/repair/from_ref.d.mts +2 -0
- package/assets/types/typebox/build/value/repair/from_template_literal.d.mts +2 -0
- package/assets/types/typebox/build/value/repair/from_tuple.d.mts +2 -0
- package/assets/types/typebox/build/value/repair/from_type.d.mts +2 -0
- package/assets/types/typebox/build/value/repair/from_union.d.mts +2 -0
- package/assets/types/typebox/build/value/repair/from_unknown.d.mts +2 -0
- package/assets/types/typebox/build/value/repair/index.d.mts +1 -0
- package/assets/types/typebox/build/value/repair/repair.d.mts +17 -0
- package/assets/types/typebox/build/value/shared/index.d.mts +3 -0
- package/assets/types/typebox/build/value/shared/optional_undefined.d.mts +2 -0
- package/assets/types/typebox/build/value/shared/union_priority_sort.d.mts +7 -0
- package/assets/types/typebox/build/value/shared/union_score_select.d.mts +3 -0
- package/assets/types/typebox/build/value/value.d.mts +15 -0
- package/assets/types/typebox/package.json +87 -0
- package/package.json +28 -0
- package/src/alt-screen.ts +46 -0
- package/src/argv.ts +147 -0
- package/src/cli-tree-host.ts +81 -0
- package/src/cli.ts +155 -0
- package/src/fatal-signal.ts +45 -0
- package/src/final-frame.ts +71 -0
- package/src/interactive-run.ts +231 -0
- package/src/presenter.ts +31 -0
- package/src/render.ts +96 -0
- package/src/run-invocation.ts +48 -0
- package/src/runtime-alias.ts +64 -0
- package/src/setup-workspace.ts +91 -0
- package/src/tree-app.ts +178 -0
- package/src/tui-test-support.ts +96 -0
package/src/cli.ts
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
import { writeSync } from "node:fs";
|
|
3
|
+
import { resolve } from "node:path";
|
|
4
|
+
import {
|
|
5
|
+
executeRun,
|
|
6
|
+
isOrchestrationProgram,
|
|
7
|
+
isYaagError,
|
|
8
|
+
loadCassette,
|
|
9
|
+
type OrchestrationProgram,
|
|
10
|
+
programDefinition,
|
|
11
|
+
type StampedEventSink,
|
|
12
|
+
} from "@yaag/runtime";
|
|
13
|
+
import { interactiveAvailable } from "./alt-screen.ts";
|
|
14
|
+
import { parseArgv } from "./argv.ts";
|
|
15
|
+
import { runInteractive } from "./interactive-run.ts";
|
|
16
|
+
import { createPlainPresenter } from "./presenter.ts";
|
|
17
|
+
import { executeOptions, formatResult, type RunFlags } from "./run-invocation.ts";
|
|
18
|
+
import { registerRuntimeAlias } from "./runtime-alias.ts";
|
|
19
|
+
import { setupWorkspace } from "./setup-workspace.ts";
|
|
20
|
+
|
|
21
|
+
registerRuntimeAlias();
|
|
22
|
+
|
|
23
|
+
/** Sets up a workspace, runs, or describes one Orchestration Program and returns an exit code. */
|
|
24
|
+
export async function main(argv: readonly string[]): Promise<number> {
|
|
25
|
+
const parsed = parseArgv(argv);
|
|
26
|
+
if (!parsed.ok) {
|
|
27
|
+
process.stderr.write(`${parsed.error}\n`);
|
|
28
|
+
return 2;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
try {
|
|
32
|
+
if (parsed.command === "setup-workspace") {
|
|
33
|
+
process.stdout.write(`${(await setupWorkspace(resolve(parsed.dir))).join("\n")}\n`);
|
|
34
|
+
return 0;
|
|
35
|
+
}
|
|
36
|
+
// A bad artifact must fail before importing an arbitrary program module.
|
|
37
|
+
if (parsed.command === "run" && (parsed.replay !== undefined || parsed.resume !== undefined)) {
|
|
38
|
+
await loadCassette(parsed.replay ?? parsed.resume ?? "");
|
|
39
|
+
}
|
|
40
|
+
const programFile = resolve(parsed.file);
|
|
41
|
+
const program = await loadProgram(programFile);
|
|
42
|
+
if (parsed.command === "describe") return describe(program);
|
|
43
|
+
return await run(program, {
|
|
44
|
+
programFile,
|
|
45
|
+
args: parsed.args,
|
|
46
|
+
eventsFd: parsed.eventsFd,
|
|
47
|
+
record: parsed.record,
|
|
48
|
+
replay: parsed.replay,
|
|
49
|
+
resume: parsed.resume,
|
|
50
|
+
quiet: parsed.quiet,
|
|
51
|
+
});
|
|
52
|
+
} catch (error) {
|
|
53
|
+
process.stderr.write(`[yaag] ${error instanceof Error ? error.message : String(error)}\n`);
|
|
54
|
+
return parsed.command === "run" && isYaagError(error) && error.code === "ARGS_INVALID" ? 2 : 1;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function describe(program: OrchestrationProgram): number {
|
|
59
|
+
const definition = programDefinition(program);
|
|
60
|
+
process.stdout.write(
|
|
61
|
+
`${JSON.stringify({
|
|
62
|
+
name: definition.name ?? null,
|
|
63
|
+
description: definition.description ?? null,
|
|
64
|
+
args: definition.args ?? null,
|
|
65
|
+
})}\n`,
|
|
66
|
+
);
|
|
67
|
+
return 0;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
async function run(program: OrchestrationProgram, flags: RunFlags): Promise<number> {
|
|
71
|
+
if (
|
|
72
|
+
interactiveAvailable({
|
|
73
|
+
stdin: process.stdin,
|
|
74
|
+
stdout: process.stdout,
|
|
75
|
+
stderr: process.stderr,
|
|
76
|
+
quiet: flags.quiet,
|
|
77
|
+
})
|
|
78
|
+
) {
|
|
79
|
+
return await runInteractive({
|
|
80
|
+
program,
|
|
81
|
+
flags,
|
|
82
|
+
events: (present) => eventSink(flags.eventsFd, present),
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
return await runPlain(program, flags);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* The plain path: sanitized stderr lines, and stdin EOF as a stop.
|
|
90
|
+
*
|
|
91
|
+
* The interactive path cannot share this wiring, because `ProcessTerminal`
|
|
92
|
+
* owns stdin in raw mode, where Ctrl-D arrives as a `\x04` byte and no `end`
|
|
93
|
+
* event ever fires.
|
|
94
|
+
*/
|
|
95
|
+
async function runPlain(program: OrchestrationProgram, flags: RunFlags): Promise<number> {
|
|
96
|
+
const presenter = createPlainPresenter(flags.quiet);
|
|
97
|
+
const stop = new AbortController();
|
|
98
|
+
const onSignal = (): void => stop.abort();
|
|
99
|
+
process.on("SIGINT", onSignal);
|
|
100
|
+
process.on("SIGTERM", onSignal);
|
|
101
|
+
// Stdin EOF is how a parent stops a Run it started (ADR-0008): it takes the
|
|
102
|
+
// same path as a signal, so every Agent is still reaped and costed. On a TTY
|
|
103
|
+
// the event simply never fires.
|
|
104
|
+
process.stdin.on("end", onSignal);
|
|
105
|
+
process.stdin.resume();
|
|
106
|
+
|
|
107
|
+
try {
|
|
108
|
+
const result = await executeRun(
|
|
109
|
+
program,
|
|
110
|
+
executeOptions(flags, eventSink(flags.eventsFd, presenter.present), stop.signal),
|
|
111
|
+
);
|
|
112
|
+
const output = formatResult(result);
|
|
113
|
+
if (output !== null) process.stdout.write(`${output}\n`);
|
|
114
|
+
return 0;
|
|
115
|
+
} finally {
|
|
116
|
+
process.off("SIGINT", onSignal);
|
|
117
|
+
process.off("SIGTERM", onSignal);
|
|
118
|
+
process.stdin.off("end", onSignal);
|
|
119
|
+
process.stdin.pause();
|
|
120
|
+
presenter.dispose();
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* The descriptor, when asked for, gets each event verbatim in the v1 envelope
|
|
126
|
+
* (ADR-0016). writeSync keeps the framing whole — one write, one line — and
|
|
127
|
+
* survives the process exiting right after the final event.
|
|
128
|
+
*/
|
|
129
|
+
function eventSink(fd: number | undefined, present: StampedEventSink): StampedEventSink {
|
|
130
|
+
return (event) => {
|
|
131
|
+
if (fd !== undefined) writeSync(fd, `${JSON.stringify({ v: 1, ...event })}\n`);
|
|
132
|
+
present(event);
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/** The program is the module's default export, and nothing else will do. */
|
|
137
|
+
async function loadProgram(path: string): Promise<OrchestrationProgram> {
|
|
138
|
+
const module: unknown = await import(path);
|
|
139
|
+
const program =
|
|
140
|
+
typeof module === "object" && module !== null && "default" in module
|
|
141
|
+
? module.default
|
|
142
|
+
: undefined;
|
|
143
|
+
if (!isOrchestrationProgram(program)) {
|
|
144
|
+
throw new Error(`${path}: export defineRun({ run }) as the default export`);
|
|
145
|
+
}
|
|
146
|
+
return program;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
if (import.meta.main) {
|
|
150
|
+
const code = await main(process.argv.slice(2));
|
|
151
|
+
// Exit rather than wait for the loop to drain: a stopped Run may leave the
|
|
152
|
+
// program's own timers pending, and a stop that does not actually end the
|
|
153
|
+
// process is not a stop (ADR-0008). Every Agent is already reaped by here.
|
|
154
|
+
process.exit(code);
|
|
155
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The first-write-wins fatal latch the interactive Run path races and reads.
|
|
3
|
+
*
|
|
4
|
+
* A render throw arrives from a callback, so the orchestration must observe it
|
|
5
|
+
* two ways: `wait` for the live races, and `taken()` for the continuation
|
|
6
|
+
* boundary a race cannot see — a fatal queued after the raced work resolved can
|
|
7
|
+
* never win that race, so it is read synchronously instead.
|
|
8
|
+
*/
|
|
9
|
+
import type { TreeAppExit } from "./tree-app.ts";
|
|
10
|
+
|
|
11
|
+
/** The fatal variant of a `TreeAppExit`. */
|
|
12
|
+
export type FatalExit = Extract<TreeAppExit, { kind: "fatal" }>;
|
|
13
|
+
|
|
14
|
+
/** A fatal error, awaitable and synchronously readable. */
|
|
15
|
+
export interface FatalSignal {
|
|
16
|
+
/** Accepts the first error only; later errors are ignored (no re-entry). */
|
|
17
|
+
raise(error: unknown): void;
|
|
18
|
+
/** Resolves when a fatal is raised, and never otherwise. For racing. */
|
|
19
|
+
readonly wait: Promise<FatalExit>;
|
|
20
|
+
/** The raised fatal, read synchronously. Undefined until one is raised. */
|
|
21
|
+
taken(): FatalExit | undefined;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Creates one fatal latch.
|
|
26
|
+
*
|
|
27
|
+
* `raise` stores the exit before it resolves `wait`, so `taken()` reports the
|
|
28
|
+
* fatal in the same tick as the call. It never throws and never rejects.
|
|
29
|
+
*/
|
|
30
|
+
export function createFatalSignal(): FatalSignal {
|
|
31
|
+
let taken: FatalExit | undefined;
|
|
32
|
+
let deliver: (exit: FatalExit) => void = () => {};
|
|
33
|
+
const wait = new Promise<FatalExit>((resolve) => {
|
|
34
|
+
deliver = resolve;
|
|
35
|
+
});
|
|
36
|
+
return {
|
|
37
|
+
raise(error: unknown): void {
|
|
38
|
+
if (taken !== undefined) return;
|
|
39
|
+
taken = { kind: "fatal", error };
|
|
40
|
+
deliver(taken);
|
|
41
|
+
},
|
|
42
|
+
wait,
|
|
43
|
+
taken: () => taken,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The final summary frame the CLI leaves on stderr after the alt-screen closes
|
|
3
|
+
* (architecture §9).
|
|
4
|
+
*
|
|
5
|
+
* Pure over the `TreeState`: it takes its clock and its width, so the same
|
|
6
|
+
* state always renders the same frame. It replaces the retained last frame the
|
|
7
|
+
* CLI used to leave on the terminal. It is now on stderr, where the Run result
|
|
8
|
+
* on stdout stays pipeable.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { visibleWidth } from "@earendil-works/pi-tui";
|
|
12
|
+
import type { TreeState } from "@yaag/tui";
|
|
13
|
+
import { type RunViewResult, renderCompact, resultText, sanitizeTerminalLine } from "@yaag/tui";
|
|
14
|
+
|
|
15
|
+
/** Everything the frame needs; nothing is read from the process. */
|
|
16
|
+
export interface FinalFrameOptions {
|
|
17
|
+
readonly now: number;
|
|
18
|
+
readonly columns: number;
|
|
19
|
+
/** Header text before the Program name; defaults to `yaag`. */
|
|
20
|
+
readonly label?: string;
|
|
21
|
+
/** How the Run ended; absent while it did not end. */
|
|
22
|
+
readonly result?: RunViewResult;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const RESULT_HEADING = "Result:";
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Renders the header line, one line per Agent, and the `Result:` block.
|
|
29
|
+
*
|
|
30
|
+
* Every line is sanitized and cut to `columns` terminal display columns — the
|
|
31
|
+
* `Result:` heading included — so a hostile Program name, Run value, or stderr
|
|
32
|
+
* tail can emit no escape byte, forge no region, and overflow no narrow
|
|
33
|
+
* terminal, even when it is wide Unicode.
|
|
34
|
+
*/
|
|
35
|
+
export function finalFrame(state: TreeState, options: FinalFrameOptions): readonly string[] {
|
|
36
|
+
const width = Math.max(1, options.columns);
|
|
37
|
+
const compact = renderCompact(state, {
|
|
38
|
+
now: options.now,
|
|
39
|
+
width,
|
|
40
|
+
...(options.label === undefined ? {} : { label: options.label }),
|
|
41
|
+
});
|
|
42
|
+
return [...compact.map((line) => cut(line, width)), ...resultLines(options.result, width)];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function resultLines(result: RunViewResult | undefined, width: number): readonly string[] {
|
|
46
|
+
if (result === undefined) return [];
|
|
47
|
+
const body = resultText(result)
|
|
48
|
+
.split("\n")
|
|
49
|
+
.map((line) => cut(line, width));
|
|
50
|
+
return [cut(RESULT_HEADING, width), ...body];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Sanitizes one line, then cuts it by terminal display width.
|
|
55
|
+
*
|
|
56
|
+
* A code-unit `slice` would let one CJK or emoji character spill a column past
|
|
57
|
+
* `width`, so the cut counts what the terminal shows.
|
|
58
|
+
*/
|
|
59
|
+
function cut(line: string, width: number): string {
|
|
60
|
+
const safe = sanitizeTerminalLine(line);
|
|
61
|
+
if (visibleWidth(safe) <= width) return safe;
|
|
62
|
+
let used = 0;
|
|
63
|
+
let kept = "";
|
|
64
|
+
for (const character of safe) {
|
|
65
|
+
const next = used + visibleWidth(character);
|
|
66
|
+
if (next > width) break;
|
|
67
|
+
kept += character;
|
|
68
|
+
used = next;
|
|
69
|
+
}
|
|
70
|
+
return kept;
|
|
71
|
+
}
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `yaag run` path that opens the alt-screen Run tree (spec §4).
|
|
3
|
+
*
|
|
4
|
+
* `orchestrateInteractiveRun` is process-free: every collaborator arrives as a
|
|
5
|
+
* parameter, so each exit path — settle, detach, fatal render, signal — is
|
|
6
|
+
* driven in tests without a TTY. `runInteractive` is the thin production edge
|
|
7
|
+
* that binds it to the real terminal, the real signals, and the real streams.
|
|
8
|
+
*
|
|
9
|
+
* A fatal render error is observed by a latch read immediately before the final
|
|
10
|
+
* channel write, with no asynchronous yield in between, so a fatal delivered in
|
|
11
|
+
* a continuation queued after a race latched is still reported.
|
|
12
|
+
*/
|
|
13
|
+
import { executeRun, type OrchestrationProgram, type StampedEventSink } from "@yaag/runtime";
|
|
14
|
+
import type { RunViewResult, TreeState } from "@yaag/tui";
|
|
15
|
+
import { createAltScreen } from "./alt-screen.ts";
|
|
16
|
+
import { createFatalSignal, type FatalExit, type FatalSignal } from "./fatal-signal.ts";
|
|
17
|
+
import { finalFrame } from "./final-frame.ts";
|
|
18
|
+
import { createPlainPresenter } from "./presenter.ts";
|
|
19
|
+
import { errorText, executeOptions, formatResult, type RunFlags } from "./run-invocation.ts";
|
|
20
|
+
import { type FinalOutput, startTreeApp, type TreeApp } from "./tree-app.ts";
|
|
21
|
+
|
|
22
|
+
/** How one Run settled, as both paths report it. */
|
|
23
|
+
type Settlement =
|
|
24
|
+
| { readonly kind: "fulfilled"; readonly result: string | null }
|
|
25
|
+
| { readonly kind: "failed"; readonly error: unknown };
|
|
26
|
+
|
|
27
|
+
/** What the interactive path needs besides the Run's own flags. */
|
|
28
|
+
export interface InteractiveRunOptions {
|
|
29
|
+
readonly program: OrchestrationProgram;
|
|
30
|
+
readonly flags: RunFlags;
|
|
31
|
+
/** Wraps the app's presenter with the fd n writer the CLI already installed. */
|
|
32
|
+
events(present: StampedEventSink): StampedEventSink;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** The signal and render-throw handlers the host installs while the app is up. */
|
|
36
|
+
export interface InteractiveHandlers {
|
|
37
|
+
/** SIGINT: opens the stop prompt, and a second one confirms. */
|
|
38
|
+
interrupt(): void;
|
|
39
|
+
/** SIGTERM: aborts the Run without waiting for a keystroke. */
|
|
40
|
+
terminate(): void;
|
|
41
|
+
/** A render throw that escaped every `try`: restore, then report. */
|
|
42
|
+
fatal(error: unknown): void;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** Everything `orchestrateInteractiveRun` would otherwise read from the process. */
|
|
46
|
+
export interface InteractiveRunDeps {
|
|
47
|
+
/** Starts the app; `stop` runs the reap ladder for this Run (ADR-0008). */
|
|
48
|
+
startApp(stop: () => void): TreeApp;
|
|
49
|
+
/** Starts the Run and resolves with its value. */
|
|
50
|
+
startRun(events: StampedEventSink, signal: AbortSignal): Promise<unknown>;
|
|
51
|
+
/** The presenter the plain lines use after the alt-screen closes. */
|
|
52
|
+
plainPresent: StampedEventSink;
|
|
53
|
+
/** Width of the final summary frame, in terminal columns. */
|
|
54
|
+
columns(): number;
|
|
55
|
+
now(): number;
|
|
56
|
+
/** Installs the handlers and returns the uninstaller. */
|
|
57
|
+
installHandlers(handlers: InteractiveHandlers): () => void;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Runs one Orchestration Program under the alt-screen tree and returns the
|
|
62
|
+
* exit code of the Run.
|
|
63
|
+
*
|
|
64
|
+
* The terminal is restored before this resolves or rejects, on every path: the
|
|
65
|
+
* settle-then-`q` path, a confirmed stop, a detach, and a render throw. A
|
|
66
|
+
* detach closes the alt-screen and keeps awaiting the Run on the plain lines,
|
|
67
|
+
* so the process never exits with a Run still running. A fatal render error is
|
|
68
|
+
* reported only after the terminal is restored and the Run is aborted and
|
|
69
|
+
* reaped, so no Run is abandoned pending. A fatal accepted at any point while
|
|
70
|
+
* the handlers are installed is rethrown, never converted into a normal return.
|
|
71
|
+
*/
|
|
72
|
+
export async function orchestrateInteractiveRun(deps: InteractiveRunDeps): Promise<number> {
|
|
73
|
+
const stop = new AbortController();
|
|
74
|
+
const app = deps.startApp(() => stop.abort());
|
|
75
|
+
let present: StampedEventSink = app.present;
|
|
76
|
+
// A render throw that escaped every `try` becomes one more exit signal the
|
|
77
|
+
// orchestration races, so it runs the same close → abort → await → emit
|
|
78
|
+
// ladder as every other path instead of throwing from a stray callback.
|
|
79
|
+
const signal = createFatalSignal();
|
|
80
|
+
const uninstall = deps.installHandlers({
|
|
81
|
+
interrupt: () => app.interrupt(),
|
|
82
|
+
terminate: () => stop.abort(),
|
|
83
|
+
fatal: (error) => signal.raise(error),
|
|
84
|
+
});
|
|
85
|
+
const running = settle(deps.startRun((event) => present(event), stop.signal));
|
|
86
|
+
|
|
87
|
+
try {
|
|
88
|
+
const early = await Promise.race([running.then(() => undefined), app.exit, signal.wait]);
|
|
89
|
+
if (early !== undefined) {
|
|
90
|
+
// The reader left before the Run settled. Close the alt-screen first,
|
|
91
|
+
// then keep awaiting the Run on the plain lines so it is still reaped and
|
|
92
|
+
// costed, and only then write the final channels.
|
|
93
|
+
await app.close();
|
|
94
|
+
present = deps.plainPresent;
|
|
95
|
+
// A fatal render must not abandon the Run: abort it and await settlement.
|
|
96
|
+
// The race carries the settlement back, so the last fatal read below is
|
|
97
|
+
// not followed by a yield that could drop a late fatal.
|
|
98
|
+
let fatal = early.kind === "fatal" ? early : undefined;
|
|
99
|
+
let settled: Settlement;
|
|
100
|
+
if (fatal !== undefined) {
|
|
101
|
+
stop.abort();
|
|
102
|
+
settled = await running;
|
|
103
|
+
} else {
|
|
104
|
+
const raced = await raceFatal(running, signal);
|
|
105
|
+
if (raced.kind === "work") {
|
|
106
|
+
settled = raced.value;
|
|
107
|
+
} else {
|
|
108
|
+
fatal = raced.exit;
|
|
109
|
+
stop.abort();
|
|
110
|
+
settled = await running;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
fatal ??= signal.taken();
|
|
114
|
+
app.emit(finalOutput(deps, app.state, settled));
|
|
115
|
+
if (fatal !== undefined) throw fatal.error;
|
|
116
|
+
return code(settled);
|
|
117
|
+
}
|
|
118
|
+
const settled = await running;
|
|
119
|
+
app.settle(viewResult(settled));
|
|
120
|
+
// The settled view stays interactive until the reader presses `q` (spec §1).
|
|
121
|
+
const exit = await Promise.race([app.exit, signal.wait]);
|
|
122
|
+
let fatal = exit.kind === "fatal" ? exit : signal.taken();
|
|
123
|
+
const closing = app.close();
|
|
124
|
+
// A fatal raised while `app.close()` is pending must not be converted into a
|
|
125
|
+
// normal return: the close still completes, then the fatal error is thrown.
|
|
126
|
+
const raced = await raceFatal(closing, signal);
|
|
127
|
+
if (raced.kind === "fatal") {
|
|
128
|
+
fatal ??= raced.exit;
|
|
129
|
+
await closing;
|
|
130
|
+
}
|
|
131
|
+
fatal ??= signal.taken();
|
|
132
|
+
app.emit(finalOutput(deps, app.state, settled));
|
|
133
|
+
if (fatal !== undefined) throw fatal.error;
|
|
134
|
+
return code(settled);
|
|
135
|
+
} finally {
|
|
136
|
+
uninstall();
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/** Binds the orchestration to the real terminal, signals, and streams. */
|
|
141
|
+
export async function runInteractive(options: InteractiveRunOptions): Promise<number> {
|
|
142
|
+
const plain = createPlainPresenter(options.flags.quiet);
|
|
143
|
+
try {
|
|
144
|
+
return await orchestrateInteractiveRun({
|
|
145
|
+
startApp: (stop) =>
|
|
146
|
+
startTreeApp({
|
|
147
|
+
tui: createAltScreen(),
|
|
148
|
+
stop,
|
|
149
|
+
writeStdout: (text) => process.stdout.write(text),
|
|
150
|
+
writeStderr: (text) => process.stderr.write(text),
|
|
151
|
+
}),
|
|
152
|
+
startRun: (events, signal) =>
|
|
153
|
+
executeRun(options.program, executeOptions(options.flags, options.events(events), signal)),
|
|
154
|
+
plainPresent: plain.present,
|
|
155
|
+
columns: () => process.stderr.columns ?? 80,
|
|
156
|
+
now: () => Date.now(),
|
|
157
|
+
installHandlers: installSignals,
|
|
158
|
+
});
|
|
159
|
+
} finally {
|
|
160
|
+
plain.dispose();
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/** Signals and the render-throw net, installed only while the app is up. */
|
|
165
|
+
function installSignals(handlers: InteractiveHandlers): () => void {
|
|
166
|
+
const onInterrupt = (): void => handlers.interrupt();
|
|
167
|
+
// SIGTERM means "abort the Run now": it must not open a prompt that waits for
|
|
168
|
+
// a keystroke. The Run's own reap ladder then ends the process (ADR-0008).
|
|
169
|
+
const onTerminate = (): void => handlers.terminate();
|
|
170
|
+
// The TUI renders from process.nextTick, so a render throw escapes every
|
|
171
|
+
// try/finally; the terminal must still be restored before it is reported.
|
|
172
|
+
const onFatal = (error: unknown): void => handlers.fatal(error);
|
|
173
|
+
process.on("SIGINT", onInterrupt);
|
|
174
|
+
process.on("SIGTERM", onTerminate);
|
|
175
|
+
process.on("uncaughtException", onFatal);
|
|
176
|
+
process.on("unhandledRejection", onFatal);
|
|
177
|
+
return () => {
|
|
178
|
+
process.off("SIGINT", onInterrupt);
|
|
179
|
+
process.off("SIGTERM", onTerminate);
|
|
180
|
+
process.off("uncaughtException", onFatal);
|
|
181
|
+
process.off("unhandledRejection", onFatal);
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/** Which of the two raced outcomes arrived first, with the work's value. */
|
|
186
|
+
type Raced<T> =
|
|
187
|
+
| { readonly kind: "work"; readonly value: T }
|
|
188
|
+
| { readonly kind: "fatal"; readonly exit: FatalExit };
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Awaits `work` while the fatal latch stays observable.
|
|
192
|
+
*
|
|
193
|
+
* The work's value travels back with the outcome, so a caller that observed a
|
|
194
|
+
* fatal never awaits `work` a second time before it reports the error.
|
|
195
|
+
*/
|
|
196
|
+
async function raceFatal<T>(work: Promise<T>, signal: FatalSignal): Promise<Raced<T>> {
|
|
197
|
+
return await Promise.race([
|
|
198
|
+
work.then((value): Raced<T> => ({ kind: "work", value })),
|
|
199
|
+
signal.wait.then((exit): Raced<T> => ({ kind: "fatal", exit })),
|
|
200
|
+
]);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
async function settle(run: Promise<unknown>): Promise<Settlement> {
|
|
204
|
+
try {
|
|
205
|
+
return { kind: "fulfilled", result: formatResult(await run) };
|
|
206
|
+
} catch (error) {
|
|
207
|
+
return { kind: "failed", error };
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
function viewResult(settled: Settlement): RunViewResult {
|
|
212
|
+
return settled.kind === "fulfilled"
|
|
213
|
+
? { kind: "fulfilled", result: settled.result ?? "" }
|
|
214
|
+
: { kind: "failed", error: errorText(settled.error) };
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
function code(settled: Settlement): number {
|
|
218
|
+
return settled.kind === "fulfilled" ? 0 : 1;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/** The pipeable Run result for stdout, and the settled final frame for stderr. */
|
|
222
|
+
function finalOutput(deps: InteractiveRunDeps, state: TreeState, settled: Settlement): FinalOutput {
|
|
223
|
+
return {
|
|
224
|
+
result: settled.kind === "fulfilled" ? settled.result : null,
|
|
225
|
+
frame: finalFrame(state, {
|
|
226
|
+
now: deps.now(),
|
|
227
|
+
columns: deps.columns(),
|
|
228
|
+
result: viewResult(settled),
|
|
229
|
+
}),
|
|
230
|
+
};
|
|
231
|
+
}
|
package/src/presenter.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The plain stderr presentation of a Run's Lifecycle Events (architecture §9).
|
|
3
|
+
*
|
|
4
|
+
* It is the only presenter for a non-TTY stream and for `--quiet`; a full TTY
|
|
5
|
+
* gets the interactive alt-screen tree instead (`tree-app.ts`).
|
|
6
|
+
*/
|
|
7
|
+
import type { StampedEventSink } from "@yaag/runtime";
|
|
8
|
+
import { type PlainRenderMode, renderEvent } from "./render.ts";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* One presentation of the Run in flight, plus the teardown its surface needs.
|
|
12
|
+
*
|
|
13
|
+
* Human-readable stderr lines are unversioned; the descriptor, when asked for,
|
|
14
|
+
* gets each event verbatim in the v1 envelope (ADR-0016).
|
|
15
|
+
*/
|
|
16
|
+
export interface EventPresenter {
|
|
17
|
+
readonly present: StampedEventSink;
|
|
18
|
+
readonly dispose: () => void;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** Builds the sanitized line presenter; `quiet` keeps the minimal line set. */
|
|
22
|
+
export function createPlainPresenter(quiet: boolean): EventPresenter {
|
|
23
|
+
const mode: PlainRenderMode = quiet ? "quiet" : "rich";
|
|
24
|
+
return {
|
|
25
|
+
present: (event) => {
|
|
26
|
+
const rendered = renderEvent(event, mode);
|
|
27
|
+
if (rendered !== null) process.stderr.write(`${rendered}\n`);
|
|
28
|
+
},
|
|
29
|
+
dispose: () => {},
|
|
30
|
+
};
|
|
31
|
+
}
|
package/src/render.ts
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { AgentActivity, LifecycleEventBody, TokenBreakdown } from "@yaag/runtime";
|
|
2
|
+
import { sanitizeTerminalLine } from "@yaag/tui";
|
|
3
|
+
|
|
4
|
+
export type PlainRenderMode = "rich" | "quiet";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Renders one Lifecycle Event as a human-readable stderr line.
|
|
8
|
+
*
|
|
9
|
+
* This format is deliberately not a wire protocol — the extension reads the
|
|
10
|
+
* event objects on a dedicated fd instead (ADR-0006). Accepts the body type:
|
|
11
|
+
* the line never shows `at`, so stamped and unstamped events render alike.
|
|
12
|
+
*/
|
|
13
|
+
export function renderEvent(
|
|
14
|
+
event: LifecycleEventBody,
|
|
15
|
+
mode: PlainRenderMode = "rich",
|
|
16
|
+
): string | null {
|
|
17
|
+
const line = renderPlainEvent(event, mode);
|
|
18
|
+
return line === null ? null : sanitizeTerminalLine(line);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function renderPlainEvent(event: LifecycleEventBody, mode: PlainRenderMode): string | null {
|
|
22
|
+
if (mode === "quiet" && !minimalEvent(event.type)) return null;
|
|
23
|
+
switch (event.type) {
|
|
24
|
+
case "run_start":
|
|
25
|
+
return `[yaag] run ${event.program}`;
|
|
26
|
+
case "agent_spawn":
|
|
27
|
+
return `[${event.agent}] spawned ${event.model} in ${event.cwd}`;
|
|
28
|
+
case "ask_start":
|
|
29
|
+
return `[${event.agent}] ask #${event.index + 1}${event.replayed === true ? " (replayed)" : ""}${event.promptGist === "" ? "" : ` — ${event.promptGist}`}`;
|
|
30
|
+
case "ask_activity":
|
|
31
|
+
return `[${event.agent}] ${renderActivity(event.activity)}`;
|
|
32
|
+
case "ask_output":
|
|
33
|
+
case "agent_usage":
|
|
34
|
+
return null;
|
|
35
|
+
case "node_update":
|
|
36
|
+
return `[${event.agent}] node ${event.path} ${event.state}${event.activityGist === undefined || event.activityGist === "" ? "" : ` \u2014 ${event.activityGist}`}`;
|
|
37
|
+
case "ask_end": {
|
|
38
|
+
const gap =
|
|
39
|
+
event.maxFrameGapMs === undefined ? "" : ` max gap ${seconds(event.maxFrameGapMs)}`;
|
|
40
|
+
return `[${event.agent}] ask #${event.index + 1} ${event.ok ? "done" : "failed"} ${seconds(event.durationMs)}${gap}`;
|
|
41
|
+
}
|
|
42
|
+
case "agent_exit":
|
|
43
|
+
return `[${event.agent}] exit ${tokens(event.tokens)} ${cost(event.cost)}${event.incomplete ? " (killed mid-ask, cost incomplete)" : ""}`;
|
|
44
|
+
case "run_end": {
|
|
45
|
+
const gap = event.worstFrameGapMs > 0 ? ` worst gap ${seconds(event.worstFrameGapMs)}` : "";
|
|
46
|
+
return `[yaag] ${event.ok ? "done" : "failed"} ${seconds(event.durationMs)} ${cost(event.cost)}${event.incomplete ? "+ (incomplete)" : ""}${gap}`;
|
|
47
|
+
}
|
|
48
|
+
default: {
|
|
49
|
+
const never: never = event;
|
|
50
|
+
throw new Error(`unhandled lifecycle event: ${JSON.stringify(never)}`);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function minimalEvent(type: LifecycleEventBody["type"]): boolean {
|
|
56
|
+
return (
|
|
57
|
+
type === "run_start" ||
|
|
58
|
+
type === "agent_spawn" ||
|
|
59
|
+
type === "ask_start" ||
|
|
60
|
+
type === "ask_end" ||
|
|
61
|
+
type === "agent_exit" ||
|
|
62
|
+
type === "run_end"
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function renderActivity(activity: AgentActivity): string {
|
|
67
|
+
switch (activity.type) {
|
|
68
|
+
case "thinking":
|
|
69
|
+
return "thinking…";
|
|
70
|
+
case "writing":
|
|
71
|
+
return "writing…";
|
|
72
|
+
case "tool":
|
|
73
|
+
return `${activity.name}${activity.argsGist === "" ? "" : `: ${activity.argsGist}`}`;
|
|
74
|
+
case "compacting":
|
|
75
|
+
return "compacting context…";
|
|
76
|
+
case "retrying":
|
|
77
|
+
return `retrying ${activity.attempt}/${activity.max}…`;
|
|
78
|
+
default: {
|
|
79
|
+
const never: never = activity;
|
|
80
|
+
throw new Error(`unhandled Agent Activity: ${JSON.stringify(never)}`);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function seconds(ms: number): string {
|
|
86
|
+
return `${(ms / 1000).toFixed(1)}s`;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/** The line reports the total only; the breakdown travels on the event (ticket 01). */
|
|
90
|
+
function tokens(value: TokenBreakdown | null): string {
|
|
91
|
+
return value === null ? "tokens unknown" : `${value.total} tokens`;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function cost(value: number | null): string {
|
|
95
|
+
return value === null ? "cost unknown" : `$${value.toFixed(4)}`;
|
|
96
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One `yaag run` invocation: the flags the command parsed, the `executeRun`
|
|
3
|
+
* options they build, and how the Run's value reaches stdout.
|
|
4
|
+
*
|
|
5
|
+
* Both presentation paths — the plain lines and the alt-screen tree — compose
|
|
6
|
+
* it, so they cannot drift on artifact flags or on the result format.
|
|
7
|
+
*/
|
|
8
|
+
import type { RunOptions, StampedEventSink } from "@yaag/runtime";
|
|
9
|
+
|
|
10
|
+
/** Everything `yaag run` parsed for one Run. */
|
|
11
|
+
export interface RunFlags {
|
|
12
|
+
readonly programFile: string;
|
|
13
|
+
readonly args: unknown;
|
|
14
|
+
readonly eventsFd: number | undefined;
|
|
15
|
+
readonly record: string | undefined;
|
|
16
|
+
readonly replay: string | undefined;
|
|
17
|
+
readonly resume: string | undefined;
|
|
18
|
+
readonly quiet: boolean;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** Builds the `executeRun` options for these flags, one sink and one signal. */
|
|
22
|
+
export function executeOptions(
|
|
23
|
+
flags: RunFlags,
|
|
24
|
+
events: StampedEventSink,
|
|
25
|
+
signal: AbortSignal,
|
|
26
|
+
): RunOptions {
|
|
27
|
+
return {
|
|
28
|
+
events,
|
|
29
|
+
args: flags.args,
|
|
30
|
+
programFile: flags.programFile,
|
|
31
|
+
...(flags.record === undefined ? {} : { record: flags.record }),
|
|
32
|
+
...(flags.replay === undefined ? {} : { replay: flags.replay }),
|
|
33
|
+
...(flags.resume === undefined ? {} : { resume: flags.resume }),
|
|
34
|
+
signal,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** The Run's result goes to stdout, so `yaag run p.ts | jq` works (ADR-0006). */
|
|
39
|
+
export function formatResult(result: unknown): string | null {
|
|
40
|
+
if (result === undefined) return null;
|
|
41
|
+
if (typeof result === "string") return result;
|
|
42
|
+
return JSON.stringify(result, null, 2);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** The message a failed Run reports, on stderr and in the Result region. */
|
|
46
|
+
export function errorText(error: unknown): string {
|
|
47
|
+
return error instanceof Error ? error.message : String(error);
|
|
48
|
+
}
|