claude_code.internal.envelope_schema
{outcome: anyOf [T-schema, calls-schema]} — the constrained output that lets one CLI run return either the final result or BAML tool calls. T's $defs lift to the envelope root so its $refs stay valid.
Reference version
Signature
function claude_code.internal.envelope_schema(
output_type: reflect.Type
) -> map<string, unknown> throws baml.errors.Unsupported | baml.json.DecodeError | baml.json.SerializationError
{outcome: anyOf [T-schema, calls-schema]} — the constrained output that lets one CLI run return either the final result or BAML tool calls. T's $defs lift to the envelope root so its $refs stay valid.
Source:<builtin>/claude_code/ns_internal/cli.bamlbytes 2082–3881